Case Study
In a low budget lab, we have the opportunity of running virtual machines within another Virtual Lab environment, for example: VMware Workstation, Microsoft Virtual PC and VMware Player (version 4), the terminology for running VM's in such environment called sometimes nested VM's (running a VM inside another VM).
Running Hypervisor infrastructure (Hyper-V R2/R3, VMware Vsphere, etc.') within virtual environment in general requires Hardware-Assisted virtualization as the underlying hardware infrastructure, allowing us to install and run guest-hypervisor within our lab infrastructure.
Using VMware Workstation/VMware VSphere 5.0 (ESXi) as the underlying infrastructure together with specific tuning allows us to install Microsoft Hyper-V R2/R3 thus running nested VM's (including 64bit VM's) on top.
Tuning
As mentioned above I will divide this tuning section according to the different Virtual infrastructure we have, within VMware Workstation (Version 8) support for Hardware-Assisted virtualization (support for Intel VT-x and EPT or AMD-V and RVI) is achieved and enabled through VM -> Settings -> Processor screen

Within VMware VSphere ESXi 5.0 support for Hardware-Assisted virtualization (support for Intel VT-x and EPT or AMD-V and RVI) is achieved and enabled through tweaking the "config" file at the following location /etc/vmware/ adding the following into the file:
vhv.allow = TRUE
Once allowed (ESXi administrator pernissions needed), Hardware-Assisted virtualization will be enabled by default for all hardware version 8 VMs with guest OS type "ESX Server 4" and "ESX Server 5." To enable Hardware-Assisted virtualization for any other guests, we will need to add the following lines to the outer guest's configuration file:
cpuid.1.ecx="----:----:----:----:----:----:--h-:----"
cpuid.80000001.ecx.amd="----:----:----:----:----:----:----:-h--"
cpuid.8000000a.eax.amd="hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh"
cpuid.8000000a.ebx.amd="hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh"
cpuid.8000000a.edx.amd="hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh"
Installing Role/Feature Process
Before you could install Hyper-V role and Feature on top of VMware Workstation as the underlying Virtualization environment there is another setting you will have to set in addition to the above, otherwise you will be facing the following error:

As mentioned above, in order to avoid the following error message when adding the role/feature, we will have to edit the Virtual Machine .vmx (for example HyperV03.vmx) file using any notepad editor you have and add the following:
hypervisor.cpuid.v0 = FALSE
(Without this option the following error arises: Hyper-V cannot be installed: A hypervisor is already running)
mce.enable = TRUE
(Without this Windows Server 8 with Hyper-V R3 role will Crash)
Installing hyper-V Role
Like with previous version of Hyper-V role (R2) on Windows 2008 Server, adding the role with Windows Server 8 Beta (R3) is the same and is done with the help of Server Manager. Nice thing with Server Manger within Windows Server 8 is that it allows you as an Administrator to add roles/Features to multiple servers at the same time.
Continuing our demonstration of adding Hyper-V R3 role to a single server within Windows Server 8,
On the Installation Type screen leave the default unattached and click next to continue

Choose Add roles and features and select Hyper-V as a role to add, click next to continue

When Pop-Up screen comes up regarding adding Remote Server Administration Tools, acknowledge by clicking Add Features

Leave the default selected and click next to continue
On Hyper-V settings screen click next to continue

Select the Physical Network Adapter you are using, this network adapter will be bound to the Virtual Switch needs to be created allowing the Virtual Machines to work outside the Physical Server, after you select one of the Network Cards from the list click next to continue

Note:
As best practice and not in a lab environment, the recommendations for Physical Network Adapters hosted on the Physical Server hosting the VM's are for at least 6 Network Cards.
Under Virtual Machine Migration screen you can decide if Live Migration request will be hosted on any available network on the server you are working on. if you want to dedicate specific network/networks for Live Migration you can use Hyper-V settings later on, click next to continue

Note:
In a cluster environment Live Migration settings should be configured when creating the Cluster.
On the Default Store where the VM's will be placed (Hard Disk files, Configuration Files), change the location according to your organization, when done click next to continue

Note:
Can also be changed when setup finishes
On Confirmation screen regarding the installation of: Roles, Features and so you have the option of restarting the Server/Servers when done. Choose to select the option best suited to the Organization and click install to continue

You can close the Installation Progress wizard without interrupting the installation progress as the following screen shows

Note:
You can see the task progress by clicking the Notification in the command bar and then select Task Details

When the installations finish and according to the selection above, choose to select to restart the server.

When the server reboots, the Hyper-V role is enabled and ready to run virtual machines. Under Windows Server 8 Hyper-V Manager have are a few new features such as:
The next figure shows the Hyper-V Manager for Windows Server 8 (as for the Beta Version of Windows Server 8)

