Skip to content

Commit

Permalink
SSPROD-48612: adding ciem roles to the cspm service account (#45)
Browse files Browse the repository at this point in the history
* SSPROD-48612: adding ciem roles to the cspm service account

* rm whiteline
  • Loading branch information
haresh-suresh authored Oct 24, 2024
1 parent 53574df commit 3814ac6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 2 additions & 1 deletion modules/config-posture/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ resource "google_iam_workload_identity_pool_provider" "posture_auth_pool_provide
# 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.workloadIdentityUser", "roles/logging.viewer", "roles/cloudfunctions.viewer", "roles/cloudbuild.builds.viewer", "roles/orgpolicy.policyViewer"])
# adding ciem role with permissions to the service account alongside cspm roles
for_each = var.is_organizational ? [] : toset(["roles/cloudasset.viewer", "roles/iam.workloadIdentityUser", "roles/logging.viewer", "roles/cloudfunctions.viewer", "roles/cloudbuild.builds.viewer", "roles/orgpolicy.policyViewer", "roles/recommender.viewer", "roles/iam.serviceAccountViewer", "roles/iam.roleViewer", "roles/container.clusterViewer", "roles/compute.viewer"])

project = var.project_id
role = each.key
Expand Down
9 changes: 0 additions & 9 deletions modules/integrations/pub-sub/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,6 @@ resource "google_service_account_iam_member" "custom_auth" {
member = "principalSet://iam.googleapis.com/projects/${data.google_project.project.number}/locations/global/workloadIdentityPools/${google_iam_workload_identity_pool.ingestion_auth_pool.workload_identity_pool_id}/attribute.aws_role/arn:aws:sts::${data.sysdig_secure_trusted_cloud_identity.trusted_identity.aws_account_id}:assumed-role/${data.sysdig_secure_trusted_cloud_identity.trusted_identity.aws_role_name}/${data.sysdig_secure_tenant_external_id.external_id.external_id}"
}

# adding ciem role with permissions to the service account
resource "google_project_iam_member" "identity_mgmt" {
for_each = var.is_organizational ? [] : toset(["roles/recommender.viewer", "roles/iam.serviceAccountViewer", "roles/iam.roleViewer", "roles/container.clusterViewer", "roles/compute.viewer"])

project = var.project_id
role = each.key
member = "serviceAccount:${google_service_account.push_auth.email}"
}

#-----------------------------------------------------------------------------------------------------------------------------------------
# Call Sysdig Backend to add the pub-sub integration to the Sysdig Cloud Account
#
Expand Down

0 comments on commit 3814ac6

Please sign in to comment.