Object access audit records include not just the fact of access allowed or denied, but also the reason for the success or failure. This “reason for access” reporting generally takes the form of an access control entry, specified in SDDL (Security Descriptor Definition Language), in the audit record. This allows for a diagnosis of scenarios in which an object to which you believe access should be denied is being permitted, or vice versa, by identifying the specific access control entry that caused the attempted access to succeed or fail.
As can be seen in Figure 6-10, object access auditing is disabled by default (as are all other auditing policies).
EXPERIMENT: Object Access Auditing
You can demonstrate object access auditing by following these steps:
In Explorer, navigate to a file to which you would normally have access. In its Properties dialog box, click on the Security tab and then select the Advanced settings. Click on the Auditing tab, and click through the administrative privileges warning. The resulting dialog box allows you to add auditing of access control entries to the file’s System Access Control List.
Click the Add button. In the resulting Select User Or Group dialog box, enter your own user name or a group to which you belong, such as Everyone, and click Check Names and then OK. This presents a dialog box for creating an Auditing Access Control Entry for this user or group for this file.
In the Successful column, select Full control (which will cause all of the other access methods to be selected as well). Click OK four times to close the file Properties dialog box.
In Explorer, double-click on the file to open it with its associated program.
In Event Viewer, navigate to the Security log. Note that there is no entry for access to the file. This is because the audit policy for object access is not yet configured.
In the Local Security Policy Editor, navigate to Local Policies, Audit Policy. Double-click on Audit Object Access, and then click Success to enable auditing of successful access to files.
In Event Viewer, click Action, Refresh. Note that the changes to audit policy resulted in audit records.
In Explorer, double-click on the file to open it again.
In Event Viewer, click Action, Refresh. Note that several file access audit records are now present.
Find one of the file access audit records for Event ID 4656, This shows up as “a handle to an object was requested.” Scroll down in the text box to find the Access Reasons section. The following example shows that two access methods, READ_CONTROL and ReadAttributes, were requested. The former was granted because the accessor was the owner of the file, and the latter was granted because of the indicated Access Control Entry. The ACE includes the SID of the user who attempted the access and includes the designation A:FA, indicating that this SID is Allowed (A) all file access methods (FA) to the file.
Global Audit Policy
In addition to object-access ACEs on individual objects, a global audit policy can be defined for the system that enables object access auditing for all file system objects, for all registry keys, or for both. A security auditor can therefore be certain that the desired auditing will be performed, without having to set or examine SACLs on all of the individual objects of interest.
An administrator can set or query the global audit policy via the AuditPol command with the /resourceSACL option. This can also be done with a program calling the
EXPERIMENT: Setting Global Audit Policy
You can use the AuditPol command to enable global audit policy.
If not already done in the previous experiment, in the Local Security Policy Editor, navigate to the Audit Policy settings (as shown in Figure 6-10), double-click Audit Object Access, and enable auditing for both success and failure. Note that on most systems, SACLs specifying object access auditing are uncommon, so few if any object access audit records will be produced at this point.
In an elevated command prompt window, enter the following command:C:\> auditpol /resourceSACL
This will produce a summary of the commands for setting and querying global audit policy.
In the same elevated command prompt window, enter the following commands:C:\> auditpol /resourceSACL /type:File /view C:\> auditpol /resourceSACL /type:Key /view
On a typical system, each of these commands will report that no Global SACL exists for the respective resource type. (Note that the keywords “File” and “Key” are case-sensitive.)
In the same elevated command prompt window, enter the following command:C:\> auditpol /resourceSACL /set /type:File /user:yourusername /success /failure /access:FW