ENTERPRISE

Windows 7 : Interacting with the Built-In Security Features - ACCESSING APPLOCKER (part 1) - Seeing the AppLocker Entries in the Registry

2/27/2014 1:48:51 AM

AppLocker provides a significant new means of enforcing application execution policies. The emphasis is on code rights, not user rights as it is with NT security. You can attach AppLocker rules in a number of ways. For example, you can create AppLocker rules that affect a particular user or group. AppLocker rules can also affect an executable's publisher or even the version of a file. It's also possible to restrict particular application types.

AppLocker doesn't work with all versions of Windows. In fact, you're limited to the following versions:

  • Windows Server 2008 R2 Standard

  • Windows Server 2008 R2 Enterprise

  • Windows Server 2008 R2 Datacenter

  • Windows Server 2008 R2 for Itanium-Based Systems

  • Windows 7 Ultimate

  • Windows 7 Enterprise

You can create AppLocker rules when working with Windows 7 Professional, but the operating system won't enforce the rules. So even though AppLocker is a marvelous new security feature, it does currently have some significant limitations. AppLocker does build on Software Restriction Policies (SRP) technology found in older versions of Windows, so you may have to rely on SRP for now and update to AppLocker later.

1. Seeing the AppLocker Entries in the Registry

The AppLocker entries are part of a GPO. Unfortunately, in this case there isn't a convenient COM object you can use to access the information you need. What you need to do in this case is view the data using a registry entry. In fact, there are commonly eight or more registry entries you could use, but only one of the multitude of registry entries is always in a known place in the registry, the HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2 key. Figure 1 shows how this key might appear on your system.

Figure 1. AppLocker relies heavily on the registry to store settings.

The SrpV2 key stands for Software Restriction Policy version 2, because that's what AppLocker really is. Beneath this key are four keys for DLL, executable, installer, and script files. Each policy key name appears as a Globally Unique Identifier (GUID), which is pronounced "gwid" (think of squid). Every policy has just one value, named Value. It consists of an XML description of the policy. Here's a typical example of a publisher policy.

<FilePublisherRule Id="2041dcc1-7677-41f6-863c-6b8bb5b1b2a0"
Name="My AppLocker Rule 2"
Description="Another sample AppLocker rule."
UserOrGroupSid="S-1-1-0"
Action="Allow">
<Conditions>
<FilePublisherCondition
PublisherName="O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"
ProductName="MICROSOFT (R) VISUAL STUDIO (R) 2010"
BinaryName="VSHOST32.EXE">
<BinaryVersionRange LowSection="10.0.0.0" HighSection="*"/>
</FilePublisherCondition>
</Conditions>
</FilePublisherRule>


Of course, the entry won't appear nicely formatted in the registry — it appears as a single line of barely readable XML. Some information, such as the Id, Name, Description, UserOrGroupSid, and Action attributes, remains the same for every entry. The contents of the <Conditions> element vary by the kind of exclusion you create. For example, a path exclusion only requires a <FilePathCondition> element that contains a Path attribute.

2. Configuring the AppLocker Demo Example

The AppLocker Demo example consists of a Windows Forms application. You need to add two buttons, List Entries (btnList) and Add Entries (btnAdd). The example also requires a list box for output, lstEntries. Because this example relies on the registry, you do need to add the following using statements, but you don't need to add any special references.

using Microsoft.Win32;
using System.Xml;
using System.Security;

Everyone can read the AppLocker entries, so you don't need to add a manifest if your only goal is to read the entries. However, only administrators can add new entries. 

Other  
  •  Windows 7 : Interacting with the Built-In Security Features - WORKING WITH AUTOMATIC UPDATES (part 2)
  •  Windows 7 : Interacting with the Built-In Security Features - WORKING WITH AUTOMATIC UPDATES (part 1)
  •  Windows 8 Architecture from a Developer’s Point of View : Understanding Windows Runtime (part 5) - What’s not in Windows Runtime
  •  Windows 8 Architecture from a Developer’s Point of View : Understanding Windows Runtime (part 4) - Language Projections
  •  Windows 8 Architecture from a Developer’s Point of View : Understanding Windows Runtime (part 3) - Metadata in Windows Runtime - Namespaces
  •  Windows 8 Architecture from a Developer’s Point of View : Understanding Windows Runtime (part 2) - Metadata in Windows Runtime - Metadata Format
  •  Windows 8 Architecture from a Developer’s Point of View : Understanding Windows Runtime (part 1) - Windows Runtime Architecture Overview
  •  Windows 8 Architecture from a Developer’s Point of View : Windows 8 Development Architecture
  •  Windows 7 : Programming KMDF Hardware Driver - Mapping Resources - Code to Map Resources
  •  Windows 7 : Programming KMDF Hardware Driver - Handling Interrupts (part 2) - Deferred Processing for Interrupts
  •  
    Top 10
    Review : Sigma 24mm f/1.4 DG HSM Art
    Review : Canon EF11-24mm f/4L USM
    Review : Creative Sound Blaster Roar 2
    Review : Philips Fidelio M2L
    Review : Alienware 17 - Dell's Alienware laptops
    Review Smartwatch : Wellograph
    Review : Xiaomi Redmi 2
    Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
    Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
    3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    VIDEO TUTORIAL
    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
    Popular Tags
    Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8