Back to Checks
claude

Claude organization has no deactivated Compliance API keys

audit_compliance_inactive_keys_removed
Service: auditSeverity: low
OfficialVerifiedPrivate
Categories:gen-ailoggingforensics-ready
Resource Type:ClaudeOrganizationSettings

Deactivated Compliance API keys are cleaned up. Deactivated keys are retained for audit visibility, and reviewing them is how a key that should never have existed gets noticed.

Prowler logoProwlerprowler-provider-claude

Risk

Deactivated keys are retained for audit visibility, and reviewing them is how a key that should never have existed gets noticed.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler claude --checks audit_compliance_inactive_keys_removed

Recommendation

Remove deactivated Compliance API keys once their audit review is complete.

Remediation

Other

1Remove deactivated Compliance API keys once their audit review is complete.

Check Code

from prowler.lib.check.models import Check

from prowler_provider_claude.lib.report import CheckReportClaude
from prowler_provider_claude.services.audit.audit_client import audit_client


class audit_compliance_inactive_keys_removed(Check):
    """Deactivated Compliance API keys are cleaned up."""

    def execute(self) -> list[CheckReportClaude]:
        findings = []
        for settings in audit_client.settings:
            if not settings.available:
                continue

            org = settings.name.removesuffix(" effective settings")
            inactive = [
                k.name or k.id for k in settings.compliance_api_keys if not k.is_active
            ]
            report = CheckReportClaude(metadata=self.metadata(), resource=settings)
            if inactive:
                report.status = "FAIL"
                report.status_extended = (
                    f"Organization {org} still lists {len(inactive)} deactivated Compliance API "
                    f"key(s): {', '.join(inactive)}."
                )
            else:
                report.status = "PASS"
                report.status_extended = (
                    f"Organization {org} lists no deactivated Compliance API keys."
                )
            findings.append(report)
        return findings