← Back to the cybersecurity blog

Turning Kubernetes API server audit logs into detections on EKS, AKS and GKE

By Daniel O'Grady · CIO y socio fundador · Published: 20 November 2026 · Updated: 20 November 2026
Turning Kubernetes API server audit logs into detections

A new Amazon EKS cluster keeps no record of who called its Kubernetes API. The AWS documentation states that every control plane log type is switched off by default and has to be enabled individually. AKS sends its audit events nowhere until someone creates a diagnostic setting. GKE is the exception, and only partly: it records writes out of the box but leaves reads out unless the customer turns them on and pays for them.

Unit 42's April 2026 figures make that default harder to ignore. Its researchers reported that Kubernetes-related threat actor operations rose by 282% in a year and that suspicious activity linked to potential service account token theft showed up in 22% of the cloud environments they observed in 2025. The same report warns that poorly configured clusters may run with audit logging disabled. Without that log, an investigation into who read a secret or who granted themselves cluster-admin begins without its main evidence.

This guide is written for platform engineers and SOC analysts at mid-sized organisations who run managed clusters on EKS, AKS or GKE, feed a SIEM, and want to know what their audit set-up sees, what it misses and what they are paying for it. Technical names were checked against the official Kubernetes, AWS, Microsoft and Google documentation on 20 November 2026.

What does the API server record for each request?

Every action against a cluster goes through the API server, whether it is an administrator's kubectl, a deployment from the CI pipeline, a controller reconciling resources or a node's kubelet reporting on its pods. The server authenticates the request, authorises it through RBAC and, when an audit policy is loaded, emits an event. According to the Kubernetes documentation, an API server started without the --audit-policy-file flag logs no events whatsoever, and it also needs a backend, either a log file or a webhook.

The fields an analyst will work with

The event itself is defined in the audit API reference. Seven fields carry most of the detection value: verb (the Kubernetes verb, such as get, list, create or delete), user (the authenticated identity and its groups), impersonatedUser (set when someone acted as another principal) and objectRef (resource, namespace, name and subresource). Alongside them sit sourceIPs, userAgent and annotations, where the authoriser records its verdict in authorization.k8s.io/decision as allow or forbid. Azure's AKSAudit table has no column for impersonatedUser, so on AKS impersonation is better governed by reviewing who holds that permission in RBAC.

Two of those fields should be handled with suspicion. The reference itself says the userAgent is supplied by the client and must not be trusted, and that every address in sourceIPs except the last can be set arbitrarily by whoever sends the request. They add context to an alert; a rule built on them alone is defeated by changing a header.

Logging levels and rule order

An audit policy assigns each request one of four levels: None (not logged), Metadata (who, when, which resource and which verb, without bodies), Request (adds the request body) and RequestResponse (adds the response body as well). Events can be emitted at four stages, RequestReceived, ResponseStarted, ResponseComplete and Panic. Rules are evaluated in order and the first match sets the level, so a broad rule near the top silently overrides the narrower ones beneath it.

On a self-managed cluster the platform team writes that file. On a managed one the provider does, and that is where detection starts to diverge.

What does the provider decide on a managed cluster?

Google publishes its GKE audit policy. Writes (create, update, delete) are generally logged at RequestResponse, reads (get, list, watch) at Metadata, and requests touching secrets, configmaps and tokenreviews are never logged above Metadata so that their contents never reach the log. AWS and Microsoft do not publish theirs. Shay Berkovich of Wiz summed it up in a November 2024 analysis: all but one of the providers he reviewed keep the policy file private, and GKE reshapes the event format enough that a rule written for upstream Kubernetes will not work there unmodified.

The table sets out what has to be enabled on each platform and what it costs. That choice is the first design decision, because it fixes which detections will be possible later.

