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

[sync] Add detection of iam.serviceAccountKeys.create event (#53) #1074

Merged
merged 1 commit into from
Jan 30, 2024
Merged
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
57 changes: 57 additions & 0 deletions rules/gcp_audit_rules/gcp_iam_service_account_key_create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
AnalysisType: rule
RuleID: "GCP iam.serviceAccountKeys.create"
DisplayName: "GCP.Iam.ServiceAccountKeys.Create"
Description: "If your user is assigned a custom IAM role, then iam.roles.update will allow you to update the “includedPermissons” on that role. Because it is assigned to you, you will gain the additional privileges, which could be anything you desire."
Enabled: true
LogTypes:
- GCP.AuditLog
Severity: High
DedupPeriodMinutes: 60
Threshold: 1
Reference: https://rhinosecuritylabs.com/gcp/privilege-escalation-google-cloud-platform-part-1/
Reports:
MITRE ATT&CK:
- TA0004:T1548
Detection:
- All:
- KeyPath: protoPayload.authorizationInfo[*].granted
Condition: Contains
Value: true
- KeyPath: protoPayload.authorizationInfo[*].permission
Condition: Contains
Value: iam.serviceAccountKeys.create
Tests:
- Name: privilege-escalation
ExpectedResult: true
Log:
protoPayload:
authorizationInfo:
- granted: true
permission: iam.serviceAccountKeys.create
methodName: v2.deploymentmanager.deployments.insert
serviceName: deploymentmanager.googleapis.com
receiveTimestamp: "2024-01-19 13:47:19.465856238"
resource:
labels:
name: test-vm-deployment
project_id: panther-threat-research
type: deployment
severity: NOTICE
timestamp: "2024-01-19 13:47:18.279921000"
- Name: fail
ExpectedResult: false
Log:
protoPayload:
authorizationInfo:
- granted: false
permission: iam.serviceAccountKeys.create
methodName: v2.deploymentmanager.deployments.insert
serviceName: deploymentmanager.googleapis.com
receiveTimestamp: "2024-01-19 13:47:19.465856238"
resource:
labels:
name: test-vm-deployment
project_id: panther-threat-research
type: deployment
severity: NOTICE
timestamp: "2024-01-19 13:47:18.279921000"
Loading