A container runtime security or cloud workload protection platform (CWPP) runs a privileged sensor on every node, holds cluster-wide permissions and can often kill processes or block deployments, so whoever controls it controls a large part of your Kubernetes estate. The tool that watches for container escapes is itself built from the things an escape aims for: host PID namespace access, kernel tracing rights, host filesystem mounts, cluster roles and credentials to a central console. This guide covers securing the tool itself as a product class: the console and its admin roles, the node sensor and its privileges, the cluster integration identities, admission and response actions, policy and exception integrity, the audit trail and the lifecycle. It is for platform engineers, detection engineers and the owners of the tool. It is vendor-neutral: confirm exact setting names and permission sets in your vendor's documentation. What runtime security is and how to write detections is covered in the Container Runtime Security Guide; how to roll the tool out in phases is in the Container runtime security and CWPP rollout playbook.
Key takeaways
- The sensor is a privileged workload by design. Run it in its own namespace under the Kubernetes Privileged profile, but keep every other namespace at Baseline or Restricted and stop anyone else deploying into the sensor namespace.
- Cluster roles are the real blast radius. The integration service accounts should read what they need and nothing more; rights such as nodes/proxy, secrets list, bind, escalate and webhook configuration are cluster takeover paths.
- Enforcement is power over production. Process kill, pod deletion, network isolation and admission blocks belong to separate roles with approval, protected namespaces and a documented kill switch.
- Silence is the attacker's goal. Sensor heartbeat loss, rule changes and new exceptions are the first things an intruder will try, so they must alert outside the tool as well as inside it.
- The console is a third-party service holding your telemetry. Process trees, command lines and file paths can carry secrets; treat the console as sensitive data storage with SSO, scoped roles and export limits.
Why the tool is a high-value target
NIST SP 800-190 groups container risk into images, registries, orchestrators, containers and host operating systems. A runtime security platform touches the last three at once, and an attacker who controls it inherits that reach. The table reflects a common architecture and is NHI Mgmt Group's view, not a description of any one product; your platform may name, merge or split these components differently.
| Component | What it holds or can do | If an attacker controls it | Primary control |
|---|---|---|---|
| Management console and API | Policies, rules, exceptions, alerts, telemetry, response actions, user roles, cluster enrolment keys | Disables rules, adds exceptions for their foothold, runs response actions, reads telemetry | SSO with phishing-resistant MFA, least-privilege roles, scoped API keys |
| Node sensor (usually a DaemonSet) | Host PID namespace, kernel tracing or BPF rights, hostPath mounts, sometimes privileged mode | Code execution on every node at once (T1611 outcome without an escape) | Signed images, pinned digests, minimal capabilities, locked namespace |
| Cluster integration service accounts | Read workloads, namespaces and events; sometimes delete pods or patch network policy | Cluster reconnaissance (T1613) or destructive changes | Read-only ClusterRole for discovery; separate, scoped role for response |
| Admission controller or webhook | Sees every admitted object; can block or mutate | Reads objects, including secrets if matched; blocks all deployments | Narrow match rules, RBAC on webhook configuration, documented fail mode |
| Enrolment and outbound credentials | Tokens or certificates that bind sensors to the tenant | Rogue sensors feeding false data, or tenant access | Short-lived enrolment tokens, per-cluster credentials, rotation |
| Pipeline and registry integrations | Tokens to read images and post build results | Tampered build gates, image metadata theft | Read-only, repository-scoped tokens with owners and expiry |
Admin roles and console access
- Role design: define at least platform administrator (clusters, integrations, users), policy author (rules and profiles), exception approver, analyst (alerts for owned clusters or namespaces) and responder (response actions). Keep full administrators to a handful and do not give analysts rule-editing rights.
- Scope by cluster and namespace: application teams need their own workloads' alerts, not the whole fleet. Scoping limits what one compromised analyst account reveals.
- Authentication: sign in through your identity provider with SSO and phishing-resistant MFA, disable local accounts except one documented break-glass account, and test it. See the Break-Glass Account Guide.
- Just-in-time elevation: grant administrator and responder roles for a time-bound window with a recorded reason, through your privileged access process.
- Admin devices: administer from hardened devices. See the Privileged Access Workstations Guide.
- API keys: issue per-integration keys with the narrowest role, an owner and an expiry. A personal key used by an automation job is an orphaned NHI waiting to happen.
Hardening the node sensor
The Kubernetes Pod Security Standards describe the Privileged profile as purposely open and aimed at system and infrastructure workloads managed by privileged, trusted users. Runtime sensors usually fall into that group. The goal is to contain that exception, not to pretend it away.
| Setting | What to aim for | Why |
|---|---|---|
| Namespace | Dedicated namespace labelled pod-security.kubernetes.io/enforce: privileged, with no application workloads | Confines the exception; every other namespace stays at Baseline or Restricted |
| Who can deploy there | Only the platform team's deployment identity can create or patch DaemonSets, pods or roles in the namespace | The RBAC good practices note that anyone who can create workloads gains the namespace's service accounts and secrets |
| Privileged mode | Use specific capabilities instead of privileged: true where the vendor documents it | Privileged mode removes most isolation at once |
| Capabilities | Prefer CAP_BPF and CAP_PERFMON (Linux 5.8 and later) over CAP_SYS_ADMIN where the sensor supports it | The capabilities manual describes CAP_SYS_ADMIN as overloaded; the narrower capabilities were split out of it |
| Host mounts | Read-only hostPath mounts limited to the paths the vendor lists; no write access to the host root | Writable host mounts turn a sensor bug into host compromise |
| Image | Pull by digest from your own registry mirror; verify signatures at admission | A swapped sensor image runs on every node (T1525, T1195.002) |
| Scheduling priority | A high PriorityClass so the sensor is not evicted under pressure; limit who can use high priority with ResourceQuota | An evicted sensor is a silent gap |
| Service account token | Set automountServiceAccountToken: false on sensor pods that do not call the API server | Removes a credential an attacker on the node could take (T1552.007) |
Watch for sensor pods with changed specs, new init containers, extra volumes or images from an unexpected registry. These are the signs of someone using your security tool as a deployment channel (T1610). The eBPF Security Guide covers kernel-level risks of BPF programs in more depth.
Cluster integration identities
Most platforms install one or more service accounts with ClusterRoles. Read the manifests or chart values before installing: they define what the tool can really do in your cluster. The Kubernetes RBAC good practices page lists the rights that amount to privilege escalation, and they should be absent from the tool's discovery role.
| Right | Why it matters | What to do |
|---|---|---|
get, list or watch on secrets | List and watch reveal secret contents, not just names | Exclude secrets from discovery roles; if secret scanning is a feature, scope it and log it |
nodes/proxy | Kubelet API access including command execution; bypasses audit logging and admission control; get is not read-only | Do not grant unless the vendor documents a specific need, and alert on use |
bind, escalate, impersonate | Create bindings to roles the holder lacks, or act as other users | Never in a monitoring role |
| Validating or mutating webhook configurations | Control lets the holder read any admitted object and, for mutating webhooks, change it | Only the installer identity, never the running controller |
serviceaccounts/token create | Issues tokens for existing service accounts | Exclude |
patch on namespaces | Can change Pod Security Admission labels and weaken enforcement | Exclude from the tool's roles |
delete on pods, create or patch on network policies | Needed only for response actions | Separate response service account, bound per namespace where possible |
- Split discovery from response: one read-only identity for inventory and context, a second for response actions, so a bug in the response path cannot read the cluster and a read token cannot change it.
- Enrolment credentials: use per-cluster enrolment tokens with a short validity, revoke them after enrolment, and rotate the long-term sensor credential on a schedule. A shared fleet token copied into a public chart value is a common leak.
- Inventory: record every tool identity per cluster with owner, role and chart version. See the Kubernetes RBAC Guide and the Kubernetes Service Account Token Guide.
Admission and response guardrails
Admission blocks and response actions turn the platform from an observer into an actor in production. The Kubernetes admission webhook good practices give the guardrails that also protect you from your own security tool.
- Exclude what keeps the cluster alive: do not match
kube-systemorkube-node-lease, and exclude the webhook's own namespace so it cannot block its own pods from restarting. - Choose the fail mode on purpose: mutating webhooks default to
failurePolicy: Fail; the good practices recommendIgnorefor mutation with a validating check behind it. Record the choice and who approved it. See the Kubernetes Admission Control Guide. - Keep timeouts small and run several replicas behind a ClusterIP Service, so a slow webhook does not stall the API server.
- Lock the webhook configuration: restrict create, update, patch and delete on webhook configurations with RBAC, and alert when one changes or disappears. Deleting the configuration is a quiet way to switch enforcement off.
- Protected workloads: exclude the sensor, the logging pipeline, ingress and DNS from automated kill or isolate actions.
- Approval and caps: require a human for fleet-wide actions, cap actions per hour, and log the approver.
- Kill switch: document how to pause all enforcement in one step and test it twice a year (our recommendation).
Policy and exception integrity
- Policy as code: keep rules, profiles and exceptions in a repository with review, deploy them through a pipeline, and alert on drift between the repository and the console.
- Owner, reason, expiry: every exception needs all three; 90 days is our suggested default. A broad exception such as a whole namespace or an image name pattern deserves a second approver.
- Separate request and approval: the team that owns a workload may request an exception; a different role approves it.
- Coverage checks: alert when a cluster stops reporting, a node has no running sensor, a sensor falls back to a degraded mode, or a rule set is disabled. Reconcile node counts from the cluster against sensor counts in the console daily.
The tool's own audit trail
| Event | Source | Alert? |
|---|---|---|
| Role assignment, new local user, SSO or API key change | Console audit log | Always |
| Rule disabled, profile changed, exception created or widened | Console audit log | Always, with approver |
| Response action run (kill, isolate, delete) | Console audit log and Kubernetes audit log | Fleet-wide or protected workloads |
| Sensor DaemonSet, namespace or ClusterRole changed | Kubernetes audit log | Always |
| Webhook configuration changed or deleted | Kubernetes audit log | Always |
| Sensor heartbeat lost, node uncovered | Console health and your SIEM | Above a set threshold |
| Bulk telemetry export | Console audit log | Above a set volume |
Export the console audit log to a SIEM or archive that tool administrators cannot alter (NIST SP 800-53 AU-9(2)). Log Kubernetes changes to the tool's namespace and roles at Metadata level or above, and keep secrets at Metadata so their contents never reach the audit log. If you send API server audit events through the webhook backend, remember that batched events are dropped when the buffer overflows, so monitor for gaps. See the Kubernetes Audit Log Detection Guide.
Telemetry as sensitive data
- Command lines carry secrets: environment variables and arguments often contain tokens and passwords. Turn on masking or redaction for command lines and environment data where the platform offers it, and rotate any real secret that appears.
- Know where data lives: record the console region, retention period and deletion process in your data protection records, and confirm what vendor staff can see.
- Restrict exports: limit who can export raw telemetry or forensic captures, and treat captured files as evidence with access control. See the Container and Kubernetes Forensics Guide.
Lifecycle: buy, deploy, run, retire
| Stage | Security actions |
|---|---|
| Buy | Ask for the exact ClusterRoles, capabilities and host mounts per feature; whether the sensor can run without privileged mode; SSO and MFA support; audit log export; where telemetry is stored; the vendor's vulnerability disclosure policy and security advisories page. See the Container Security Buyer's Guide. |
| Deploy | Review manifests, mirror and pin images, create the locked namespace, deploy discovery roles first and response roles only where agreed, enable SSO and audit export on day one. |
| Run | Apply vendor security updates to sensors and controllers promptly; quarterly review of console roles, API keys, exceptions and cluster roles; daily coverage reconciliation. |
| Retire | Remove DaemonSets, webhook configurations, ClusterRoles and bindings from every cluster; revoke enrolment and API credentials; obtain written confirmation of telemetry deletion. A forgotten webhook with Fail can block deployments long after the tool is gone. |
Detection and measurement
- Sensor coverage: percentage of nodes with a healthy sensor, reconciled against the cluster node list (target: 100 percent, gaps explained).
- Tool service accounts holding any of the escalation rights in the table above (target: zero outside a documented response role).
- Exceptions past expiry without re-approval (target: zero).
- Console admin and responder actions with a matching change or case reference (target: 100 percent).
- Median time from sensor heartbeat loss to alert in the SIEM.
- Days since the enforcement kill switch was last tested.
Framework mapping
| Control area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | ATT&CK threat addressed |
|---|---|---|---|
| Console roles and scoping | AC-2, AC-6, AC-6(5) | PR.AA-05 | T1078 Valid Accounts |
| Cluster integration identities | AC-6, IA-5 | PR.AA-05 | T1552.007 Container API, T1098 Account Manipulation |
| Sensor hardening and image integrity | CM-6, CM-7, SI-7 | PR.PS-01 | T1610 Deploy Container, T1525 Implant Internal Image |
| Rules, exceptions and webhook changes | CM-3 | PR.PS-01 | T1685 Disable or Modify Tools |
| Audit trail and coverage | AU-6, AU-9(2), AC-6(9), SI-4 | PR.PS-04, DE.CM-09 | T1685 Disable or Modify Tools |
| Vendor and update risk | SA-9, SR-3, SI-2 | GV.SC-07 | T1195.002 Compromise Software Supply Chain |
Common failure patterns
- Sensor namespace open to all: the privileged namespace allows any CI identity to deploy, so it becomes the easiest place to run a privileged pod.
- Discovery role with secrets list: the default chart grants list on secrets cluster-wide for a feature nobody uses.
- Webhook left behind: an uninstalled tool leaves a webhook configuration with
Fail, and the next outage blocks every deployment. - Exceptions as noise control: whole namespaces excluded during tuning and never re-enabled.
- Heartbeat loss treated as an operations issue: missing sensors raise a dashboard tile rather than a security alert.
- Shared enrolment token: one long-lived token used across clusters and committed in a values file.
Practitioner checklist
- Classify the platform's service accounts, API keys and enrolment credentials as privileged NHIs and inventory them per cluster.
- Enforce SSO with phishing-resistant MFA and keep one tested break-glass account.
- Run the sensor in a dedicated privileged namespace that only the platform team can deploy into.
- Prefer narrow capabilities and read-only host mounts over privileged mode; pin and verify sensor images.
- Remove secrets, nodes/proxy, bind, escalate, impersonate and namespace patch from discovery roles.
- Split response into its own role with approval, caps, protected workloads and a tested kill switch.
- Keep rules and exceptions in code, with owner, reason and expiry, and alert on drift.
- Alert on sensor loss, webhook changes and rule changes in your SIEM, not only in the console.
- Remove every DaemonSet, webhook and binding on retirement.
Standards and references
- NIST: SP 800-190 Application Container Security Guide
- Kubernetes: Role Based Access Control Good Practices
- Kubernetes: Pod Security Standards
- Kubernetes: Admission Webhook Good Practices
- Kubernetes: Auditing
- NSA and CISA: Kubernetes Hardening Guide
- Linux man-pages: capabilities(7)
- NIST: SP 800-53 Rev. 5 Security and Privacy Controls
Related NHI Mgmt Group resources: Container Runtime Security Guide · Container runtime security and CWPP rollout playbook · Container Runtime Protection vs Host EDR · Securing the EDR and XDR platform itself · Securing the CNAPP and CSPM platform itself