๐ก๏ธ Google IAM Service Account has admin privileges๐ข
- Contextual name: ๐ก๏ธ Service Account has admin privileges๐ข
- ID:
/ce/ca/google/iam/service-account-admin-privileges - Tags:
- ๐ข Policy with categories
- ๐ข Policy with type
- ๐ข Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logicโ
- ๐ง prod.logic.yaml๐ข
Similar Policiesโ
- Cloud Conformity: Restrict Administrator Access for Service Accounts
Descriptionโ
Descriptionโ
A service account is a special Google account that belongs to an application or a VM, instead of to an individual end-user. The application uses the service account to call the service's Google API so that users aren't directly involved. It's recommended not to use admin access for ServiceAccount.
Rationaleโ
Service accounts represent service-level security of the Resources (application or a VM) which can be determined by the roles assigned to it. Enrolling ServiceAccount with Admin rights gives full access to an assigned application or a VM. A ServiceAccount Access holder can perform critical actions like delete, update change settings, etc. without user intervention. For this reason, it's recommended that service accounts not have Admin rights.
Impactโ
Removing
*Adminor*adminorEditororOwnerrole assignments from service accounts may break functionality that uses impacted service accounts. Required role(s) should be assigned to impacted service accounts in order to restore broken functionalities.... see more
Remediationโ
Remediationโ
From Google Cloud Consoleโ
- Go to
IAM & admin/IAMusing https://console.cloud.google.com/iam-admin/iam- Under the
IAMTab look forVIEW BY PRINCIPALS- Filter
PRINCIPALSusingtype : Service account- Look for the Service Account with the Principal nomenclature:
SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com- Identify
User-Managed user createdservice account with roles containing*Adminor*adminor role matchingEditoror role matchingOwnerunderRoleColumn.- Click on
Edit (Pencil Icon)for the Service Account, it will open all the roles which are assigned to the Service Account.- Click the
Delete binicon to remove the role from the Principal (service account in this case)From Google Cloud CLIโ
gcloud projects get-iam-policy PROJECT_ID --format json > iam.json
- Using a text editor, Remove Role which contains roles/*Admin or roles/*admin or matched roles/editor or matches 'roles/owner`. Add a role to the bindings array that defines the group members and the role for those members.
... see more