-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65f066a
commit 449059c
Showing
13 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package cloud_sql_connect | ||
|
||
violation[{"msg": msg, "details": {"project": project, "actor": actor, "instance": instance}}] { | ||
input.protoPayload.methodName == "cloudsql.instances.connect" | ||
|
||
project = input.resource.labels.project_id | ||
project == "example" | ||
|
||
instance = input.resource.labels.database_id | ||
|
||
actor = input.protoPayload.authenticationInfo.principalEmail | ||
actor != "[email protected]" | ||
|
||
msg = "unexpected connection to cloudsql instance" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package firewall_rule_created | ||
|
||
violation[{"msg": msg, "details": {"project": project, "actor": actor, "name": name}}] { | ||
input.protoPayload.request["@type"] == "type.googleapis.com/compute.firewalls.insert" | ||
|
||
project = input.resource.labels.project_id | ||
name = input.protoPayload.request.name | ||
actor = input.protoPayload.authenticationInfo.principalEmail | ||
|
||
msg = "firewall rule created" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package gke_rbac_deny | ||
|
||
violation[{"msg": msg, "details": {"cluster": cluster, "actor": actor, "method": method}}] { | ||
input.labels["authorization.k8s.io/decision"] == "deny" | ||
|
||
project = input.resource.labels.project_id | ||
actor = input.protoPayload.authenticationInfo.principalEmail | ||
cluster = input.resource.labels.cluster_name | ||
method = input.protoPayload.methodName | ||
|
||
msg = "GKE RBAC deny" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package service_account_keys | ||
|
||
violation[{"msg": msg, "details": {"actor": actor, "service_account": svcAcct}}] { | ||
input.protoPayload.methodName == "google.iam.admin.v1.CreateServiceAccountKey" | ||
|
||
svcAcct = input.resource.labels.email_id | ||
actor = input.protoPayload.authenticationInfo.principalEmail | ||
|
||
msg = "service account key created" | ||
} |
File renamed without changes.