AKSAudit
- Category
- Containers / Audit (Azure Kubernetes Service — Kubernetes API server audit log)
- Connector / source
- AKS managed-cluster Diagnostic Settings with the
kube-auditlog category routed to a Log Analytics workspace in Resource-specific destination mode (this fillsAKSAudit/AKSAuditAdmin; legacy Azure-diagnostics mode lands inAzureDiagnosticsinstead). Emitted by the Kubernetes API server's audit backend on the AKS control plane. - Table plan
- Basic supported — the reference flags Basic log: Yes (also ingestion-time DCR support and lake-only ingestion). Defaults to Analytics unless the workspace sets the table to Basic.
What this table is
Each row is a single Kubernetes API server audit event from an AKS cluster: one authenticated (or anonymous) call to the API server — who called it, from where, what verb, against which object, and the response code. AKSAudit is the full audit stream and explicitly includes the high-volume get and list (read) verbs; its sibling AKSAuditAdmin carries only the mutating subset (create/update/patch/delete), so use AKSAuditAdmin when you only care about changes and AKSAudit when you need reads too (secret enumeration, recon, pods/exec). Rows appear only when Diagnostic Settings route the kube-audit category to the workspace in resource-specific mode. In a SOC it is the primary source for detecting attacker activity inside a cluster — service-account/identity abuse, secret theft, pods/exec into running workloads (a remote-shell into a container), privileged-pod and RBAC manipulation, and reconnaissance against the API.
Schema
Full column list, validated against the Microsoft Learn reference. Types are KQL/Log Analytics types. Much of the security-relevant content lives in dynamic columns (User, SourceIps, ObjectRef, ResponseStatus, RequestObject, ResponseObject, Annotations) and must be unpacked with tostring() / toint() / parse_json.
| Column | Type | Description |
|---|---|---|
| TimeGenerated | datetime | Event generation time (UTC). |
| AuditId | string | Unique audit ID generated for each request. The stable key for an individual API call across its stages. |
| Stage | string | Request-handling stage at which this event was generated: RequestReceived, ResponseStarted, ResponseComplete, Panic. |
| StageReceivedTime | datetime | Time when the request reached the current audit stage. |
| RequestReceivedTime | datetime | Time when the API server first received the request. |
| Level | string | Audit level of the event: Metadata, Request, RequestResponse. Controls whether request/response bodies are captured. |
| Verb | string | The Kubernetes verb for the request (get, list, watch, create, update, patch, delete, deletecollection); for non-resource requests this is the lower-cased HTTP method. |
| RequestUri | string | The URI of the request the client made to the server (path + query string — carries namespace, resource, name, and subresources such as exec). |
| User | dynamic | Authenticated user metadata of the requesting client: username, optional uid, groups[], and an extra bag (on AKS+Entra integration the Entra object id appears under extra.oid). |
| ObjectRef | dynamic | The Kubernetes object reference this event targeted: resource, namespace, name, subresource, apiGroup, apiVersion. Does not apply to list or non-resource requests. |
| ResponseStatus | dynamic | Response status including the HTTP code; in error cases also status, reason, and message. |
| SourceIps | dynamic | Array of source IP addresses for the originating client and any intermediate proxies. |
| UserAgent | string | The user-agent string presented by the originating client (e.g. kubectl/..., kubelet/..., controller user-agents). |
| Annotations | dynamic | Unstructured key-value map set by admission/authorization plugins in the serving chain (e.g. authorization.k8s.io/decision, ...reason). Present at the Metadata level. |
| RequestObject | dynamic | Kubernetes API object from the request body (object form) or the string "skipped-too-big-size-object". Omitted for non-resource requests and when Level < Request. |
| ResponseObject | dynamic | Kubernetes API object from the response body, or "skipped-too-big-size-object". Omitted for non-resource requests and when Level < RequestResponse. |
| PodName | string | Name of the (control-plane) pod emitting this audit event. Frequently empty for user kubectl calls. |
| SourceSystem | string | Type of agent the event was collected by (Azure for Azure Diagnostics, etc.). |
| TenantId | string | The Log Analytics workspace ID. |
| Type | string | The name of the table (AKSAudit). |
| _ResourceId | string | ARM resource id of the AKS managed cluster the record is associated with. |
| _SubscriptionId | string | Unique identifier for the subscription the record is associated with. |
| _BilledSize | real | The record size in bytes. |
| _IsBillable | string | Whether ingesting the data is billable (string true/false); false is not billed. |
Every column from the reference is listed (the page exposes ~22 distinct columns plus the
_-prefixed billing/identity columns). No column has been invented. The detection-critical dynamic blobs areUser,SourceIps,ObjectRef,ResponseStatus,RequestObject,ResponseObject, andAnnotations(noteVerbis a flat string, not dynamic).
Key columns for detection & hunting
- Identity (actor):
tostring(User.username)— for an Entra-integrated AKS user this is the UPN (e.g.alexw@contoso.com); for in-cluster identities it is a service-account principal (system:serviceaccount:<ns>:<name>), a node (system:node:<vmss>), or a system principal (system:apiserver,system:kube-scheduler). Groups:User.groups(array); Entra object id:tostring(User.extra.oid[0]). - Host / device: there is no
Computer/DeviceNamecolumn. The cluster is_ResourceId(.../managedclusters/aks-prod-01);PodNamenames the control-plane pod for system events; the target workload istostring(ObjectRef.name)intostring(ObjectRef.namespace). - Network:
SourceIpsis a dynamic array — the client IP istostring(SourceIps[0])(e.g.185.220.101.2). There is no destination/port column. - Outcome / result:
toint(ResponseStatus.code)— an HTTP status (200 OK, 201 Created, 101 Switching Protocols for a successfulexec/attach/portforwardupgrade, 403 Forbidden, 404). On failure,tostring(ResponseStatus.reason)/tostring(ResponseStatus.message)carry the RBAC denial text. It is a number inside a dynamic blob, not a top-level int. - Timestamps:
TimeGenerated(event time);RequestReceivedTime(when the API server first saw the request);StageReceivedTime(per-stage). - Join keys (to other tables):
tostring(User.username)/tostring(User.extra.oid[0])→UserPrincipalName/ Entra object id inSigninLogs,AADNonInteractiveUserSignInLogs,AuditLogs;tostring(SourceIps[0])→IPAddress/RemoteIPin sign-in and network tables;_ResourceId/_SubscriptionId→AzureActivity(cluster-level ARM ops,listClusterUserCredential);AuditIdto correlate the same call across stages and withAKSAuditAdmin.
Schema gotchas
- Almost everything is in dynamic JSON —
tostring()/toint()before you filter.User,ObjectRef,ResponseStatus, andSourceIpsare dynamic (VerbandRequestUriare flat strings). Usetostring(User.username),tostring(ObjectRef.resource),toint(ResponseStatus.code),tostring(SourceIps[0]). Filtering on a dynamic column without a cast silently misbehaves. ResponseStatus.codeis a number nested in a blob, not a top-level int — there is no flatResultType. Comparetoint(ResponseStatus.code) == 403, never a bare top-level field. A successfulexec/attach/portforwardreturns 101 (Switching Protocols), not 200 — don't filter exec oncode == 200.AKSAuditvsAKSAuditAdmin.AKSAuditincludes reads (get/list/watch);AKSAuditAdminis mutations only. Secret enumeration andpods/execrecon are visible only inAKSAudit— a detection written againstAKSAuditAdminwill miss them.pods/execis encoded two ways — check both.tostring(ObjectRef.subresource) == "exec"is the reliable signal; the command also appears URL-encoded inRequestUri(/pods/<name>/exec?command=...). The same applies toattach,portforward, andproxy.- No
Computer/DeviceName; the namespace lives in two places. Host joins must use_ResourceId(the cluster), notComputer. The namespace istostring(ObjectRef.namespace)for resource calls but only insideRequestUriforlist(whereObjectRefmay be absent). - Volume + plan caveat.
AKSAuditis high-cardinality because it carries every read; the reference flags Basic log: Yes. Under Basic/Auxiliary, scheduled-analytics rules and cross-tablejoinare restricted — confirm the table's plan before building alerting, and expect heavyget/listcontroller/kubelet noise to filter out.
Sample data
AKSAudit_sample.csv — 22 rows. The rows tell the container-attack step (~11:00 on cluster aks-prod-01) of Operation Quiet Ledger: amid benign control-plane noise (cluster-autoscaler, kube-controller-manager list pods, kubelet/system:node reads, scheduler lease renewals, an system:apiserver health check, and a benign meganb get configmap in hr), the compromised alexw@contoso.com connecting from 185.220.101.2 enumerates and reads secrets in namespace finance (list secrets, get finance-db-credentials, get a service-account token secret), execs into two running pods (pods/exec → code 101, one running /bin/sh, one cat-ing the in-pod serviceaccount/token), creates a pause-debug pod, mints a serviceaccounts/default/token, and trips a 403 Forbidden trying to list secrets at cluster scope.
The sample uses this curated subset of real columns: TimeGenerated, AuditId, Stage, Level, Verb, RequestUri, User, SourceIps, ObjectRef, ResponseStatus, UserAgent, PodName, SourceSystem, _ResourceId. This is the AKS exec / secret-read step (~11:00 on aks-prod-01), the final on-keyboard stage after the Key Vault / NSG actions (~10:40).
Threat-hunting hypotheses (single-table)
H1 · Interactive shell into a running container (pods/exec) — T1609
Hypothesis: A create against the pods/exec subresource is a remote shell into a live workload — rarely legitimate from a human kubectl in production, and a hallmark of container compromise (also covers attach/portforward).
AKSAudit
| where Verb == "create"
| where tostring(ObjectRef.subresource) in ("exec", "attach", "portforward") or RequestUri has "/exec?"
| extend actor = tostring(User.username), srcIp = tostring(SourceIps[0]),
ns = tostring(ObjectRef.namespace), pod = tostring(ObjectRef.name),
code = toint(ResponseStatus.code)
| where actor !startswith "system:"
| project TimeGenerated, actor, srcIp, ns, pod, sub = tostring(ObjectRef.subresource), code, RequestUri
| sort by TimeGenerated asc
Triage: True positive = alexw@contoso.com from 185.220.101.2 exec-ing finance pods with code == 101. Benign = a known operator/CI principal debugging in a non-prod namespace within a change window.
H2 · Secret enumeration & service-account token theft — T1552.007
Hypothesis: A non-system principal that lists secrets and then gets individual secrets / mints service-account tokens is harvesting credentials from the cluster.
AKSAudit
| extend actor = tostring(User.username), res = tostring(ObjectRef.resource),
sub = tostring(ObjectRef.subresource), v = Verb,
ns = tostring(ObjectRef.namespace), code = toint(ResponseStatus.code)
| where actor !startswith "system:"
| where (res == "secrets" and v in ("list","get"))
or (res == "serviceaccounts" and sub == "token" and v == "create")
| summarize events = count(), verbs = make_set(strcat(v,":",res,iff(sub=="","",strcat("/",sub)))),
namespaces = make_set(ns), firstSeen = min(TimeGenerated), lastSeen = max(TimeGenerated)
by actor, srcIp = tostring(SourceIps[0])
| where events >= 2
| sort by events desc
Triage: True positive = one identity touching list secrets + multiple get secrets + serviceaccounts/.../token create in minutes. Benign = a controller service account (excluded by !startswith "system:") or a one-off operator read.
H3 · API authorization failures — RBAC probing / privilege boundaries — T1613
Hypothesis: A burst of 403 Forbidden responses for one principal indicates it is probing what it can reach (e.g. attempting cluster-scope list secrets after namespace-scoped access).
AKSAudit
| where toint(ResponseStatus.code) == 403
| extend actor = tostring(User.username), srcIp = tostring(SourceIps[0]),
res = tostring(ObjectRef.resource), reason = tostring(ResponseStatus.reason)
| where actor !startswith "system:"
| project TimeGenerated, actor, srcIp, Verb, res, reason,
message = tostring(ResponseStatus.message), RequestUri
| sort by TimeGenerated asc
Triage: True positive = alexw@contoso.com denied a cluster-scope list secrets while still reading within finance — an actor testing reach. Benign = a misconfigured app hitting a single expected-denied endpoint repeatedly.
H4 · Suspicious workload created in a sensitive namespace — T1610
Hypothesis: A human principal that creates a pod directly (not via a Deployment/controller) in a production namespace — especially a generic/debug/pause name — may be deploying a foothold or privileged container.
AKSAudit
| where Verb == "create" and tostring(ObjectRef.resource) == "pods" and isempty(tostring(ObjectRef.subresource))
| extend actor = tostring(User.username), ns = tostring(ObjectRef.namespace),
pod = tostring(ObjectRef.name), code = toint(ResponseStatus.code), srcIp = tostring(SourceIps[0])
| where actor !startswith "system:"
| where ns in ("finance","kube-system","default")
| project TimeGenerated, actor, srcIp, ns, pod, code, ua = UserAgent
| sort by TimeGenerated asc
Triage: True positive = alexw creating pause-debug in finance (code 201) from a Tor-range IP. Benign = a controller principal (excluded) or an approved operator deploying a named, reviewed workload.
Correlates with
- SigninLogs / AADNonInteractiveUserSignInLogs on
tostring(User.username)→UserPrincipalName(ortostring(User.extra.oid[0])→ object id) — tie the in-cluster identity back to the Entra sign-in (the risky185.220.101.2logon) that obtained cluster credentials. - AzureActivity on
_ResourceId/_SubscriptionId— catch the control-plane operation that handed out access, e.g.Microsoft.ContainerService/managedClusters/listClusterUserCredential/action, immediately before the kubectl burst. - DeviceNetworkEvents / network tables on
tostring(SourceIps[0])→RemoteIP— pivot on185.220.101.2to see the same attacker IP across the broader incident. - AKSAuditAdmin on
AuditId— the mutating-only twin; confirmcreate/deleteevents there and de-duplicate the same call seen in both tables.
References
Check your own query
Write your own query on AKSAudit and check it against the real schema.
Table library by Kaushik Saha. Source: sentinel/tables/AKSAudit/README.md at ea5adab001fa. Queries checked with Microsoft.Azure.Kusto.Language 12.4.1 against schema bundle 2026.10.29. Technique ids checked against ATT&CK 20.0.