<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Raf Cox Security blog</title><link>http://blogs.technet.com/b/raf_cox_security_blog/</link><description /><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Looking for unprotected directories (and files)</title><link>http://blogs.technet.com/b/raf_cox_security_blog/archive/2011/02/13/looking-for-unprotected-directories-and-files.aspx</link><pubDate>Sun, 13 Feb 2011 15:34:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3387089</guid><dc:creator>Raf Cox</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/raf_cox_security_blog/rsscomments.aspx?WeblogPostID=3387089</wfw:commentRss><comments>http://blogs.technet.com/b/raf_cox_security_blog/archive/2011/02/13/looking-for-unprotected-directories-and-files.aspx#comments</comments><description>&lt;p&gt;When checking if a system is secure, you often want to validate if there are no locations that are &lt;i&gt;writeable&lt;/i&gt; for standard users (non-admins); for example, on a website, you want to make sure that all application files and directories are read-only (unless you have a specific directory in which you would allow users to upload files). Even on content management systems where users can store their own files (such as SharePoint), user-documents are stored in the database and never on the file system, so no need there to grant users any kind of write access on the server.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;What can go wrong if users do have write access to application files? &lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Well, by default, they won't be able to upload anything, so it might seem not too harmful. But what if for some reasons you open up a file-share (e.g. to allow server-administrators to upload new files)? Or somebody enables WebDav authoring access on a website? Enforcing least privilege access is often a defense-in-depth measure that will limit the damage if somebody makes a configuration mistake later on.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;So, how can we check the access rights on the file-system and identify those directories (and files) where users have write-access on? &lt;/i&gt;&lt;/p&gt;
&lt;p&gt;One tool that might help you is &lt;a href="http://live.sysinternals.com/AccessEnum.exe"&gt;AccessEnum&lt;/a&gt; from SysInternals: &lt;i&gt;"This simple yet powerful security tool shows you who has what access to directories, files and Registry keys on your systems. Use it to find holes in your permissions."&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;If you're just interested in finding to which directories and files, standard users have write-access, you can use the script below. It will enumerate all directories (if you want to include files, remove the where-clause ?{$_.PSIScontainer -eq $true}) and for each one, check if standard users (identified as "Builtin\Users", "Domain Users", "NT AUTHORITY\Authenticated Users" and "everyone" in the code-sample) have &lt;i&gt;some kind of write-access&lt;/i&gt; to the directory. Write-access also includes the right to create or delete a file in a directory, change a file, take ownership, modify permissions, etc.&lt;/p&gt;
&lt;p&gt;The script can probably be further optimized for performance (scanning all directories in c:\windows takes less than 2 minutes on my W7 machine), but it does the job. &lt;/p&gt;
&lt;p&gt;What does the script do? In short:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check ACL of the given root-directory, including inherited ACEs&lt;/li&gt;
&lt;li&gt;Get a listing of all subdirectories&lt;/li&gt;
&lt;li&gt;Check the ACL for each of the subdirectories, excluding inherited ACEs (since these were checked at the root)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;(Check also my first post on AppLocker: this script might help you identifying writeable directories under C:\Windows and c:\program files, so you can add them as exceptions)&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;Function CheckACLStrength([string]$FromDir) {&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp;#enumerate all groups you want to check (add your own groups)&lt;br /&gt;&amp;nbsp;$Grps= @("BUILTIN`\Users","DomainUsers","NTAUTHORITY`\AuthenticatedUsers","Everyone")&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp;$ListViolations = @()&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;#Check the ACL of the root-directory, including inherited ACEs&lt;br /&gt;&amp;nbsp;$acl=(Get-Acl $FromDir)&lt;br /&gt;&amp;nbsp;if(CheckACLViol $acl $Grps $True) {$ListViolations += $FromDir}&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;#enumerate all subdirectories and check ACLs (excluding inherited ACEs)&lt;br /&gt;&amp;nbsp;$allDirs = Get-ChildItem &amp;ndash;path $FromDir -recurse | ?{$_.PSIScontainer &amp;ndash;eq $true}&lt;br /&gt;&amp;nbsp;foreach($DirOrFile in ($allDirs)){&lt;br /&gt;&amp;nbsp;&amp;nbsp;$acl=(Get-Acl $DirOrFile.FullName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(CheckACLViol $acl $Grps $false){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$ListViolations += $DirOrFile.FullName&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp;Return $ListViolations&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;Function CheckACLViol($acl, [String[]] $Groups, [boolean] $InclInherited){&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp;#create an array of all unwanted access types (valid for both files &amp;amp; directories)&lt;br /&gt;&amp;nbsp;$InvalidAccessTypes=([system.Security.AccessControl.FileSystemRights]::AppendData,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::ChangePermissions,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::CreateDirectories,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::CreateFiles,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::Delete,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::DeleteSubdirectoriesAndFiles,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::FullControl,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::Modify,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::TakeOwnership,`&lt;br /&gt;&amp;nbsp;[system.Security.AccessControl.FileSystemRights]::WriteData)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp;# check if any of the ACE matches any of the unwanted access types for the list of groups&lt;br /&gt;&amp;nbsp;$count=0&lt;br /&gt;&amp;nbsp;$AceAllow=[System.Security.AccessControl.AccessControlType]::Allow&lt;br /&gt;&amp;nbsp;$AceDeny=[System.Security.AccessControl.AccessControlType]::Deny&lt;br /&gt;&amp;nbsp;foreach($ace in $acl.access){&lt;br /&gt;&amp;nbsp;&amp;nbsp;if ($ace.AccessControlType &amp;ndash;eq $AceAllow &amp;ndash;and (($InclInherited &amp;ndash;and $ace.IsInherited) &amp;ndash;or &amp;ndash;not $ace.IsInherited)){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$tmpmtch=$Groups &amp;ndash;contains $ace.IdentityReference.toString()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if($tmpmtch){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$isok=$true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$InvalidAccessTypes | foreach{ $isok = $isok &amp;ndash;and &amp;ndash;not ($ace.FileSystemRights &amp;ndash;match $_)}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;If (-not $isok) {$count++}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;nbsp;if($count-gt0) {1} else {0}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;CheckACLStrength "c:\Windows"&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3387089" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Compliance/">Compliance</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/PowerShell/">PowerShell</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Windows+Server+2008+R2/">Windows Server 2008 R2</category></item><item><title>Security Compliance checking with PowerShell: roles, role-combinations and other basic checks</title><link>http://blogs.technet.com/b/raf_cox_security_blog/archive/2011/01/26/security-compliance-checking-with-powershell-roles-role-combinations-and-other-basic-checks-1-2.aspx</link><pubDate>Wed, 26 Jan 2011 19:41:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3382746</guid><dc:creator>Raf Cox</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/raf_cox_security_blog/rsscomments.aspx?WeblogPostID=3382746</wfw:commentRss><comments>http://blogs.technet.com/b/raf_cox_security_blog/archive/2011/01/26/security-compliance-checking-with-powershell-roles-role-combinations-and-other-basic-checks-1-2.aspx#comments</comments><description>&lt;p&gt;In my last post, I already pointed out 2 security considerations that apply across roles: &lt;i&gt;which combination of server roles is allowed&lt;/i&gt; and&lt;i&gt; is a specific role suited (and preferably installed on) a Windows Server CORE&lt;/i&gt;?&lt;/p&gt;
&lt;p&gt;Besides these 2, there are a number of other things you might want to check if you want to see if a W2K8R2 server is configured securely. So, a more complete list of checks (summarized from the Windows 2008 R2 Security guide) would look as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Which server-roles allowed on your networks? Which features do you want to allow?&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 30px;"&gt;Some organizations might not want to allow specific server roles on their networks. For example Certificate Server: this is normally a role that you only install on a limited number of highly secured servers. Or maybe you might only want to allow a server role if you have security guidance and checklists available for them? The same might be true for server &lt;i&gt;features&lt;/i&gt;, such as the "Wireless Lan Service" or "Telnet Server".&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;What role combinations are allowed?&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 30px;"&gt;A general recommendation from the security guides is to limit role-combinations. Combining roles will increase the attack surface of a server. Further, it will also complicate the management of servers, especially if role A is managed by another team than role B. Some other roles on the other hand are often combined, such as application-server roles or Domain Controller and DNS. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Should the server be installed on Windows Server CORE?&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 30px;"&gt;Windows Server CORE significantly reduces the attack surface of a server, since all UI-related binaries are not installed: no Internet Explorer vulnerabilities, no GDI vulnerabilities, etc. Therefore, you might want to have your most critical servers installed on Windows Server CORE, such as your Domain Controllers, Hyper-V servers, but maybe also the infrastructure servers (DNS, DHCP, File, Print, etc).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Is the computer joined to a domain?&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 30px;"&gt;Joining a computer to a domain brings a large number of immediate security benefits: users are managed on a central infrastructure (AD), you automatically use a strong network authentication protocol (Kerberos), you can control the security configuration of your servers centrally (apply security baseline GPOs), etc.&lt;i&gt;&lt;/i&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Has the security baseline GPO been applied?&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 30px;"&gt;You do want to check quickly if you haven't forgotten to move the server to the right OU to ensure that all security baseline GPOs are applied correctly to the server. There are multiple ways to do this (e.g. you could use SCCM/DCM functionality to validate each setting), but a quick check might be to just check if a policy names xyz has been applied. Or if the legal notice has been set (the legal notice is not set by default and is typically unique for an organization, so easily identifiable). &lt;i&gt;&lt;/i&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Are security updates installed on a regular basis?&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 30px;"&gt;While you're checking if a server is secure, you might as well quickly want to check if its WSUS configuration (or SCCM) is correct or at least, that the server has received security updates recently. A quick check ("when has the latest patch been applied?") is in no way a replacement for a full check of course (using MBSA or equivalent tools). But at least, you know that the server is receiving security updates.&lt;i&gt;&lt;/i&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;How many users are in the "administrator" role on the server?&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 30px;"&gt;A last thing you might want to check is the number of users that have administrative rights on the server; normally, this should only be a small group and membership of the local "administrators" group on a server should be limited to only those users that really need it (i.e. server administrators)&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Does all of this sound obvious? &lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Well, it is actually. But it wouldn't come to a surprise that in any organization, you will find servers that are not configured correctly and/or securely. Even IT-Pro's do make a mistake every now and then :-).&lt;/p&gt;
&lt;p&gt;&lt;i&gt;So, how to check all of this using PowerShell?&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Let's start with allowed server roles, server-role combinations and features. &lt;/p&gt;
&lt;p&gt;Windows Server 2008 R2 has a great build-in module to support all this: ServerManager.&lt;/p&gt;
&lt;p&gt;Following code allows you to retrieve all installed roles on server&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;Import-module ServerManager&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;$installedRoles = Get-WindowsFeature | where {$_.featureType -eq "Role" -and $_.Installed -eq $true} | select name, DisplayName&lt;/span&gt; &lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The FeatureType property could have any of the following values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Role&lt;/li&gt;
&lt;li&gt;Role Service &lt;/li&gt;
&lt;li&gt;Feature&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To compare with your list of approved roles (or role-combinations), you could work with an array or hash-list that contains all allowed roles, and for each role, the allowed role-combinations. The sample script (at the end of this blog) shows how to implement this in PowerShell for a case where you would allow only 5 roles and specific role-combinations (IMPORTANT NOTE: the script does &lt;span style="text-decoration: underline;"&gt;not&lt;/span&gt; give any&amp;nbsp;security recommendations for role-combinations or allowed roles; it's just a sample how you can use PowerShell to check compliancy with &lt;span style="text-decoration: underline;"&gt;your&lt;/span&gt; security policies).&lt;/p&gt;
&lt;p&gt;While checking the roles, you can as well check if each role is required to be installed on Windows Server CORE (and hence if the combination of all (allowed) roles on the server is required to be installed on Windows Server CORE).&lt;/p&gt;
&lt;p&gt;To check if a server is installed as Windows Server CORE, you can use the OperatingSystemSKU property of the Win32_OperatingSystem WMI object. The values 12, 13 and 14 refer to Windows Server CORE OS SKU's (Datacenter CORE, Enterprise CORE and Standard Server CORE).&lt;/p&gt;
&lt;p&gt;If you want to have a quick check (really superficial) to see if your company's security policy GPOs have been applied, you could check for specific registry values that are set within the policies. I prefer to use the &lt;i&gt;Legal Notice&lt;/i&gt;, since that value is mostly unique for each company (if used of course). The values set by GPOs can be easily checked in the registry (for the majority of the settings); for example, the Legal Notice Caption can be found as follows:&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style="font-family: courier new,courier;"&gt;$LegalNoticeCaption = Get-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -name LegalNoticeCaption&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;Another check would be to quickly validate if security updates are being installed; if you want to do a full check (which you should from time to time), use MBSA or equivalent tools. As a quick check, you could just validate when the last update was installed:&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;$AllQFEs = Get-WmiObject -Namespace "root\CIMV2" -class "win32_QuickFixEngineering" |sort -Property @{Expression={[dateTime]$_.InstalledOn};Ascending=$false}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;$lastQFEDate = [datetime]$AllQFEs[0].InstalledOn # check first if $AllQFEs is not empty! &lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Further, you can find in the script 2 other checks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check how many users (local or domain) are member of the administrators group (I will explain that in more depth in future)&lt;/li&gt;
&lt;li&gt;Check if the computer is joined to a domain: this is accomplished by checking the &lt;i&gt;PartOfDomain&lt;/i&gt; property on the Win32_ComputerSystem WMI object; the &lt;i&gt;domain&lt;/i&gt; property gives you the name of the domain.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Below you can find the full script (including the DNS part of my previous post). For better readability, copy to notepad or PowerShell ISE and validate on your test-environment. (ps: I don't check if DNS is installed or not, so it might fail if DNS is not installed on the server; I leave it up to you to add the code to check first if DNS role is installed before calling the &lt;span style="font-family: Courier New; font-size: xx-small;"&gt;CheckSecCompl-DNS&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt; function)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;#--------------------------------------------------------------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;# Sample Security Compliancy Check Script for Windows 2008 R2 Roles&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;# Raphael Cox, Microsoft Consulting Services Belgium-Luxembourg&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;# &lt;/span&gt;&lt;/span&gt;&lt;a href="http://blogs.technet.com/b/raf_cox_security_blog/"&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;http://blogs.technet.com/b/raf_cox_security_blog/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;# January 2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;# Parameters:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;#&amp;nbsp;&amp;nbsp; none&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;#--------------------------------------------------------------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;Function New-CompliancyResult&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;Param(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [string]$Category,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [string]$SubCategory,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [string]$setting,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [boolean]$IsCompliant&lt;br /&gt;&amp;nbsp;)&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;# create a new object and set the noteproperties using a hash-table&lt;br /&gt;&amp;nbsp;$x = New-Object PSObject -Property @{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Computer&amp;nbsp;= (Get-WmiObject -Class Win32_ComputerSystem).name &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Category &amp;nbsp;= $Category&lt;br /&gt;&amp;nbsp;&amp;nbsp;SubCategory = $SubCategory&lt;br /&gt;&amp;nbsp;&amp;nbsp;Setting &amp;nbsp;= $setting&lt;br /&gt;&amp;nbsp;&amp;nbsp;IsCompliant = $IsCompliant }&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;return $x&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;function CheckSecCompl-DNS {&lt;br /&gt;&amp;nbsp;$CompliancyResList = @()&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;$DNSServer =&amp;nbsp; Get-WmiObject -Namespace "root\MicrosoftDNS" -Class "MicrosoftDNS_Server"&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;$CompliancyResList += New-CompliancyResult "DNS" "Server Configuration" "Secure Cache Against Pollution" $DNSServer.SecureResponses&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;$DNSZones = Get-WmiObject -Namespace "root\MicrosoftDNS" -Class "MicrosoftDNS_Zone"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;foreach ($DNSzone in $DNSZones) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SubCategory = "DNS Zone: " + $DNSzone.Name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# To check if a DNS zone only accepts secure dynamic updates, use the property: AllowUpdate&lt;br /&gt;&amp;nbsp;&amp;nbsp;# AllowUpdate can have following values:&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 0: no dynamic updates allowed&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 1: secure and insecure dynamic updates allowed --&amp;gt; not secure&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 2: only secure dynamic updates allowed&lt;br /&gt;&amp;nbsp;&amp;nbsp;$CompliancyResList += New-CompliancyResult "DNS" $SubCategory "Secure or no dynamic updates" ($DNSzone.AllowUpdate -eq 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# To check if a DNS zone is Active-Directory-integrated, use the property: DsIntegrated&lt;br /&gt;&amp;nbsp;&amp;nbsp;$CompliancyResList += New-CompliancyResult "DNS" $SubCategory "Zone is AD integrated" $DNSZone.DsIntegrated&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# To check if a DNS zone doesn't allow zone transfers to any computer, use the property: SecureSecondaries&lt;br /&gt;&amp;nbsp;&amp;nbsp;# SecureSecondaries can have following values:&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 0: Allow zone transfers to any server --&amp;gt; not secure&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 1: Allow zone transfers only to specific servers (listed in the name-servers tab)&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 2: Allow zone transfers only to specific servers (listed in the zone-transfers tab)&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 3: Do not allow Zone Transfers&lt;br /&gt;&amp;nbsp;&amp;nbsp;$CompliancyResList += New-CompliancyResult "DNS" $SubCategory "Zone transfers only to known secondaries" ($DNSZone.SecureSecondaries -ne 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;return $CompliancyResList&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;function Getlocalgroupmembers ([string]$localcomputername, [string]$localgroupname) { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $groupobj =[ADSI]"WinNT://$localcomputername/$localgroupname" &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $localmembers = @($groupobj.psbase.Invoke("Members")) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $localmembers | foreach {$_.GetType().InvokeMember("AdsPath","GetProperty",$null,$_,$null)} &lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;function GetAllUserMembers ($group) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # $group is string in format "&lt;/span&gt;&lt;/span&gt;&lt;a href="ldap://CN"&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;LDAP://CN&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;=..."&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $UserList = @()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $groupMembers = ([adsi]$group).member&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($PrincipalPath in $groupMembers) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $principal = [adsi]"&lt;/span&gt;&lt;/span&gt;&lt;a href="ldap://$PrincipalPath"&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;LDAP://$PrincipalPath&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($principal.SchemaClassName -eq "group") {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # if a group, recursively add all members of this group to the list&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $UserList += GetAllUserMembers $principal.Path&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # if not a group, it is either user or workstation&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $UserList += $PrincipalPath&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $UserList&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;Function CountAllUsersInLocalGroup ($LocalGroupName) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Members = Getlocalgroupmembers . $LocalGroupName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $countLocalUsers = 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $MemberInDomain = @()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CheckMembersInOtherDomains=$false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($Members.count -gt 0) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($Principal in $Members) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # break up the string of each principal "WinNT://domain\username"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $spl = $Principal -split "WinNT://"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $UserDomain = ($spl[1] -split "/")[0]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $UserName = ($spl[1] -split "/")[1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $domain = [System.DirectoryServices.ActiveDirectory.domain]::GetCurrentdomain()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $root = $domain.GetDirectoryEntry()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # create object to search in AD&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $search = [System.DirectoryServices.DirectorySearcher]$root&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (-not ($UserDomain -eq (gwmi "Win32_Computersystem").caption) ) #check $userdomain equals local computername&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #user, workstation or group is domain member&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $search.Filter = "(cn=$UserName)"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $result = $search.FindOne()&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($result -ne $null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {$MemberInDomain += GetAllUserMembers $result.Path}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else { #user is in other domain of the forest or in other forest; not counted here &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #local users&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $countLocalUsers +=1 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #count all users found locally and in domain (eliminate duplicates)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $countLocalUsers +&amp;nbsp; ($MemberInDomain | sort -Unique).count&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;function CheckSecCompl-BaseChecks {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Import-module ServerManager&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;$CompliancyResList = @()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get all installed roles&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $installedRoles = Get-WindowsFeature | where {$_.featureType -eq "Role" -and $_.Installed -eq $true} | select name, DisplayName &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # sample data structure that lists allowed roles, allowed role-combinations and if required for CORE install&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # This is not a security recommendation, just a sample!&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $RoleData = @()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $RoleData += New-Object PSObject -Property @{Role="AD-Domain-Services";combine=@("DNS"); CORErequired=$true }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $RoleData += New-Object PSObject -Property @{Role="Print-Services&amp;rdquo;;combine=@("DHCP","File-Services"); CORErequired=$true}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $RoleData += New-Object PSObject -Property @{Role="File-Services&amp;rdquo;;combine=@("DHCP","Print-Services"); CORErequired=$true}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $RoleData += New-Object PSObject -Property @{Role="DHCP";combine=@(&amp;rdquo;File-Services&amp;rdquo;,&amp;rdquo;Print-Services&amp;rdquo;); CORErequired=$true}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $RoleData += New-Object PSObject -Property&amp;nbsp; @{Role="DNS";combine=@("AD-Domain-Services"); CORErequired=$true}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $COREReqForAllRoles = $true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($installedRole in $installedRoles) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $roleFound=$false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($RoleItem in $RoleData) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($RoleItem.Role -eq $InstalledRole.Name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $roleFound=$true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($roleFound) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Role Allowed" $installedRole.DisplayName $true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($otherRole in $installedRoles) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($otherRole.name -ne $InstalledRole.name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $roleCombStr = $installedRole.name + " &amp;amp; " + $otherRole.DisplayName&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($RoleItem.combine -contains $otherRole.name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Role combination allowed" $roleCombStr $true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Role combination allowed" $roleCombStr $false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($roleItem.CORERequired -eq $false) { $CoreReqForAllRules = $false}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Role Allowed" $installedRole.DisplayName $false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Do all installed roles support Windows Server CORE&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $OSSKU = (Get-WmiObject -Namespace "root\CIMV2" -class "Win32_OperatingSystem").OperatingSystemSKU&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $IsCORE = $OSSKU -eq 12-or $OSSKU -eq 13 -or $OSSKU -eq 14&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($COREReqForAllRoles) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "CORE Install" "Windows CORE Install Required" $IsCore&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Quick check if security policy GPO is applied by checking Legal Notice caption text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Warning: this does not guarantee that a security policy is correctly applied! Other quick checks can be added in the same way&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ApprovedLegalNoticeCaption = "You are about to log on to CONTOSO Networks"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SettingText = "Legal Notice Caption set to: " + $ApprovedLegalNoticeCaption&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $LegalNoticeCaption = Get-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -name LegalNoticeCaption&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($LegalNoticeCaption.LegalNoticeCaption -eq "" -or $LegalNoticeCaption.LegalNoticeCaption -eq $null){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Security GPO applied" $SettingText $false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($LegalNoticeCaption -ne $ApprovedLegalNoticeCaption) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Security GPO settings" $SettingText $false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Security GPO settings" $SettingText $true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Quick check if Windows Update is enabled by checking time of last update&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Warning: this check doesn't guarantee that all Security Updates have correctly been installed and no important ones are missing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # you can extend this part, e.g. by checking against a list of must-have hotfixes; for a full check, use MBSA or equivalent tools&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $AllQFEs = Get-WmiObject -Namespace "root\CIMV2" -class "win32_QuickFixEngineering" |sort -Property @{Expression={[dateTime]$_.InstalledOn};Ascending=$false}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $AllowedNrDaysSinceLastUpdate = 40 # 40 Days is NOT a recommendations, just an example&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SettingText = "Last update installed less than " + $AllowedNrDaysSinceLastUpdate + " days ago"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($AllQFEs -eq $null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Security updates" $SettingText $false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $lastQFEDate = [datetime]$AllQFEs[0].InstalledOn&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($lastQFEDate -lt [datetime]::now.AddDays(-30)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Security updates" $SettingText $false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Security updates" $SettingText $false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Check number of Administrators on the machine: List members of local Administrators group (local and in domain)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # you can extend this part by checking other local groups&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $PrivGroupToCheck = "Administrators"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $MaxNrOfMembers = 5 # a maximum number of 5 admins is just an example;not a security recommendations!&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $NrOfAdministrators = CountAllUsersInLocalGroup $PrivGroupToCheck&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SettingText = "Nr of members of $PrivGroupToCheck &amp;lt;= $MaxNrOfMembers"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($NrOfAdministrators -le $MaxNrOfMembers) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Privileged Access" $SettingText $true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Privileged Access" $SettingText $false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Check if the computer is joined to domain&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $WMIComputerSystem = Get-WmiObject -Namespace "root\CIMV2" -class "Win32_ComputerSystem"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($WMIComputerSystem.PartOfDomain) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ComputerDomain = $WMIComputerSystem.domain&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Domain Joined" "Joined to domain ($ComputerDomain)" $true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CompliancyResList += New-CompliancyResult "Base Configuration" "Domain Joined" "Joined to domain (none)" $true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $compliancyResList&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;$CompliancyResList = @()&lt;br /&gt;$CompliancyResList += CheckSecCompl-BaseChecks&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;$CompliancyResList += CheckSecCompl-DNS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: xx-small;"&gt;$CompliancyResList | select computer, category, subcategory, setting, iscompliant |Out-GridView&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3382746" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Compliance/">Compliance</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/PowerShell/">PowerShell</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Windows+Server+2008+R2/">Windows Server 2008 R2</category></item><item><title>Security Compliance checking with PowerShell: DNS </title><link>http://blogs.technet.com/b/raf_cox_security_blog/archive/2011/01/07/security-compliance-checking-with-powershell-dns.aspx</link><pubDate>Fri, 07 Jan 2011 20:39:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3378225</guid><dc:creator>Raf Cox</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/raf_cox_security_blog/rsscomments.aspx?WeblogPostID=3378225</wfw:commentRss><comments>http://blogs.technet.com/b/raf_cox_security_blog/archive/2011/01/07/security-compliance-checking-with-powershell-dns.aspx#comments</comments><description>&lt;p&gt;I guess most of you will agree that DNS is a critical component in a Windows infrastructure. It's not only the basis for a good working AD, but also the first target for anybody who wants to attack your systems and communication-channels, using Man-in-the-Middle techniques. &amp;nbsp;E.g., suppose an (internal) hacker could advertise a compromised system as your company portal or proxy server by changing the A-records? Or inserting false A-records?&lt;/p&gt;
&lt;p&gt;If your DNS configuration is not secure, these types of attacks are easy to perform. E.g. if you allow un-authenticated and un-authorized updates in a DNS zone, an attacker could insert e.g. an A-record for the "wpad.company.com" (wpad = Web Proxy Autodiscovery Protocol) which points to a malicious proxy that could intercept all internet traffic for those clients whose internet proxy settings are not explicitly configured ("automatically detect settings" is enabled in the browser). And when an attacker succeeds in bringing down your DNS servers, Active Directory will stop functioning too ...&lt;/p&gt;
&lt;p&gt;Security configuration settings for the DNS role in Windows Server 2008 R2 can be found in 2 areas. First, there is the server configuration itself for which you can configure for example the setting "Configure DNS to Configure DNS to ignore non-authoritative resource records" (a.k.a. &lt;a target="_blank" href="http://blogs.technet.com/controlpanel/blogs/posteditor.aspx/cache poisoning" title="http://en.wikipedia.org/wiki/DNS_cache_poisoning"&gt;cache poisoning&lt;/a&gt;). &lt;/p&gt;
&lt;p&gt;This setting is enabled by default, but you do want to ensure that it stays enabled. The setting can be found under the "advanced" tab of the DNS server properties:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/330x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-86-43/4336.DNS-Secure-Cache.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;To validate if this setting is set correctly using powershell, you can use the "SecureResponses" property of the DNS-server WMI object. The script below can be used to check on the local host.&lt;/p&gt;
&lt;table align="left" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;$DNSServer =&amp;nbsp; Get-WmiObject -Namespace "root\MicrosoftDNS" -Class "MicrosoftDNS_Server"&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;if ($DNSServer.SecureResponses) {&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;&amp;nbsp;&amp;nbsp; $result = "DNS Option *Secure Cache Against Pollution* is enabled on server."&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;else &lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;&amp;nbsp; $result = "DNS Option *Secure Cache Against Pollution* is not enabled on server."&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(run this script using a PowerShell prompt that runs with elevated privileges; see also at the end of this post).&lt;/p&gt;
&lt;p&gt;As you can see, I use the WMI interface to query the DNS configuration, since DNS role in Windows Server 2008 R2 doesn't have a direct interface for PowerShell. DNS has however very good and simple WMI support, so the scripts are straightforward to implement.&lt;/p&gt;
&lt;p&gt;(note: the SCM Document also make recommendations about 2 other server configuration settings: "Enable recursion to only the appropriate DNS servers" and "Configure root hints for the internal DNS namespace"; these are not handled in this post).&lt;/p&gt;
&lt;p&gt;Next, you have the security configuration settings for each DNS zone; following the best-practices in SCM documentation, following should be checked for each zone:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Preferably use AD-integrated DNS zone replication.&amp;nbsp;This won't be possible in all environments, e.g. when you have a combination of Windows DNS and BIND.&lt;/li&gt;
&lt;li&gt;DNS-zones must be configured to only allow secure dynamic updates or no dynamic updates; under no circumstances, insecure (=un-authenticated and/or not-authorized)&amp;nbsp;updates should be allowed.&lt;/li&gt;
&lt;li&gt;Restrict Zone Transfers to Specific Computers Running DNS&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some other recommendations will be handled in a next post in this blog. Specifically checks about role-combinations and use of Windows Server CORE amongst other server security recommendations that apply to multiple server roles. Specifically for DNS, we can already identify:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Combine DNS with DC: only a DNS that runs on a DC, supports secure dynamic updates and the zone replications relies on the secure AD-replication mechanisms.&lt;/li&gt;
&lt;li&gt;Run DNS on Windows Server CORE.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The code for the DNS security compliancy check as described above&amp;nbsp;looks as follows:&lt;/p&gt;
&lt;table border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;# The function New-CompliancyResult is used to create an array of ps-objects that store the compliancy-checks information&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;Function New-CompliancyResult&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;Param(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [string]$Category,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [string]$SubCategory,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [string]$setting,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [boolean]$IsCompliant&lt;br /&gt;&amp;nbsp;)&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;# create a new object and set the noteproperties using a hash-table&lt;br /&gt;&amp;nbsp;$x = New-Object PSObject -Property @{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; computer&amp;nbsp;= (Get-WmiObject -Class Win32_ComputerSystem).name&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category &amp;nbsp;= $Category&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubCategory = $SubCategory&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Setting &amp;nbsp;= $setting&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsCompliant = $IsCompliant }&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;return $x&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="font-family: terminal,monaco;"&gt;function CheckSecCompl-DNS {&lt;br /&gt;&amp;nbsp;$CompliancyResList = @() #array of compliancy-checks results&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;&amp;nbsp;$DNSServer =&amp;nbsp; Get-WmiObject -Namespace "root\MicrosoftDNS" -Class "MicrosoftDNS_Server"&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;&amp;nbsp;# check if the server is protected against DNS cache pollution using the property: SecureResponses &lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;&amp;nbsp;$CompliancyResList += New-CompliancyResult "DNS" "Server Configuration" "Secure Cache Against Pollution" $DNSServer.SecureResponses&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;&amp;nbsp;$DNSZones = Get-WmiObject -Namespace "root\MicrosoftDNS" -Class "MicrosoftDNS_Zone"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;foreach ($DNSzone in $DNSZones) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SubCategory = "DNS Zone: " + $DNSzone.Name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# To check if a DNS zone only accepts secure dynamic updates, use the property: AllowUpdate&lt;br /&gt;&amp;nbsp;&amp;nbsp;# AllowUpdate can have following values:&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 0: no dynamic updates allowed&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 1: secure and insecure dynamic updates allowed --&amp;gt; not secure&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 2: only secure dynamic updates allowed&lt;br /&gt;&amp;nbsp;&amp;nbsp;$CompliancyResList += New-CompliancyResult "DNS" $SubCategory "Secure or no dynamic updates" ($DNSzone.AllowUpdate -eq 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# To check if a DNS zone is Active-Directory-integrated, use the property: DsIntegrated&lt;br /&gt;&amp;nbsp;&amp;nbsp;$CompliancyResList += New-CompliancyResult "DNS" $SubCategory "Zone is AD integrated" $DNSZone.DsIntegrated&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# To check if a DNS zone doesn't allow zone transfers to any computer, use the property: SecureSecondaries&lt;br /&gt;&amp;nbsp;&amp;nbsp;# SecureSecondaries can have following values:&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 0: Allow zone transfers to any server --&amp;gt; not secure&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 1: Allow zone transfers only to specific servers (listed in the name-servers tab)&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 2: Allow zone transfers only to specific servers (listed in the zone-transfers tab)&lt;br /&gt;&amp;nbsp;&amp;nbsp;# 3: Do not allow Zone Transfers&lt;br /&gt;&amp;nbsp;&amp;nbsp;$CompliancyResList += New-CompliancyResult "DNS" $SubCategory "Zone transfers only to known secondaries" ($DNSZone.SecureSecondaries -ne 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;return $CompliancyResList&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: "&gt;&lt;span style="font-family: terminal,monaco;"&gt;CheckSecCompl-DNS | Out-GridView&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;.&lt;/p&gt;
&lt;p&gt;The result will appear in a PowerShell GridView. &lt;/p&gt;
&lt;p&gt;Copy the script above to a powershell script file (e.g. SecCompl_DNS.ps1) and run using a&amp;nbsp;Powershell-prompt under elevated privileges (All Programs --&amp;gt; Accessories --&amp;gt; Windows&amp;nbsp;Powershell --&amp;gt; Windows PowerShell --&amp;gt; right-click and select:"run as administrator"). Be aware: I've only tested these scripts on &lt;span style="text-decoration: underline;"&gt;Windows Server 2008 R2&lt;/span&gt;, not earlier versions. But feel free to try on other versions...&lt;/p&gt;
&lt;p&gt;Was this post useful for you? Let me know through the feedback!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3378225" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Compliance/">Compliance</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/PowerShell/">PowerShell</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/DNS/">DNS</category></item><item><title>Security Compliance checking with PowerShell</title><link>http://blogs.technet.com/b/raf_cox_security_blog/archive/2011/01/02/security-compliance-checking-with-powershell.aspx</link><pubDate>Sun, 02 Jan 2011 20:07:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3378095</guid><dc:creator>Raf Cox</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/raf_cox_security_blog/rsscomments.aspx?WeblogPostID=3378095</wfw:commentRss><comments>http://blogs.technet.com/b/raf_cox_security_blog/archive/2011/01/02/security-compliance-checking-with-powershell.aspx#comments</comments><description>&lt;p&gt;This is just a quick intro to a number of short articles that I will post in this blog over the coming months where I will show you some examples on how to check &lt;i&gt;Security Compliance&lt;/i&gt; using PowerShell scripts. The main focus will be on the different roles offered by Windows Server 2008 R2 (DNS, DHCP, IIS, etc) and how to check if they are configured in a secure way (using PowerShell scripts).&lt;/p&gt;
&lt;p&gt;Quick note: I work as a Microsoft consultant with many large organizations to help them improve their security and the last couple of years I've been mainly&amp;nbsp;working with NATO's Computer Incident Response Center (NCIRC). Although the security best-practices outlined in these posts are pulled from the Security Compliance Manager documents, the rest of the information you will find in these posts is not directly endorsed by the Solution Accelerators team (although, through my work at NCIRC, I have a very good working relationship with that team).&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Have you already seen the Security Compliance Manager?&lt;/i&gt; &lt;/p&gt;
&lt;p&gt;For anybody who is involved in defining and creating security policies for large organizations, this is THE tool for you:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;"The &lt;/i&gt;&lt;a href="http://social.technet.microsoft.com/wiki/contents/articles/microsoft-security-compliance-manager-scm.aspx" title="Click to view the page titled: Microsoft Security Compliance Manager (SCM)"&gt;&lt;i&gt;Microsoft Security Compliance Manager (SCM)&lt;/i&gt;&lt;/a&gt;&lt;i&gt; tool is the next evolution of the Microsoft Security Compliance Management Toolkit (SCMT) Series. We've taken our extensive guidance and documentation and incorporated it into this new tool, enabling you to access and automate all of your organization's security baselines in one centralized location."&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://social.technet.microsoft.com/wiki/contents/articles/microsoft-security-compliance-manager-scm.aspx"&gt;&lt;i&gt;http://social.technet.microsoft.com/wiki/contents/articles/microsoft-security-compliance-manager-scm.aspx&lt;/i&gt;&lt;/a&gt;&lt;i&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;SCM incorporates all the data and documents of the former Microsoft security guides and Group Policies into a single database, which can be accessed and managed through the SCM user-interface. The tool allows you to import settings, customize them, create multiple versions and export them into different formats, such as Group Policies, System Center Configuration Manager Desired Configuration Management (SCCM/DCM) packs and others. Do you want to learn more about it? Follow the link above...&lt;/p&gt;
&lt;p&gt;So, for 90% of the security guidance, SCM helps you with defining, implementing (GPO) and checking compliance (SCCM/DCM) with your security policies. The remaining 10% is documented as best-practices in the security documents that are part of the security baselines in SCM. &lt;/p&gt;
&lt;p&gt;This 10% is however becoming increasingly important. The Windows platform, as well as the most of the server-applications (Exchange, Office, SQL, ...) are designed to be secure by default. Way back in time, during the Windows NT4 prehistoric times, configuring security policies was a number 1 priority for anybody in IT Security. There were lots of settings that could be set to a stricter value (given that you wanted to sacrifice some application or network compatibility (e.g. with Windows 95)). &lt;/p&gt;
&lt;p&gt;This has however dramatically evolved. When comparing nowadays, the most strict settings (so called SSLF: Specialized Security, Limited Functionality) with the default (out-of-the-box) settings, you will see a decreasing difference going from Windows 2000 to Windows 2008 R2 or Windows 7. &lt;/p&gt;
&lt;p&gt;&lt;i&gt;Does this imply, that you no longer have to define security policies?&lt;/i&gt; &lt;/p&gt;
&lt;p&gt;Of course not! It's not because the initial installation of your system is secure, that it will stay secure over time. Admins might "temporary" change some settings for testing purposes (but forget to reset it); a system might have been upgraded from an old OS version and this might have left some old (less secure) settings in place; an application or installation package might have changed some of the settings, etc ... Through GPOs (defined in SCM), you can ensure that your systems &lt;span style="text-decoration: underline;"&gt;stay secure&lt;/span&gt;. &lt;/p&gt;
&lt;p&gt;&lt;i&gt;So, what to do with the remaining 10% of the security best-practices that cannot be automatically enforced through GPO or other means?&lt;/i&gt; &lt;/p&gt;
&lt;p&gt;Well, that's what I try to tackle in this blog in the coming months. Most of the best-practices documented in SCM are either&lt;em&gt; architectural guidance&lt;/em&gt; for a specific role (e.g. how to separate your external from your internal DNS) or specific &lt;em&gt;role configurations&lt;/em&gt; (e.g. how to configure a server to avoid &lt;i&gt;DNS&lt;/i&gt; &lt;i&gt;cache poisoning&lt;/i&gt;). The focus in this blog will be on automating the compliancy checks on the &lt;em&gt;role configurations&lt;/em&gt; using PowerShell scripts...&lt;/p&gt;
&lt;p&gt;For those not familiar with PowerShell, well, there's tons of information out there. Some links you can find in near future in a separate post. One book I liked particular myself (certainly if you have to start from scratch with PowerShell) is "Windows PowerShell 2.0 Administrator's Pocket Consultant" by William Stanek.&lt;/p&gt;
&lt;p&gt;So, stay tuned ... next post will be: validating security of a DNS configuration using PowerShell scripts. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3378095" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/SCM/">SCM</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/Compliance/">Compliance</category><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/PowerShell/">PowerShell</category></item><item><title>First post: a pragmatic approach towards AppLocker policies</title><link>http://blogs.technet.com/b/raf_cox_security_blog/archive/2010/12/15/first-post-a-pragmatic-approach-towards-applocker-policies.aspx</link><pubDate>Wed, 15 Dec 2010 20:42:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3375330</guid><dc:creator>Raf Cox</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/raf_cox_security_blog/rsscomments.aspx?WeblogPostID=3375330</wfw:commentRss><comments>http://blogs.technet.com/b/raf_cox_security_blog/archive/2010/12/15/first-post-a-pragmatic-approach-towards-applocker-policies.aspx#comments</comments><description>&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;AppLocker is a very powerful security tool within Windows 7 and Windows 2008 R2. You can control &lt;em&gt;&lt;span style="font-family: 'Segoe UI','sans-serif';"&gt;and&lt;/span&gt;&lt;/em&gt;&amp;nbsp;audit every program, MSI or script that a user (tries) to start. A good overview of what AppLocker is and does, can be found &lt;a href="http://windowsteamblog.com/windows/b/springboard/archive/2009/08/18/understanding-windows-7-applocker.aspx"&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;here&lt;/span&gt;&lt;/a&gt; (but I&amp;rsquo;m sure you&amp;rsquo;ll find a lot of other interesting sites when &lt;a href="http://www.bing.com/search?q=What%20is%20AppLocker%20Windows%207"&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;Bing&lt;/span&gt;&lt;/a&gt;&amp;rsquo;ing it)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;Looks great, but how do you deploy AppLocker in a large environment, where you have lots of system administrators in many sites and you&amp;rsquo;re the security guy that needs to set the policy? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;Best approach is (as usual): keep it simple!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;In short: how does it work?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;AppLocker allows you to control which applications can be started by (specific groups of) users; you identify the applications by &amp;ldquo;publisher rules&amp;rdquo; (e.g. WinWord.exe, version 12.0.0.0 or higher, Publisher: Microsoft, etc), &amp;ldquo;hash rules&amp;rdquo; (SHA256 hash) or &amp;ldquo;path rules&amp;rdquo; (C:\program files\CompanyX\AppY.exe). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;The rule can be either an &amp;ldquo;allow rule&amp;rdquo; or a &amp;ldquo;deny rule&amp;rdquo; and each rule allows you to specify exceptions (e.g. in a path rule, you can specify that users are allowed to execute anything under the &amp;ldquo;c:\program files&amp;rdquo; directory, except e.g. &amp;ldquo;C:\program files\CompanyX\AppY.exe&amp;rdquo;). Exceptions only exist for Publisher and Path rules, but the exceptions themselves can be specified in any combination of the 3 rule categories.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;And last but not least, the rule can apply to a certain group of users (default: everyone). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;Ok, but how do I define now an AppLocker policy for 20.000+ computers, in 200 locations, managed by 100 different system administrators with no common application baseline?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;Well, if you have a very motivated, skilled and very security aware staff of System Administrators who&amp;rsquo;s first concern is &lt;i style="mso-bidi-font-style: normal;"&gt;security&lt;/i&gt; and are willing to support you, you might want to start with identifying all applications + versions, create AppLocker publisher rules for each one of them, combine everything in a nice, big policy and have 1 or more FTEs available to update the AppLocker policy on a daily basis.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;If you don&amp;rsquo;t have that, following pragmatic and simple approach might you get started anyway with AppLocker:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;The basic idea for this approach is to prevent as much as possible that non-admin users would be able to execute files (.exe's) they downloaded themselves.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;In order to do that, you create a simple AppLocker policy that allows users only to execute programs from "trusted locations": c:\windows and c:\program files (actually %windir% and %programfiles%) using path-rules.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;Next, add all writeable sub-directories in those 2 directories as exceptions on these path-rule. To find the user-writeable subdirectories, you can use the AccessEnum tool from sysinternals. So, the %windir%\temp directory amongst others should be part of this exception list (this way, you can also blocked users from using utilities like arp.exe, etc). On a newly installed Windows 7, I identified following directories under %windir% that are writeable for normal users (non admin) and should be added to the &lt;i style="mso-bidi-font-style: normal;"&gt;exception&lt;/i&gt; list:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class="MsoNormalTable" style="margin: auto auto auto 4.65pt; width: 637px; border-collapse: collapse; mso-yfti-tbllook: 1184; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt;" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tbody&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\debug\WIA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 1;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\PCHEALTH\ERRORREP\QHEADLES\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 2;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\PCHEALTH\ERRORREP\QSIGNOFF\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 3;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\PLA\Reports\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 4;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\PLA\Rules\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 5;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\PLA\Templates\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 6;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\Registration\CRMLog\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 7;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\catroot2\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 8;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\com\dmp\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 9;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\FxsTmp\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 10;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\LogFiles\WMI\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 11;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\spool\drivers\color\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 12;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\spool\PRINTERS\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 13;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 14;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\CertificateServicesClient\UserTask-Roam\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 15;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\MemoryDiagnostic\CorruptionDetector\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 16;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\MemoryDiagnostic\DecompressionFailureDetect&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 17;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\PLA\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 18;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\PLA\System\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 19;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\RemoteApp and Desktop Connections Update\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 20;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\SideShow\SessionAgent\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 21;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\SyncCenter\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 22;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\Microsoft\Windows\WindowsColorSystem\Calibration Loader\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 23;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\System32\Tasks\User_Feed_Synchronization-{F3998D1D-6B67-45B6-BE78-9A1176A90B&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 24;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\Tasks\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 25;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\Temp\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 26;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\Temp\Cookies\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 27;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\Temp\History\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 28;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\Temp\Temporary Internet Files\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="height: 15pt; mso-yfti-irow: 29; mso-yfti-lastrow: yes;"&gt;
&lt;td width="637" nowrap="nowrap" valign="bottom" style="padding-bottom: 0cm; background-color: transparent; padding-left: 5.4pt; width: 478pt; padding-right: 5.4pt; height: 15pt; padding-top: 0cm; border: #f0f0f0;"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt;"&gt;&lt;span style="color: black; mso-ascii-font-family: Calibri; mso-fareast-font-family: 'Times New Roman'; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri;"&gt;&lt;span style="font-size: small;" size="3"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;%WINDIR%\tracing\*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;Local site admins can create exceptions on this base policy using a delta-GPO in which they list additional directories using AppLocker path-rules, e.g. for apps that are installed in a subdirectory directly under the c:\ or e.g. for the App-V Q:-drive. The advantage of this approach is that it is very lightweight, easy to understand and maintain. (For some other apps, e.g. exe's on thumb-drives to unlock the drive (e.g. IronKey), you must create publisher rules or hash-rules, since path rules won&amp;rsquo;t work in this situation.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;If your focus is mainly "policy-enforcement", this approach works pretty well (so far in my experience); you have to assume though that, even with a lot of testing, malicious users (or hackers) will find some day a writeable directory that is not excluded in the path rules; but it does protect against somebody trying to download something occasionally and execute it; or against the majority of automated attacks... (or against less skilled hackers ;-); and it does also prevent users from downloading and installing Google Chrome or Firefox themselves under their profile-directories (thereby circumventing all the IE security policies you have created).&lt;/span&gt;&lt;/p&gt;
&lt;p style="background: white; mso-line-height-alt: 10.5pt;"&gt;&lt;span lang="EN" style="font-family: 'Segoe UI','sans-serif'; color: #333333; mso-ansi-language: EN;"&gt;&lt;o:p&gt;Did this post help you? Let me know ...&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3375330" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/raf_cox_security_blog/archive/tags/AppLocker+Security+Baseline/">AppLocker Security Baseline</category></item></channel></rss>