iac.htora.dev · security templates

Home/For responders/Containers on AKS and OKE

Containers on AKS and OKE

AKS and OKE run the same Kubernetes as GKE and EKS. The differences that matter in an incident are what the cluster records, what a pod can reach on its node, and what can remove the node before you have its disks.

Side by side

AKSOKE
Cluster audit logNothing kept until you add a diagnostic setting. kube-audit (table AKSAudit) has every request; kube-audit-admin (AKSAuditAdmin) leaves out get and listChanges are in the OCI Audit service, under OKE API Server Admin Access, for 365 days. Oracle does not say whether reads are recorded
kubectl execIn AKSAudit on the exec subresource. kubectl 1.31 and later opens exec as a get over a WebSocket, which kube-audit-admin leaves outNot documented. Exec into a test pod and search Audit before you rely on it
A pod's cloud identityWorkload ID: a federated credential whose subject is system:serviceaccount:<namespace>:<name>. Sign-ins carry FederatedCredentialId. The pod-managed identity add-on has been out of support since September 2025Workload identity, on enhanced clusters, through the OCI SDK: policies match request.principal.type = 'workload' with the namespace, service account, and cluster
The node's own identityEvery pod can reach the instance metadata endpoint by default. IMDS restriction, in preview, blocks pods that are not on the host networkEvery pod can reach the node's instance principal certificates by default. Oracle's fix is a default-deny network policy
Node operating systemUbuntu by default on Standard, or Azure Linux. kubectl debug node/<node> starts a privileged pod with the host at /host; SSH is as azureuserOracle Linux, with CRI-O and crictl. SSH as opc only if a key was set when the node pool was created, usually through the Bastion service
What removes a nodeThe cluster autoscaler, node auto-provisioning, auto-repair, node image upgrades (weekly by default), and Spot evictionThe cluster autoscaler, node cycling, scaling the pool down, preemptible capacity being reclaimed, and a manual reboot or boot volume replacement through the OKE or Kubernetes API. No automatic repair is documented
Keeping a nodeThe autoscaler annotation, karpenter.sh/do-not-disrupt for node auto-provisioning, and a cordon. AKS does not support changes in the node resource group, so there is no protection on the VM itselfThe autoscaler annotation and a cordon. OCI has no termination protection, so ask the platform team to pause node pool changes
The node's disksOS disks are ephemeral by default where the VM size allows it, and cannot be snapshotted. Managed data disks, persistent volumes included, canBoot and block volume backups, crash-consistent while the node runs. Persistent volumes from oci-bv are deleted with their claim by default
Managed runtime detectionDefender for Containers, with a sensor on each node. Defender XDR adds Isolate pod, Restrict pod access, and Terminate pod, in previewCloud Guard's container checks cover configuration on enhanced clusters. No runtime detection inside containers is documented; Falco fills the gap

Responding on AKS

  1. Record the pod and its logs. Annotate the node for the cluster autoscaler and, if the cluster uses node auto-provisioning, with karpenter.sh/do-not-disrupt.
  2. Cordon the node. Do not cut the node itself off the network: a node that stops reporting Ready for about 10 minutes is rebooted, then reimaged, which erases an ephemeral OS disk.
  3. Snapshot every managed disk on the node into a resource group of your own. A snapshot left in the node resource group is deleted with the cluster.
  4. Label the pod for quarantine. If the node's OS disk was ephemeral, anything the attacker wrote outside a volume survives only as long as the node. Investigate on it now with kubectl debug node, knowing that the debugging pod is itself a change.

Switch on kube-audit before an incident. kube-audit-admin is cheaper, and it misses exec from current kubectl and every read of a secret.

Responding on OKE

  1. Record the pod and its logs, annotate the node for the autoscaler, and cordon it.
  2. Tell whoever manages the node pool to pause every change, including node reboots. Node cycling and boot volume replacement both remove the evidence.
  3. Back up the boot volume and every attached block volume, persistent volumes included, with the incident in a tag.
  4. Label the pod for quarantine. The quarantine policy denies all egress, which also stops the pod reaching the metadata endpoint and its node's instance principal.

Every pod on an OKE node can act as that node unless you block it. Look for the node's instance OCID in Audit calls made after the compromise.

When you cannot reach the node

ModeWhat you loseWhat to rely on
AKS virtual nodesThe node. Pods run in Azure Container Instances, with no VM or disk of yoursThe pod's record and logs, the audit log, and logs the application ships
AKS AutomaticSSH to nodes through Entra ID, which Automatic does not support, and changes in the node resource group, which a deny assignment locks. Deployment safeguards enforce the baseline Pod Security Standard, which refuses the privileged, host-namespace pods node debugging uses, outside excluded namespacesThe pod's record and logs, Container insights, which is on by default, and Defender for Containers
OKE virtual nodesThe node, exec, ephemeral containers, and follow-mode logs. Persistent volumes can only be File Storagekubectl logs and kubectl logs -p, the pod's record, and Audit

Templates for this

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.