Skip to content

Commit

Permalink
feat: add iam.automaticIamGrantsForDefaultServiceAccounts org policy …
Browse files Browse the repository at this point in the history
…constraint (#386)
  • Loading branch information
pmjansson authored and bharathkkb committed Mar 31, 2021
1 parent 39b8da3 commit f6b0387
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions 1-org/envs/shared/org_policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ module "org_disable_sa_key_creation" {
constraint = "constraints/iam.disableServiceAccountKeyCreation"
}

module "org_disable_automatic_iam_grants_on_default_service_accounts" {
source = "terraform-google-modules/org-policy/google"
version = "~> 3.0"
organization_id = local.organization_id
folder_id = local.folder_id
policy_for = local.policy_for
policy_type = "boolean"
enforce = "true"
constraint = "constraints/iam.automaticIamGrantsForDefaultServiceAccounts"
}

/******************************************
Storage
*******************************************/
Expand Down
3 changes: 2 additions & 1 deletion test/integration/org/controls/gcloud_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
'constraints/compute.restrictXpnProjectLienRemoval',
'constraints/sql.restrictPublicIp',
'constraints/iam.disableServiceAccountKeyCreation',
'constraints/storage.uniformBucketLevelAccess'
'constraints/storage.uniformBucketLevelAccess',
'constraints/iam.automaticIamGrantsForDefaultServiceAccounts'
]

control 'gcloud_policy' do
Expand Down

0 comments on commit f6b0387

Please sign in to comment.