Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP K8S tuning #1331

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ def title(event):
)


def dedup(event):
return deep_get(
event, "protoPayload", "authenticationInfo", "principalEmail", default="<ACTOR_NOT_FOUND>"
)


def alert_context(event):
context = gcp_alert_context(event)
volume_mount_path = deep_walk(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Reports:
- TA0001 # Initial Access
- TA0002 # Execution
Filename: gcp_k8s_pod_create_or_modify_host_path_vol_mount.py
DedupPeriodMinutes: 360
Tests:
- Name: Pod With Suspicious Volume Mount Created
ExpectedResult: true
Expand Down
6 changes: 6 additions & 0 deletions rules/gcp_k8s_rules/gcp_k8s_privileged_pod_created.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def title(event):
return f"[GCP]: [{actor}] created a privileged pod [{pod_name}] in project [{project_id}]"


def dedup(event):
return deep_get(
event, "protoPayload", "authenticationInfo", "principalEmail", default="<ACTOR_NOT_FOUND>"
)


def alert_context(event):
context = gcp_alert_context(event)
containers_info = deep_walk(event, "protoPayload", "response", "spec", "containers", default=[])
Expand Down
1 change: 1 addition & 0 deletions rules/gcp_k8s_rules/gcp_k8s_privileged_pod_created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Reference: https://www.golinuxcloud.com/kubernetes-privileged-pod-examples/
Reports:
MITRE ATT&CK:
- TA0004:T1548 # Abuse Elevation Control Mechanism
DedupPeriodMinutes: 360
Tests:
- Name: Privileged Pod Created
ExpectedResult: true
Expand Down
Loading