בהמשך לחלק הראשון בסדרת שני המאמרים בנושא מנגנון ה AppLocker בחלק זה נדבר על הבנת החוקים שבמנגנון וכיצד ליישם בצורה חלקה חלק מהם.
התנהגות ברירת המחדל היא התנהגות "מאובטחת", כלומר כאשר אתה מפעיל את מנגנון ה AppLocker אתה בעצם "חוסם". חוסם את היכולת של משתמש הקצה ואף את "המנהלים" מלהפעיל מלהפעיל כל סוג של תוכנה/קובץ/התקנה, לכן יש לשוב ולהדגיש/להזכיר את חשיבות הגדרת ברירת המחדל של Allow על מנת לאפשר לפחות עבור המנהלים (מקומית Local או מתוך תחום Domain) להריץ כל סוג של תוכנה/קובץ/התקנה, הפעלת המנגנון ללא חוק זה עלול להפוך את תחנת הקצה לבלתי שמישה.
מנגנון ה AppLocker מחולק לארבעה "אזורים" הקרויים Rule Collections (אוספי כללים), הרשימה למטה כוללת דוגמא/פורמט של כל אחד מארבעת ה אוספים:
- קבצי הפעלה (לדוגמא: קבצי .exe)
- סקריפטים (לדוגמא: .vbs, .cmd)
- תכניות התקנה (לדוגמא: .msi)
- קבצי DLL (לדוגמא: .dll)
תנאי הכללים
חוקי התנאי/תנאים הם הקריטריונים עליהם מבוסס מנגנון ה AppLocker, שלושת התנאים היסודיים ליצירת חוק הם: המוציא לאור (Publisher), הנתיב (Path) ושם הקובץ (File Hash).
כללי ה- מוציא לאור (Publisher)
כלל/חוק על בסיס תנאי זה מזהה את ה יישום על פי חתימתו הדיגיטלית ועל פי תכונותיו המורחבות (Extended Attributes). ה "חתימה הדיגיטלית" מכילה מידע על החברה אשר ייצרה את הבקשה. חלק קטן מה "תכונות המורחבות" אשר מתקבלות מהמשאב בצורה בינארית מכילות בתוכן לדוגמא את: שם המוצר ואת מספר הגרסה של היישום (שוב כפי שניתן לראות ב איור -1). נתוני ה "חתימה הדיגיטלית" "מחולצים" מיוצר הבקשה ואין כל צורך בהתערבותכם ביצירתה. אולם ביכולתכם לשנות את גרסת הקובץ/קבצים תחת ה "כלל/חוק" שהינכם יוצרים וזאת על מנת שה "כלל/חוק" יהיה פעיל גם לאחר שינויי גרסה שמתבצע בעקבות עדכוני תוכנה. בנוסף, כלל זה יישאר פעיל גם לאחר שינוי של מיקום הקבצים בעקבות התקנה מחודשת של ה אפליקציה בנתיב שונה (Use custom values).

איור 1
נתיב (Path)
כלל/חוק על בסיס תנאי זה מזהה יישום/תוכנה על ידי מיקומו במערכת הקבצים, מקומית או מיתוך מיקום ב "רשת". מנגנון ה AppLocker יודע להשתמש ב "משתני סביבה" עבור ספריות במערכת ההפעלה. במידה והנתיב ב כלל/חוק מוגדר עם משתנה סביבה הכולל בתוכו את הסיומת *, אזי ה כלל/חוק יידע להכיל עצמו אך בספריית ה אב ועל תתי הספריות תחתיו. הגדרת כללים/ חוקים על בסיס תנאי זה יכולים להיפרץ על ידי העברת הקובץ למיקום אחר במערכת ההפעלה, לדוגמא:

קובץ שאינו חתום (File Hash)
כלל/חוק על בסיס תנאי זה, המערכת מחשבת hash קריפטוגרפיה המזוהה עם הקבוץ שנבחר, במילים אחרות אפליקציה שאינה מזוהה עם חתימה דיגיטלית כלשהי יכולה להיחסם ע"י שימוש ב כלל/חוק מסוג File hash במקום כלל/חוק מסוג Publisher (מוציא לאור). באמצעות מנגנון AppLocker הנך יכול ליצור כללים/חוקים שאינם ניתנים לביצוע באמצעות מנגנון ה Software Restriction.

התנהגות ה כללים/חוקים
ה כללים/חוקים יכולים לאפשר או לחסום הפעלה של אחד ו/או יותר מארבעת ה "אוספים" ע"י:
אפשר (Allow)
באפשרותך לקבוע אילו קבצים מאושרים להיות מופעלים בסביבת העבודה ועל ידי איזה משתמש ו/או קבוצת משתמשים במערכת. בנוסף, באפשרותך לקבוע חריגים (יוצאים מן הכלל) עליהם ה כללים/חוקים אינם תקפים.
חסום (Deny)
באפשרותך לקבוע אילו קבצים אינם מאושרים להיות מופעלים או שאינם מאושרים להיות פעילים בסביבת העבודה ועל ידי איזה משתמש ו/או קבוצת משתמשים במערכת. בנוסף, באפשרותך לקבוע חריגים (יוצאים מן הכלל) עליהם ה כללים/חוקים אינם תקפים.

