Guide · Detection engineering

Kubernetes audit log detection guide for EKS, AKS and GKE

Last reviewed: by Dr. Austin Osuide

Managed Kubernetes hides the control-plane hosts, but it does not remove the need to monitor the API. EKS, AKS and GKE all expose Kubernetes audit events. The collection switch, destination and provider schema differ, so a useful detection design starts with the shared Kubernetes event and keeps the provider details beside it.

Start with the Kubernetes API

Kubernetes API requests need their own detection model. In GKE, Cloud Audit Logs records Kubernetes API events under the k8s_cluster resource type, apart from operations on the managed GKE service. A user can create a ClusterRoleBinding, read a Secret or open an exec session without making a new cloud control-plane call.

Kubernetes audit events cover that inner control plane. The API server records requests from people, service accounts, controllers and nodes according to its audit policy. An event can identify the user, groups, verb, target resource, namespace, source address, user agent, response status and audit stage. Request or response bodies appear only when the managed policy selects a level that records them.

Keep the two planes linked in an investigation. A cloud identity may obtain cluster access through IAM or Entra ID, then appear under a different Kubernetes username or group. The provider log explains how access was granted or how collection changed. The Kubernetes event explains what that principal did to cluster resources.

  • Cloud control plane: cluster creation, identity integration, logging configuration and managed-service changes.
  • Kubernetes control plane: API verbs against pods, secrets, RBAC objects, workloads and other cluster resources.
  • Node and container runtime: process, file and network behaviour after a workload starts. Audit logs do not replace runtime telemetry.

Preserve a shared event model

The Kubernetes audit schema is the common layer across all three services. Preserve the audit ID, stage, request received timestamp, stage timestamp, verb, user name, user groups, source IPs, user agent, object reference and response status before building alerts. Keep the provider's original record as well. Flattening too early can discard the request object needed to inspect a pod specification or the provider identity needed to trace a federated login.

Prefer one completed event per request for most detections. Kubernetes can emit events at RequestReceived, ResponseStarted, ResponseComplete and Panic. Counting every stage as a separate action creates duplicate alerts. Use ResponseComplete where available, retain the audit ID for de-duplication and keep non-success response codes because repeated forbidden requests can expose discovery or failed privilege abuse.

Audit level matters. Metadata records who called which resource and verb without request or response bodies. Request adds the request body. RequestResponse adds both. Managed services set their own policies. The documented EKS policy limits Secrets to metadata, so a missing secret value is protection against log leakage, not evidence that the read did not happen.

  • Do not key a rule only on an HTTP method. Kubernetes audit verbs such as create, update, patch, delete, get, list and watch are more portable.
  • Retain resource, subresource, namespace and object name separately. pods and pods/exec describe very different actions.
  • Record ingestion time beside the API timestamp so routing delays and silent collection gaps can be measured.

Enable and route EKS audit logs

Amazon EKS control-plane logging is configured per cluster. Enable the audit log type for Kubernetes API activity. The neighbouring api and authenticator types add useful context for API server faults and IAM-backed authentication, but enabling api without audit does not provide the same request record. EKS sends enabled control-plane logs to CloudWatch Logs in the cluster account, usually within a few minutes.

Set retention and access controls on the CloudWatch log group, then route the audit stream to the SOC path. CloudWatch Logs subscriptions can send events to Kinesis Data Streams, Data Firehose or Lambda for onward processing. Monitor subscription delivery errors and test the destination with a known Kubernetes action. A green EKS logging setting proves that export is configured, not that the SIEM parser receives every field.

EKS uses a managed audit policy. AWS documents metadata logging for Secrets and ConfigMaps, request logging for reads across known API groups and fuller request or response logging for many writes. Detection logic should fit the event that EKS actually emits. Do not assume that changing the logging switch also lets the cluster owner replace the managed audit policy.

  • Verify the audit stream after cluster creation and after any infrastructure-as-code change to cluster logging.
  • Track the CloudWatch log group, retention period, subscription destination and parser version as part of the coverage record.
  • Alert on audit logging being disabled through the EKS control plane as a separate cloud-platform signal.

Enable and route AKS audit logs

AKS exposes control-plane activity as Azure Monitor resource logs. The service generates the logs, but Azure does not collect and store them until a diagnostic setting routes the selected categories. Use resource-specific mode when the SOC wants the AKSAudit and AKSAuditAdmin tables rather than placing every record in AzureDiagnostics.

The kube-audit category contains the full AKS audit stream covered by the managed policy. kube-audit-admin removes get and list events, which cuts volume and cost. That smaller category works for many write-focused alerts, including RBAC changes and workload creation, but it cannot support a claim that secret reads are monitored. Route kube-audit when read activity matters, or document that gap plainly.

A diagnostic setting can send the categories to Log Analytics, Event Hubs or Storage. Log Analytics supports KQL detections; Event Hubs is the usual route to an external SIEM. After deployment, run a permitted read and a harmless write, then check the expected table and downstream destination.

  • Use AKSAuditAdmin for lower-volume administrative writes when get and list coverage is not required.
  • Use AKSAudit when detections depend on reads, including access to Secrets or broad resource enumeration.
  • Keep the category and table name with each rule so a move between AzureDiagnostics and resource-specific tables does not fail quietly.

Enable and route GKE audit logs

GKE writes Kubernetes API events into Cloud Audit Logs. Its provider policy normally sends create, delete and update requests to Admin Activity, while get, list and updateStatus requests go to Data Access. Admin Activity is available without enabling Data Access. Read-focused detections need the relevant Data Access configuration, so test that setting before counting secret or enumeration coverage.

