TL;DR: Container security testing must cover build artefacts, registry trust, Kubernetes permissions, runtime behaviour and exposed applications, according to Invicti, because a clean image scan can still ship a workload with excessive privilege or exploitable APIs. Runtime and deployment controls, not scanning alone, determine whether container risk stays contained.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on Invicti's blog post: Container security testing needs to span build, registry, deployment, runtime and application layers because image scans alone miss privilege and API exposure.
Why it matters: IAM and platform teams need to treat container testing as a control chain, because permissions, secrets, runtime drift and application flaws can each bypass a clean image scan.
Context
Container security testing is the process of checking both the packaged software and the controls around how that software is built, distributed and run. In practice, teams often test one layer and assume the rest is equally safe, which leaves gaps between image review, cluster configuration and exposed application behaviour.
Containers introduce a governance problem as much as a technical one: the same image can be deployed with different privileges, network reach and secret access in different environments. That means the security question is not only whether the image is vulnerable, but whether the running workload is allowed to do more than it should.
Key questions
Q: How do I test container security across build and runtime?
A: Test container security by scanning the image during build for known package and base-image flaws, checking the Dockerfile for unsafe settings, and validating the runtime with admission controls, least-privilege Linux capabilities, read-only filesystems, and seccomp or AppArmor profiles. Include secret scanning and runtime monitoring for unexpected network calls, process spawning, and privilege escalation attempts.
Q: Why can a clean container image still be risky in Kubernetes?
A: A clean container image can still be risky because Kubernetes adds effective permissions through service accounts, RBAC, mounted secrets, network reachability, and pod security context settings. A container may also inherit dangerous node access or reach internal services even when the image itself has no known vulnerabilities.
Q: How should teams verify container image integrity?
A: Verify container image integrity by signing images, checking signatures before deployment, and pinning images by digest rather than by mutable tags. Use an admission controller or policy engine to reject unsigned or tampered images, and verify provenance so the running workload matches the approved build output.
Q: What is the best way to govern service account access for containers?
A: Govern service account access by assigning each container the smallest possible service account, binding it to narrowly scoped RBAC roles, and avoiding long-lived tokens or default accounts. Rotate credentials where possible, disable unused service accounts, and review which pods can mount secrets or call the API server.
Technical breakdown
Why image scans miss container runtime risk
Image scanners are good at finding known vulnerable packages and dependencies, but they do not tell you whether the workload will run with dangerous permissions or whether the application exposes a flaw at runtime. A container can be built from a trusted base image and still inherit risk from mutable tags, overbroad file permissions, hidden tooling or application logic that only appears once the service is live. That is why build-time checks and runtime checks answer different questions. See the Container Image Security Guide.
Practical implication: Pair image scanning with runtime verification so deployment decisions reflect both software content and the effective privileges the workload will receive.
How Kubernetes permissions and network policy change the threat surface
Kubernetes adds an identity and authorisation layer around workloads. Service accounts, RBAC bindings, pod security settings and network policies decide what a container can reach, read or modify after deployment. A workload that passes vulnerability scanning can still become high risk if it can read Secrets, create privileged pods or bypass network segmentation. Policy objects also need verification, because a manifest that looks restrictive may not be enforced the way teams expect. See the NIST SP 800-190 Container Security Guide.
Practical implication: Test the effective permissions and connectivity of each workload, not just the YAML, before treating the deployment as isolated.
Why supply-chain evidence must include signatures, SBOMs and provenance
Container supply-chain assurance is stronger when teams can tie an immutable image digest to a signature, an SBOM and build provenance. These artefacts answer different questions: what the image contains, whether it was signed by a trusted identity and how it was produced. None of them proves absence of vulnerability on its own, but together they let teams distinguish an approved artefact from an unverified one and track affected versions when new disclosures appear.
Practical implication: Require digest pinning plus attestations and inventories so remediation can target the exact image that was deployed.
Threat narrative
Attacker objective: The attacker aims to turn a seemingly safe container deployment into a foothold for data access, lateral movement or application abuse.
- Entry occurs when a container image, build artefact or deployed workload contains an exploitable dependency, exposed secret or unsafe configuration.
- Escalation follows when the workload is granted excessive permissions, broad network reach or privileged host access that the attacker can abuse.
- Impact comes when the attacker uses the running container to reach data, pivot through the cluster or manipulate the exposed application and APIs.
Breaches seen in the wild
- Massive Docker Hub Secrets Leak: 10,000+ Docker Hub container images expose hardcoded secrets and authentication keys.
- SonicWall SSL VPN account compromises 2025: Attackers used valid credentials to log in to more than 100 SonicWall SSL VPN accounts across 16 environments in October 2025.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Container testing is a governance chain, not a single control. Build scanning, registry review, deployment policy and runtime monitoring each answer a different question, and none of them is sufficient on its own. The practical mistake is to treat image vulnerability findings as the whole risk picture when permissions, connectivity and application exposure can change after build time. Teams need a control chain that follows the workload from source to execution.
Excessive workload privilege is the named failure mode here. A container that looks clean at build time can still be deployed with broad Kubernetes permissions, unrestricted network access or host-level exposure. That means the real governance gap is not simply vulnerable software, but a permissions model that can outrun the image review process. The fix is to verify what the workload can actually do in the cluster, not what the manifest claims.
Identity controls matter because workloads authenticate and authorise just like users do. Service accounts, registry roles and secret access determine which containers can pull, push, read or modify sensitive assets, so container security is also an identity problem. Where the workload identity layer is weak, attackers can move from code exposure to privileged access without needing to break the image itself. Container security governance should therefore include workload identity review as part of deployment assurance.
Application testing still belongs in the container conversation. A secure image can host a vulnerable web app or API, and that flaw may become the easiest exploitation path once the workload is live. The governance implication is that platform teams and AppSec teams have to share responsibility for the running service, not hand off risk at the image boundary.
Container risk management is shifting from artifact confidence to runtime evidence. Digest pinning, signing and SBOMs are increasingly baseline requirements, but they only become useful when teams can connect them to drift detection, runtime alerts and retesting. Practitioners should expect container assurance to be judged by whether they can prove what was deployed, what changed and what was actually exposed.
From our research library:
- 97% of NHIs carry excessive privileges, increasing unauthorised access and broadening the attack surface, according to the Ultimate Guide to NHIs.
- Red Hat’s Kubernetes Security Report found that nearly 9 in 10 organizations had at least 1 container or Kubernetes security incident in the last 12 months.
- Read next: NIST SP 800-190 Container Security Guide
What this signals
Container assurance is moving toward runtime proof. Teams can no longer rely on scan results alone when a deployment can change privilege, network reach and secret access after the image is built. The practical shift is toward proving what actually ran, not only what was packaged.
Workload identity is part of container security, not a separate concern. Service accounts and registry permissions decide whether a container can retrieve images, read Secrets or modify workloads, so identity review belongs in the same control set as hardening and scanning. The container stack becomes governable only when access is checked at issuance and at deployment, not after compromise.
For practitioners
- Verify effective workload permissions before deployment Review service accounts, RBAC bindings, pod security settings and host access together so a workload cannot gain more privilege in the cluster than it needs.
- Treat image signatures as evidence, not assurance Require digest pinning, signature verification and SBOM retention, then revalidate the image when vulnerability intelligence changes or a new build is promoted.
- Test network isolation with allow and deny cases Confirm that policies actually block unwanted ingress and egress, including DNS and dependency traffic, rather than assuming the manifest enforces isolation on its own.
- Retest exposed applications after infrastructure checks pass Run DAST and API testing against the live service so container hardening does not mask application flaws in authenticated workflows or object-level access.
Key takeaways
- Container security failures often begin after the build stage, when workload permissions, network reach and application exposure change the real risk.
- Image verification, SBOMs and signatures matter, but they do not replace runtime checks or Kubernetes policy validation.
- Practitioners should treat container governance as a combined image, identity, deployment and application control problem.
Related NHI Mgmt Group resources: Container Security Guide · NIST SP 800-190 Container Security Guide · Containers vs Serverless Security · Container Image Security Guide
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, MITRE ATT&CK and OWASP API Security Top 10 address the attack and risk surface, while NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-05 — Overprivileged NHI | Workload service accounts and registry roles can give containers more access than they need. |
| NHI-02 — Secret Leakage | The post covers embedded secrets in Dockerfiles, build artefacts and image layers. | |
| Recommendation — Review container identities for excess privilege and remove permissions that are not required at runtime. Scan build inputs and image layers for exposed secrets and revoke any leaked credentials immediately. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | Container RBAC, service accounts and registry access are the central authorisation concerns here. |
| Recommendation — Enforce least-privilege permissions for workloads, registries and cluster operations. | ||
| CIS Controls v8 | CIS-5 — Account Management | Container and cluster identities need controlled lifecycle, especially for service accounts and registry roles. |
| Recommendation — Inventory and review container-related accounts regularly, then remove unused or excessive access. | ||
| MITRE ATT&CK | TA0006;TA0008 — Credential Access; Lateral Movement | Leaked secrets and overprivileged workloads can support credential abuse and cluster pivoting. |
| Recommendation — Map exposed container secrets and broad workload permissions to credential-access and lateral-movement detection. | ||
| OWASP API Security Top 10 | API5 — Broken Function Level Authorization | The article includes testing APIs exposed by containerised services, including authorization weaknesses. |
| API1 — Broken Object Level Authorization | Authenticated API testing is needed because containerised services can still expose object-level access flaws. | |
| Recommendation — Test exposed APIs for function-level authorisation failures before promoting a containerised service. Verify object-level authorisation in containerised APIs using role-separated tests and retesting after fixes. | ||
Key terms
- Container Security: The practice of protecting containerised applications, their images, runtime environments, and supporting infrastructure from compromise. It covers the full path from build to deployment to execution, because risk can be introduced in the image, the orchestrator, the secrets mechanism, or the cloud permissions the workload inherits.
- Service Account: A special-purpose account used by applications, automated tools, or services rather than a human user to interact with systems, APIs, and infrastructure. Service accounts are a primary category of NHI and one of the most frequently exploited attack vectors.
- Kubernetes RBAC: Kubernetes RBAC is the permission system that decides what users, groups, and service accounts can do inside a cluster. It uses roles and cluster roles, then binds them to subjects so access is limited to specific resources, verbs, and namespaces, reducing unnecessary control over workloads and infrastructure.
- SBOM: A software bill of materials is an inventory of the components, dependencies and often transitive packages used in an application or build. The US NTIA describes it as a formal record of the details and supply chain relationships of components used in building software, and published minimum elements in July 2021. It helps defenders spot risky or newly introduced dependencies.
Deepen your knowledge
NHI Mgmt Group covers identity security, NHI governance, and agentic AI through independent research, practitioner guides, and the NHI Foundation Level course. If your programme touches workload identity or secrets management, the course gives your team a common control vocabulary.
Published by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org