DaemonSets
| Operation | Description | Sample | Rule |
|---|---|---|---|
| get-daemonsets | Y | Y | |
| list-daemonsets | Y | Y | |
| watch-daemonsets | Y | Y | |
| create-daemonsets | DaemonSet created (runs on every node; used for lateral movement / persistence). | Y | Y |
| update-daemonsets | Y | Y | |
| patch-daemonsets | DaemonSet patched (sidecar injection or workload modification). | Y | Y |
| delete-daemonsets | Y | N | |
| deletecollection-daemonsets | Y | N | |
| get-daemonsets-status | Y | N | |
| update-daemonsets-status | Y | N | |
| patch-daemonsets-status | Y | N | |
| any-daemonsets | Synthetic aggregation for rules that filter the daemonsets resource with no specific verb. Not a distinct audit record; hosts rule listings that key on objectRef.resource alone. | N | N |
get daemonsets
#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/daemonsets/dw-harn-daemonsets",
"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": "daemonsets",
"namespace": "dw-harn",
"name": "dw-harn-daemonsets",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T04:47:28.833154Z",
"stageTimestamp": "2026-07-02T04:47:28.834546Z",
"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-daemonsets: list daemonsets, watch-daemonsets: watch daemonsets, create-daemonsets: create daemonsets, update-daemonsets: update daemonsets, patch-daemonsets: patch daemonsets 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 daemonsets
#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/daemonsets?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": "daemonsets",
"namespace": "dw-harn",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T04:47:28.960798Z",
"stageTimestamp": "2026-07-02T04:47:28.962651Z",
"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-daemonsets: get daemonsets, watch-daemonsets: watch daemonsets, create-daemonsets: create daemonsets, update-daemonsets: update daemonsets, patch-daemonsets: patch daemonsets 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 daemonsets
#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/daemonsets?resourceVersion=1518&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": "daemonsets",
"namespace": "dw-harn",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T04:47:28.963708Z",
"stageTimestamp": "2026-07-02T04:47:31.964663Z",
"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-daemonsets: get daemonsets, list-daemonsets: list daemonsets, create-daemonsets: create daemonsets, update-daemonsets: update daemonsets, patch-daemonsets: patch daemonsets 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 daemonsets
#Description
DaemonSet created (runs on every node; used for lateral movement / persistence).
Example Audit Event #
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "0030660c-9015-41ea-8400-922acaaa25fe",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/kube-system/daemonsets?fieldManager=kubectl-client-side-apply&fieldValidation=Strict",
"verb": "create",
"user": {
"username": "kubernetes-admin",
"uid": "aws-iam-authenticator",
"groups": [
"system:masters",
"system:authenticated"
]
},
"sourceIPs": [
"203.0.113.10"
],
"userAgent": "kubectl/v1.27.2 (darwin/arm64) kubernetes/7f6f68f",
"objectRef": {
"resource": "daemonsets",
"namespace": "kube-system",
"name": "fluentd-elasticsearch",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 201
},
"requestObject": {
"kind": "DaemonSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "fluentd-elasticsearch",
"namespace": "kube-system",
"creationTimestamp": null,
"labels": {
"k8s-app": "fluentd-logging"
},
"annotations": {
"deprecated.daemonset.template.generation": "0",
"kubectl.kubernetes.io/last-applied-configuration": {
"apiVersion": "apps/v1",
"kind": "DaemonSet",
"metadata": {
"annotations": {},
"labels": {
"k8s-app": "fluentd-logging"
},
"name": "fluentd-elasticsearch",
"namespace": "kube-system"
},
"spec": {
"selector": {
"matchLabels": {
"name": "fluentd-elasticsearch"
}
},
"template": {
"metadata": {
"labels": {
"name": "fluentd-elasticsearch"
}
},
"spec": {
"containers": [
{
"image": "quay.io/fluentd_elasticsearch/fluentd:v2.5.2",
"name": "fluentd-elasticsearch",
"resources": {
"limits": {
"memory": "200Mi"
},
"requests": {
"cpu": "100m",
"memory": "200Mi"
}
},
"volumeMounts": [
{
"mountPath": "/var/log",
"name": "varlog"
}
]
}
],
"terminationGracePeriodSeconds": 30,
"tolerations": [
{
"effect": "NoSchedule",
"key": "node-role.kubernetes.io/control-plane",
"operator": "Exists"
},
{
"effect": "NoSchedule",
"key": "node-role.kubernetes.io/master",
"operator": "Exists"
}
],
"volumes": [
{
"hostPath": {
"path": "/var/log"
},
"name": "varlog"
}
]
}
}
}
}
}
},
"spec": {
"selector": {
"matchLabels": {
"name": "fluentd-elasticsearch"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"name": "fluentd-elasticsearch"
}
},
"spec": {
"volumes": [
{
"name": "varlog",
"hostPath": {
"path": "/var/log",
"type": ""
}
}
],
"containers": [
{
"name": "fluentd-elasticsearch",
"image": "quay.io/fluentd_elasticsearch/fluentd:v2.5.2",
"resources": {
"limits": {
"memory": "200Mi"
},
"requests": {
"cpu": "100m",
"memory": "200Mi"
}
},
"volumeMounts": [
{
"name": "varlog",
"mountPath": "/var/log"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node-role.kubernetes.io/control-plane",
"operator": "Exists",
"effect": "NoSchedule"
},
{
"key": "node-role.kubernetes.io/master",
"operator": "Exists",
"effect": "NoSchedule"
}
]
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 0,
"numberMisscheduled": 0,
"desiredNumberScheduled": 0,
"numberReady": 0
}
},
"responseObject": {
"kind": "DaemonSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "fluentd-elasticsearch",
"namespace": "kube-system",
"uid": "29198900-9b6a-4d5c-b518-dd3c8f792ca3",
"resourceVersion": "2798981",
"generation": 1,
"creationTimestamp": "2023-12-14T12:00:14Z",
"labels": {
"k8s-app": "fluentd-logging"
},
"annotations": {
"deprecated.daemonset.template.generation": "1",
"kubectl.kubernetes.io/last-applied-configuration": {
"apiVersion": "apps/v1",
"kind": "DaemonSet",
"metadata": {
"annotations": {},
"labels": {
"k8s-app": "fluentd-logging"
},
"name": "fluentd-elasticsearch",
"namespace": "kube-system"
},
"spec": {
"selector": {
"matchLabels": {
"name": "fluentd-elasticsearch"
}
},
"template": {
"metadata": {
"labels": {
"name": "fluentd-elasticsearch"
}
},
"spec": {
"containers": [
{
"image": "quay.io/fluentd_elasticsearch/fluentd:v2.5.2",
"name": "fluentd-elasticsearch",
"resources": {
"limits": {
"memory": "200Mi"
},
"requests": {
"cpu": "100m",
"memory": "200Mi"
}
},
"volumeMounts": [
{
"mountPath": "/var/log",
"name": "varlog"
}
]
}
],
"terminationGracePeriodSeconds": 30,
"tolerations": [
{
"effect": "NoSchedule",
"key": "node-role.kubernetes.io/control-plane",
"operator": "Exists"
},
{
"effect": "NoSchedule",
"key": "node-role.kubernetes.io/master",
"operator": "Exists"
}
],
"volumes": [
{
"hostPath": {
"path": "/var/log"
},
"name": "varlog"
}
]
}
}
}
}
}
},
"spec": {
"selector": {
"matchLabels": {
"name": "fluentd-elasticsearch"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"name": "fluentd-elasticsearch"
}
},
"spec": {
"volumes": [
{
"name": "varlog",
"hostPath": {
"path": "/var/log",
"type": ""
}
}
],
"containers": [
{
"name": "fluentd-elasticsearch",
"image": "quay.io/fluentd_elasticsearch/fluentd:v2.5.2",
"resources": {
"limits": {
"memory": "200Mi"
},
"requests": {
"cpu": "100m",
"memory": "200Mi"
}
},
"volumeMounts": [
{
"name": "varlog",
"mountPath": "/var/log"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node-role.kubernetes.io/control-plane",
"operator": "Exists",
"effect": "NoSchedule"
},
{
"key": "node-role.kubernetes.io/master",
"operator": "Exists",
"effect": "NoSchedule"
}
]
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 0,
"numberMisscheduled": 0,
"desiredNumberScheduled": 0,
"numberReady": 0
}
},
"requestReceivedTimestamp": "2023-12-14T12:00:14.969470Z",
"stageTimestamp": "2023-12-14T12:00:14.981816Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": ""
}
}
Common Indicators #
Field/value combinations most frequently checked by detection rules targeting this event, derived from cross-vendor predicate analysis.
| Field | Kind | Value | Rules | Vendors |
|---|---|---|---|---|
kubernetes.audit.objectRef.resource (elastic rule field) | in | cronjobs | 3 rules | elastic |
kubernetes.audit.objectRef.resource (elastic rule field) | in | daemonsets | 3 rules | elastic |
kubernetes.audit.objectRef.resource (elastic rule field) | in | deployments | 3 rules | elastic |
verb | eq | create | 3 rules | panther, splunk |
EventType (elastic rule field) | in | io.k8s.apps.v1.daemonsets.create | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.apps.v1.daemonsets.patch | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.apps.v1.deployments.create | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.apps.v1.deployments.patch | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.batch.v1.cronjobs.create | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.batch.v1.cronjobs.patch | 2 rules | elastic |
client.user.email (elastic rule field) | is_not_null | | 2 rules | elastic |
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. This ES|QL rule correlates two successful GKE audit behaviors from the same This new-terms rule alerts on the first create or patch of a DaemonSet, Deployment, or CronJob from a new combination of Elastic #
T1059, T1059.004, T1069, T1087, T1609, T1610↳ also matches get-daemonsets: get daemonsets, list-daemonsets: list daemonsets, watch-daemonsets: watch daemonsets, update-daemonsets: update daemonsets, patch-daemonsets: patch daemonsets Investigation guide
Triage and analysis#
Investigating Direct Interactive Kubernetes API Request by Unusual Utilities#
Possible investigation steps#
False positive analysis#
Response and remediation#
T1098, T1098.006↳ also matches patch-daemonsets: patch daemonsets Investigation guide
Triage and analysis#
Investigating GKE Sensitive RBAC Change Followed by Workload Modification#
client.user.email within five minutes:escalate / bind / impersonate, secret read, or privileged API resources such as pods/exec and serviceaccounts/token)Esql.rbac_to_workload_minutes is the gap from the latest sensitive RBAC event to the earliest workload modification in the lookback window.Possible investigation steps#
Esql.event_action_values and Esql.gcp_audit_resource_name_values for the Role/ClusterRole and workload objects touched.Esql.user_agent_original_values and Esql.source_ip_values for unexpected clients or networks.False positive analysis#
Response and remediation#
T1098, T1098.006↳ also matches patch-daemonsets: patch daemonsets Investigation guide
Triage and analysis#
Investigating GKE Unusual Sensitive Workload Modification#
user_agent.original, source.ip, and client.user.email.Possible investigation steps#
False positive analysis#
Response and remediation#
Splunk #
T1204Panther #
T1543, T1610
References #
update daemonsets
#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/daemonsets/dw-harn-daemonsets?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": "daemonsets",
"namespace": "dw-harn",
"name": "dw-harn-daemonsets",
"uid": "00000000-0000-0000-0000-000000000000",
"apiGroup": "apps",
"apiVersion": "v1",
"resourceVersion": "680"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"kind": "DaemonSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-daemonsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "680",
"generation": 1,
"creationTimestamp": "2026-07-02T21:30:54Z",
"labels": {
"dw-harn-patched": "1"
},
"annotations": {
"deprecated.daemonset.template.generation": "1"
}
},
"spec": {
"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"
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 1,
"numberMisscheduled": 0,
"desiredNumberScheduled": 1,
"numberReady": 1,
"observedGeneration": 1,
"updatedNumberScheduled": 1,
"numberAvailable": 1
}
},
"responseObject": {
"kind": "DaemonSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-daemonsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "680",
"generation": 1,
"creationTimestamp": "2026-07-02T21:30:54Z",
"labels": {
"dw-harn-patched": "1"
},
"annotations": {
"deprecated.daemonset.template.generation": "1"
}
},
"spec": {
"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"
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 1,
"numberMisscheduled": 0,
"desiredNumberScheduled": 1,
"numberReady": 1,
"observedGeneration": 1,
"updatedNumberScheduled": 1,
"numberAvailable": 1
}
},
"requestReceivedTimestamp": "2026-07-02T21:30:58.166660Z",
"stageTimestamp": "2026-07-02T21:30:58.169978Z",
"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-daemonsets: get daemonsets, list-daemonsets: list daemonsets, watch-daemonsets: watch daemonsets, create-daemonsets: create daemonsets, patch-daemonsets: patch daemonsets 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 daemonsets
#Description
DaemonSet patched (sidecar injection or workload modification).
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/daemonsets/dw-harn-daemonsets?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": "daemonsets",
"namespace": "dw-harn",
"name": "dw-harn-daemonsets",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"metadata": {
"labels": {
"dw-harn-patched": "1"
}
}
},
"responseObject": {
"kind": "DaemonSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-daemonsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "1529",
"generation": 1,
"creationTimestamp": "2026-07-02T04:47:28Z",
"labels": {
"dw-harn-patched": "1"
},
"annotations": {
"deprecated.daemonset.template.generation": "1"
}
},
"spec": {
"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"
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 1,
"numberMisscheduled": 0,
"desiredNumberScheduled": 1,
"numberReady": 1,
"observedGeneration": 1,
"updatedNumberScheduled": 1,
"numberAvailable": 1
}
},
"requestReceivedTimestamp": "2026-07-02T04:47:32.064200Z",
"stageTimestamp": "2026-07-02T04:47:32.069404Z",
"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\""
}
}
Common Indicators #
Field/value combinations most frequently checked by detection rules targeting this event, derived from cross-vendor predicate analysis.
| Field | Kind | Value | Rules | Vendors |
|---|---|---|---|---|
kubernetes.audit.objectRef.resource (elastic rule field) | in | cronjobs | 3 rules | elastic |
kubernetes.audit.objectRef.resource (elastic rule field) | in | daemonsets | 3 rules | elastic |
kubernetes.audit.objectRef.resource (elastic rule field) | in | deployments | 3 rules | elastic |
EventType (elastic rule field) | in | io.k8s.apps.v1.daemonsets.create | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.apps.v1.daemonsets.patch | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.apps.v1.deployments.create | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.apps.v1.deployments.patch | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.batch.v1.cronjobs.create | 2 rules | elastic |
EventType (elastic rule field) | in | io.k8s.batch.v1.cronjobs.patch | 2 rules | elastic |
client.user.email (elastic rule field) | is_not_null | | 2 rules | elastic |
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. This ES|QL rule correlates two successful GKE audit behaviors from the same This new-terms rule alerts on the first create or patch of a DaemonSet, Deployment, or CronJob from a new combination of Elastic #
T1059, T1059.004, T1069, T1087, T1609, T1610↳ also matches get-daemonsets: get daemonsets, list-daemonsets: list daemonsets, watch-daemonsets: watch daemonsets, create-daemonsets: create daemonsets, update-daemonsets: update daemonsets Investigation guide
Triage and analysis#
Investigating Direct Interactive Kubernetes API Request by Unusual Utilities#
Possible investigation steps#
False positive analysis#
Response and remediation#
T1098, T1098.006↳ also matches create-daemonsets: create daemonsets Investigation guide
Triage and analysis#
Investigating GKE Sensitive RBAC Change Followed by Workload Modification#
client.user.email within five minutes:escalate / bind / impersonate, secret read, or privileged API resources such as pods/exec and serviceaccounts/token)Esql.rbac_to_workload_minutes is the gap from the latest sensitive RBAC event to the earliest workload modification in the lookback window.Possible investigation steps#
Esql.event_action_values and Esql.gcp_audit_resource_name_values for the Role/ClusterRole and workload objects touched.Esql.user_agent_original_values and Esql.source_ip_values for unexpected clients or networks.False positive analysis#
Response and remediation#
T1098, T1098.006↳ also matches create-daemonsets: create daemonsets Investigation guide
Triage and analysis#
Investigating GKE Unusual Sensitive Workload Modification#
user_agent.original, source.ip, and client.user.email.Possible investigation steps#
False positive analysis#
Response and remediation#
References #
delete daemonsets
#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/daemonsets/dw-harn-daemonsets",
"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": "daemonsets",
"namespace": "dw-harn",
"name": "dw-harn-daemonsets",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"status": "Success",
"details": {
"name": "dw-harn-daemonsets",
"group": "apps",
"kind": "daemonsets",
"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-daemonsets",
"group": "apps",
"kind": "daemonsets",
"uid": "00000000-0000-0000-0000-000000000000"
}
},
"requestReceivedTimestamp": "2026-07-02T04:47:32.186553Z",
"stageTimestamp": "2026-07-02T04:47:32.203107Z",
"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 daemonsets
#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/daemonsets?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": "daemonsets",
"namespace": "dw-harn",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"responseObject": {
"kind": "DaemonSetList",
"apiVersion": "apps/v1",
"metadata": {
"resourceVersion": "796"
},
"items": [
{
"metadata": {
"name": "dw-harn-daemonsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "794",
"generation": 1,
"creationTimestamp": "2026-07-02T23:12:56Z",
"labels": {
"dw-harn-patched": "1"
},
"annotations": {
"deprecated.daemonset.template.generation": "1"
}
},
"spec": {
"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"
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 1,
"numberMisscheduled": 0,
"desiredNumberScheduled": 1,
"numberReady": 1,
"observedGeneration": 1,
"updatedNumberScheduled": 1,
"numberAvailable": 1
}
}
]
},
"requestReceivedTimestamp": "2026-07-02T23:13:00.284529Z",
"stageTimestamp": "2026-07-02T23:13:00.290514Z",
"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 daemonsets/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/daemonsets/dw-harn-daemonsets/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": "daemonsets",
"namespace": "dw-harn",
"name": "dw-harn-daemonsets",
"apiGroup": "apps",
"apiVersion": "v1",
"subresource": "status"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-07-02T21:30:58.239770Z",
"stageTimestamp": "2026-07-02T21:30:58.241760Z",
"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 daemonsets/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/daemonsets/dw-harn-daemonsets/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": "daemonsets",
"namespace": "dw-harn",
"name": "dw-harn-daemonsets",
"uid": "00000000-0000-0000-0000-000000000000",
"apiGroup": "apps",
"apiVersion": "v1",
"resourceVersion": "680",
"subresource": "status"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"kind": "DaemonSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-daemonsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "680",
"generation": 1,
"creationTimestamp": "2026-07-02T21:30:54Z",
"labels": {
"dw-harn-patched": "1"
},
"annotations": {
"deprecated.daemonset.template.generation": "1"
}
},
"spec": {
"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"
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 1,
"numberMisscheduled": 0,
"desiredNumberScheduled": 1,
"numberReady": 1,
"observedGeneration": 1,
"updatedNumberScheduled": 1,
"numberAvailable": 1
}
},
"responseObject": {
"kind": "DaemonSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-daemonsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "680",
"generation": 1,
"creationTimestamp": "2026-07-02T21:30:54Z",
"labels": {
"dw-harn-patched": "1"
},
"annotations": {
"deprecated.daemonset.template.generation": "1"
}
},
"spec": {
"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"
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 1,
"numberMisscheduled": 0,
"desiredNumberScheduled": 1,
"numberReady": 1,
"observedGeneration": 1,
"updatedNumberScheduled": 1,
"numberAvailable": 1
}
},
"requestReceivedTimestamp": "2026-07-02T21:30:58.331530Z",
"stageTimestamp": "2026-07-02T21:30:58.335093Z",
"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 daemonsets/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/daemonsets/dw-harn-daemonsets/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": "daemonsets",
"namespace": "dw-harn",
"name": "dw-harn-daemonsets",
"apiGroup": "apps",
"apiVersion": "v1",
"subresource": "status"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {},
"responseObject": {
"kind": "DaemonSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "dw-harn-daemonsets",
"namespace": "dw-harn",
"uid": "00000000-0000-0000-0000-000000000000",
"resourceVersion": "710",
"generation": 1,
"creationTimestamp": "2026-07-02T22:17:36Z",
"labels": {
"dw-harn-patched": "1"
},
"annotations": {
"deprecated.daemonset.template.generation": "1"
}
},
"spec": {
"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"
}
},
"updateStrategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 0
}
},
"revisionHistoryLimit": 10
},
"status": {
"currentNumberScheduled": 1,
"numberMisscheduled": 0,
"desiredNumberScheduled": 1,
"numberReady": 1,
"observedGeneration": 1,
"updatedNumberScheduled": 1,
"numberAvailable": 1
}
},
"requestReceivedTimestamp": "2026-07-02T22:17:40.217296Z",
"stageTimestamp": "2026-07-02T22:17:40.220019Z",
"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 daemonsets (synthetic aggregation)
#Description
Synthetic aggregation for rules that filter the daemonsets resource with no specific verb. Not a distinct audit record; hosts rule listings that key on objectRef.resource alone.