Skip to main content
compliance · azure

AKS clusters with no diagnostic setting collecting control-plane logs

resource types
1
rule IDs covered
1
severity
medium

What does ZopNight detect here?

ZopNight is built to flag an AKS cluster when no diagnostic setting sends any of the `kube-apiserver`, `kube-audit`, `kube-audit-admin` or `kube-controller-manager` log categories to a destination, but its current data source returns no diagnostic settings, so it raises no findings yet. Azure keeps none of these logs until a diagnostic setting exists.

Signal and threshold

How ZopNight evaluates AKS clusters with no diagnostic setting collecting control-plane logs.
Field Value
Rule IDsRC-1355
Categorycompliance
Severitymedium
Metricnone — pure configuration read
Thresholdno enabled control-plane log category
SourceZopNight
Permissions usedMicrosoft.ContainerService/managedClusters/read · Microsoft.Insights/DiagnosticSettings/Read

Control-plane logs do not exist until you ask for them

The Kubernetes API server, audit log and controller manager run in the AKS-managed control plane, where you cannot install an agent. Their logs are exposed as Azure resource logs, and Microsoft’s AKS monitoring guide states that resource logs are not collected or stored until you create a diagnostic setting that routes them somewhere: a Log Analytics workspace, a storage account or Event Hubs.

Without one, there is no record of who called the API server, which service account deleted a deployment, or when an admission failure started. Incident response starts blind.

Checking a cluster’s diagnostic settings

Terminal window
AKS_ID=$(az aks show --resource-group my-rg --name my-aks --query id -o tsv)
az monitor diagnostic-settings list --resource "$AKS_ID"

An empty list, or settings whose logs entries are all disabled, means no control-plane log is being kept.

Four log categories count as coverage

ZopNight looks for a diagnostic setting on the cluster with at least one of these categories enabled: kube-apiserver, kube-audit, kube-audit-admin or kube-controller-manager. Any one of them clears the cluster. The finding fires only when Azure’s diagnostic settings data shows none enabled; it is a configuration read with no metric or window.

When the check stays quiet

A cluster whose diagnostic-setting state ZopNight could not read is treated as unknown and is not flagged. In practice that is every cluster today: ZopNight reads diagnostic settings through Azure Resource Graph, which does not return them, so the rule raises no findings until a direct listing of each cluster’s settings is added. The az monitor diagnostic-settings list command above is the reliable check meanwhile. Tags on the cluster claiming logging is on are ignored, because a tag proves nothing about what Azure is actually collecting. Settings that enable only other AKS log categories do not count as control-plane coverage here.

The cost trade-off runs the other way

This compliance rule claims no saving, and fixing it adds a bill. Microsoft warns that collecting AKS resource logs can be expensive, particularly kube-audit, and resource logs carry Log Analytics ingestion and retention charges. Its advice is to prefer kube-audit-admin, which excludes get and list events, and to disable kube-audit when it is not required.

Turning on control-plane logging

  1. Pick or create a Log Analytics workspace for the cluster’s region.
  2. Create a diagnostic setting with the categories you need:
Terminal window
az monitor diagnostic-settings create --name aks-control-plane \
--resource "$AKS_ID" --workspace my-law-workspace \
--logs '[{"category":"kube-apiserver","enabled":true},{"category":"kube-audit-admin","enabled":true},{"category":"kube-controller-manager","enabled":true}]'
  1. Confirm the cluster shows the setting; Microsoft notes the CLI does not check provisioning state, so verify after the change.
  2. Query the AzureDiagnostics table (or resource-specific tables) to see records arriving.

For node and pod telemetry, which is separate from these logs, see AKS Cluster Monitoring Not Enabled.

See it fire on your bill.

Connect an account read-only. The first findings land in minutes.

472 rule families across 353 resource types on 22 platforms. Every threshold, metric, and IAM action is documented on these pages before you grant anything.

472 rule families documented
353 resource types covered
read-only default access level
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·