StatefulSets
| Operation | Description | Sample | Rule |
|---|---|---|---|
| get-statefulsets | Y | Y | |
| list-statefulsets | Y | Y | |
| watch-statefulsets | Y | Y | |
| create-statefulsets | StatefulSet created (persistent workload identity; storage-backed lateral movement vector). | Y | Y |
| update-statefulsets | Y | Y | |
| patch-statefulsets | Y | Y | |
| delete-statefulsets | Y | N | |
| deletecollection-statefulsets | Y | N | |
| get-statefulsets-scale | Y | N | |
| update-statefulsets-scale | Y | N | |
| patch-statefulsets-scale | Y | N | |
| get-statefulsets-status | Y | N | |
| update-statefulsets-status | Y | N | |
| patch-statefulsets-status | Y | N | |
| any-statefulsets | Synthetic aggregation for rules that filter the statefulsets resource with no specific verb. Not a distinct audit record; hosts rule listings that key on objectRef.resource alone. | N | N |
get statefulsets
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "Metadata",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets",
"verb": "get",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=9bb0383c49b319fbf6b5ed61ab944378956d4292c784d32244ce2fa4dd846a3c"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T04:47:25.335113Z",
"stageTimestamp": "2026-07-02T04:47:25.336410Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
Detection Rules #
Full rule details for this event, including ATT&CK technique mappings and native queries → Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs. This rule detects interactive commands executed inside containers that use atypical utilities to hit the Kubernetes API, paired with near-simultaneous API activity on pods, secrets, service accounts, roles/bindings, or pod exec/attach/log/portforward. It surfaces hands-on-keyboard discovery and lateral movement using custom scripts that evade common tool allowlists; for example, an intruder opens a shell in a pod, uses Python to query the in-cluster API to list secrets, then triggers pods/exec to pivot into another workload.Elastic #
T1059, T1059.004, T1069, T1087, T1609, T1610↳ also matches list-statefulsets: list statefulsets, watch-statefulsets: watch statefulsets, create-statefulsets: create statefulsets, update-statefulsets: update statefulsets, patch-statefulsets: patch statefulsets Investigation guide
Triage and analysis#
Investigating Direct Interactive Kubernetes API Request by Unusual Utilities#
Possible investigation steps#
False positive analysis#
Response and remediation#
References #
list statefulsets
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "Metadata",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets?limit=500&timeout=3s",
"verb": "list",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=9bb0383c49b319fbf6b5ed61ab944378956d4292c784d32244ce2fa4dd846a3c"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T04:47:25.460830Z",
"stageTimestamp": "2026-07-02T04:47:25.462092Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
Detection Rules #
Full rule details for this event, including ATT&CK technique mappings and native queries → Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs. This rule detects interactive commands executed inside containers that use atypical utilities to hit the Kubernetes API, paired with near-simultaneous API activity on pods, secrets, service accounts, roles/bindings, or pod exec/attach/log/portforward. It surfaces hands-on-keyboard discovery and lateral movement using custom scripts that evade common tool allowlists; for example, an intruder opens a shell in a pod, uses Python to query the in-cluster API to list secrets, then triggers pods/exec to pivot into another workload.Elastic #
T1059, T1059.004, T1069, T1087, T1609, T1610↳ also matches get-statefulsets: get statefulsets, watch-statefulsets: watch statefulsets, create-statefulsets: create statefulsets, update-statefulsets: update statefulsets, patch-statefulsets: patch statefulsets Investigation guide
Triage and analysis#
Investigating Direct Interactive Kubernetes API Request by Unusual Utilities#
Possible investigation steps#
False positive analysis#
Response and remediation#
References #
watch statefulsets
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "Metadata",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets?resourceVersion=1495&timeout=3s&watch=true",
"verb": "watch",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=9bb0383c49b319fbf6b5ed61ab944378956d4292c784d32244ce2fa4dd846a3c"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T04:47:25.463116Z",
"stageTimestamp": "2026-07-02T04:47:28.465849Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
Detection Rules #
Full rule details for this event, including ATT&CK technique mappings and native queries → Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs. This rule detects interactive commands executed inside containers that use atypical utilities to hit the Kubernetes API, paired with near-simultaneous API activity on pods, secrets, service accounts, roles/bindings, or pod exec/attach/log/portforward. It surfaces hands-on-keyboard discovery and lateral movement using custom scripts that evade common tool allowlists; for example, an intruder opens a shell in a pod, uses Python to query the in-cluster API to list secrets, then triggers pods/exec to pivot into another workload.Elastic #
T1059, T1059.004, T1069, T1087, T1609, T1610↳ also matches get-statefulsets: get statefulsets, list-statefulsets: list statefulsets, create-statefulsets: create statefulsets, update-statefulsets: update statefulsets, patch-statefulsets: patch statefulsets Investigation guide
Triage and analysis#
Investigating Direct Interactive Kubernetes API Request by Unusual Utilities#
Possible investigation steps#
False positive analysis#
Response and remediation#
References #
create statefulsets
#Description
StatefulSet created (persistent workload identity; storage-backed lateral movement vector).
Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets?fieldManager=kubectl-create&fieldValidation=Strict",
"verb": "create",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=9bb0383c49b319fbf6b5ed61ab944378956d4292c784d32244ce2fa4dd846a3c"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 201
},
"requestObject": {
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"replicas": 0,
"availableReplicas": 0
}
},
"responseObject": {
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "1487",
"generation": 1,
"creationTimestamp": "2026-07-02T04:47:25Z"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"replicas": 0,
"availableReplicas": 0
}
},
"requestReceivedTimestamp": "2026-07-02T04:47:25.265455Z",
"stageTimestamp": "2026-07-02T04:47:25.269055Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
Detection Rules #
Full rule details for this event, including ATT&CK technique mappings and native queries → Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs. This rule detects interactive commands executed inside containers that use atypical utilities to hit the Kubernetes API, paired with near-simultaneous API activity on pods, secrets, service accounts, roles/bindings, or pod exec/attach/log/portforward. It surfaces hands-on-keyboard discovery and lateral movement using custom scripts that evade common tool allowlists; for example, an intruder opens a shell in a pod, uses Python to query the in-cluster API to list secrets, then triggers pods/exec to pivot into another workload.Elastic #
T1059, T1059.004, T1069, T1087, T1609, T1610↳ also matches get-statefulsets: get statefulsets, list-statefulsets: list statefulsets, watch-statefulsets: watch statefulsets, update-statefulsets: update statefulsets, patch-statefulsets: patch statefulsets Investigation guide
Triage and analysis#
Investigating Direct Interactive Kubernetes API Request by Unusual Utilities#
Possible investigation steps#
False positive analysis#
Response and remediation#
References #
update statefulsets
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets?fieldManager=kubectl-replace&fieldValidation=Strict",
"verb": "update",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=4cf95d11cbd90036bab41cdc6b88cc8f91550e9135ed4bb61495b02f647812ff"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"uid": "00000000-0000-0000-0000-000000000000",
"apiGroup": "apps",
"apiVersion": "v1",
"resourceVersion": "652"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "652",
"generation": 1,
"creationTimestamp": "2026-07-02T21:30:50Z",
"labels": {
"dw-harn-patched": "1"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"readyReplicas": 1,
"currentReplicas": 1,
"updatedReplicas": 1,
"currentRevision": "dw-harn-statefulsets-fbf9f7467",
"updateRevision": "dw-harn-statefulsets-fbf9f7467",
"collisionCount": 0,
"availableReplicas": 1
}
},
"responseObject": {
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "652",
"generation": 1,
"creationTimestamp": "2026-07-02T21:30:50Z",
"labels": {
"dw-harn-patched": "1"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"readyReplicas": 1,
"currentReplicas": 1,
"updatedReplicas": 1,
"currentRevision": "dw-harn-statefulsets-fbf9f7467",
"updateRevision": "dw-harn-statefulsets-fbf9f7467",
"collisionCount": 0,
"availableReplicas": 1
}
},
"requestReceivedTimestamp": "2026-07-02T21:30:54.296086Z",
"stageTimestamp": "2026-07-02T21:30:54.299188Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
Detection Rules #
Full rule details for this event, including ATT&CK technique mappings and native queries → Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs. This rule detects interactive commands executed inside containers that use atypical utilities to hit the Kubernetes API, paired with near-simultaneous API activity on pods, secrets, service accounts, roles/bindings, or pod exec/attach/log/portforward. It surfaces hands-on-keyboard discovery and lateral movement using custom scripts that evade common tool allowlists; for example, an intruder opens a shell in a pod, uses Python to query the in-cluster API to list secrets, then triggers pods/exec to pivot into another workload.Elastic #
T1059, T1059.004, T1069, T1087, T1609, T1610↳ also matches get-statefulsets: get statefulsets, list-statefulsets: list statefulsets, watch-statefulsets: watch statefulsets, create-statefulsets: create statefulsets, patch-statefulsets: patch statefulsets Investigation guide
Triage and analysis#
Investigating Direct Interactive Kubernetes API Request by Unusual Utilities#
Possible investigation steps#
False positive analysis#
Response and remediation#
References #
patch statefulsets
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets?fieldManager=kubectl-patch",
"verb": "patch",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=9bb0383c49b319fbf6b5ed61ab944378956d4292c784d32244ce2fa4dd846a3c"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"metadata": {
"labels": {
"dw-harn-patched": "1"
}
}
},
"responseObject": {
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "1505",
"generation": 1,
"creationTimestamp": "2026-07-02T04:47:25Z",
"labels": {
"dw-harn-patched": "1"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"readyReplicas": 1,
"currentReplicas": 1,
"updatedReplicas": 1,
"currentRevision": "dw-harn-statefulsets-fbf9f7467",
"updateRevision": "dw-harn-statefulsets-fbf9f7467",
"collisionCount": 0,
"availableReplicas": 1
}
},
"requestReceivedTimestamp": "2026-07-02T04:47:28.534463Z",
"stageTimestamp": "2026-07-02T04:47:28.539431Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
Detection Rules #
Full rule details for this event, including ATT&CK technique mappings and native queries → Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs. This rule detects interactive commands executed inside containers that use atypical utilities to hit the Kubernetes API, paired with near-simultaneous API activity on pods, secrets, service accounts, roles/bindings, or pod exec/attach/log/portforward. It surfaces hands-on-keyboard discovery and lateral movement using custom scripts that evade common tool allowlists; for example, an intruder opens a shell in a pod, uses Python to query the in-cluster API to list secrets, then triggers pods/exec to pivot into another workload.Elastic #
T1059, T1059.004, T1069, T1087, T1609, T1610↳ also matches get-statefulsets: get statefulsets, list-statefulsets: list statefulsets, watch-statefulsets: watch statefulsets, create-statefulsets: create statefulsets, update-statefulsets: update statefulsets Investigation guide
Triage and analysis#
Investigating Direct Interactive Kubernetes API Request by Unusual Utilities#
Possible investigation steps#
False positive analysis#
Response and remediation#
References #
delete statefulsets
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets",
"verb": "delete",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=9bb0383c49b319fbf6b5ed61ab944378956d4292c784d32244ce2fa4dd846a3c"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"status": "Success",
"details": {
"name": "dw-harn-statefulsets",
"group": "apps",
"kind": "statefulsets",
"uid": "00000000-0000-0000-0000-000000000000"
},
"code": 200
},
"requestObject": {
"kind": "DeleteOptions",
"apiVersion": "meta.k8s.io/__internal",
"propagationPolicy": "Background"
},
"responseObject": {
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Success",
"details": {
"name": "dw-harn-statefulsets",
"group": "apps",
"kind": "statefulsets",
"uid": "00000000-0000-0000-0000-000000000000"
}
},
"requestReceivedTimestamp": "2026-07-02T04:47:28.600977Z",
"stageTimestamp": "2026-07-02T04:47:28.604726Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
References #
deletecollection statefulsets
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets?labelSelector=dw-harn-patched",
"verb": "deletecollection",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=3ffde68ef687218e01296d94b0aa59c81cc98de2bd73ab70e21510c8cd4b9cec"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"responseObject": {
"kind": "StatefulSetList",
"apiVersion": "apps/v1",
"metadata": {
"resourceVersion": "765"
},
"items": [
{
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "764",
"generation": 2,
"creationTimestamp": "2026-07-02T23:12:52Z",
"labels": {
"dw-harn-patched": "1"
}
},
"spec": {
"replicas": 2,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"observedGeneration": 2,
"replicas": 2,
"readyReplicas": 1,
"currentReplicas": 2,
"updatedReplicas": 2,
"currentRevision": "dw-harn-statefulsets-fbf9f7467",
"updateRevision": "dw-harn-statefulsets-fbf9f7467",
"collisionCount": 0,
"availableReplicas": 1
}
}
]
},
"requestReceivedTimestamp": "2026-07-02T23:12:56.321985Z",
"stageTimestamp": "2026-07-02T23:12:56.327121Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
References #
get statefulsets/scale
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "Metadata",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets/scale",
"verb": "get",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=fd038e49e5a46840f8f58360c3f09257f92bccd0cadad3ad68fcfec20b99b52c"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"apiGroup": "apps",
"apiVersion": "v1",
"subresource": "scale"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T22:12:07.402839Z",
"stageTimestamp": "2026-07-02T22:12:07.404702Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
References #
update statefulsets/scale
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets/scale",
"verb": "update",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=2f9bb39ae9e6831406f8ad02206bf46e69b5760f7adffe5feb860da290b80a7e"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"uid": "00000000-0000-0000-0000-000000000000",
"apiGroup": "apps",
"apiVersion": "v1",
"resourceVersion": "719",
"subresource": "scale"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"kind": "Scale",
"apiVersion": "autoscaling/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "719",
"creationTimestamp": "2026-07-03T00:14:23Z"
},
"spec": {
"replicas": 1
},
"status": {
"replicas": 1,
"selector": "app=dw-harn"
}
},
"responseObject": {
"kind": "Scale",
"apiVersion": "autoscaling/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "720",
"creationTimestamp": "2026-07-03T00:14:23Z"
},
"spec": {
"replicas": 1
},
"status": {
"replicas": 1,
"selector": "app=dw-harn"
}
},
"requestReceivedTimestamp": "2026-07-03T00:14:27.432010Z",
"stageTimestamp": "2026-07-03T00:14:27.438187Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
References #
patch statefulsets/scale
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets/scale",
"verb": "patch",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=fd038e49e5a46840f8f58360c3f09257f92bccd0cadad3ad68fcfec20b99b52c"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"apiGroup": "apps",
"apiVersion": "v1",
"subresource": "scale"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"spec": {
"replicas": 2
}
},
"responseObject": {
"kind": "Scale",
"apiVersion": "autoscaling/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "683",
"creationTimestamp": "2026-07-02T22:12:03Z"
},
"spec": {
"replicas": 2
},
"status": {
"replicas": 1,
"selector": "app=dw-harn"
}
},
"requestReceivedTimestamp": "2026-07-02T22:12:07.645817Z",
"stageTimestamp": "2026-07-02T22:12:07.654152Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
References #
get statefulsets/status
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "Metadata",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets/status",
"verb": "get",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=4cf95d11cbd90036bab41cdc6b88cc8f91550e9135ed4bb61495b02f647812ff"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"apiGroup": "apps",
"apiVersion": "v1",
"subresource": "status"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T21:30:54.363067Z",
"stageTimestamp": "2026-07-02T21:30:54.364675Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
References #
update statefulsets/status
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets/status?fieldManager=kubectl-replace&fieldValidation=Strict",
"verb": "update",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=4cf95d11cbd90036bab41cdc6b88cc8f91550e9135ed4bb61495b02f647812ff"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"uid": "00000000-0000-0000-0000-000000000000",
"apiGroup": "apps",
"apiVersion": "v1",
"resourceVersion": "652",
"subresource": "status"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "652",
"generation": 1,
"creationTimestamp": "2026-07-02T21:30:50Z",
"labels": {
"dw-harn-patched": "1"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"readyReplicas": 1,
"currentReplicas": 1,
"updatedReplicas": 1,
"currentRevision": "dw-harn-statefulsets-fbf9f7467",
"updateRevision": "dw-harn-statefulsets-fbf9f7467",
"collisionCount": 0,
"availableReplicas": 1
}
},
"responseObject": {
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "652",
"generation": 1,
"creationTimestamp": "2026-07-02T21:30:50Z",
"labels": {
"dw-harn-patched": "1"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"readyReplicas": 1,
"currentReplicas": 1,
"updatedReplicas": 1,
"currentRevision": "dw-harn-statefulsets-fbf9f7467",
"updateRevision": "dw-harn-statefulsets-fbf9f7467",
"collisionCount": 0,
"availableReplicas": 1
}
},
"requestReceivedTimestamp": "2026-07-02T21:30:54.454582Z",
"stageTimestamp": "2026-07-02T21:30:54.457773Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
References #
patch statefulsets/status
#Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "00000000-0000-0000-0000-000000000000",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/dw-harn/statefulsets/dw-harn-statefulsets/status?fieldManager=kubectl-patch",
"verb": "patch",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"X509SHA256=786fc563dbb253683c44d23d0aac3742ea61ade7f27a43f50934a82662e15409"
]
}
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.36.2 (linux/amd64) kubernetes/24e2b02",
"objectRef": {
"resource": "statefulsets",
"namespace": "dw-harn",
"name": "dw-harn-statefulsets",
"apiGroup": "apps",
"apiVersion": "v1",
"subresource": "status"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {},
"responseObject": {
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-statefulsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "674",
"generation": 1,
"creationTimestamp": "2026-07-02T22:17:32Z",
"labels": {
"dw-harn-patched": "1"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "dw-harn"
}
},
"template": {
"metadata": {
"labels": {
"app": "dw-harn"
}
},
"spec": {
"containers": [
{
"name": "c",
"image": "docker.io/library/busybox:1.36",
"command": [
"sh",
"-c",
"sleep 3600"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 0,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"serviceName": "dw-harn",
"podManagementPolicy": "OrderedReady",
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"partition": 0
}
},
"revisionHistoryLimit": 10,
"persistentVolumeClaimRetentionPolicy": {
"whenDeleted": "Retain",
"whenScaled": "Retain"
}
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"readyReplicas": 1,
"currentReplicas": 1,
"updatedReplicas": 1,
"currentRevision": "dw-harn-statefulsets-fbf9f7467",
"updateRevision": "dw-harn-statefulsets-fbf9f7467",
"collisionCount": 0,
"availableReplicas": 1
}
},
"requestReceivedTimestamp": "2026-07-02T22:17:35.920876Z",
"stageTimestamp": "2026-07-02T22:17:35.924061Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}
References #
any verb on statefulsets (synthetic aggregation)
#Description
Synthetic aggregation for rules that filter the statefulsets resource with no specific verb. Not a distinct audit record; hosts rule listings that key on objectRef.resource alone.