Kubernetes audit logging on managed clusters
ProviderHow to enable itDestination and namingDefault stateCost and caveats
Amazon EKSControl plane logging, audit type (plus authenticator to see how IAM identities are mapped)CloudWatch Logs, group /aws/eks/<cluster>/cluster, streams kube-apiserver-audit-*OffStandard CloudWatch ingestion and storage; default retention never expires; delivery is best effort
Azure AKSDiagnostic setting with the kube-audit or kube-audit-admin category, in resource-specific modeLog Analytics, AKSAudit and AKSAuditAdmin tablesNo destination until a setting existsMicrosoft warns of substantial cost with kube-audit; AKSAuditAdmin excludes get and list
Google GKEAdmin Activity always on; Data Access enabled in the project's audit configurationCloud Logging, cloudaudit.googleapis.com/activity and data_access logs, k8s_cluster resourceWrites logged; reads offAdmin Activity free of charge; Data Access billed at Cloud Logging rates

Compiled by Hard2bit from AWS, Microsoft and Google documentation consulted on 20 November 2026. Prices vary by region and agreement; check them before budgeting.

What the cheap option leaves out

AKS and GKE both offer an economical route, and both trim the same thing: reads. On AKS, the AKSAuditAdmin table holds API server events except get and list, and Microsoft's AKS monitoring guidance recommends it to keep spending under control. On GKE, the published policy sends get, list and updateStatus requests to the Data Access log, which is disabled by default. EKS has no such middle ground: its audit type includes reads, and the resulting CloudWatch volume is what persuades teams to switch it off.

Trimming reads hides the most direct credential access technique in a cluster: reading or listing secrets, which the API sees as a get or a list. MITRE ATT&CK catalogues it as T1552.007, Container API, and it typically follows service account token theft, of which Unit 42 saw signs in roughly one environment in five. A cluster that logs only writes will see an attacker create something, but not read the database credentials held in a secret.

The kubectl exec problem

Exec detection (T1609) has a catch. In January 2026 Graham Helton published an audit event produced by kubectl 1.31 running exec in a pod, and the recorded verb was get, not create. The Kubernetes source comment he quotes explains why: a WebSocket client, the transport kubectl switched to by default in 1.31, sends a GET, which becomes get, while the older SPDY protocol sends a POST, which becomes create.

The first consequence is that a rule looking for verb equal to create on the exec subresource will miss exec calls from current clients. The second, which is our own inference from Microsoft's documentation, is that those events may never reach AKSAuditAdmin, which drops get. GKE is less of a concern, because Google's own example places exec events in the free Admin Activity log. We are not presenting that as settled: the validation test later in this guide answers it for each cluster in about ten minutes.

Helton also notes that, until Kubernetes 1.35, a role holding only get on pods/exec was enough to run commands over WebSocket. Version 1.35 also requires the create permission through the AuthorizePodWebsocketUpgradeCreatePermission feature gate, beta and enabled by default, which covers exec, attach and port-forward; the event is still recorded as get. Clusters on earlier versions, or with that gate disabled, should be checked for roles that grant the permission.

How is audit logging enabled and verified on each platform?

Amazon EKS

A first deployment needs the audit and authenticator types; the latter records how each IAM identity authenticates to the cluster. The change is asynchronous, so the update has to finish before confirming that a kube-apiserver-audit stream exists. Before setting retention, the group's current setting should be checked: if it is unlimited and there are preservation obligations, whatever will fall outside the new window should be exported to S3 first. Once the new retention applies, CloudWatch marks older events for deletion and usually removes them within 72 hours.

# Enable the audit and authenticator control plane logs.
aws eks update-cluster-config --name <cluster> --logging '{"clusterLogging":[{"types":["audit","authenticator"],"enabled":true}]}'
# Wait until the update reports Successful.
aws eks describe-update --name <cluster> --update-id <update-id>
# Check which log types are now enabled.
aws eks describe-cluster --name <cluster> --query "cluster.logging.clusterLogging"
# Confirm that audit streams are arriving.
aws logs describe-log-streams --log-group-name /aws/eks/<cluster>/cluster --log-stream-name-prefix kube-apiserver-audit
# Set 365-day retention after reviewing the current one.
aws logs put-retention-policy --log-group-name /aws/eks/<cluster>/cluster --retention-in-days 365

GuardDuty's EKS protection, AWS explains, analyses audit activity without requiring these logs to be enabled or stored. It raises useful findings, such as Discovery:Kubernetes/SuccessfulAnonymousAccess for successful API calls by system:anonymous, but it does not hand over raw events for investigation or custom rules. It complements the log; it does not replace it.

