Service account has admin privileges Affecting IAM service in Google


Severity

0.0
high
0
10
Severity Framework
Snyk CCSS
Rule category
IAM/ Least Privilege

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-ControlsCIS-GoogleCSA-CCMHIPAAISO-27001PCI-DSSSOC-2
  • Snyk IDSNYK-CC-00348
  • creditSnyk Research Team

Description

Service accounts should not have admin privileges as they give full access to an assigned application or a VM, and a service account can perform critical actions like delete, update, etc. without user intervention.

How to fix?

Remove any administrative roles from service accounts. Administrative roles include roles that have any of the following suffixes admin, roles/editor and roles/owner.

Example Configuration

resource "google_project_iam_member" "valid" {
  role = "roles/viewer"
  member = google_service_account.valid.email
}

resource "google_service_account" "valid" {
  account_id   = "service-account-id"
  display_name = "Service Account"
}