π Google IAM Service Account has admin privileges π’
- Contextual name: π Service Account has admin privileges π’
- ID:
/ce/ca/google/iam/service-account-admin-privileges
- Located in: π Google IAM
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
Logicβ
- π§ prod.logic.yaml π’
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
*Admin
or*admin
orEditor
orOwner
role 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/IAM
using https://console.cloud.google.com/iam-admin/iam- Under the
IAM
Tab look forVIEW BY PRINCIPALS
- Filter
PRINCIPALS
usingtype : Service account
- Look for the Service Account with the Principal nomenclature:
SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com
- Identify
User-Managed user created
service account with roles containing*Admin
or*admin
or role matchingEditor
or role matchingOwner
underRole
Column.- 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 bin
icon 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
policy.yamlβ
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ CIS GCP v3.0.0 β πΌ 1.5 Ensure That Service Account Has No Admin Privileges - Level 1 (Automated) | 1 | |||
πΌ Cloudaware Framework β πΌ Role-Based Access Control (RBAC) Management | 9 |