בניגוד למדיניות הגבלת תוכנה, יישום מדיניות הפיקוח AppLocker זמין רק ב- Windows 7 ובגרסאות Enterprise\Ultimate, וכל המהדורות של Windows Server 2008 R2. מדיניות הפיקוח של AppLocker מבוססת על הפונקציונליות של הגבלת תוכנה אותה אנחנו מכירים ממערכות הפעלה קודמות אולם הם כוללים תכונות נוספות העושות את השימוש בה הרבה יותר חזק ושימושי. אחד מהשיפורים העיקריים והחזקים היא היכולת להגדיר אילו משתמשים יכולים להריץ יישומים ספציפיים.
החוקים יכולים להיבנות על-פי תכונות הקובץ (File Attributes) כמו שם קובץ, גרסת הקובץ וכדומה. באפשרותנו ליצור כללים חריגים על בסיס קבוצת אבטחת משתמשים או על בסיס משתמש בודד.
מדיניות הכללים נמצאות ב-
Computer Configuration\Windows Settings\Security Settings\Application Control Policies\AppLocker
הבהרות
ראשית, חשוב לציין שכאשר מבצעים שדרוג ל- Windows 7 מגרסאות קודמות של מערכות הפעלה עם מדיניות הגבלת תוכנה מופעלת ומפעילים את מנגנון מדיניות הפיקוח AppLocker אזי רק הכללים ממנגנון ה AppLocker נאכפים.
שנית, מנגנון ה- AppLocker תלוי בשירות (Service) יישום זהות ((Application Identity אשר מוגדר במצב אתחול ידני כברירת מחדל. ולכן לפני הגדרת ההקשחות יש לוודא כי השירות (Service) מופעל באופן אוטומטי. (כפי שניתן לראות ב איור -1-)

איור - -1
לבסוף יש לזכור כי במידה ומכילים מדיניות כאשר הכללים מתייחסים לדוגמא, לקבצים מסוג DLL משתמשים עשויים לחוות ירידה בביצועים מכיוון שמנגנון ה- AppLocker בודק את קבצי ה- DLL כאשר היישום נטען.
חשוב מאוד להבין את יישום הכללים של AppLocker וכמובן את ההתנהגות. אם לא קיימים חוקי ברירת מחדל של מנגנון AppLocker ונוצר כלל חדש עבור אוסף מסוים של קבצים, אזי יהיה מותר להריץ רק את הקבצים המפורשים בחוק בעוד כל הקבצים האחרים חסומים. לדוגמא אם אתם יוצרים כלל/חוק להפעלה של קבצי .exe מתוך ספריית C:\Program Files אזי ניתן יהיה להפעיל קבצי .exe הממוקמים בנתיב זה בלבד.
יש לשים לב ליצור סביבה שבה מדיניות ברירת המחדל מוגדרת לאפשר פעולות ולאחר מכן יש ליצור את היוצאים מהכלל לאוסף מסוים מכיוון שמנגנון ה AppLocker מגביל את ההפעלה של אפליקציות באשר הן. הנכם יכולים להשתמש ב "קומבינציה" לאפשר ולמנוע פעולות באותו החוק/כלל אולם עליכם לזכור כי מה שאתם מונעים חזק יותר ממה שאתם מאפשרים. אתם אינכם יכולים לבצע כל אוסף (יישום, סקריפט, התקנה) שאינו נכלל תחת חוק המאפשר ביצוע.
חוקי ברירת המחדל נוצרים ע"י לחיצה על הלחצן הימני על כל אחד מה- תתי כללים/חוקים (Executable, Windows Installer, Script) ובחירה ב- יצירת כללי ברירת מחדל (Create Default Rules).
הגדרת כללי ברירת המחדל עבור כל אוסף תאפשר את הפעלתם של קבצי Windows ותוכניות כמפורט להלן:
-
Allows members of the local Administrators group to run all applications
-
Allows members of the Everyone group to run applications that are located in the Windows folder.
-
Allows members of the Everyone group to run applications that are located in the Program Files folder.
-
Allows members of the Everyone group to run digitally signed Windows Installer files.
-
Allows members of the Everyone group to run all Windows Installer files located in %systemdrive%\Windows\Installer.
-
Allows members of the local Administrators group to run all Windows Installer files.
-
Allows members of the Everyone group to run scripts that are located in the Program Files folder.
-
Allows members of the Everyone group to run scripts that are located in the Windows folder.
-
Allows members of the local Administrators group to run all scripts
כפי שניתן לראות ב איור -2-

איור -2-
האם נתקלתם פעם בתקלה עם מנגנון ה- File Replication Service – FRS, בשרתי ה- Domain Controller באחד מהארגונים להם אתם נותנים שירות והאם הצלחתם בצורה מהירה ויעילה כיצד לזהות את אופי הבעיה/תקלה והכי חשוב לתת מענה מהיר ואפקטיבי.
לשם התחלה הנה הסבר קצר על מנגנון ה- FRS:
File Replication Service is a Microsoft Windows Server service for distributing shared files and Group Policy Objects. It replaced the (Windows NT) Lan Manager Replication service, and has been partially replaced by Distributed File System Replication. It is also known as NTFRS after the name of the executable file that runs the service (When the File Replication Service (FRS) detects a change to a file, such as the creation of a new file or the modification to an existing file, it replicates it to other servers in the group).
בעקבות תקלה בה הייתי מעורב (באחד מלקוחותיי מיני-רבים) בימים האחרונים ולאחר "חפירה" בלא מעט מאמרים טכניים ופורומים שונים ברחבי האינטרנט, כולל פורומים ובלוגים שונים (בהן גם ב- מיקרוסופט) אני מביא לפניכם את תיאור התקלה ואת הכלים בהם אתם יכולים להשתמש בכדי לתת מענה לסוג זה של תקלות במנגנון ה- FRS.
אופי התקלה:
בעת צירוף של שרת חדש (Domain Controller) אל הדומיין נתקלתי בתופעה שמנגנון ה- FRS לא מבצע את אחד מהתפקידים החשובים שלו (distributing shared files and Group Policy Objects) המשמעות היא כאשר משתמש מבצע לוגין אל הדומין ואל השרת הספציפי, הוא אינו מקבל את מיפויי הכונן להם הוא זקוק, מה גם שהגדרות ה- Policy אינם חלים על תחנת העבודה/משתמש.
בנוסף, על השרת מולו הוא מתרפלק מופיעות הודעות שגיאה מסוג- (Event ID: 13562 (Missing FRS objects and FRS attributes in Active Directory, שמשמעותן כי חסרים מספר אובייקטים. הודעות שמהם לא ניתן להבין את אופי התקלה שלא לדבר מהם הצעדים אשר יכולים להביא אל הפתרון.
כמו שציינתי קודם, לאחר "חפירה" מעמיקה ברחבי האינטרנט גיליתי שני כלים מבית מיקרוסופט אשר יכולים להקל בזיהוי הבעיה כאשר אחד מהם אף נותן צעדים כיצד לפתור, סדר הופעת הכלים ברשימה היא גם ההמלצה האישית שלי באיזה כלי להשתמש:
FRSDIAG- את הכלי ניתן להריץ על גבי מספר רב של מערכות הפעלה (כולל Desktop's מסוגים שונים) לאחר הרצת הכלי מול כל אחד משרתי ה- Domain Controller's בדומיין, מתקבלת הפלט גם בצורה גרפית וגם בצורה של לוגים מהם ניתן לשלוף גם את הגורם לבעיה וחשוב יותר כיצד ניתן לפתור את התקלה (במקרה שלי היו מספר אובייקטים חסרים אותם הייתי צריך ליצור מחדש באמצעות שימוש ב- adsiedit), אני מצרף תמונת מסך של אחד מהם ואת מיקומו כמובן:

את הכלי ואת דרישות החומרה/תוכנה כולל תהליך ההתקנה ניתן להוריד מהלינק הבא:
http://www.microsoft.com/download/en/details.aspx?id=8613
Monitoring and troubleshooting tool for file replication-ULTRASOUND - כלי קצת יותר מסובך להתקנה, הכלי דורש גרסה של SQL (גרסת Express נתמכת אף היא). לאחר התקנת הכלי תהליך שאורך מספר דקות וסריקת ה- דומיין מתקבלת תמונה די ברורה להתנהגות של מנגנון ה- FRS על כל אחד מהשרתים. המינוס בשימוש בכלי, הוא מפנה אתכם אל מאמר אחד או יותר ברחבי ה- אינטרנט בהם ניתן לעיין בכדי לפתור את התקלה, את הכלי ניתן להוריד מהלינק הבא:
http://www.microsoft.com/download/en/details.aspx?id=3660
צירפתי מספר מסכים של הכלי בכדי שתוכלו לראות כיצד נראה הכלי ואיזה נתונים הוא מספק:


![clip_image002[7] clip_image002[7]](http://blogs.microsoft.co.il/blogs/ilansaadi/clip_image0027_thumb_4B5AF3F8.jpg)
מקווה שהצלחתי להביא אליכם בצורה יעילה ומובנת את הנושא והצעדים בכדי לפקח על התקלה ואפילו לתת פתרון.