Skip to content

Commit 704d999

Browse files
ensure prow-build can operate secret manager secrets
1 parent f951106 commit 704d999

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

infra/gcp/bash/prow/ensure-e2e-projects.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ function ensure_e2e_project() {
7272
file.googleapis.com \
7373
logging.googleapis.com \
7474
monitoring.googleapis.com \
75-
storage-component.googleapis.com
75+
storage-component.googleapis.com \
76+
secretmanager.googleapis.com
7677

7778
# TODO: this is what prow.k8s.io uses today, but seems overprivileged, we
7879
# could consider using a more limited custom IAM role instead
@@ -112,6 +113,17 @@ function ensure_e2e_project() {
112113
"serviceAccount:${PROW_BUILD_SVCACCT}" \
113114
"roles/iam.serviceAccountUser"
114115

116+
# Ensure GCP Default Compute Service Account can administer Secret Manager secrets
117+
ensure_project_role_binding "${prj}" \
118+
"serviceAccount:${PROW_BUILD_SVCACCT}" \
119+
"roles/secretmanager.admin"
120+
121+
# Ensure GCP Default Compute Engine Service Agent Account can manage Secret Manager Secrets
122+
ensure_project_role_binding "${prj}" \
123+
"serviceAccount:service-${project_number}@compute-system.iam.gserviceaccount.com" \
124+
"roles/secretmanager.admin"
125+
126+
115127
# TODO: this is what prow.k8s.io uses today, but seems overprivileged, we
116128
# could consider using a more limited custom IAM role instead
117129
color 6 "Empower boskos-janitor service account to clean e2e project: ${prj}"

infra/gcp/terraform/k8s-infra-prow/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module "project" {
4040
"certificatemanager.googleapis.com",
4141
"artifactregistry.googleapis.com",
4242
"secretmanager.googleapis.com",
43-
"cloudbuild.googleapis.com"
43+
"cloudbuild.googleapis.com",
44+
"secretmanager.googleapis.com",
4445
]
4546
}

0 commit comments

Comments
 (0)