Skip to main content

🛡️ Google IAM Service Account has User-Managed Keys🟢

Stats

not available

Logic

Similar Policies

Description

Open File

Description

User-managed service accounts should not have user-managed keys.

Rationale

Anyone who has access to the keys will be able to access resources through the service account. GCP-managed keys are used by Cloud Platform services such as App Engine and Compute Engine. These keys cannot be downloaded. Google will keep the keys and automatically rotate them on an approximately weekly basis. User-managed keys are created, downloadable, and managed by users. They expire 10 years from creation.

For user-managed keys, the user has to take ownership of key management activities which include:

 - Key storage
- Key distribution
- Key revocation
- Key rotation
- Protecting the keys from unauthorized users
- Key recovery

Even with key owner precautions, keys can be easily leaked by common development malpractices like checking keys into the source code or leaving them in the Downloads directory, or accidentally leaving them on support blogs/channels.

It is recommended to prevent user-managed service account keys.

... see more

Remediation

Open File

Remediation

From Google Cloud Console

  1. Go to the IAM page in the GCP Console using https://console.cloud.google.com/iam-admin/iam
  2. In the left navigation pane, click Service accounts. All service accounts and their corresponding keys are listed.
  3. Click the service account.
  4. Click the edit and delete the keys.

From Google Cloud CLI

To delete a user managed Service Account Key:

gcloud iam service-accounts keys delete \
--iam-account={{user-managed-service-account-email}} {{key-id}}

policy.yaml

Open File

Linked Framework Sections

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
💼 CIS GCP v1.2.0 → 💼 1.4 Ensure that there are only GCP-managed service account keys for each service account - Level 1 (Automated)1no data
💼 CIS GCP v1.3.0 → 💼 1.4 Ensure That There Are Only GCP-Managed Service Account Keys for Each Service Account - Level 1 (Automated)1no data
💼 CIS GCP v2.0.0 → 💼 1.4 Ensure That There Are Only GCP-Managed Service Account Keys for Each Service Account - Level 1 (Automated)1no data
💼 CIS GCP v3.0.0 → 💼 1.4 Ensure That There Are Only GCP-Managed Service Account Keys for Each Service Account - Level 1 (Automated)1no data
💼 CIS GCP v4.0.0 → 💼 1.4 Ensure That There Are Only GCP-Managed Service Account Keys for Each Service Account - Level 1 (Automated)1no data
💼 CIS GCP v5.0.0 → 💼 1.5 Ensure That There Are Only GCP-Managed Service Account Keys for Each Service Account - Level 1 (Automated)1no data
💼 Cloudaware Framework → 💼 Credential Lifecycle Management32no data