Azure AKS

Microsoft recommends resource-specific mode, which writes events to dedicated tables instead of the shared AzureDiagnostics table. The choice is between kube-audit (the AKSAudit table, reads included) and kube-audit-admin (AKSAuditAdmin, no get or list). The AKS monitoring guidance mentions a third route: collect kube-audit and configure AKSAudit as a Basic logs table, which is cheaper to ingest in exchange for paying per query and supporting only simple log alerts. Before choosing it, it is important to check that those alerts cover the planned detections, as they are more limited than those on an Analytics table.

# Send kube-audit-admin to Log Analytics in resource-specific tables.
az monitor diagnostic-settings create --name aks-audit --resource <cluster-resource-id> --workspace <workspace-resource-id> --export-to-resource-specific true --logs '[{"category":"kube-audit-admin","enabled":true}]'
# Review the cluster's diagnostic settings.
az monitor diagnostic-settings list --resource <cluster-resource-id>

Final verification happens in Log Analytics, where a query such as AKSAuditAdmin | summarize count() by bin(TimeGenerated, 1h) should return events every hour. If the table is still empty after half an hour, the workspace and the setting's resource-specific mode are the first things to check. Microsoft warns that the CLI does not check the cluster's provisioning state, so the result has to be confirmed, not assumed.

Google GKE

Writes need no action on GKE. Reads require Data Access logs to be enabled for the Kubernetes Engine API in the project's audit log configuration, with the ADMIN_READ and DATA_READ subtypes. Google's documentation notes that these logs are chargeable and can be excluded through a sink if volume exceeds allotments. gcloud confirms that events are arriving.

# Latest write events for the cluster in Admin Activity.
gcloud logging read 'resource.type="k8s_cluster" AND logName:"cloudaudit.googleapis.com%2Factivity"' --limit 5
# Latest read events, if Data Access is enabled.
gcloud logging read 'resource.type="k8s_cluster" AND logName:"cloudaudit.googleapis.com%2Fdata_access"' --limit 5

Which detections earn back the cost of the log?

Audit logging with no rules on top only helps after the fact. We suggest five behaviours to start with, chosen because they appear in the MITRE ATT&CK containers matrix and because the API server sees them clearly. The KQL targets AKS; the Sigma rule and the CloudWatch and Cloud Logging searches cover the other platforms. In every case, a baseline of a week or two comes before any query becomes an alert.

Five behaviours to watch in Kubernetes audit logs
BehaviourATT&CK techniqueKey fieldsNeeds reads logged
Exec or attach into a podT1609objectRef.subresource exec or attachOn AKS, yes, for WebSocket clients
Service account reading or listing secretsT1552.007objectRef.resource secrets, verb get, list or watchYes
RBAC changes (roles and bindings)T1098.006objectRef.resource clusterrolebindings, rolebindings, clusterroles, rolesNo
Requests allowed for system:anonymousT1078user.username system:anonymous, decision allowYes
Burst of denied requests from one identity or sourceT1613responseStatus.code 401 or 403Yes

Techniques from MITRE ATT&CK for Containers. The last column shows whether the detection requires get and list events.

Execution inside containers

This query deliberately ignores the verb, for the reason given above, and counts distinct audit IDs because long-running requests such as exec emit one event when the response starts and another when it completes. It groups by identity, pod and client so an analyst can tell an on-call engineer's one-off exec apart from a service account doing something it has never done before.

// Exec and attach into pods over the past seven days.
// Use AKSAudit to include exec calls recorded as get.
AKSAudit
| where TimeGenerated > ago(7d)
| where tostring(ObjectRef.subresource) in ("exec", "attach")
// The RequestReceived stage does not yet carry the authorisation decision.
| where Stage != "RequestReceived"
// Fields the analyst needs.
| extend username = tostring(User.username), ns = tostring(ObjectRef.namespace), pod = tostring(ObjectRef.name), decision = tostring(Annotations["authorization.k8s.io/decision"])
// Group by identity and client.
| summarize requests = dcount(AuditId), first_seen = min(TimeGenerated), last_seen = max(TimeGenerated) by username, ns, pod, decision, UserAgent
| order by last_seen desc

