Skip to content

Commit

Permalink
Merge pull request #2058 from spiffxp/fix-audit-viewer-role
Browse files Browse the repository at this point in the history
infra/gcp: fix audit.viewer role and remove stray bindings
  • Loading branch information
k8s-ci-robot authored May 19, 2021
2 parents 5e990a3 + 186bde0 commit a4df700
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
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

0 comments on commit a4df700

Please sign in to comment.