Skip to content

feat(infra): trim isolated backup and vulnfeeds roles from osv-worker on oss-vdb-test - #6491

Closed
another-rex wants to merge 1 commit into
google:masterfrom
another-rex:trim_isolated_worker_roles_staging
Closed

another-rex wants to merge 1 commit into
google:masterfrom
another-rex:trim_isolated_worker_roles_staging

Conversation

@another-rex

Copy link
Copy Markdown
Contributor

Overview

Trims the isolated backup and vulnfeeds write permissions off osv-worker@oss-vdb-test now that GKE_METADATA Workload Identity (PR #6460) is live on oss-vdb-test and dedicated SAs (osv-backup, osv-vulnfeeds, osv-gitter, osv-monitoring) own those workloads.

Details

  • Adds an opt-in trim_isolated_worker_roles boolean (default false) to modules/osv_pipeline and modules/osv (gated with lifecycle.precondition checks so oss-vdb and private-osv are unaffected until their Phase 2 cutover completes):
    • Removes from osv-worker@oss-vdb-test: roles/datastore.importExportAdmin, roles/storage.objectAdmin on osv-test-affected-commits (with a moved block so oss-vdb/private-osv see zero churn), and roles/storage.objectAdmin on osv-test-backup.
    • Downgrades on osv-worker@oss-vdb-test (create_before_destroy): roles/storage.objectAdmin → roles/storage.objectViewer on osv-test-cve-osv-conversion and osv-test-debian-osv (read-only access is still required by importer/worker/recoverer per source_test.yaml, while writes belong solely to osv-vulnfeeds).
    • Retains roles/monitoring.viewer: Still required by custommetrics (go/cmd/custommetrics calls monitoring.ListTimeSeries).
  • Enables trim_isolated_worker_roles = true in deployment/terraform/environments/oss-vdb-test/main.tf.
  • Rollout note: No manual terraform apply needed — deployment@oss-vdb already holds roles/resourcemanager.projectIamAdmin and bucket storage.buckets.setIamPolicy (via roles/editor / roles/storage.legacyBucketOwner) on oss-vdb-test, so merging applies cleanly via build-and-stage. Recommend confirming tonight's 18:00 AEDT backup CronJob run on osv-backup before merging.

Testing

  • Verified terraform fmt -check -recursive deployment/terraform.
  • Verified read-only terraform plan -lock=false on oss-vdb-test: removes the 3 isolated backup bindings and replaces the 2 vulnfeeds conversion bucket bindings with roles/storage.objectViewer (create_before_destroy).
  • Verified osv-gitter, osv-vulnfeeds, osv-monitoring, and osv-worker live on oss-vdb-test under GKE_METADATA with zero PERMISSION_DENIED errors.
  • AI-assisted PR.

agy

@another-rex

Copy link
Copy Markdown
Contributor Author

Closing in favor of trimming isolated osv-worker roles cleanly across both oss-vdb-test and oss-vdb together once prod Workload Identity (Phase 1 + Phase 2) is also rolled out, avoiding an extra temporary Terraform flag.

@another-rex another-rex closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant