Repository navigation
feat(0-bootstrap): make compute.restrictVpcPeering producers configurable - #352
Conversation
|
This was added in this commit: 2be4597 Which does not provide a reasoning for why it was added. However reading the attached blog post that it links to: Is required to allow Google services to peer with VPC's in our projects. Quote from the blog post:
So removing this line would effectively disallow the peering that is required. Instead of removing this line we should add documentation around this, and if possible link to somewhere other than that blog post for that information. On top of that we should have automation that allows this particular item to be turned on/off as necessary, for example when CloudSQL/GKE private clusters are not used or not required. |
|
Follow-up on a canonical source for the Google Cloud documentation does not publish this folder ID, nor the other two from the blog post. The only sources found are the Medium post and third-party deployment guides that copy it. What official documentation does cover:
The current policy is also incomplete for the use cases the blog post covers. It allows only the service networking tenancy folder. Legacy peering-based GKE private clusters also need Proposed direction instead of removing the line:
@aghassemlouei, could you help find an internal owner who can confirm these folder IDs, or point to a supported public reference for them? |
|
@Calvin-Cheng1 I was referred to you by AJ, do you have a good contact? |
|
Thanks for catching this, and you're right. I read I'd like to rework this PR into your first two items rather than close it:
On the third item, I can help find the owning team inside Google and will post back here with whatever public reference they can point to. If you'd rather have the rework in a fresh PR, I'll close this one instead. |
There was a problem hiding this comment.
Confirmed today's Google-managed producer folder and organization IDs for constraints/compute.restrictVpcPeering:
under:folders/832634261155covers Private Services Access (servicenetworking.googleapis.com) tenant networks used by Cloud SQL, AlloyDB, Memorystore, Filestore, Vertex AI, and Cloud Build private pools.under:folders/1087601843002covers Cloud SQL dedicated private IP peering (cloudsql-mysql-googleapis-comandcloudsql-postgres-googleapis-com).under:folders/391150242170covers legacy VPC peering-based GKE private cluster control planes.under:folders/270204312590covers Dataproc Metastore VPC peering.under:folders/38889423310covers Filestore Basic tier direct VPC peering.under:folders/1073120509012covers Memorystore for Redis direct VPC peering.under:folders/102761826467covers Cloud TPU VPC peering.under:organizations/433637338589is the top-level Google producer organization ID (published in the Private Service Connect consumer security documentation) if an organization prefers a single producer org entry over per-service folders.
We are submitting updates to the public Private Services Access, GKE cluster creation troubleshooting, and Stellar Engine deployment walkthrough documentation on cloud.google.com so these producer IDs and org_policies_config.constraints options are documented directly and dynamically updated whenever any changes occur.
…able Private services access peers VPC networks with Google producer networks, so compute.restrictVpcPeering has to allow the producer folder. Stage 0 hard-coded the Service Networking producer folder next to a blog link. Add org_policies_config.constraints.allowed_vpc_peering_producers. It defaults to ["under:folders/832634261155"], so the rendered policy doesn't change. Deployments can add other Google producers, or set it to [] if they use only Private Service Connect. Replace the blog link with a comment that cites the constraint reference, the private services access overview and the Private Service Connect security page, and points at the google#352 review for other producer IDs.
8803763 to
eeed051
Compare
Description
Make the Google producer values in
compute.restrictVpcPeeringconfigurable, as digitalresistor proposed on this PR and aghassemlouei endorsed in review.The first version of this PR removed
under:folders/832634261155. That was wrong. It's Google's Service Networking producer folder, and private services access peers with it. This version replaces that commit and keeps the folder as the default.org_policies_config.constraints.allowed_vpc_peering_producerslist infast/stages-aw/0-bootstrap/variables.tfdefaults to["under:folders/832634261155"].organization.tfpasses the list to thedata/custom-org-policies/templates, the same way it passesallowed_policy_member_domains.networking_policy.yamlrenders the list afterunder:organizations/${organization_id}.terraform.tfvars.sampleshows the new key with its default, andtools/tfdoc.pyregenerated the README variables table.With the default, the rendered policy doesn't change. A deployment can add producers, such as
under:folders/391150242170for legacy peering-based GKE private clusters, or set the list to[]if it uses only Private Service Connect.Type of Change
Deployment & Compliance Impact
main.Checklist
Code Quality & Reusability
modules/orfast/stages-aw/can be leveraged for this change.docs/naming-convention.md.Documentation
README.mdof the modified module or blueprint.Security
Testing
Testing Performed
terraform consolerendered Stage 0'slocal.org_policiesonmainand on this branch, afterterraform init -backend=false, with test inputs.org_policies_configthat omits the new key, and withnull,compute.restrictVpcPeeringallows the organization andunder:folders/832634261155. The wholelocal.org_policiesmap hashes the same as onmainunder IL5, IL4 and FEDRAMP_HIGH (69 policies) and FEDRAMP_MODERATE (63 policies).[], the policy allows only the organization.["under:folders/832634261155", "under:folders/391150242170"], the policy allows the organization and both folders.terraform init -backend=falseandterraform validateinfast/stages-aw/0-bootstrap/report a valid configuration.bash tools/lint.shwith TFLint v0.64.0 passes all 10 checks.uv run --locked pytestpasses 107 tests, and thetests/test_*.shsuites pass.