Repository navigation
feat(gcp): set up a connection with Terraform, and sign log pushes instead of a URL secret - #1499
JeremyFunk wants to merge 6 commits into
Conversation
The setup script and a new Terraform module create the same resources. The push subscription now signs each request as a dedicated push service account that holds no role, so neither the subscription nor Terraform state carries the connection's secret.
setup_scripts now also returns the Terraform module block. check_access signs in as the connection's read-only account and records it as in place, which a Terraform run cannot report the way the setup script does.
…h account A push carrying a Google ID token is accepted when Google signed it for the connector's push service account in its host project and for an audience naming the connector. The first such push to a connector nothing has reported on (Terraform sends no report) records log forwarding as set up. Pushes with the URL secret keep working for subscriptions an earlier script created.
The apply stage offers the Terraform module beside the Cloud Shell script, with a check that confirms the read-only access, since a Terraform run reports nothing.
Documents setting a connection up with Terraform, taking over a script-made one by import, and the push service account. The module's mock-provider tests run in CI.
Maple review🟢 Confidence 8/10 · likely safe to merge Google Cloud connections can now be set up with a Terraform module, and Pub/Sub pushes are OIDC-signed instead of carrying a URL secret; the ingest verifies the ID token, and a new
Before merge
Findings🔵 Note · F1 · The JWKS fetch has no Client span, so ingest→Google is absent from the service mapobservability · MAP-01 ·
🤖 Prompt to fix this finding with an AI agentProduction impactTelemetry this change adds and removes (1)
What was checked
Observability coverage: 2 of 3 changes observable
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Google Cloud admins can now set a connection up with Terraform instead of pasting the setup script, and log pushes no longer carry a secret.
What changes
deploy/terraform-google-maple: the resources the script creates, under the same names, so either can take over from the other. Additive*_iam_membergrants only. Mock-providertofu testcovers project/org scopes, logs off, and a secret-bearing endpoint being refused; a new workflow runs fmt/validate/test.maple-push-<19 hex>that holds no role. The script and the module both set it up. The ingest gateway verifies the Google ID token (RS256 against Google's JWKS, issuer, expiry, verified email), then checks the email is the connector's push account in its host project and that the audience names the connector. Subscriptions an earlier script made keep working with the URL secret until the script runs again.--push-auth-service-account/--push-auth-token-audience, and deletes the account when log forwarding is turned off or cleaned up. The secret now only authenticates the script's own reports (REPORT_ENDPOINT); Google Cloud never gets it.setup_scriptsalso returnsterraform(the module block). NewPOST /v2/integrations/gcp/connectors/{id}/check_accessreads the scope as the read-only account and records it as in place, since Terraform sends no report./lab/gcp.Verified
checkAccess, v2 route test, domain contract tests.tofu validate/tofu teston the module; a rendered block validated against the module with OpenTofu.Not verified: a real
terraform applyand a real signed push against Google Cloud. Worth one run onmaple-development-projectbefore release.Before release
terraform-google-maple-v1.0.0after merge: the generated block pins?ref=to it.terraform-google-maplerepo to publish it on the Terraform Registry.Need help on this PR? Tag
@codesmith-botwith what you need.