Expected false positives include the platform team's debugging tools, operators running maintenance commands against databases and some deployment pipelines. Service accounts that exec should be few and well known, and any newcomer deserves a look. The CloudWatch Logs Insights equivalent for EKS is below.

# CloudWatch Logs Insights over /aws/eks/<cluster>/cluster.
fields @timestamp, user.username, objectRef.namespace, objectRef.name, verb, userAgent
| filter @logStream like /kube-apiserver-audit/
| filter objectRef.subresource = "exec" or objectRef.subresource = "attach"
| sort @timestamp desc
| limit 200

On GKE, the Logs Explorer filter is resource.type="k8s_cluster" combined with protoPayload.methodName=~"io.k8s.core.v1.pods.(exec|attach)". Google uses a different event format, which is why the field names differ from upstream Kubernetes. According to Google's GKE audit logging documentation, exec events appear in Admin Activity with a command.gke.io/command label that holds the command. The validation test confirms whether WebSocket exec calls also reach that log.

Service accounts reading secrets

This detection works only where reads are logged: AKSAudit, Data Access on GKE or the audit type on EKS. It focuses on service accounts because that is the identity an attacker holds after lifting a token from a pod. Node kubelets read secrets constantly to mount them into pods, so they are excluded.

// Service accounts listing secrets cluster-wide, reading across namespaces or being denied.
AKSAudit
| where TimeGenerated > ago(1d)
| where tostring(ObjectRef.resource) == "secrets" and Verb in ("get", "list", "watch")
// Fields the analyst needs.
| extend username = tostring(User.username), ns = tostring(ObjectRef.namespace), decision = tostring(Annotations["authorization.k8s.io/decision"])
| where username startswith "system:serviceaccount:"
// Group by identity and client.
| summarize reads = dcount(AuditId), namespaces = dcount(ns), cluster_wide = countif(isempty(ns)), denied = countif(decision == "forbid") by username, UserAgent
// Alert threshold.
| where namespaces > 1 or cluster_wide > 0 or denied > 0
// Thresholds to tune against the baseline.

The usual false positives are controllers that manage secrets by design (cert-manager, external-secrets, sealed-secrets), Helm, which stores release state in secrets, and cluster backup agents. Elastic's related rule names those controllers and Helm in its investigation guide and recommends allowlisting their service accounts, although its query exempts the service-account groups of several whole namespaces. Excluding individual service accounts is the safer choice, since an exempt namespace makes a comfortable hiding place.

RBAC changes and token requests

The third query gathers rare operations that grant or manufacture privilege: creating or changing roles and bindings, approving certificate signing requests and requesting tokens for service accounts. Google's GKE RBAC best practices name the escalate and bind verbs and the creation of certificate signing requests among the privilege escalation risks.

// Operations that grant or manufacture privilege, past day.
AKSAuditAdmin
| where TimeGenerated > ago(1d)
// Fields the analyst needs.
| extend username = tostring(User.username), resource = tostring(ObjectRef.resource), sub = tostring(ObjectRef.subresource), decision = tostring(Annotations["authorization.k8s.io/decision"])
// Three alternative conditions.
| where (resource in ("clusterrolebindings", "rolebindings", "clusterroles", "roles") and Verb in ("create", "update", "patch", "delete"))
or (resource == "certificatesigningrequests" and sub == "approval")
or (resource == "serviceaccounts" and sub == "token" and not(username startswith "system:node:"))
// Output columns.
| project TimeGenerated, username, Verb, resource, sub, name = tostring(ObjectRef.name), decision, SourceIps

Noise here comes from platform upgrades, operators that install roles as they deploy and GitOps tools (Argo CD, Flux) applying manifests that contain RBAC. Correlating with the pipeline's deployment window cuts the volume considerably. What should always fire is a new binding created by a human identity outside that window, or by any service account other than the deployer.

The fourth behaviour, anonymous access, needs the full table because the usual abuse is reads. Health and version endpoints, which Kubernetes lets unauthenticated clients query, would flood the alert, so the query keeps only requests that target a resource.

