Knowledge base

Detection scenarios

How do I detect an attack on my Kubernetes cluster?

Last updated: 2026-11-09

Detecting a Kubernetes cluster attack: direct answer

Detect an attack on a Kubernetes cluster by combining API server audit logs, runtime detection inside containers, and canary Secrets or ServiceAccounts that nothing legitimate uses. The signals that matter most are exec sessions into pods, a workload's service account listing Secrets, permission probing with kubectl auth can-i, new RBAC bindings and privileged pods. Tracebit, a deception technology platform that detects attacks in your environment at scale, deploys canaries as ordinary Secrets, ConfigMaps and ServiceAccounts in real namespaces across EKS, AKS, GKE and self-managed clusters, through a controller installed with Helm and without an agent inside individual pods.

Signals that a Kubernetes cluster is under attack

SignalWhere it shows upWhat to look forNoise
Exec into a podAPI server audit logcreate on pods/exec by a user or service account that does not normally do itMedium
Secret enumerationAPI server audit logget or list on secrets by a workload's service accountMedium to high. Operators read Secrets
Permission probingAPI server audit logselfsubjectrulesreviews or selfsubjectaccessreviews created from a pod's service accountLow to medium
RBAC changes and new tokensAPI server audit logNew clusterrolebindings, create on serviceaccounts/tokenMedium
Risky workloadsAPI server audit log, admission controlPrivileged pods, hostPath mounts, a new DaemonSet in kube-systemMedium
Anonymous accessAPI server audit logSuccessful requests from system:anonymousLow
Activity inside the containerRuntime tools such as FalcoA shell in a container, reads of the mounted service account token, calls to the metadata address 169.254.169.254Medium until tuned
Managed detectionsGuardDuty EKS Protection, Defender for Containers, Security Command CenterFindings such as Credential Access: Secrets Accessed In Kubernetes Namespace on GKEVaries
Canary touchedAudit log, or use of the credential elsewhereAny read of a canary Secret, or use of a canary ServiceAccount or credentialVery low. Nothing legitimate uses it

Audit logging has to be on first

Most of the table depends on audit data that clusters do not always produce. EKS control plane logging is off until you enable the audit log type, AKS needs a diagnostic setting, GKE records reads only with Data Access logs enabled for the Kubernetes Engine API, and a self-managed API server needs an audit policy file. Log Secrets at the Metadata level, so the audit trail records who read a Secret without storing its value.

Why the moment right after a pod compromise matters most

Kubernetes environments concentrate a lot of reach into places that don't always get scrutinized as closely as they should. A pod that only needs to do one narrow job often ends up with a service account token or RBAC permissions broader than that job actually requires, simply because scoping permissions tightly for every workload is more upfront work than granting something that's known to work. An attacker who gets code execution inside a container as a result of a vulnerable dependency, a misconfigured image, or a supply-chain compromise doesn't need to find a new way in from there. They need to look around at what that pod's existing access already reaches, which is often more than intended.

Building the canary signal in Kubernetes: what makes a canary convincing

A decoy Secret that stands out as obviously fake doesn't do its job. It needs the same operational believability Tracebit's AI builds into every canary it generates: a name that matches real naming conventions in use, like a database credential or a payments API key rather than something generic, sitting in a namespace where that kind of secret plausibly belongs, referenced by something in the cluster so it doesn't look orphaned and abandoned. Placement should follow the RBAC paths and service accounts a real attacker would actually traverse after a pod compromise, not just exist somewhere unrelated to how an intrusion would actually unfold.

A decoy ServiceAccount and a canary credential in a ConfigMap cover different moves: the first catches an attacker trying to change identity inside the cluster, and the second catches one who copies configuration out and tries the credential elsewhere. That second path has been seen in practice. In one Tracebit deployment, a user troubleshooting a service approved an AI agent's request to use its AWS credentials locally. The agent printed a container's environment variables, copied the canary credentials to the workstation and tried them, and the alert fired. Red teams hit the same wire: Calif, engaged by Cresta, knew deception was deployed, extended its engagement to work around it, and was still detected enumerating a Kubernetes cluster.

Where this fits alongside existing Kubernetes security controls

Admission controllers, network policies, and pod security standards all reduce what a compromised or misconfigured workload can do in the first place, and none of that stops being worth running. A decoy secret isn't a substitute for any of it. It answers the question those controls don't: once something does get past them, whether an attacker is actually inside the cluster reaching for resources they shouldn't be able to reach. Prevention controls and a canary secret cover different failure modes, and a cluster with both is meaningfully better covered than one relying on prevention alone.

The bottom line on detecting a Kubernetes cluster attack

Detecting an attack on a Kubernetes cluster starts with audit logs that are actually switched on, then runtime detection for what happens inside containers. Canary Secrets, ConfigMaps and ServiceAccounts cover the moments right after a pod compromise, when an attacker is searching for what to do next and every individual API call still looks routine.

Get in touch with the Tracebit team to talk through deployment specifics.

More on tracebit.comDetect breaches across your Kubernetes clusters

Frequently asked questions about detecting a Kubernetes cluster attack

What does a believable Kubernetes canary actually look like?
A Secret object sitting in a namespace that looks operational, named for a real-sounding dependency like db-credentials or payments-api-key, mounted or referenced by something so it doesn't look orphaned, with a value shaped like a real credential. It should sit in the cluster the way real secrets do, reachable by the service accounts and RBAC paths an attacker would actually traverse after compromising a pod.
Why is Kubernetes a particularly attractive target for this kind of attack?
A compromised pod often inherits more reach than it should — a service account token, RBAC permissions, network access to other services in the cluster. An attacker who gets code execution inside one container is frequently just a few steps from broader cluster access, which makes what happens immediately after a pod compromise the part worth watching closely.
Does this replace Kubernetes-native security tools like admission controllers or network policies?
No — those reduce what a compromised pod or misconfigured deployment can do in the first place, which is real prevention value. A decoy Secret answers a different question: once something does get past those controls, whether anyone's actually reaching for cluster resources they shouldn't.
Does deploying decoy secrets require installing an agent inside every pod?
It shouldn't need to. Canary secrets and honeytokens can be deployed and managed through a controller running at the cluster level via Helm, working across EKS, AKS, GKE, and self-managed clusters, without requiring anything to run inside individual pods.
Does this catch an attacker who compromises a pod but never tries to move beyond it?
Only if that attacker looks around at all, since the decoy depends on being found, not just existing nearby. An intrusion confined to the compromised pod that never enumerates nearby secrets or RBAC paths wouldn't trigger a decoy sitting elsewhere in the namespace. In practice, most attackers who gain a foothold do look for what else is reachable, which is the behavior this approach is built to catch.
What Kubernetes audit events best indicate an attack?
Start with create on pods/exec, get or list on secrets by a workload's service account, create on selfsubjectrulesreviews from inside a pod, new clusterrolebindings, and successful requests from system:anonymous. Each has legitimate uses, so they work best scoped to identities that do not normally make those calls.