Back to controls

Ensure API keys are not created for a project

### Overview

Category

Controls

Low

Applies to

General guidance

Coverage

Reference entry

Asset types

Not specified

Overview

Overview

+API keys are weaker than identity-based authentication and are frequently exposed in client code and repositories. Projects should avoid API key usage when service accounts or stronger controls are available.

Remediation guidance

GCP remediation

+### Console +1. Open APIs and Services -> Credentials. +2. Identify and remove unnecessary API keys. +3. For keys that must exist temporarily, restrict by API, application, and source. +4. Prefer service accounts and workload identity over API keys. + +### Google Cloud CLI +List API keys in a project: + +~~~bash +gcloud services api-keys list --project +~~~ + +Delete an API key: + +~~~bash +gcloud services api-keys delete --project +~~~ + +### References +- https://cloud.google.com/api-keys/docs +- https://cloud.google.com/sdk/gcloud/reference/services/api-keys

Service-wide remediation

Recommended when many resources are affected: fix the platform baseline first so new resources inherit the secure setting, then remediate the existing flagged resources in batches.

Platform

Use the provider or platform baseline, preventive policy, and IaC modules to enforce this setting consistently when many resources are affected.

Operational rollout

  1. Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
  2. Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
  3. Re-scan and track approved exceptions with an owner and expiry date.

Query logic

These are the stored checks tied to this control.

No stored query bodies are attached to this entry.

Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon