feat(windows): add known aks processes and files to defender exclusions to improve windows node performance#8245
Merged
timmy-wright merged 4 commits intomainfrom Apr 8, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Windows CSE Defender exclusions to reduce performance impact from Defender scanning containerd snapshot artifacts (e.g., VHDX files) during container operations.
Changes:
- Added Defender exclusion paths under
C:\ProgramData\containerdinUpdate-DefenderPreferences. - (Minor) formatting change (blank line) in the same function.
djsly
reviewed
Apr 7, 2026
djsly
reviewed
Apr 7, 2026
djsly
approved these changes
Apr 8, 2026
timmy-wright
added a commit
that referenced
this pull request
Apr 13, 2026
…ns to improve windows node performance (#8245)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So, I didn't do the full recommendation. And I looked at what files are actually on the node. This PR is to help windows nodes work a bit better. Full research report continues...
Windows Defender Exclusions for containerd on AKS Windows Nodes
Date: 2026-04-07
Author: AKSClaw (research for Tim Wright, AKS Windows Nodes EM)
Executive Summary
Excluding
C:\ProgramData\containerd(or itsrootfssubdirectory) from Windows Defender real-time scanning is a well-established pattern for container hosts. Microsoft's own documentation acknowledges the redundant scanning problem for container filesystems and has built kernel-level optimizations (viawcifs.sys) to address it — but these optimizations require AV vendor cooperation and may not fully eliminate overhead. Docker officially recommends excluding its data directory from AV scanning. The performance benefits are significant (reduced CPU, faster container startup, lower I/O latency), while the security trade-offs are manageable with compensating controls.Recommendation: Exclude
C:\ProgramData\containerd(the full root) with process exclusions forcontainerd.exeas a belt-and-suspenders approach. Combine with image scanning at registry level (Defender for Containers) and node-level runtime threat detection.1. What Lives in
C:\ProgramData\containerdThe containerd
rootdirectory stores all persistent data: snapshots, content, metadata, and plugin data. On Windows, the typical layout:Key distinction:
rootfs— On Windows containerd, the "rootfs" concept manifests differently than Linux. Windows uses the HCS (Host Compute Service) with layer folders and WCIFS overlay, not a simplerootfs/mount. Thesnapshots\directory under the Windows snapshotter is the functional equivalent.Parent vs.
rootfsOnlyC:\ProgramData\containerdC:\ProgramData\containerd\root\...\snapshotsonlyExcluding only
rootfs/snapshots misses significant I/O hotspots. The content store sees heavy I/O during image pulls (every blob downloaded gets scanned). The metadata DB (BoltDB) is accessed on every container operation. Excluding only part of the tree provides incomplete performance relief.2. Performance Impact
2.1 CPU Overhead
Windows Defender's
MsMpEng.exe(Antimalware Service Executable) intercepts every file open/read/write via its minifilter driver. For container workloads, this means:Reported impact from the community:
MsMpEng.exeas the dominant CPU consumer.Set-MpPreference -DisableRealtimeMonitoring $truevia VMSS run-command.Microsoft's own documentation (Anti-virus Optimization for Windows Containers) states:
2.2 I/O Latency
The minifilter interception adds latency to every file operation:
2.3 Container Startup Time
Microsoft designed the WCIFS container isolation filter specifically to enable AV optimization that achieves:
But this requires the AV product to implement the ECP (Extra Create Parameters) protocol to detect placeholder files and skip redundant scans. If the AV doesn't implement this optimization, every container start pays the full scan cost for all base OS files.
2.4 Quantitative Estimates
No published benchmarks with exact numbers, but based on the pattern:
3. Security Trade-offs
3.1 What You Lose
Excluding the containerd directory from real-time scanning means:
3.2 Attack Vectors Opened
3.3 Compensating Controls
These make the exclusion acceptable:
3.4 Key Insight: Linux Parity
AKS Linux nodes do not ship with any real-time AV scanner. There is no antimalware equivalent to Defender running on Linux node OS by default. This means Windows nodes with containerd directory exclusions would have equivalent file-level scanning posture to Linux nodes — a reasonable baseline given the compensating controls above.
4. Documented Best Practices
4.1 Microsoft Official
Anti-virus Optimization for Windows Containers (learn.microsoft.com):
Windows Containers Support Policy:
This implies Microsoft has implemented some WCIFS-aware optimization in Defender, but community reports suggest it's insufficient for high-throughput container workloads.
4.2 Docker Official
Docker Docs — Antivirus software and Docker:
Docker explicitly recommends excluding the data directory. They suggest scheduling periodic offline scans as compensation.
4.3 containerd
No official containerd documentation specifically addresses AV exclusions, but the Docker guidance applies directly since containerd uses an equivalent directory structure.
4.4 Kubernetes Community
No official Kubernetes documentation on AV exclusions, but the pattern is well-understood:
C:\var\lib\kubelet) is another candidate for exclusion4.5 Other Container Runtimes
%ProgramData%\docker%ProgramData%\containerd(defaultroot)5. CVEs and Real-World Incidents
5.1 Container Escape CVEs (Relevant Context)
While not specific to Windows Defender exclusions, these demonstrate why container rootfs directories are security-sensitive:
5.2 Windows-Specific Container Malware
No widely-reported incidents of malware specifically targeting
C:\ProgramData\containerd\rootfsor equivalent Windows container filesystem directories in the wild. The attack surface exists theoretically but:5.3 Cryptomining in Containers
The most common real-world container malware is cryptominers injected via compromised images or exposed APIs. These execute within the container runtime, and AV scanning of the rootfs directory is not the primary detection vector — runtime behavioral detection and network monitoring are more effective.
6. Cloud Provider Defaults
Notable: All three providers leave AV exclusion configuration as a customer responsibility on Windows nodes. None pre-configure containerd/Docker exclusions out of the box. This is an opportunity for AKS to differentiate.
7. Surgical Exclusion Approaches
7.1 Process Exclusions (Recommended as Complement)
Instead of or in addition to path exclusions, exclude the containerd process:
Advantages:
Disadvantages:
7.2 Extension Exclusions
Not recommended as primary approach — too fragile, doesn't cover all file types, and container content files don't have predictable extensions.
7.3 Recommended Combined Approach
7.4 Other Candidate Exclusions for AKS Windows Nodes
C:\ProgramData\containerdC:\var\lib\kubeletC:\etc\kubernetesC:\k8. Recommendations for AKS Windows Nodes Team
Immediate (Low Risk)
C:\ProgramData\containerdpath exclusion to the AKS Windows node VHD build or CSE (CustomScriptExtension). This matches Docker's official guidance and addresses a known performance issue reported since 2020.containerd.exeandcontainerd-shim-runhcs-v1.exe.Medium-Term
C:\var\lib\kubeletexclusion as an additional performance optimization.Decision Framework
The risk profile is:
Sources