Skip to content

Commit

Permalink
Adding necessary view only permissions for GCP CSPM in order to view …
Browse files Browse the repository at this point in the history
…cloud functions and their builds (#27)
  • Loading branch information
miguelpais authored Apr 29, 2024
1 parent 9d48337 commit a575ed2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/services/service-principal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "google_project_iam_member" "browser" {
# role permissions for CSPM (GCP Predefined Roles for Sysdig Cloud Secure Posture Management)
#---------------------------------------------------------------------------------------------
resource "google_project_iam_member" "cspm" {
for_each = var.is_organizational ? [] : toset(["roles/cloudasset.viewer", "roles/iam.serviceAccountTokenCreator", "roles/logging.viewer"])
for_each = var.is_organizational ? [] : toset(["roles/cloudasset.viewer", "roles/iam.serviceAccountTokenCreator", "roles/logging.viewer", "roles/cloudfunctions.viewer", "roles/cloudbuild.builds.viewer"])

project = var.project_id
role = each.key
Expand Down
2 changes: 1 addition & 1 deletion modules/services/service-principal/organizational.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "google_organization_iam_member" "browser" {
# role permissions for CSPM (GCP Predefined Roles for Sysdig Cloud Secure Posture Management)
#---------------------------------------------------------------------------------------------
resource "google_organization_iam_member" "cspm" {
for_each = var.is_organizational ? toset(["roles/cloudasset.viewer", "roles/iam.serviceAccountTokenCreator", "roles/logging.viewer"]) : []
for_each = var.is_organizational ? toset(["roles/cloudasset.viewer", "roles/iam.serviceAccountTokenCreator", "roles/logging.viewer", "roles/cloudfunctions.viewer", "roles/cloudbuild.builds.viewer"]) : []

org_id = data.google_organization.org[0].org_id
role = each.key
Expand Down

0 comments on commit a575ed2

Please sign in to comment.