// Allowed unauthenticated requests against API resources.
AKSAudit
| where TimeGenerated > ago(1d)
// Anonymous user or unauthenticated group.
| where tostring(User.username) == "system:anonymous" or tostring(User.groups) has "system:unauthenticated"
| where tostring(Annotations["authorization.k8s.io/decision"]) == "allow" and isnotempty(tostring(ObjectRef.resource))
// Output columns.
| project TimeGenerated, Verb, resource = tostring(ObjectRef.resource), RequestUri, SourceIps

The last query covers bursts of denials, which often mean someone is probing what a freshly stolen token allows. A legitimate identity knows its permissions and seldom fails repeatedly; one exploring unfamiliar resources piles up 401 and 403 responses within minutes.

// More than 20 responses of 401 or 403 in ten minutes per identity or source.
AKSAudit
| where TimeGenerated > ago(1d)
| where toint(ResponseStatus.code) in (401, 403)
// Count per identity, source and window.
// On 401 events the user is empty, so the source is what counts.
| summarize failures = dcount(AuditId), resources = dcount(tostring(ObjectRef.resource)) by username = tostring(User.username), source = tostring(SourceIps), bin(TimeGenerated, 10m)
// Starting threshold.
| where failures > 20

Twenty is a starting point, not a validated figure, and should be tuned against the baseline. The query reads AKSAudit because typical probing consists of reads, and it filters on the response code because authentication failures (401), such as an expired or revoked stolen token, carry no authorisation annotation.

Nor do they identify the user, because the API server logs them before resolving the identity: 401s group by source alone, and attribution to an identity applies only to 403s. Misconfigured controllers after an upgrade tend to fail in a loop against a single resource, and the distinct resource count helps separate them from genuine probing.

A portable Sigma rule

For a SIEM other than Sentinel, the Sigma rule below covers container execution using upstream Kubernetes event fields. It applies directly to EKS and self-managed clusters; GKE needs the fields mapped to its own format.

title: Exec or attach into a Kubernetes pod
id: 2118c3bc-08cf-4fd1-97fd-6fe90daa4d2d
status: experimental
description: Detects requests to a pod's exec or attach subresource without filtering on the verb, covering both WebSocket and SPDY clients.
author: Hard2bit
date: 2026-11-20
tags: [attack.execution, attack.t1609]
logsource: {category: application, product: kubernetes, service: audit}
detection: {selection: {objectRef.resource: pods, objectRef.subresource: [exec, attach]}, condition: selection}
falsepositives: [Debugging by the platform team, Operators running maintenance tasks]
level: medium

SigmaHQ also maintains public rules for this log source, such as its secrets enumeration rule, which looks for the list verb on secrets. Before converting a rule, sigma check validates the syntax, and the field names should be checked against what the connector delivers.

Testing safely

Validation needs no offensive tooling. With written authorisation and the SOC told in advance, two test namespaces and a dedicated service account are enough to generate the behaviours above and measure how long they take to reach the SIEM. EKS delivers on a best-effort basis, so observed latency should be measured before committing to response times. Impersonating the account with --as will not test the secrets query: the event would record the impersonating operator as the user, and the query would ignore it.

# Test namespaces, pod and service account.
kubectl create namespace soc-tests-a
kubectl create namespace soc-tests-b
kubectl -n soc-tests-a run probe --image=busybox:1.36 --restart=Never -- sleep 3600
kubectl -n soc-tests-a wait --for=condition=Ready pod/probe --timeout=90s
kubectl -n soc-tests-a create serviceaccount test-reader
# Benign exec: should appear in the first query.
kubectl -n soc-tests-a exec probe -- id
# Test secrets and read permission in both namespaces.
kubectl -n soc-tests-a create secret generic detection-test --from-literal=key=test-value
kubectl -n soc-tests-b create secret generic detection-test --from-literal=key=test-value
kubectl -n soc-tests-a create rolebinding reader --clusterrole=view --serviceaccount=soc-tests-a:test-reader
kubectl -n soc-tests-b create role reader --verb=get --resource=secrets
kubectl -n soc-tests-b create rolebinding reader --role=reader --serviceaccount=soc-tests-a:test-reader

