Select Page

There’s no doubt that the built-in security auditing in Windows is thorough–sometimes too thorough, as anyone who has tried to manage auditing logs in large AD environments knows. But when it comes to auditing Group Policy changes, the native auditing can be lacking. It’s why we built our Group Policy Auditing & Attestation (GPAA) product last year–to make sense out of Group Policy changes that happen within your environment in a way that is meaningful to Group Policy administrators. In this post, I want to talk about what Windows does and doesn’t do for you, when it comes to Group Policy change auditing. The big thing to note about native Windows auditing and Group Policy is that, when it comes to auditing changes to GPO settings, there is, literally, nothing available in the box. That is, if you make a change to a GPO setting, there is no native way of determining what that change was in any meaningful way. You’ll be able to tell that *something* has changed, but not what the changed setting was, nor its before or after values. That’s where a product like GPAA comes into play. GPAA can show you, not only who made the change and when, but also what the actual setting change was, as shown in this figure:

Group Policy Change Auditing with GPAA

Capturing GPO Settings Changes with GPAA

In addition, other types of operations related to Group Policy management do generate audit events, but it takes a bit of work to make sense of them. In this article I want to describe what exactly you can audit natively, when it comes to GP management, and what you can’t. And, show you how GPAA can make the whole process much easier. But first, lets talk about the best way to configure auditing for your AD environment.

Windows Auditing Options

The first thing to know, is that there is “legacy” auditing and then there is “advanced” auditing, within Windows server. Legacy auditing has existed since Windows 2000, and contains a set of coarse-grained audit categories that you can enable, as shown in this figure of audit configuration within a Group Policy Object:

 

Legacy Windows audit categories

Legacy Audit Categories

 

The downside to using these audit categories, is that they are pretty darn noisy. That is, if you enable even a few of them on your AD domain controllers, you are likely to get your security logs rolling over pretty quickly in a reasonably large environment. This is because within each of these coarse categories, are a number of sub-category event types that are audited and you have no control over which of those you get when you enable a particular category–you get them all. So unless you have a really good event log collection system, you may end up missing events as the logs roll over. I’ve seen security logs in large organizations completely roll over in a matter of 15-20 minutes, and that’s with making the security log file size reasonably large. So, what can you do?

Fortunately, when Server 2008 shipped, Microsoft introduced “Advanced Audit Configuration”. This advanced auditing capability gave you the ability to turn on and off, all of those sub-categories within the legacy audit categories, so that you could audit just what you needed, and no more. In Server 2008, you could set these audit sub-categories on your Domain Controllers using the command-line auditpol.exe tool. But, starting in Server 2008-R2, Microsoft added these options to Group Policy, so that you could easily and graphically configure these advanced audit categories, as shown in the figure below:

Windows Advanced Auditing

Advanced Auditing Configuration in Group Policy

 

You’ll notice that under each major category on the left, in the screenshot above, there are sub-categories that can be enabled or disabled for auditing. So, for example, under Directory Service Access (DS Access), you can enable auditing for everything from AD replication events to accessing AD. For the purposes of tracking changes made to AD, which is what we’re interested in for Group Policy change auditing, you can enable the Directory Service Changes sub-category, and in fact this is the category of events GPAA uses to track the who, what, when and why of AD changes related to Group Policy.

The one thing to note about enabling these advanced audit configuration categories on your domain controllers, is that you have to also tell AD to ignore the legacy auditing categories, if you plan to keep them enabled as well. You can do that by enabling the policy on your DCs, within a GPO under Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings. Once that policy is enabled, then all legacy events categories will be ignored and only advanced audit categories will be logged to the DC’s security event logs.

 

Configuring AD for Group Policy Change Auditing

In order to get events related to AD changes, you have to do two basic tasks. The first is that you have to enable auditing for AD changes, as I just described above. The second task is that AD objects that you’re interested in auditing changes against, must have their System Access Control Lists (SACLs) configured to enable auditing. By default, Server 2008 does many of these tasks for you, as it relates to Group Policy changes, out of the box. If we take the whole universe of things that can be audited as it relates to Group Policy management, then only deletion of GPOs and the creation and deletion of WMI filters require additional SACLs being put in place to generate audit events.