Use the k8s_cluster resource type to select Kubernetes API activity rather than changes to the managed GKE service. GKE supplies provider fields such as principal identity and method name, and its audit records can identify pods/exec activity. Preserve the nested payload and Kubernetes resource context when routing the event out of Cloud Logging.

Cloud Logging sinks can route matching entries to a log bucket, Cloud Storage, BigQuery or Pub/Sub. Pub/Sub supports third-party SIEM routes. Build the sink filter around both Admin Activity and the Data Access types the team enabled, then test a write and a read. A sink that captures only activity logs will miss the Data Access half of the design.

  • Confirm Data Access settings at the project, folder or organisation scope that governs the cluster.
  • Keep k8s_cluster and gke_cluster records distinct, then correlate them by project, cluster, identity and time.
  • Monitor sink exclusions, destination permissions and Pub/Sub delivery health alongside the detection rules.

Alert on high-value verbs and resources

Start with a small set of actions where the API event has clear security value. Tune by principal, namespace, source network, user agent and change window rather than suppressing the resource for everyone. Controllers make legitimate writes constantly, so the useful question is whether this identity normally performs this verb against this object in this part of the cluster.

Exec is a strong review signal because it opens command execution in an existing container. Match requests to the pods/exec subresource, then score interactive users, unusual service accounts, production namespaces and unfamiliar source addresses more highly. This activity maps to T1609 Container Administration Command. The audit event proves that the API received the exec request; it does not show every process or file change inside the session.

Workload creation and modification support T1610 Deploy Container when they introduce a container. Inspect create, update and patch requests for Pods and workload controllers such as Deployments, DaemonSets, StatefulSets, Jobs and CronJobs. Raise priority for privileged containers, host namespaces, risky hostPath mounts, added Linux capabilities or images outside the approved registries. If the managed audit level omits the request body, correlate with admission-controller, configuration-state or runtime evidence before claiming that a privileged pod was requested.

  • Secret access: get, list or watch on secrets by a new user, service account, namespace or source address. Treat the event as an access signal; do not make the rule depend on secret values appearing in the audit record.
  • RBAC grants: create, update, patch or delete on roles, clusterroles, rolebindings and clusterrolebindings, especially bindings to cluster-admin or broad wildcard permissions.
  • Token creation: create on serviceaccounts/token, reviewed with the requesting identity, target service account and namespace.
  • Workload execution: create, update or patch on pods and workload controllers, with the requested security context inspected where the provider record carries it.
  • Destructive changes: delete or deletecollection against namespaces, workloads, network policies, admission controls or security tooling.

Test coverage, not configuration

A logging toggle is the start of the control, not the acceptance test. For each cluster, generate a small set of approved canary actions: read a harmless test Secret, create and remove a test RoleBinding, start an exec session in a disposable pod and submit a workload with a benign policy violation. Record which event arrived, which fields survived parsing and which alert fired. Remove the test objects afterwards.

Repeat the checks after cluster upgrades, parser changes and routing migrations. Managed audit policies can differ in detail, and downstream schemas change even when the Kubernetes action stays the same. Measure freshness as well as presence. A detection arriving after the incident window is evidence for investigation, but it is weak alerting coverage.

Report each result with an evidence label. An enabled provider setting is collection configuration. A raw event in the destination is audit-log evidence. A tested SIEM alert is detection evidence. Runtime confirmation is separate again. Keep those labels beside T1609 and T1610 so one successful log export is not reported as complete container detection coverage.

  • Inventory every EKS, AKS and GKE cluster, including short-lived development clusters and clusters in newly acquired subscriptions or projects.
  • Track the read boundary explicitly: AKSAuditAdmin excludes get and list, while GKE read coverage depends on Data Access logging.
  • Review noisy rules by principal and workload baseline before dropping high-value verbs or resources.
  • Keep node, admission and runtime detections beside the API audit layer. Each answers a different incident question.
Sources
  • Kubernetes documentation, Auditing, https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/
  • Kubernetes documentation, kube-apiserver Audit Configuration (v1), https://kubernetes.io/docs/reference/config-api/apiserver-audit.v1/
  • Amazon EKS user guide, Send control plane logs to CloudWatch Logs, https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html
  • Amazon EKS best practices guide, Auditing and logging, https://docs.aws.amazon.com/eks/latest/best-practices/auditing-and-logging.html
  • Amazon CloudWatch Logs user guide, Real-time processing of log data with subscriptions, https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions.html
  • Microsoft Learn, Monitor Azure Kubernetes Service, https://learn.microsoft.com/en-us/azure/aks/monitor-aks
  • Microsoft Learn, Diagnostic settings in Azure Monitor, https://learn.microsoft.com/en-us/azure/azure-monitor/data-collection/diagnostic-settings
  • Google Cloud documentation, GKE audit logging information, https://docs.cloud.google.com/kubernetes-engine/docs/how-to/audit-logging
  • Google Cloud documentation, Audit policy for GKE, https://docs.cloud.google.com/kubernetes-engine/docs/concepts/audit-policy
  • Google Cloud documentation, Route logs to supported destinations, https://docs.cloud.google.com/logging/docs/export/configure_export_v2
  • MITRE ATT&CK T1609 Container Administration Command, https://attack.mitre.org/techniques/T1609/
  • MITRE ATT&CK T1610 Deploy Container, https://attack.mitre.org/techniques/T1610/
Last verified: 2026-11-17