Back to Checks
claude

Claude API key does not act as a personal user identity

apikey_principal_is_service_account
Service: apikeySeverity: medium
OfficialVerifiedPrivate
Categories:gen-aisecretsidentity-access
Resource Type:ClaudeApiKey

Automation uses service accounts rather than personal keys. A key bound to a person carries that person's access and dies with their account, so automation built on one breaks at offboarding and over-grants until then.

Risk

A key bound to a person carries that person's access and dies with their account, so automation built on one breaks at offboarding and over-grants until then.

Run this check with Prowler

Run in Prowler Cloud
Install
pip install --extra-index-url https://__token__:${PROWLER_REGISTRY_DOWNLOAD_API_KEY}@registry.prowler.com/simple/ "prowler-provider-claude[runtime]"
Run
prowler claude --checks apikey_principal_is_service_account

Recommendation

Move automation onto service account keys and revoke the personal keys it used.

Remediation

Other

1Move automation onto service account keys and revoke the personal keys it used.

Check Code

from prowler.lib.check.models import Check

from prowler_provider_claude.lib.report import CheckReportClaude
from prowler_provider_claude.services.apikey.apikey_client import apikey_client


class apikey_principal_is_service_account(Check):
    """Automation uses service accounts rather than personal keys."""

    def execute(self) -> list[CheckReportClaude]:
        findings = []
        for key in [k for k in apikey_client.api_keys if k.status == "active"]:
            report = CheckReportClaude(metadata=self.metadata(), resource=key)
            if key.principal_type == "user_actor":
                report.status = "FAIL"
                report.status_extended = (
                    f"API key {key.name} acts as a person ({key.principal_id}), so it carries "
                    "their access and stops working when their account does."
                )
            else:
                report.status = "PASS"
                report.status_extended = (
                    f"API key {key.name} does not act as a personal identity "
                    f"(principal type is {key.principal_type or 'none'})."
                )
            findings.append(report)
        return findings