Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

App Control events 3076 and 3077: a file would be or was blocked

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A program, DLL or driver fails to start on a Windows machine that has an App Control for Business policy, or an administrator testing a policy sees a list of files it would have stopped. The record is in Event Viewer, under Applications and Services Logs, Microsoft, Windows, CodeIntegrity, Operational. Two events carry the verdict. Event 3076 is the audit-mode event: the file would have been blocked had the policy been enforced. Event 3077 is the enforcement event: the file did not pass the policy and was blocked.

Microsoft's events page prints a one-line description for each event and does not print the message wording, so no message text is quoted here. What follows explains the two events, how to prove which policy and which file are involved, and what Microsoft's pages say to change. Nothing before the Fix section changes anything.

What the error means

Microsoft describes the two events in these words: "This event is the main App Control block event for audit mode policies. It indicates that the file would have been blocked if the policy was enforced." and "This event is the main App Control block event for enforced policies. It indicates that the file didn't pass your policy and was blocked."

The page also says that "App Control logs events when a policy is loaded, when a file is blocked, or when a file would be blocked if in audit mode", and that these block events "include information that identifies the policy and gives more details about the block". It adds that App Control does not log every successful executable policy evaluation by default.

Event Log Meaning on Microsoft's page
3076 CodeIntegrity - Operational Main block event for audit mode policies: the file would have been blocked if the policy was enforced
3077 CodeIntegrity - Operational Main block event for enforced policies: the file did not pass the policy and was blocked
3089 CodeIntegrity - Operational Signature information for a file that was blocked or audit blocked, one event per signature
8028 AppLocker - MSI and Script A script host queried App Control in audit mode; the script or MSI file should have run, but would not have passed an enforced policy
8029 AppLocker - MSI and Script The enforcement mode equivalent of 8028

Executables, DLLs and drivers are logged in the CodeIntegrity log. Scripts, MSI installers, packaged apps and COM objects are logged in a second log, AppLocker - MSI and Script, which the page says is not included on Windows Server Core edition. For scripts, the page adds a limit: event 8029 says a script was blocked, but "the script hosts control the actual script enforcement behavior", and PowerShell, for example, runs a script that the policy does not allow in Constrained Language Mode rather than blocking it outright.

Events 3033 and 3034 are related but different: they describe a file that did not meet the policy's requirements, and event 3033 should occur alongside a 3077 event when App Control policy caused it. They are covered in App Control events 3033 and 3034: signing level and verification error values.

Likely causes

Microsoft does not give a ranked list of causes for 3076 and 3077. Its pages give the definitions above and the procedure for adding rules, which imply the causes below. Each row is a reading of those pages, and the order carries no meaning.

Cause What points to it
The file is not covered by any allow rule in the policy The audit procedure describes finding "applications, binaries, and scripts that are missing from your App Control policy but should be included"
The policy is in audit mode The event is 3076, not 3077
The policy is enforced and the file is not allowed The event is 3077
The file's signature is revoked, or carries an expired Lifetime Signing EKU A 3033 event beside the 3077, and 3089 signature events for the same file
A policy was loaded or replaced recently A 3099 event near the time the blocks began

Prove the cause before changing anything

All of these steps read only.

  1. In Event Viewer open Applications and Services Logs, Microsoft, Windows, CodeIntegrity, Operational. Find the 3076 or 3077 event for the file. The event number tells you whether the policy was in audit mode (3076) or enforcing (3077). Microsoft says the event's details identify the policy and give more details about the block.

  2. Take the Correlation ActivityID from the System portion of that event and look for 3089 events with the same value. Microsoft says one 3089 event is created for each signature of a file, that each shows "the total number of signatures found" and an index to identify the current signature, and that unsigned files "generate a single one of these events with TotalSignatureCount of 0". Our reading, not the page's: a single 3089 with a count of 0 points to an unsigned file.

  3. Look for a 3099 event, which Microsoft describes as "Indicates that a policy has been loaded" and whose details include the policy's options. Its time tells you whether the blocks began after a policy change. Event 3096 says a refresh did not happen because the policy was already up to date.

  4. For a script, MSI file or packaged app, repeat steps 1 and 2 in the AppLocker - MSI and Script log, using 8028 and 8029 for scripts and 8039 and 8040 for packaged apps. The 8038 event plays the part of 3089 for scripts and is matched by the same Correlation ActivityID.

  5. Check for 3033 or 3034 events with the same ActivityID. If they are present, the file failed on its signature, and App Control events 3033 and 3034: signing level and verification error values applies before any rule change does.

Example (illustrative): a finance team's accounting add-in stops loading on a server where an enforced policy was deployed on Monday. The CodeIntegrity log holds a 3077 for the add-in's DLL, and one 3089 with a TotalSignatureCount of 0. That points to an unsigned file with no allow rule, and the decision becomes whether the add-in should be trusted at all, and at what rule level.