# Ten-minute token for the test account.
TOKEN=$(kubectl -n soc-tests-a create token test-reader --duration=10m)
# Reads as the service account: should appear in the secrets query.
kubectl --token="$TOKEN" -n soc-tests-b get secret detection-test
kubectl --token="$TOKEN" -n soc-tests-a get secret detection-test
# Clean up afterwards.
kubectl delete namespace soc-tests-a soc-tests-b

The read in soc-tests-a will fail with a 403, because the view role excludes secrets, and that denial should also show up in the query. Depending on how the kubeconfig authenticates (through an AWS or Azure plugin, for example), a separate context may be needed to use the token.

The exec result is the most informative. If the event appears in AKSAudit with verb get and is absent from AKSAuditAdmin, the current set-up cannot see exec calls from modern kubectl clients, and the choice is between paying for the full table or accepting the gap in writing. The date, cluster, kubectl version, table and latency should be recorded; that record doubles as audit evidence.

Where does API server auditing fall short?

The log captures API requests, not what happens inside a container. After an exec, whatever the attacker types in the interactive session is absent from the event; only the initial command, carried in requestURI, is recorded. Process activity needs a runtime sensor on the nodes, whether the cloud platform's own or a third party's, correlated with the audit trail.

It also misses anything that bypasses the API server. Helton documented that even get on nodes/proxy allows command execution through the kubelet, and that this path leaves no trace in the cluster's audit log beyond an authorisation check. The Kubernetes Security Team regards that as intended behaviour.

Since version 1.36, fine-grained kubelet API authorisation is generally available, letting monitoring agents receive narrower permissions (metrics, logs or pod status) instead of nodes/proxy. It offers no replacement for exec, attach or port-forward through the kubelet, so agents that use them still need it. The defensive steps are to review which roles grant nodes/proxy, move those agents to the fine-grained permissions and restrict network access to the kubelet port to what is strictly required.

Other limits to keep in mind when planning coverage:

  • GKE's format differs from upstream, so each rule needs a Google-specific version.
  • Providers set the audit levels. AKSAudit has columns for request and response bodies, but which requests carry them depends on the provider's policy, and AWS warns in its EKS best practices guide that entries over 1 MB are truncated or keep only the request metadata. Before building a rule on the body (to spot a pod created as privileged, say), it is important to confirm in a logged event that the data is there.
  • Delivery is not instant and, on EKS, not guaranteed. A critical alert should not hinge on a single event.
  • On EKS, the authenticator log helps link a Kubernetes identity to the IAM role behind it.

None of this makes the log less useful. It marks where the log stops, and why it belongs alongside a runtime sensor and least privilege in RBAC.

Evidence for auditors

A log that is retained and reviewed satisfies controls found in the main compliance frameworks. The table is no substitute for each organisation's applicability analysis; it shows what evidence each part of this guide provides.

Indicative mapping to compliance frameworks
FrameworkControlEvidence from this guide
ENS (Spain, RD 311/2022)op.exp.8 Activity logging; op.mon.1 Intrusion detectionPer-cluster audit configuration, defined retention and active rules
ISO/IEC 27001:2022A.8.15 Logging; A.8.16 Monitoring activities; A.8.2 Privileged access rightsAPI server logs, detection queries and review of RBAC changes
NIS2 (Directive 2022/2555)Art. 21(2)(b) incident handling; Art. 21(2)(i) access control policiesAbility to reconstruct who did what in the cluster, with alerts on privilege changes
DORA (Regulation 2022/2554)Art. 10 DetectionMechanisms to detect anomalous activity on the container platform

Indicative mapping by Hard2bit. Applicability depends on each organisation's scope.

Where to start

The first step is to turn on audit logging with reads included for the cluster that holds the most valuable secrets, even if it is only that cluster and only with short retention, and to put the service-account secret-read query on top. Everything else in this guide can be layered on afterwards.

Next, the exec test in a lab namespace shows whether the paid-for configuration sees what it is assumed to see. For baselining, false-positive tuning or round-the-clock monitoring, our managed SOC and threat hunting services work with these same sources, and the IAM and cloud posture review covers RBAC and the providers' identity layer.

Related reading: which logs to send to the SIEM and how long to keep them; how to measure detection robustness against ATT&CK; and how to secure service accounts and their tokens, the other half of this problem. If the clusters are deployed from GitHub, our GitHub Actions security guide covers the pipeline that holds permissions over them.

