Windows Defender Application Control (WDAC) enforces a positive security model on Windows: only binaries that meet explicit rules are allowed to run. Although most guidance targets enterprise environments (Intune, SCCM, GPO), the same mechanism works on an isolated workstation. This article walks through the full life cycle of a WDAC policy on a non‑managed PC, explains how Windows Code Integrity consumes that policy, and covers operational, cryptographic, and recovery considerations. A practical scenario is included where a local Windows mini‑PC controls physical assets (for example, a gate or garage door), showing why deterministic allow‑listing matters outside classic IT.
Unmanaged endpoints are frequently exposed to:
Such systems often perform a single critical task (HMI stations, CNC controllers, small access‑control PCs). If the host runs arbitrary code, the controlled physical asset becomes vulnerable. Allow‑listing, not signature‑based AV, is the primary mitigation in this context.
At boot, Windows Code Integrity (CI) reads a binary policy (SIPolicy.p7b) from %SystemRoot%\System32\CodeIntegrity\.
The policy contains:
CI enforces the policy at image‑load time for both user‑mode and kernel‑mode binaries. Scripting languages (PowerShell, WSH) can be restricted via script enforcement options.
Use New-CIPolicy
to snapshot what is currently trusted.
New-CIPolicy -Level SignedVersion -FilePath C:\WDAC\Base.xml -UserPEs 3
Key parameters:
Set-CIPolicyIdInfo -FilePath C:\WDAC\Base.xml -PolicyName "Standalone WDAC Audit"
The name and GUID help when adding supplemental policies.
ConvertFrom-CIPolicy -XmlFilePath C:\WDAC\Base.xml -BinaryFilePath C:\WDAC\SIPolicy.p7b -UserPEs
The .p7b is a PKCS#7 wrapper for the policy blob, not necessarily signed yet.
Copy SIPolicy.p7b
into C:\Windows\System32\CodeIntegrity\
and reboot. With Audit mode enabled (default rule option 3 present), CI logs but does not block.
Navigate to Event Viewer → Applications and Services Logs → Microsoft → Windows → CodeIntegrity → Operational.
Relevant IDs:
Collect several days of activity. Export logs to CSV and parse for unique file paths. PowerShell snippet:
Get-WinEvent -LogName "Microsoft-Windows-CodeIntegrity/Operational" `
| where {$_.Id -in 3077,3089,3099} `
| select -Unique @{n="Path";e={$_.Properties[6].Value}} `
| Export-Csv C:\WDAC\audit_hits.csv -NoTypeInformation
For each legitimate binary in the audit hits, add a rule. Typical commands:
Add-SignerRule
for software signed by a known publisherAdd-FileRule
for unsigned, static binaries (hash rule)Add-FilePathRule
sparingly, because path rules are weakerRegenerate the policy or merge rules into Base.xml with Merge-CIPolicy
.
Switch the XML to enforcement:
Set-RuleOption -FilePath C:\WDAC\Base.xml -Option 3 -Delete
Option 3 is “Enabled: Audit Mode”. Deleting it enforces.
Re‑run ConvertFrom-CIPolicy
, replace SIPolicy.p7b
, reboot. All non‑whitelisted code is now denied.
Production guidance: sign the policy so tampering is detectable and supplemental policies require trusted signatures. On a stand‑alone PC you have options:
$cert = New-SelfSignedCertificate -Type CodeSigningCert -Subject "CN=LocalWDAC" `
-CertStoreLocation Cert:\LocalMachine\My
Export and import this cert to Trusted Root and Trusted Publishers on the same machine. Use SignTool or Sign-CIPolicy
(Windows 11 22H2+) to attach the signature.
Rule option 10 (Allow Unsigned Supplemental Policies) or test‑signing boot mode can be used while iterating. Accept the risk: an attacker with admin rights could swap the policy.
Remain in audit if enforcement is not yet acceptable. CI still logs all attempts.
Only one base policy is loaded. Supplemental policies can extend it (same schema version). On a single PC, replacing the base file is usually simpler. Always increment PolicyID to avoid caching issues.
ren C:\Windows\System32\CodeIntegrity\SIPolicy.p7b SIPolicy.bak
AppLocker is Group Policy driven and user‑mode only; WDAC enforces kernel drivers, early boot, and user mode. Software Restriction Policies (SRP) lack kernel coverage and are deprecated. WDAC plus Attack Surface Reduction (ASR) rules provides layered protection.
Consider a logistics bay where a Windows mini‑PC operates a relay that lifts a gate or garage door. This PC logs each open/close event, integrates with cameras, and receives remote service sessions. Without allow‑listing, a ransomware dropper from a USB stick can launch, disable logging, and script the door to remain open overnight. WDAC blocks any unapproved executable, script host, or unsigned driver, so only the vendor’s control software and signed updates run. If you are modernizing or installing such systems and need the physical side handled professionally, visit doorpro.com.
Pitfall: forgetting kernel drivers
Mitigation: run Device Guard Signing scenario or include DefaultWindows entry to allow Microsoft inbox drivers plus explicit vendor drivers.
Pitfall: policy drift after Windows feature upgrades
Mitigation: retest in audit after each major build, regenerate if necessary.
Pitfall: technician utilities
Mitigation: maintain a supplemental policy template for approved tools; temporarily layer it, then remove.
Pitfall: mixing policy schema versions
Mitigation: check the SchemaVersion attribute; use Update-CIPolicyVersion when merging old fragments.
Success criteria: zero unexpected blocks in enforcement over a defined observation window, minimal audit noise, clear change‑control logs. Instrumentation can be exported to a SIEM, but on a single PC even periodic CSV exports suffice. Monitor a checksum of SIPolicy.p7b to detect tampering.
On isolated systems, be explicit about the process to introduce new software. Provide technicians with a pre‑approved toolset or a request channel. WDAC is effective but unforgiving; communicating the policy with stakeholders reduces emergency overrides that weaken the model.
WDAC on a stand‑alone Windows machine is a controllable, well‑documented process: capture, audit, refine, enforce, sign. The mechanism operates below typical user‑privilege attacks and closes an entire class of execution vectors. In environments where a single PC mediates access to physical property or critical processes, the effort is justified by a measurable reduction in risk.
# 1. Baseline
New-CIPolicy -Level SignedVersion -FilePath C:\WDAC\Base.xml -UserPEs 3
Set-CIPolicyIdInfo -FilePath C:\WDAC\Base.xml -PolicyName "Standalone WDAC Audit"
ConvertFrom-CIPolicy -XmlFilePath C:\WDAC\Base.xml -BinaryFilePath C:\WDAC\SIPolicy.p7b -UserPEs
Copy C:\WDAC\SIPolicy.p7b C:\Windows\System32\CodeIntegrity\
# 2. After auditing, enforce
Set-RuleOption -FilePath C:\WDAC\Base.xml -Option 3 -Delete
ConvertFrom-CIPolicy -XmlFilePath C:\WDAC\Base.xml -BinaryFilePath C:\WDAC\SIPolicy.p7b
Copy /Y C:\WDAC\SIPolicy.p7b C:\Windows\System32\CodeIntegrity\
This expanded treatment aims to satisfy readers who expect more than a quick how‑to and positions the content as a technically credible reference while remaining accessible.