Fix

First decide whether the block is wanted. If the file should not run, event 3077 is the policy doing its job and nothing needs to change.

If the file should run, Microsoft's page "Use audit events to create App Control policy rules" describes this process on a device that already has an audit mode policy: run the application the policy does not allow, confirm that events are logged for it, generate a new policy from the logged events, check what it trusts, merge it into the base policy or convert it to a supplemental policy, convert the result to binary and deploy it. The generation step is the one the page gives a command for.

Before running it, note that the command writes its output to the file names that the page sets in variables. If an earlier EventsPolicy.xml or EventsPolicyWarnings.txt already sits on the desktop, copy both elsewhere first. The page gives no command for that copy, so it is general advice.

Risk: the next two blocks create a new policy file, EventsPolicy.xml, from the logged audit events, plus a warnings file, both on the desktop. The command deploys nothing, but the file it writes trusts every file that was logged, including a file you never meant to allow, at the rule level you choose. Microsoft's note says the FilePublisher level with a Hash fallback "may be more specific than desired" and can be re-run with other -Level and -Fallback values. The first block only sets session variables; the second writes the files.

The page's variable block, run in an elevated PowerShell window:

$PolicyName= "Lamna_FullyManagedClients_Audit"
$LamnaPolicy=$env:userprofile+"\Desktop\"+$PolicyName+".xml"
$EventsPolicy=$env:userprofile+"\Desktop\EventsPolicy.xml"
$EventsPolicyWarnings=$env:userprofile+"\Desktop\EventsPolicyWarnings.txt"

The page's generation command:

New-CIPolicy -FilePath $EventsPolicy -Audit -Level FilePublisher -Fallback SignedVersion,FilePublisher,Hash -UserPEs -MultiplePolicyFormat 3> $EventsPolicyWarnings

The policy name in the first block is the page's example name, so replace it with your own audit policy's name. The page says the command only creates rules for files that can still be found on disk. Files that are no longer present get no rule, although "the event log should have sufficient information" to add rules for them by editing the policy XML by hand.

To undo it: the command wrote only EventsPolicy.xml and EventsPolicyWarnings.txt on the desktop. Deleting them is permanent, and any file of the same name that was not copied elsewhere first, including a policy file you still want to check, is lost for good; delete nothing else. After that, put back the copies you saved, if there were any. The page gives no command for this.

The remaining steps change what runs on the machines that receive the policy, so they are described here and no commands are given. The page says to find and check EventsPolicy.xml and make sure it includes only file and signer rules for things you wish to allow, with rules removable by editing the XML or in the App Control Policy Wizard. It says to check EventsPolicyWarnings.txt for files that no rule could be created for, then to merge EventsPolicy.xml with the base policy or convert it to a supplemental policy, convert to binary and deploy "using your preferred method". The page gives no deployment command and no way to take a deployed policy back; plan the roll-back with whoever owns the policy before deploying.

Moving a policy from audit to enforcement is a separate decision. On the rule options page, Microsoft says "To enforce an App Control policy, delete this option", meaning Enabled:Audit Mode, and that "When the Enabled:Audit Mode is deleted, the policy runs in enforced mode". The page names the Set-RuleOption cmdlet and the wizard as the tools but prints no syntax in the sections that carry the option table, so no command is given here.

Confirm the fix

  • Run the same file again on a device that has the updated policy. No new 3076 or 3077 event appears for it.
  • A 3099 event shows the updated policy loaded, and no 3100 event ("refreshed but was unsuccessfully activated. Retry.") follows it.
  • For a script, no new 8028 or 8029 event appears for it in the AppLocker - MSI and Script log.
  • Other blocks that were in the original list are still blocked if they should be: the new rules were meant to trust only what you checked in the XML.

What to watch afterwards

  • New 3076 events after software updates. Each one is a file a new version added or replaced that the rules do not cover; a hash rule needs updating for every new version of a file.
  • Policy activation events 3095, 3097 and 3100, which say a policy could not be refreshed, needs a restart, or did not activate.
  • Volume. If a policy enables the Intelligent Security Graph or a managed installer, Microsoft warns that diagnostic logging "can generate many events", so consider collection costs before sending them to a central log service.
  • A policy still in audit mode that the business believes is protecting it. A 3076 is a warning, not a block.

Risks and limits

These steps have not been run or lab-tested. The events page gives descriptions, not message text, so the exact wording in your own log may differ from anything quoted here. The page documents events by number and does not give a Windows version range for 3076 and 3077. The generation command writes rules that trust whatever was logged, which is why checking the XML matters more than the command. Deploying, merging and enforcing are described, not given as commands, because Microsoft's pages on this give no command for them and no way to withdraw a deployed policy.

Sources