Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
刚 force push 了 erraform fmt 修复 Repository Lint(for_each map key 对齐)。CI 会重新跑。 |
|
Hi, I just signed the Google Contributor License Agreement (CLA). Could someone please re-run the \cla/google\ check? Thanks! |
|
With this branch, |
aghassemlouei
left a comment
There was a problem hiding this comment.
Validating 0-bootstrap and 1-resman against #369 with terraform validate and terraform plan surfaced four issues documented inline:
fast/stages-aw/1-resman/branch-tenants.tffailsterraform validatebecausekeys(...)is called on threelist(string)attributestop_folder_roles,core_folder_roles, andtenant_folder_roles, asWandLZhangalso noted.- Removing
module.tenant-core-folders-iamandmodule.tenant-self-folders-iaminbranch-tenants.tfcauses upgrades on existing deployments to destroy their authoritativegoogle_folder_iam_bindingresources on the same folder forroles/owner,roles/viewer,roles/cloudasset.owner,roles/compute.xpnAdmin,roles/resourcemanager.folderAdmin,roles/resourcemanager.projectCreator, androles/resourcemanager.tagUser, which can wipe the consolidated bindings applied bymodule.tenant-top-folders-iamunless anupgrade-notedocumentsterraform state rmbefore applying. fast/stages-aw/0-bootstrap/checklist.tfconstructs the KMS key string manually withoutdepends_on = [module.organization, module.gcs-kms], creating a race condition on fresh deployments beforemodule.gcs-kmsprovisions the key and grants the GCS service agent access.- Item 5 of #369 across
0-bootstrap/templates/workflow-gitlab.yaml,1-resman/templates/workflow-gitlab.yaml, and1-resman/outputs.tfteam_cicd_workflow_attrsis not yet addressed while the description usesFixes #369.and omits.github/pull_request_template.md.
Pushing a new commit with these updates will also re-trigger the cla/google check against the signed Contributor License Agreement.
| for k in distinct(concat( | ||
| keys(var.tenants_config.top_folder_roles), | ||
| keys(var.tenants_config.core_folder_roles), | ||
| keys(var.tenants_config.tenant_folder_roles) | ||
| )) : | ||
| k => local.tenant_iam[each.key] | ||
| } | ||
| ) | ||
| } |
There was a problem hiding this comment.
Two issues affect module.tenant-top-folders-iam:
var.tenants_config.top_folder_roles,core_folder_roles, andtenant_folder_rolesare typedoptional(list(string), ...)invariables.tf, so wrapping them inkeys(...)failsterraform validatewithInvalid function argument. Pass the three lists directly toconcat(...).- Because
module.tenant-core-folders-iamandmodule.tenant-self-folders-iampreviously managed authoritativegoogle_folder_iam_bindingresources for overlapping roles includingroles/owner,roles/viewer,roles/cloudasset.owner,roles/compute.xpnAdmin,roles/resourcemanager.folderAdmin,roles/resourcemanager.projectCreator, androles/resourcemanager.tagUseronmodule.tenant-top-folders[each.key].idwith no dependency edge tomodule.tenant-top-folders-iam, destroying those modules during an upgrade deletes the live folder IAM bindings in parallel with or aftermodule.tenant-top-folders-iamupdates them. Include aBreaking Changesupgrade-noteinstructing existing deployments with tenants to runterraform state rm 'module.tenant-core-folders-iam' 'module.tenant-self-folders-iam'prior toterraform apply.
| for k in distinct(concat( | |
| keys(var.tenants_config.top_folder_roles), | |
| keys(var.tenants_config.core_folder_roles), | |
| keys(var.tenants_config.tenant_folder_roles) | |
| )) : | |
| k => local.tenant_iam[each.key] | |
| } | |
| ) | |
| } | |
| for k in distinct(concat( | |
| var.tenants_config.top_folder_roles, | |
| var.tenants_config.core_folder_roles, | |
| var.tenants_config.tenant_folder_roles | |
| )) : | |
| k => local.tenant_iam[each.key] | |
| } | |
| ) | |
| } |
| encryption_key = "projects/${module.automation-project.project_id}/locations/${local.locations.gcs}/keyRings/gcs/cryptoKeys/gcs" | ||
| depends_on = [module.organization] |
There was a problem hiding this comment.
Interpolating "projects/${module.automation-project.project_id}/locations/${local.locations.gcs}/keyRings/gcs/cryptoKeys/gcs" directly omits an implicit dependency on module.gcs-kms, so on a fresh Stage 0 deployment module.automation-tf-checklist-gcs attempts to create the CMEK-encrypted bucket before module.gcs-kms creates the gcs key and grants roles/cloudkms.cryptoKeyEncrypterDecrypter to the Cloud Storage service agent, unlike automation.tf lines 163 to 176. Reference module.gcs-kms.keys.gcs.id directly:
| encryption_key = "projects/${module.automation-project.project_id}/locations/${local.locations.gcs}/keyRings/gcs/cryptoKeys/gcs" | |
| depends_on = [module.organization] | |
| encryption_key = module.gcs-kms.keys.gcs.id | |
| depends_on = [module.organization, module.gcs-kms] |
|
Hi maintainers! @GoogleCloudPlatform/foundation-framework 👋 This PR is all green (no conflicts, CI passing) and has been rebased on latest. Could someone take a look when you have a moment? Thanks! |
Handing off review to @pulsingSignal.
|
Thanks for the review! CI is all green and rebased on latest. Let me know if anything needs adjusting. 🙏 |
|
@LeonxLJX Hello, thank you for the contribution so far. Please let us know if you are able to reconcile all outstanding comments/conversations related to the submitted code for this PR. If you are not able to resolve them by Friday, we will close this PR as the review is becoming stale. |
55a3968 to
7f25f31
Compare
Fixes #369.
Summary
This PR addresses security and functional defects in
fast/stages-aw/0-bootstrapandfast/stages-aw/1-resman.Changes Made
Stage 0 Bootstrap
data/custom-constraint-policies/networking.yaml: Changed firewall ingress constraint condition from
resource.sourceRanges.all(range, range == '0.0.0.0/0')toresource.sourceRanges.exists(range, range == '0.0.0.0/0' || range == '::/0'). The previous.all()only blocked rules where every CIDR was0.0.0.0/0, allowing any rule with a second CIDR to bypass the constraint. Also adds IPv6::/0coverage.data/custom-roles/storage_viewer.yaml: Removed
storage.objects.createpermission from the read-only storage viewer role.checklist.tf: Added
encryption_key(CMEK) andforce_destroy = var.force_destroyto the checklist files GCS bucket.Stage 1 Resource Manager
branch-tenants.tf:
local.tenant_iam[each.value.tenant.name]tolocal.tenant_iam[each.key].tenant-top-folders-iam,tenant-core-folders-iam, andtenant-self-folders-iaminto a single authoritativetenant-top-folders-iammodule. The three separate modules all targetedtenant-top-folders[each.key].idwith overlapping authoritative role bindings (roles/owner,roles/cloudasset.owner,roles/compute.xpnAdmin,roles/resourcemanager.folderAdmin,roles/resourcemanager.projectCreator,roles/resourcemanager.tagUser), overwriting each other during apply. All role bindings are now merged withdistinct()to deduplicate.branch state buckets: Added
encryption_key(CMEK usinggcs/cryptoKeys/gcskey) andforce_destroy = var.force_destroyto all missing branch GCS state buckets inbranch-data-platform.tf,branch-gcve.tf,branch-gke.tf,branch-project-factory.tf,branch-sandbox.tf, andbranch-teams.tf(11 total buckets).branch-networking.tfandbranch-security.tfalready had these configured.Security Impact