On this page
On October 5, 2026, Microsoft announced a welcome change to how Microsoft Defender for Cloud reports Kubernetes misconfigurations. Affected Kubernetes Security Posture Management (KSPM) recommendations are moving from individual running container instances to the container deployment or top-level controller, such as a Deployment or StatefulSet. Microsoft lists the change as generally available and notes that affected recommendations and their Secure Score impact may change. Microsoft release note.
For a Deployment, that gets the finding closer to the configuration you need to fix. The relationship is Deployment → ReplicaSet → Pod. Delete a pod and Kubernetes creates another from the same template. If the setting that caused the finding is still there, the replacement inherits it. Kubernetes Deployments.
The practical question for me was what Defender would do when those pods changed. Would the finding still identify the same workload? And after I fixed the template, what would Defender actually show?
I tested that on Azure Kubernetes Service (AKS). The result was a registry finding that kept its identity across a rollout, and a root-filesystem finding that disappeared after I corrected the setting. I captured both replacement pods ready about 68 seconds after the patch. My Defender captures put the root-filesystem finding’s disappearance between about 24 and 27 hours after the fix. In this Deployment test, the findings identified the controller as the top-level owner, matching the scope Microsoft described.
3 recorded outcomesSwipe to compare
Generation 1 → 2. Both pods ready. The root-filesystem setting changed from false to true.
Fresh supporting pod. Still Unhealthy. ARM and Resource Graph agree.
Absent from the complete ARM and Resource Graph exports.
nineliveszerotrust.comOne Setting, Two Findings
I started with a two-replica Deployment running a digest-pinned pause image. I left it unchanged until I captured actual Defender findings on October 8. Both the Azure Resource Manager API (ARM) and Azure Resource Graph reported two agentless recommendations: enforce a read-only root filesystem, and use a trusted registry.
The records named the Deployment as the top-level owner. There was a detail worth keeping, though: the resource type still said k8s-container. Defender was giving me Deployment attribution within a container record, so I kept both pieces when comparing the results.
Before changing the template, I deleted one pod on October 8 to test replacement on its own. Kubernetes replaced it, but I did not capture a conclusive Defender follow-up before moving to the template fix.
I chose the root-filesystem setting for the fix and left the registry alone. That gave me two things to follow through the same rollout. One recommendation addressed a setting I had corrected. The other could show whether Defender had picked up a new pod while the underlying registry issue remained.
Later that day, I changed readOnlyRootFilesystem from false to true in the Deployment template. The patch checked the Deployment’s identity and expected state before applying the change. This is the relevant fragment:
# Fragment of the Deployment's pod template, not a complete manifest.
spec:
template:
spec:
containers:
- name: pause
securityContext:
readOnlyRootFilesystem: true
Kubernetes kept the same Deployment UID, created a new active ReplicaSet, and brought up two new ready pods. Both had the read-only setting. The requested image, the image-ID set returned by Kubernetes, and the replica count stayed unchanged.
Microsoft’s captured remediation text says to “redeploy the pod with the updated spec.” For this Deployment-managed workload, updating the controller’s template put that guidance into practice: the rollout replaced both pods with the new setting.
That completed the Kubernetes part of the test. It didn’t tell me whether Defender had seen the change yet.
Following the Rollout in Defender
Both findings kept returning that deleted pod name after the rollout. An ARM capture on October 9 still named it, about 24 hours 40 minutes after I requested its deletion. The preceding Resource Graph capture showed the same thing.
The new pods were ready and configured correctly. Defender’s returned records still named the earlier pod, so I waited for a supporting reference I could match to the rollout.
Later on October 9, I had one. The registry recommendation named a pod created during the template rollout. I checked that pod’s UID against the rollout and current Kubernetes captures; the UID came from Kubernetes, not the Defender record.
Then I compared the exact assessment ID and complete assessed-resource details with the initial and pre-patch records. They matched in both exports.
The pod had changed. The registry finding and resource identities had stayed the same. That’s the continuity I could demonstrate for this rollout.
Here is that comparison with the private pod names replaced by aliases. The excerpt uses the saved Resource Graph records, with the same values checked against ARM:
Saved API evidence · registry check
Same finding. New supporting pod.
- Same controller in both captures
- Deployment
kspm-scope-proof-v2 - Container
pause- Status in both
- Unhealthy
Baseline
Captured
- Pod alias
baseline-pod-A
After
Captured
- Pod alias
post-rollout-pod-A
Full assessment ID and assessed-resource details: unchanged.
Source fields and comparison notes
Container images should be deployed from trusted registries only
KSPM-Agentless k8s-container
Full identity equality comes from the retained comparison of the complete records. Full private IDs are not displayed here.
12ceffa0-bd66-4ae9-abbf-58f88b0a7bc0
This identifies the recommendation type. It is not a unique key for every resource with this finding.
The dates above identify saved captures, not service scans. Exact timestamps are retained in the source comparison.
nineliveszerotrust.com
One detail worth knowing when checking freshness: the registry record’s firstEvaluationDate and statusChangeDate still held their original October 8 values, even after it named the new pod. Its status remained Unhealthy. I used the new pod reference to confirm fresh workload data; those unchanged dates couldn’t tell me when Defender last checked it.
That established freshness for the registry recommendation. I still had to check the root-filesystem result separately.
The Finding I Fixed Was Gone
The root-filesystem recommendation was absent from both complete exports. A request to its exact previous API address returned 404, while the recommendation definition remained available. A portal search for read-only also returned no recommendations with the workflow-status filter removed.
In this lab, the fix showed up as the root-filesystem finding disappearing; I didn’t capture a separate Healthy or resolved record. The registry issue I had left unchanged was still present, now with a new pod in its supporting detail.
read-only, with the workflow-status filter removed. Open the full search and filters.My last capture with the root-filesystem finding and my first capture without it put removal between about 24 and 27 hours after the fix. That gives a useful observation window for this test. Plan a follow-up check after the rollout, then confirm the result from fresh Defender data in your own tenant; timing can differ.
I also checked the old zero-replica ReplicaSet. It still existed, with readOnlyRootFilesystem: false in its historical template. I hadn’t deleted it to get this result. The active ReplicaSet and both running pods carried the corrected setting.
This was one Deployment rollout. I didn’t establish StatefulSet behavior, a fixed replica-to-finding ratio, or a measured Secure Score effect. The earlier isolated pod-replacement phase never produced a conclusive Defender follow-up; the result here belongs to the template rollout.
What I’d Check in Your Tenant
If your automation opens tickets from Defender findings, keep the assessment and resource IDs alongside the current pod and workload owner. In this test, a new pod name did not mean a new registry finding. Treating the pod name as the ticket’s identity would have missed that continuity.
For example, suppose a ticket was opened for this registry finding before the rollout. When the next record arrives with the same full assessment ID and assessed-resource ID, but a different supporting pod, the integration can update the existing ticket’s pod context. It shouldn’t create a duplicate just because the pod name changed. The registry status is still Unhealthy, so this observation doesn’t justify closing that ticket.
That is a suggested integration pattern, not a ticketing system I tested here. Keep the full identifiers: the recommendation GUID alone names a check that can apply to many resources. A different full identity needs investigation before you merge it into an existing ticket, and a missing row needs verification before you close one.
One more tip for automation: in the ID I captured, the segment after pod- contained the Deployment name. The actual supporting pod was named separately in properties.additionalData.podName. Read the fields returned in your tenant before building a join around that string.
For remediation, follow the finding to its controller and the source that manages that controller. Test the template change and verify the replacement pods in Kubernetes. Then check Defender again. Microsoft also notes that the scope update can change recommendations and Secure Score, so confirm the configuration in Kubernetes and the result in Defender before treating a change in counts as a completed fix.
The query below keeps the identifiers needed for a before-and-after comparison. Replace the cluster, namespace and Deployment selectors with your own authorized lab.
Resource Graph query for checking the workload
securityresources
| where type =~ "microsoft.security/assessments"
| where tostring(properties.resourceDetails.Id) startswith "/subscriptions/<subscription-id>/resourceGroups/<lab-rg>/providers/Microsoft.ContainerService/managedClusters/<lab-cluster>/"
| where tostring(properties.additionalData.source) == "KSPM-Agentless"
| where tostring(properties.additionalData.namespaceName) == "nls-kspm-controller-lab"
| where tostring(properties.additionalData.topLevelName) == "kspm-scope-proof-v2"
| project
AssessmentId = id,
Recommendation = tostring(properties.displayName),
Status = tostring(properties.status.code),
AssessedResource = tostring(properties.resourceDetails.Id),
ResourceType = tostring(properties.resourceDetails.ResourceType),
OwnerKind = tostring(properties.additionalData.topLevelKind),
OwnerName = tostring(properties.additionalData.topLevelName),
SupportingPod = tostring(properties.additionalData.podName)
These are the fields Defender returned in my lab. The collectors also save the full exports and look separately for the recommendation, Kubernetes resource type and workload. A query returning no rows is a reason to check the full response before concluding the finding is gone. Keep the raw before-and-after captures, their hashes, and the Kubernetes object UIDs privately.
There is a Kubernetes-side check worth pairing with that query. Compare the setting in the Deployment template with the setting on each current pod, then follow the controlling owner references back through the ReplicaSet. That identifies the controller responsible for the pod named by Defender.
Read-only commands to check the template, pods, and owners
These are Bash examples for your own lab, not additional observations from this experiment. Set an explicit context and substitute your namespace, Deployment and pod names. The selector below matches this lab’s manifest.
LAB_CONTEXT="<your-lab-context>"
LAB_NAMESPACE="nls-kspm-controller-lab"
LAB_DEPLOYMENT="kspm-scope-proof-v2"
# Deployment identity and reported rollout status.
kubectl --context "$LAB_CONTEXT" -n "$LAB_NAMESPACE" get deployment "$LAB_DEPLOYMENT" \
-o 'custom-columns=NAME:.metadata.name,UID:.metadata.uid,GENERATION:.metadata.generation,OBSERVED:.status.observedGeneration,DESIRED:.spec.replicas,READY:.status.readyReplicas'
# Desired setting, with the container name alongside it.
kubectl --context "$LAB_CONTEXT" -n "$LAB_NAMESPACE" get deployment "$LAB_DEPLOYMENT" \
-o 'jsonpath={range .spec.template.spec.containers[*]}{.name}{"\t"}{.securityContext.readOnlyRootFilesystem}{"\n"}{end}'
# Current pod names and each container's setting.
kubectl --context "$LAB_CONTEXT" -n "$LAB_NAMESPACE" get pods \
-l "app.kubernetes.io/name=$LAB_DEPLOYMENT" \
-o 'jsonpath={range .items[*]}{.metadata.name}{"\n"}{range .spec.containers[*]}{" "}{.name}{"\t"}{.securityContext.readOnlyRootFilesystem}{"\n"}{end}{end}'
# Choose a current pod, then inspect its owner references.
LAB_POD="<pod-from-the-list>"
kubectl --context "$LAB_CONTEXT" -n "$LAB_NAMESPACE" get pod "$LAB_POD" \
-o 'jsonpath={.metadata.uid}{"\n"}{.metadata.ownerReferences}{"\n"}'
# For a Deployment-managed pod, use the controlling ReplicaSet's name.
LAB_REPLICASET="<controlling-replicaset-name>"
kubectl --context "$LAB_CONTEXT" -n "$LAB_NAMESPACE" get replicaset "$LAB_REPLICASET" \
-o 'jsonpath={.metadata.uid}{"\n"}{.metadata.ownerReferences}{"\n"}'
Use the owner reference with controller: true. Its UID must match the ReplicaSet’s metadata.uid. Then compare the ReplicaSet’s controlling Deployment UID with the Deployment UID from the first command. If the references don’t match or the objects change between reads, capture them again before attributing the finding. Kubernetes owners and dependents.
A blank readOnlyRootFilesystem value means the field was not returned, not that it was true. The commands inspect regular containers in this fixture; they are not an init-container or application write-denial test. Configuration and Ready counts also don’t prove that Defender has reevaluated the workload. Keep raw identifiers private when sharing results.
These examples use documented kubectl output formats and JSONPath expressions. Windows quoting differs, so don’t paste the Bash block unchanged into PowerShell.
This test showed the practical value of Microsoft’s controller-scope change. Defender identified the Deployment as the top-level owner, and the registry finding kept its identity as the pods changed. The separate root-filesystem finding disappeared after I fixed the template. Fix the template, verify the new pods in Kubernetes, then check Defender again. I confirmed both results in Defender the next day.
Lab Notes and Evidence
The companion lab has the runbook and comparison files. You can download the sanitized evidence or inspect the post-rollout result JSON. The details below preserve the fields and timing behind the story.
The returned fields, recommendation IDs, and June/July background
The initial root-filesystem recommendation was Unhealthy in both ARM and Resource Graph. These selected fields and identifiers are from that record:
{
"displayName": "Immutable (read-only) root filesystem should be enforced for containers",
"status": { "code": "Unhealthy" },
"additionalData": {
"source": "KSPM-Agentless",
"topLevelKind": "Deployment",
"topLevelName": "kspm-scope-proof-v2",
"namespaceName": "nls-kspm-controller-lab",
"containerName": "pause"
},
"resourceDetails": { "ResourceType": "k8s-container" }
}
This excerpt comes from properties, with private identifiers and the supporting pod name left out. Defender explicitly names the Deployment, while ResourceType still says k8s-container. Both details matter when you’re writing a query or connecting the finding to a ticket.
The assessed-resource ID also contained the namespace, top-level kind, Deployment name, and container name. Its final segment included:
…/securityentitydata/namespace-nls-kspm-controller-lab-
toplevelworkloadkind-deployment-pod-kspm-scope-proof-v2-container-pause
The line break is for readability. This is the pod- naming detail described in What I’d Check in Your Tenant.
Two live checks supplied the comparison:
Recommendation identifiersSwipe across for columns
| Recommendation | Observed assessment name | Baseline state |
|---|---|---|
| Immutable (read-only) root filesystem should be enforced for containers | b4262879-2a96-468f-bacd-6ed4d567bbdd | Unhealthy |
| Container images should be deployed from trusted registries only | 12ceffa0-bd66-4ae9-abbf-58f88b0a7bc0 | Unhealthy |
Both reported KSPM-Agentless. The registry recommendation’s metadata severity was High, while its contextual risk was Low. Those fields describe different things. I saw one record per recommendation for this two-replica workload; that doesn’t establish a fixed replica-to-finding ratio.
The history helps explain why I checked the IDs. Microsoft previewed agentless, container-level KSPM checks on June 1 and announced GA on July 1. The June recommendation list includes a read-only-root-filesystem check. I matched the live records by assessment key and source because similar display names appear across the recommendation paths. The October announcement describes the scope change without listing a key mapping.
The older Azure Policy-backed root-filesystem recommendation has a different recommendation ID, 27d6f0e9-b4d5-468b-ae7e-03d5473fd864. The recommendation catalog documents that policy-backed entry under the same display name, so the recommendation key and source distinguish it from the agentless finding observed here.
Timeline and the 32-export cross-check
October 7: I captured the two-pod writable-root baseline for this run. My earlier attempt had kept its workload alive for only about 65 minutes and returned no matching Defender finding.
October 8: Defender’s first-evaluation field placed the initial KSPM check about 6.5 hours after the original pod was created. I first captured the result later that day, so that field does not measure when it became visible. After the inconclusive single-pod test, I changed the template. The replacement pod later named by the registry finding was created during this rollout; its Kubernetes UID matched the rollout and current captures.
October 9: An ARM export still named the deleted original pod, about 24 hours 40 minutes after I requested its deletion. That was also the last captured presence of the root-filesystem finding. Later captures showed it absent and the registry finding naming a rollout pod. These checks bound the removal window to about 24 to 27 hours after the fix; they don’t identify the exact service evaluation time.
I checked 32 saved full Resource Graph exports from both runs through October 9. The two agentless findings appeared 33 times, and every returned row was Unhealthy. Those were repeated observations of the same two findings. For the root-filesystem check, I saw the finding disappear after the fix; I never captured it turning Healthy. That’s what happened in this lab, not a rule for every KSPM check.
Test setup, earlier phases, and limits
The companion lab includes my earlier Kubernetes-only run and an isolated pod-replacement phase that never produced a conclusive Defender follow-up. The fresh Defender result in this post comes from the template rollout.
The test used AKS 1.35.8 with two Azure Linux nodes, an isolated namespace, no application ingress, Defender CSPM with agentless Kubernetes discovery, and Defender for Containers. I created the Trusted Access binding using Microsoft’s documented procedure, then waited for actual findings. A successful binding alone didn’t establish that Defender had discovered the workload. Trusted Access guidance.
I didn’t install the Azure Policy add-on. Defender’s own missing-add-on recommendation was Unhealthy in the same capture as these KSPM-Agentless findings. These checks ran in this lab without the add-on. Prerequisites can differ by recommendation, so check Microsoft’s agentless architecture, support matrix, and troubleshooting guidance for the one you’re testing.
Microsoft’s agentless discovery FAQ describes up to 24 hours for changes to appear in the security graph, attack paths and Security Explorer. Its assessment troubleshooting guidance separately describes dashboard timing. Use the guidance for the surface you’re checking, then verify the finding itself. The 24-to-27-hour window here comes from my saved captures.
Dates use UTC. The downloadable evidence retains exact service and capture timestamps and aliases private identities. The lab runbook includes the observation limits, cost boundary, and current cleanup status.
The test workload has no application traffic. I verified that the new pods picked up the setting and became ready. I didn’t test a real application’s compatibility with a read-only root, or try writing a file to check that it failed. Your application may need writable mounted volumes for specific paths; a read-only container root doesn’t make every mounted volume read-only. Security contexts, read-only mounts.
The October 5 announcement sets out the scope change; the captures show how it appeared in this lab. Check the records returned by your own tenant as you adopt the change.

Jerrad Dahlager, CISSP, CCSP
Cloud Security Architect · Adjunct Instructor
Marine Corps veteran and firm believer that the best security survives contact with reality.
Have thoughts on this post? I'd love to hear from you.
