Keeping your company secure using Group Policy

In this TechEd session I presented at TechEd New Zealand 2014 I covered some of the changes with Group Policy preferences recently as well as some of the new Group Policy improvements you can do to protect yourself against Pass the Hash attacks. Unfortunately at the end one of my Demo’s did not work however I actually did get it to work only a few minutes after the video ended. All I had to do was log off and on and the authentication attempt failed as expected. In any case it was a great session and best of all it was recorded in full video so you actually get to see me talk on stage rather than just look at my monitor.

TE

Unfortunately they have only release the video as a WMV so you will need to click use this link to play the video. http://video.ch9.ms/sessions/teched/nz/2014/PCIT312_FINAL.wmv

Source: http://channel9.msdn.com/Events/TechEd/NewZealand/2014/PCIT312

Updated: Windows 8.1 Update and Windows Server 2012 R2 Update Administrative Templates ADMX/ADML pack

COG[1]Update: I had discovered that this original ADMX template were missing some Internet Explore 11 Group Policy settings. As a result the ADMX/ADML pack has now been re-released but can be downloaded using the same link below.

Microsoft has just released the Administrative Templates (ADMX/ADML) files that allow you to configure their newest Group Policy Administrative Template setting for Windows 8.1 Update and Windows Server 2012 R2 Update.  These files are already provided with the operating system when you go to install it however this download allows you to update the policy settings even on an older version of the OS.

The changes to these files mainly include the support for the new group policy setting regarding the new UI setting for configuring the start screen and task bar.

The best way to deploy these files is to simply copy them to the Group Policy Central Store. This will update all  your group policy objects in one easy step. Even if you are not running the latest OS in you environment there is no issues with updating the ADMX/ADML files as all the setting are fully backwards compatible and will just mean one less step to do when you do upgrade in the future.

Download the Windows 8.1 update ADMX/ADLM pack from  http://www.microsoft.com/en-us/download/details.aspx?id=43413

How to use Internet Explorer 11 Enterprise Mode with Group Policy

IE9answer.pngThe session that myself and Chris Jackson (a.k.a. AppCompatGuy) at TechEd New Zealand 2014 has now been published. So for your viewing pleasure I have embedded the video below:

This session covers Internet Explorer 11 with Enterprise Mode and how you can use Group Policy to manage the feature to enable you to migrated to the latest version of IE in your organisation. Myself and Chris has a blast doing this session and the session feedback has been excellent… So if you want a little bit of a laugh and learn a lot about IE Enterprise mode then by all means enjoy the video.

If you are after a copy of the video or slides for offline viewing then you can click on the source link below.

Source: http://channel9.msdn.com/Events/TechEd/NewZealand/2014/PCIT307

Internet Explorer ActiveX Blocking Group Policy