Once the Directory Service Changes auditing sub-category is enabled on your DCs, and SACLs are configured, then you can start to look at all of the changes that occur in AD related to Group Policy management. AD change events generated by this sub-category generally fall into one of three event IDs:

5136- Changes to AD objects

5137- Creation of new AD objects

5141- Deletion of existing AD objects

And since GPOs are just a special kind of AD object, it follows that creation, deletion and modification of GPOs also generate events of these event IDs. There’s a few things to keep in mind about GPO change events. First, all changes related to GPOs (e.g. creation, deletion, modification) happen within the CN=Policies, CN=System container under a given AD domain (see figure below)

The System Policies container where GPOs are stored in AD

GPO Storage in AD

 

So when it comes to auditing changes to GPOs, it all happens within this container. As you can see from the screenshot above, that container holds a set of GUID-named GPO containers (of AD object class groupPolicyContainer) that represent each GPO in the domain. Now, creating, deleting or changing GPOs is not the only GP management operation you will be interested in auditing. You will also want to know when GPOs are linked or unlinked from a site, domain or OU. Those actions require auditing of changes (i.e. writes) to the GPLink attribute on those container objects (which is also a default SACL in newer versions of Windows) . In addition, you may want to know when WMI filters are created, modified or deleted. Those occur as creation modification or deletion events against objects under the CN=SOM, CN=WMI Policy,CN=System container within a given AD domain, which is where WMI filters are stored.

Auditing Group Policy Changes

Now that we have an idea about what kinds of GP related stuff we can audit using Windows native auditing, let’s take a look at what events are generated for each type of GP management activity. The following table lays out a  variety of GP management tasks, the event IDs to look for and sample event text from that event operation within, in this case, a Windows Server 2008-R2 DC. Within the sample event column, I show the raw event log entry of an event that gets thrown when that GP operation occurs. In red I highlight the class or attribute that is modified, created or deleted when the task is performed. There’s a couple of things to note in this table. First off, the Change GPO event relates to changes that you make to a GPO. They could be a GPO permission change or a GPO settings change. In the case of the former, you will be able to use the data provided in the event log (namely the change of the ntSecurityDescriptor attribute) to determine the actual GPO permission change. Unfortunately, in the case of a GPO setting change, you won’t see any detail around the actual settings that were changed–you will only see that *something* changed in the GPO, who made the change and that it’s versionNumber was incremented. The before and after values of the actual settings change are one of the things that GPAA fills in, as I discussed above.

In addition, when it comes to making sense of the audit events below, it does require a bit of work. For example, a GPO permission change does record two events–one the before value of the ntSecurityDescriptor attribute on the groupPolicyContainer (GPC) object representing the GPO, and one with the after value. But the data in the audit entry is in the form of the Security Descriptor Definition Language (SDDL), so you’ll have to know how to translate that value in a readable format. In addition, for things like changing or disabling a GPO Link, the audit log reports the before and after values of the gpLink attribute on a given OU, site or Domain container, but it doesn’t tell you what those values (e.g. 0, 1 and 2) mean. All of this is where GPAA can come in handy, because it can take the data out of the raw events and make sense of it in the context of Group Policy changes.

 

Event Event ID Sample Event
Create GPO 5137 A   directory service object was created.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN:   CN={F5FEDDD8-2031-4E1D-A43C-809F4ED83332},CN=Policies,CN=System,DC=cpandl,DC=com
GUID:   CN={F5FEDDD8-2031-4E1D-A43C-809F4ED83332},CN=Policies,CN=System,DC=cpandl,DC=com
Class: groupPolicyContainer

Operation:
Correlation ID:   {ac790c0f-49df-4e58-86d8-79ee040ae082}
Application Correlation ID: –

Change GPO 5136 A   directory service object was modified.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN:   CN={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},CN=POLICIES,CN=SYSTEM,DC=CPANDL,DC=COM
GUID: CN={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},CN=Policies,CN=System,DC=cpandl,DC=com
Class: groupPolicyContainer

