Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infra/gcp: fix audit.viewer role and remove stray bindings #2058

Merged
merged 4 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion infra/gcp/ensure-organization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,21 @@ org_role_bindings=(
"serviceAccount:$(svc_acct_email "kubernetes-public" "k8s-infra-gcp-auditor"):$(custom_org_role_name "audit.viewer")"
)

removed_org_role_bindings=()
removed_org_role_bindings=(
# TODO(spiffxp): remove all of these in followup PR once deployed
"group:[email protected]:roles/secretmanager.viewer"
"user:[email protected]:roles/compute.viewer"
"user:[email protected]:roles/dns.reader"
"user:[email protected]:roles/iam.securityReviewer"
"user:[email protected]:roles/resourcemanager.organizationViewer"
"user:[email protected]:roles/serviceusage.serviceUsageConsumer"
"user:[email protected]:roles/compute.viewer"
"user:[email protected]:roles/dns.reader"
"user:[email protected]:roles/iam.securityReviewer"
"user:[email protected]:roles/resourcemanager.organizationViewer"
"user:[email protected]:roles/serviceusage.serviceUsageConsumer"
"user:[email protected]:roles/resourcemanager.organizationAdmin"
)

function ensure_org_roles() {
for role in "${org_roles[@]}"; do
Expand Down
15 changes: 15 additions & 0 deletions infra/gcp/roles/audit.viewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# - roles/dns.reader
# # read access to cloud assets metadata
# - roles/cloudasset.viewer
# # read access to secrets metadata (not their contents)
# - roles/secretmanager.viewer
#
# # meta roles (regardless of roles/viewer)
# # read access for the project hierarchy (org, folders, projects)
Expand Down Expand Up @@ -70,6 +72,7 @@ includedPermissions:
- aiplatform.modelEvaluationSlices.list
- aiplatform.modelEvaluations.list
- aiplatform.models.list
- aiplatform.nasJobs.list
- aiplatform.operations.list
- aiplatform.specialistPools.list
- aiplatform.studies.list
Expand Down Expand Up @@ -192,6 +195,7 @@ includedPermissions:
- clientauthconfig.brands.list
- clientauthconfig.clients.list
- cloudasset.assets.analyzeIamPolicy
- cloudasset.assets.analyzeMove
- cloudasset.assets.exportAccessLevel
- cloudasset.assets.exportAccessPolicy
- cloudasset.assets.exportAllAccessPolicy
Expand Down Expand Up @@ -283,6 +287,7 @@ includedPermissions:
- cloudasset.assets.exportSpannerInstances
- cloudasset.assets.exportSqladminInstances
- cloudasset.assets.exportStorageBuckets
- cloudasset.assets.listCloudkmsCryptoKeys
- cloudasset.assets.searchAllIamPolicies
- cloudasset.assets.searchAllResources
- cloudasset.feeds.list
Expand Down Expand Up @@ -682,18 +687,23 @@ includedPermissions:
- dialogflow.participants.list
- dialogflow.phoneNumberOrders.list
- dialogflow.phoneNumbers.list
- dialogflow.securitySettings.list
- dialogflow.sessionEntityTypes.list
- dialogflow.smartMessagingEntries.list
- dialogflow.transitionRouteGroups.list
- dialogflow.versions.list
- dialogflow.webhooks.list
- dlp.analyzeRiskTemplates.list
- dlp.columnDataProfiles.list
- dlp.deidentifyTemplates.list
- dlp.estimates.list
- dlp.inspectFindings.list
- dlp.inspectTemplates.list
- dlp.jobTriggers.list
- dlp.jobs.list
- dlp.projectDataProfiles.list
- dlp.storedInfoTypes.list
- dlp.tableDataProfiles.list
- dns.changes.get
- dns.changes.list
- dns.dnsKeys.get
Expand All @@ -706,6 +716,7 @@ includedPermissions:
- dns.policies.getIamPolicy
- dns.policies.list
- dns.projects.get
- dns.resourceRecordSets.get
- dns.resourceRecordSets.list
- documentai.evaluations.list
- documentai.labelerPools.list
Expand Down Expand Up @@ -978,6 +989,7 @@ includedPermissions:
- resourcemanager.tagKeys.list
- resourcemanager.tagValues.getIamPolicy
- resourcemanager.tagValues.list
- resourcesettings.settings.list
- retail.catalogs.list
- retail.operations.list
- retail.products.list
Expand All @@ -994,9 +1006,12 @@ includedPermissions:
- runtimeconfig.variables.list
- runtimeconfig.waiters.getIamPolicy
- runtimeconfig.waiters.list
- secretmanager.locations.get
- secretmanager.locations.list
- secretmanager.secrets.get
- secretmanager.secrets.getIamPolicy
- secretmanager.secrets.list
- secretmanager.versions.get
- secretmanager.versions.list
- securitycenter.assets.list
- securitycenter.findings.list
Expand Down
2 changes: 2 additions & 0 deletions infra/gcp/roles/specs/audit.viewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ include:
- roles/dns.reader
# read access to cloud assets metadata
- roles/cloudasset.viewer
# read access to secrets metadata (not their contents)
- roles/secretmanager.viewer

# meta roles (regardless of roles/viewer)
# read access for the project hierarchy (org, folders, projects)
Expand Down