Additional Microsoft Defender tools and services that provide security across various platforms and environments
Keep Smart App Control enabled by signing each GCC-generated executable with a valid code-signing certificate from a trusted provider; Smart App Control does not support per-file or per-app exceptions.
Confirm which policy is blocking the executable
Open Windows Security → App & browser control → Smart App Control settings:
- On means Smart App Control is enforcing its trust requirements.
- Evaluation means Smart App Control should not currently block applications.
- If the Smart App Control section is absent, or this is an organization-managed computer, another Application Control policy may be responsible.
In enforcement mode, Smart App Control permits code recognized as safe by Microsoft's intelligence service or signed with a trusted certificate. A newly compiled test1.exe is unknown and normally unsigned, so it can be blocked even though you wrote its source code yourself.^1^
Supported alternative: sign the generated executable
- Obtain a code-signing certificate from a trusted certificate provider, or use Microsoft Artifact Signing. A locally created self-signed/test certificate is not publicly trusted and therefore is not a substitute for a trusted production certificate.^2^
- Compile the program as usual.
- Sign the resulting
.exebefore running it. Microsoft documents Artifact Signing as the preferred option;signtool.exe, included with Visual Studio, can also sign with a certificate installed in your certificate store.^3^ - Repeat signing whenever recompilation replaces the executable.
For example, when using an installed trusted certificate with SignTool:
gcc .\test1.c -o .\test1.exe
$thumbprint = "<code-signing-certificate-thumbprint>"
signtool sign /sha1 $thumbprint /fd SHA256 .\test1.exe
signtool verify /pa /v .\test1.exe
.\test1.exe
The certificate must chain to a certificate authority in the Microsoft Trusted Root Program; merely applying any signature is insufficient.^3^
If trusted signing is impractical
There is currently no supported Allow anyway, exclusion list, folder exemption, or one-file bypass for Smart App Control. Microsoft's documented choices are to sign the executable with a valid trusted certificate or turn Smart App Control off.^4^
For frequent local development, production-grade signing on every build may be impractical. In that case, keeping Smart App Control enabled means running unsigned development builds in a separate development environment—such as another development computer or VM where Smart App Control is not enforcing—rather than weakening protection on the primary installation.
If Smart App Control is not On, the message likely comes from a different Application Control policy. On a managed device, ask the administrator to identify the active App Control for Business policy and approve the compiler/output appropriately; Smart App Control itself is disabled on enterprise-managed devices.^5^
References