IE9answerMicrosoft has just released a patch MS14-051 (https://support.microsoft.com/kb/2976627) for Internet Explore on Windows 7 and Windows 8 that allows IT Admins to block out of date ActiveX controls from running in the browser. This move aligns IE with other browsers that actively block out of date version of plug-ins such as Java but is still very similar to the ActiveX kill list that Microsoft used to issue to block controls with known vulnerabilities. The key difference with this change is that it now uses an XML configuration file (see here) to publish what controls are out of date rather than hard coding them into a patch.

Interesting to note that while the name of blog post and update specifically say this is a ActiveX blocking update it is currently only going to be configured to block out of date versions of Java. Of course having and XML configuration file also means that Microsoft can also use the same mechanism for blocking other out of date controls (Flash, Silverlight etc) in the future.

It is also good to know that this change does *NOT* apply to web sites that are configured to run in the Intranet Zone or Trusted Zones meaning that all your our of date ActiveX controls you run on your intranet are not affected by this change. In addition to this Microsoft has now said they will give a grace period before they block the controls until September 9th.

To manage this new security feature Microsoft has also create four new group policy settings under Administrative Templates > Windows Components > Internet Explorer > Security Features > Add-on Management

  • Turn on ActiveX control logging in Internet Explorer
  • Remove Run this time button for outdated ActiveX controls in Internet Explorer
  • Turn off blocking of outdated ActiveX controls for Internet Explorer on specific domains
  • Turn off blocking of outdated ActiveX controls for Internet Explorer

For more details on these setting check out http://technet.microsoft.com/en-us/library/dn761713.aspx

To get these new Group Policy setting for your organisation you either need to install the MS14-051 update on the computer that you edit your GPO’s on OR you need to download the ADMX files from htp://www.microsoft.com/en-us/download/details.aspx?id=40905 and update your Group Policy Policydefenitions central or local store.

Additional Reference: http://blogs.msdn.com/b/ie/archive/2014/08/06/internet-explorer-begins-blocking-out-of-date-activex-controls.aspx

How to remove cPassword values from Active Directory

no_passwordsWith the recent MS14-025 security patch Microsoft has removed the ability to configure passwords in Group Policy Preferences via the User Interface. However this update does not remove the password value from AD nor does it stop the value being applied to computers/users. So, if you have apply MS14-025 and you have also implemented another way of managing the local admin password (see my other post How to set the Local Administrator account to a Random Password ) the next thing to do is to remove all the passwords from AD so there is no traces left of the old insecure passwords.

Side Note: These passwords in AD that Group Policy preferences user are also know as cPasswords because that is the name of field that is used to save the password value (see below)

image

How insecure is the cPassword field? See my post Why Passwords in Group Policy Preference are VERY BAD. Then remember that even you have deployed MS14-025 and you are managing password via other mean’s you might still have passwords in your organisation that have not be changed, so these passwords might still be valid on some computers.

So along with the password reset PowerShell script released in the MS14-025 Microsoft  they also provide a script that allows you to identify the polices. Below I go thought and show how you can run this script and how you can purge the scourged of cPasswords in your organisation.

First of all go to http://support.microsoft.com/kb/2962486 and copy the Get-SettingsWithCPassword.ps1 script from the page and save that as a file called “Get-SettingsWithCPassword.ps1” on the computer you are going to run the script.

Note: You will need to run “Set-ExecutionPolicy -ExecutionPolicy Unrestricted” on the computer to run this script as it is not signed. Be sure to not leave your computer in this state as it does reduce the security of your system.

Then open a PowerShell command prompt from any workstation, preferably one that has read access to all the GPO’s which is most accounts by default.

Warning: Depending on the size of your System Volume and how fast your network and domain controllers are this can take a VERY LONG time (Hours).

Then run the following command (replacing the highlighted values with your own DNS domain name):

.\Get-SettingsWithCPassword.ps1 –path “\\corp.local\SYSVOL\corp.local” | Format-List

image

As you can see it has now listed the Group Policy Objects name and path to the setting in your domain that have the cPassword value configured.

TIP: You may want to run this script on your environment straight away on your environment to see how pervasive the use of the cPassword value is in your environment. (I am betting a lot).

Removing cPasswords the easy way

The easiest thing to do to remove these values would be to simply go in an delete the relevant Group Policy Preferences settings or the Group Policy Object. This will delete all the files that contain the cPassword value from SYSVOL thus purging the value.

Removing cPasswords the hard way

But this Group Policy Preference might be part of a complicated Group Policy Object or other Group Policy Preferences settings so you *might* want to just remove the cpassword value surgically.

To do this open up the Group Policy Management Console and edit the affect GPO so that we can go to the relevant file in the SYSVOL for that GPO. Then navigate to the Computer Configuration (or user) > Policies > Windows Settings > Scripts (Startup/Shutdonw) then click on the “Startup” script and then click on the “Show Files…” button.

image.

This will open up Windows Explorer somewhat close to the folder that has the cPassword value stored. You will need to go up the “Machine” (or User) folder and then open up the “Preferences” folder.

image

Now open Notepad.exe as an administrator and open the XML files in that location (in our example it is ScheduledTasks.xml).Now search for the name “cpassword” and it will jump to the location that the cPassword is stored.

Note: It is important to open up notepad as administrator (or with permission to edit the GPO) otherwise you will not be able to save the file.

image

Warning: Be sure that you have replaced the functionality of this Group Policy Preferences using another method as this will break the functionality of the setting.

Now delete the entire cpassword field from the XML and save the XML file.

image

You can run the script again to confirm that the cpassword filed is removed from AD.

image

So I expect this is the last in the series of post about cPassword value in Active Directory. Hopefully by now you are fully aware of the issues with passwords with Group Policy Preferences (see Why Passwords in Group Policy Preference are VERY BAD) and that you have prepped your environment (see How to enable WinRM via Group Policy) to enable password management via the means (see How to set the Local Administrator account to a Random Password). You then  applied MS14-025 to all your computers (see Group Policy Preferences Password Behaviour Change – MS14-025) and have been trying to identify and limit the use of the cPassword values using this post.

So how many cPasswords do you have in your environment? Please shout out the number in the comments below.