Detection rules › Panther
GCP K8s Pod Attached To Node Host Network
This detection monitor for the creation of pods which are attached to the host's network. This allows a pod to listen to all network traffic for all deployed computer on that particular node and communicate with other compute on the network namespace. Attackers can use this to capture secrets passed in arguments or connections.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | T1611 Escape to Host |
Rules detecting the same action
Other rules on this platform that filter on the same API call or operation.
Rule body yaml
AnalysisType: rule
RuleID: "GCP.K8s.Pod.Attached.To.Node.Host.Network"
DisplayName: "GCP K8s Pod Attached To Node Host Network"
Enabled: false
Status: Deprecated
Filename: gcp_k8s_pod_attached_to_node_host_network.py
LogTypes:
- GCP.AuditLog
Tags:
- Deprecated
- GCP
- Optional
Severity: Medium
Description:
This detection monitor for the creation of pods which are attached to the host's network.
This allows a pod to listen to all network traffic for all deployed computer on that particular node and
communicate with other compute on the network namespace. Attackers can use this to capture secrets passed in
arguments or connections.
Reports:
MITRE ATT&CK:
- TA0004:T1611 # Escape to Host
Runbook:
Investigate a reason of creating a pod which is attached to the host's network. Advise that it is discouraged
practice. Create ticket if appropriate.
Reference: https://medium.com/snowflake/from-logs-to-detection-using-snowflake-and-panther-to-detect-k8s-threats-d72f70a504d7
Tests:
- Name: triggers
ExpectedResult: true
Log:
{
"authorizationInfo":
[
{
"granted": true,
"permission": "io.k8s.core.v1.pods.create",
"resource": "core/v1/namespaces/default/pods/nginx-test",
},
],
"protoPayload":
{
"methodName": "io.k8s.core.v1.pods.create",
"request": { "spec": { "hostNetwork": true } },
},
}
- Name: ignore
ExpectedResult: false
Log:
{
"authorizationInfo":
[
{
"granted": true,
"permission": "io.k8s.core.v1.pods.create",
"resource": "core/v1/namespaces/default/pods/nginx-test",
},
],
"protoPayload":
{
"methodName": "io.k8s.core.v1.pods.create",
"request": { "spec": { "hostNetwork": false } },
},
}
Detection logic
Condition
protoPayload.methodName in ["io.k8s.core.v1.pods.create", "io.k8s.core.v1.pods.update", "io.k8s.core.v1.pods.patch"]
protoPayload.request.spec.hostNetwork eq "True"
not (protoPayload.authenticationInfo.principalEmail is_not_null and (protoPayload.authenticationInfo.principalEmail starts_with "system:kube-controller-manager" or protoPayload.authenticationInfo.principalEmail starts_with "system:kube-scheduler" or protoPayload.authenticationInfo.principalEmail starts_with "system:addon-manager" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:kube-system:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:kube-public:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:kube-node-lease:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:gke-system:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:gke-managed-system:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:gmp-system:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:gmp-public:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:config-management-system:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:istio-system:" or protoPayload.authenticationInfo.principalEmail starts_with "system:serviceaccount:asm-system:"))
protoPayload.resourceName not is_not_null
This rule also runs imperative logic the parser cannot express as a filter; the conditions above are the structured part it could extract.
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
protoPayload.authenticationInfo.principalEmail | starts_with | system:addon-manager |
protoPayload.authenticationInfo.principalEmail | starts_with | system:kube-controller-manager |
protoPayload.authenticationInfo.principalEmail | starts_with | system:kube-scheduler |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:asm-system: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:config-management-system: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:gke-managed-system: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:gke-system: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:gmp-public: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:gmp-system: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:istio-system: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:kube-node-lease: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:kube-public: |
protoPayload.authenticationInfo.principalEmail | starts_with | system:serviceaccount:kube-system: |
protoPayload.authenticationInfo.principalEmail | is_not_null | |
protoPayload.resourceName | is_not_null |
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
protoPayload.methodName | in |
|
protoPayload.request.spec.hostNetwork | eq |
|
Output fields
Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.
| Field | Source |
|---|---|
project | resource.labels.project_id |
principal | protoPayload.authenticationInfo.principalEmail |
caller_ip | protoPayload.requestMetadata.callerIP |
methodName | protoPayload.methodName |
resourceName | protoPayload.resourceName |
serviceName | protoPayload.serviceName |