Attribute:
LDAP Display Name: versionNumber
Syntax (OID): 2.5.5.9
Value: 65538

Operation:
Type: Value Added
Correlation ID:   {167f4140-a0d9-4ec7-b938-46447b8c932c}
Application Correlation ID: –

Delete GPO 5141 A   directory service object was deleted.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN:   CN=Machine,CN={9E195968-8734-4E45-8E7D-6D54FEF7C95D},CN=Policies,CN=System,DC=cpandl,DC=com
GUID:   CN=Machine\0ADEL:f7bf6fbc-88a4-4b06-82db-beefa21e9f3f,CN=Deleted   Objects,DC=cpandl,DC=com
Class: container

Operation:
Tree Delete: No
Correlation ID:   {1cc87a40-58c0-42f6-8f85-167bb6e42f8f}
Application Correlation ID: –

Change GPO Permission 5136 A   directory service object was modified.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN:   cn={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},cn=policies,cn=system,DC=cpandl,DC=com
GUID: CN={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},CN=Policies,CN=System,DC=cpandl,DC=com
Class: groupPolicyContainer

Attribute:
LDAP Display Name: nTSecurityDescriptor
Syntax (OID): 2.5.5.15
Value:   O:DAG:DAD:PAI(OA;CI;CR;edacfd8f-ffb3-11d1-b41d-00a0c968f939;;AU)(A;;CCDCLCSWRPWPDTLOSDRCWDWO;;;DA)(A;CI;CCDCLCRPWPSDRCWDWO;;;S-1-5-21-817735531-4269160403-1409475253-2612)(A;CI;CCDCLCSWRPWPDTLOSDRCWDWO;;;DA)(A;CI;CCDCLCSWRPWPDTLOSDRCWDWO;;;EA)(A;CI;CCDCLCSWRPWPDTLOSDRCWDWO;;;S-1-5-21-817735531-4269160403-1409475253-1123)(A;CI;LCRPLORC;;;ED)(A;CI;LCRPLORC;;;AU)(A;CI;CCDCLCSWRPWPDTLOSDRCWDWO;;;SY)(A;CIIO;CCDCLCSWRPWPDTLOSDRCWDWO;;;CO)S:AI(OU;CIIDSA;WPWD;;f30e3bc2-9ff0-11d1-b603-0000f80367c1;WD)(AU;CIIDSA;WPSD;;;WD)(OU;CIIOIDSA;WP;f30e3bbe-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(OU;CIIOIDSA;WP;f30e3bbf-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)

Operation:
Type: Value Added
Correlation ID:   {5d0497d2-8c7e-4543-861f-cac543cde7eb}
Application Correlation ID: –

Change GPO Status 5136 A   directory service object was modified.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN:   cn={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},cn=policies,cn=system,DC=cpandl,DC=com
GUID: CN={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},CN=Policies,CN=System,DC=cpandl,DC=com
Class: groupPolicyContainer

Attribute:
LDAP Display Name: flags
Syntax (OID): 2.5.5.9
Value: 2

Operation:
Type: Value Added
Correlation ID:   {ade7ee5a-64a5-4c43-b0ae-d9697ca427e4}
Application Correlation ID: –

Change GPO WMI Filter 5136 A   directory service object was modified.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN:   cn={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},cn=policies,cn=system,DC=cpandl,DC=com
GUID: CN={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},CN=Policies,CN=System,DC=cpandl,DC=com
Class: groupPolicyContainer

Attribute:
LDAP Display Name: gPCWQLFilter
Syntax (OID): 2.5.5.12
Value:   [cpandl.com;{65E2FC2F-55C4-4810-92E3-64BF1000F7DD};0]

Operation:
Type: Value Added
Correlation ID:   {90b34980-ee07-4a69-a8b4-768482a015bb}
Application Correlation ID: –

Create WMI Filter 5137 A   directory service object was created.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN:   CN={9CC847D2-3633-4CCB-919C-991C188CE0D2},CN=SOM,CN=WMIPolicy,CN=System,DC=cpandl,DC=com
GUID:   CN={9CC847D2-3633-4CCB-919C-991C188CE0D2},CN=SOM,CN=WMIPolicy,CN=System,DC=cpandl,DC=com
Class: msWMI-Som

Operation:
Correlation ID:   {e3fbe963-c2b7-4209-a73c-5d4529abd43d}
Application Correlation ID: –

Delete WMI Filter 5141 A   directory service object was deleted.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN:   CN={9D06B582-DD6A-46D0-97BD-4654AB9B358D},CN=SOM,CN=WMIPolicy,CN=System,DC=cpandl,DC=com
GUID:   CN={9D06B582-DD6A-46D0-97BD-4654AB9B358D}\0ADEL:518a23c6-3500-499c-9051-bc1264fd3d81,CN=Deleted   Objects,DC=cpandl,DC=com
Class: msWMI-Som

Operation:
Tree Delete: No
Correlation ID:   {ffac999b-f1f9-4c1e-967a-5e82fed2285b}
Application Correlation ID: –

Change Link Enforced Flag 5136 A   directory service object was modified.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN: OU=DPM,DC=cpandl,DC=com
GUID: OU=DPM,DC=cpandl,DC=com
Class: organizationalUnit

Attribute:
LDAP Display Name: gPLink
Syntax (OID): 2.5.5.12
Value:   [LDAP://cn={97FC6033-5BAD-426F-BFCC-B6120A349608},cn=policies,cn=system,DC=cpandl,DC=com;0][LDAP://cn={438F250E-B0CC-4FD7-BC6E-61BCCAF408FA},cn=policies,cn=system,DC=cpandl,DC=com;0]

Operation:
Type: Value Deleted
Correlation ID: {91cc8727-3ed7-4254-8baa-0534a6155809}
Application Correlation ID: –

Change SOM Block Inheritance Flag 5136 A   directory service object was modified.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN: OU=DPM,DC=cpandl,DC=com
GUID: OU=DPM,DC=cpandl,DC=com
Class: organizationalUnit

Attribute:
LDAP Display Name: gPOptions
Syntax (OID): 2.5.5.9
Value: 1

Operation:
Type: Value Added
Correlation ID:   {09b0e4e8-a95c-4475-aa74-aaea2fb128b6}
Application Correlation ID: –

Unlink GPO 5136 A   directory service object was modified.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN: OU=Test,OU=Office   Deploy,OU=EastCoast,DC=cpandl,DC=com
GUID: OU=Test,OU=Office   Deploy,OU=EastCoast,DC=cpandl,DC=com
Class: organizationalUnit

Attribute:
LDAP Display Name: gPLink
Syntax (OID): 2.5.5.12
Value:

Operation:
Type: Value Added
Correlation ID:   {696218a2-80e9-4757-8066-7b270b4d1e93}
Application Correlation ID: –

Link GPO 5136 A   directory service object was modified.Subject:
Security ID:  CPANDL\darren
Account Name:  darren
Account Domain:  CPANDL
Logon ID:  0x33cf14Directory Service:
Name: cpandl.com
Type: Active Directory Domain   ServicesObject:
DN: OU=Test,OU=Office   Deploy,OU=EastCoast,DC=cpandl,DC=com
GUID: OU=Test,OU=Office   Deploy,OU=EastCoast,DC=cpandl,DC=com
Class: organizationalUnit

Attribute:
LDAP Display Name: gPLink
Syntax (OID): 2.5.5.12
Value:   [LDAP://cn={33B8CE9C-87F3-4712-94C3-E5BB0C8DDEB2},cn=policies,cn=system,DC=cpandl,DC=com;0]

Operation:
Type: Value Added
Correlation ID:   {47e0444f-82d3-4065-8b5f-b502eee366f7}
Application Correlation ID: –

 

 

The bottom line for Group Policy Change Auditing, is that while the native audit logs can definitely get you information about some of the changes related to Group Policy within your environment, a product like GPAA can really help make sense of the data as it comes in, and sift through the myriad of values, flags, codes and just downright missing information, that can arise when you are parsing through this data.

Thanks for reading!

Darren