Sources and methodology: official documentation from Kubernetes (auditing and the audit.k8s.io/v1 API reference), Amazon EKS and GuardDuty, Azure Monitor and AKS, and Google Kubernetes Engine and Cloud Logging; MITRE ATT&CK; Unit 42's April 2026 report; analysis by Wiz and Graham Helton; public Elastic and SigmaHQ rules. Information checked as of 20 November 2026.
Disclaimer: the queries and settings in this guide are indicative. Managed services change often: every change should be tested in a non-production environment and its impact on cost and data retention assessed before it is enabled in production. Rules should be tuned to each cluster's baseline. Validation tests must have written authorisation.

Frequently asked questions

Is Kubernetes audit logging enabled by default on EKS, AKS and GKE? ▾

Only partly. On EKS every control plane log type is off until enabled. On AKS, events go nowhere until a diagnostic setting is created for kube-audit or kube-audit-admin. GKE always records writes in Admin Activity at no charge, but reads such as get and list go to Data Access, which is disabled by default and billed.

What is the difference between AKSAudit and AKSAuditAdmin? ▾

AKSAudit holds every API server event; AKSAuditAdmin holds the same minus get and list. The admin table is considerably cheaper, but it loses secret reads and may also lose pod exec calls from WebSocket clients, which are logged as get. Running a test exec and searching both tables is the quickest way to find out on a given cluster.

Why does a kubectl exec detection rule fail to fire? ▾

It probably filters on the create verb. Recent kubectl versions that use WebSocket send a GET, which the API server records as get; only the older SPDY protocol produces create. The fix is to match on the exec or attach subresource with no verb condition and to check that the table or log being queried includes reads.

Can the audit policy be changed on a managed cluster? ▾

Not on EKS or AKS, where the provider sets the levels and does not publish the file. Google does publish GKE's policy, which logs writes with full bodies and keeps secrets, configmaps and tokenreviews at metadata only. What customers control is which log types or categories are switched on, where they are sent and how long they are kept.

Does GuardDuty replace audit logging on EKS? ▾

It is a useful layer, not a replacement. GuardDuty analyses EKS audit activity without the logs having to be stored and raises findings, but it does not hand over raw events for investigation or for custom rules. Reconstructing an incident or tailoring detections to the environment still requires the log in a queryable store.

What can API server audit logs not see? ▾

They do not show what happens inside a container after an exec beyond the initial command, nor command execution through the kubelet via the nodes/proxy permission, which never passes through the API server. That is why they should be paired with a runtime sensor on the nodes, a review of who holds that permission and network rules limiting access to the kubelet port.

How long should Kubernetes audit logs be retained? ▾

That depends on the applicable frameworks and the risk analysis, but it should be set explicitly. On EKS the default CloudWatch retention never expires and keeps accruing cost, while on GKE and AKS it depends on the destination's configuration. A common pattern keeps what the rules need in hot storage and archives the remainder more cheaply for investigations.

Share this article

Cite this article

If you write about this topic, you can cite it like this:

Daniel O'Grady (20 November 2026). Turning Kubernetes API server audit logs into detections on EKS, AKS and GKE. Hard2bit. https://hard2bit.com/en/blog/kubernetes-api-server-audit-logs-eks-aks-gke-detection/

<a href="https://hard2bit.com/en/blog/kubernetes-api-server-audit-logs-eks-aks-gke-detection/">Turning Kubernetes API server audit logs into detections on EKS, AKS and GKE</a> (Hard2bit)

Want a straight answer on scope, priorities and price?

Most organizations reach us mid-question: something needs fixing, nobody has scoped it, and finance wants a number. Thirty minutes with a technical consultant — not a salesperson — gets you a defined scope, priorities ranked by risk and a price range. With what comes out of that call, we turn it into a fixed proposal. We work with organizations in Spain, across the EU and in LATAM.

If your situation is different, tell us anyway — we also take one-off questions on cybersecurity and regulatory compliance.

Based in Spain · Working across the EU and LATAM · ENS High · ISO 27001 · We usually reply in under 24 business hours