Skip to main content

๐Ÿ›ก๏ธ 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 Type: COMPLIANCE_POLICY
  • Policy Categories: SECURITY

Logicโ€‹

Similar Policiesโ€‹

Descriptionโ€‹

Open File

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 or Editor or Owner 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โ€‹

Open File

Remediationโ€‹

From Google Cloud Consoleโ€‹

  1. Go to IAM & admin/IAM using https://console.cloud.google.com/iam-admin/iam
  2. Under the IAM Tab look for VIEW BY PRINCIPALS
  3. Filter PRINCIPALS using type : Service account
  4. Look for the Service Account with the Principal nomenclature: SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com
  5. Identify User-Managed user created service account with roles containing *Admin or *admin or role matching Editor or role matching Owner under Role Column.
  6. Click on Edit (Pencil Icon) for the Service Account, it will open all the roles which are assigned to the Service Account.
  7. 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
  1. 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โ€‹

Open File

Linked Framework Sectionsโ€‹

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
๐Ÿ’ผ CIS GCP v1.2.0 โ†’ ๐Ÿ’ผ 1.5 Ensure that Service Account has no Admin privileges - Level 1 (Automated)1no data
๐Ÿ’ผ CIS GCP v1.3.0 โ†’ ๐Ÿ’ผ 1.5 Ensure That Service Account Has No Admin Privileges - Level 1 (Automated)1no data
๐Ÿ’ผ CIS GCP v2.0.0 โ†’ ๐Ÿ’ผ 1.5 Ensure That Service Account Has No Admin Privileges - Level 1 (Automated)1no data
๐Ÿ’ผ CIS GCP v3.0.0 โ†’ ๐Ÿ’ผ 1.5 Ensure That Service Account Has No Admin Privileges - Level 1 (Automated)1no data
๐Ÿ’ผ Cloudaware Framework โ†’ ๐Ÿ’ผ Role-Based Access Control (RBAC) Management14no data
๐Ÿ’ผ FedRAMP High Security Controls โ†’ ๐Ÿ’ผ AC-6 Least Privilege (M)(H)81157no data
๐Ÿ’ผ FedRAMP Moderate Security Controls โ†’ ๐Ÿ’ผ AC-6 Least Privilege (M)(H)657no data
๐Ÿ’ผ ISO/IEC 27001:2022 โ†’ ๐Ÿ’ผ 5.15 Access control1431no data
๐Ÿ’ผ ISO/IEC 27001:2022 โ†’ ๐Ÿ’ผ 8.2 Privileged access rights710no data
๐Ÿ’ผ NIST CSF v1.1 โ†’ ๐Ÿ’ผ PR.AC-4: Access permissions and authorizations are managed, incorporating the principles of least privilege and separation of duties1756no data
๐Ÿ’ผ NIST CSF v2.0 โ†’ ๐Ÿ’ผ PR.AA-05: Access permissions, entitlements, and authorizations are defined in a policy, managed, enforced, and reviewed, and incorporate the principles of least privilege and separation of duties116no data
๐Ÿ’ผ NIST SP 800-53 Revision 5 โ†’ ๐Ÿ’ผ AC-6 Least Privilege102350no data
๐Ÿ’ผ SOC 2 โ†’ ๐Ÿ’ผ CC6.1-3 Restricts Logical Access122no data
๐Ÿ’ผ SOC 2 โ†’ ๐Ÿ’ผ CC6.1-4 Identifies and Authenticates Users46no data
๐Ÿ’ผ SOC 2 โ†’ ๐Ÿ’ผ CC6.1-7 Restricts Access to Information Assets1327no data
๐Ÿ’ผ SOC 2 โ†’ ๐Ÿ’ผ CC6.1-8 Manages Identification and Authentication1824no data
๐Ÿ’ผ SOC 2 โ†’ ๐Ÿ’ผ CC6.3-1 Creates or Modifies Access to Protected Information Assets3no data
๐Ÿ’ผ SOC 2 โ†’ ๐Ÿ’ผ CC6.3-2 Removes Access to Protected Information Assets3no data
๐Ÿ’ผ SOC 2 โ†’ ๐Ÿ’ผ CC6.3-3 Uses Access Control Structures14no data