Back to Checks
Prowlerprowler-provider-claude
All active Claude Compliance API keys have an expiration date set
audit_compliance_key_expiration_set
Service: auditSeverity: medium
OfficialVerifiedPrivate
Categories:gen-ailoggingforensics-ready
Resource Type:ClaudeOrganizationSettings
Compliance API keys expire. A Compliance Access Key reads conversations, files and session transcripts, so a non-expiring one is the highest-value static credential in the tenant.
Risk
A Compliance Access Key reads conversations, files and session transcripts, so a non-expiring one is the highest-value static credential in the tenant.
Run this check with Prowler
Run in Prowler CloudRun
prowler claude --checks audit_compliance_key_expiration_setRecommendation
Recreate Compliance Access Keys with an expiry and rotate them on that schedule.
Remediation
Other
1Recreate Compliance Access Keys with an expiry and rotate them on that schedule.
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_key_expiration_set(Check):
"""Compliance API keys expire."""
def execute(self) -> list[CheckReportClaude]:
findings = []
for settings in audit_client.settings:
active = [k for k in settings.compliance_api_keys if k.is_active]
if not active:
continue
org = settings.name.removesuffix(" effective settings")
without_expiry = [k.name or k.id for k in active if not k.expires_at]
report = CheckReportClaude(metadata=self.metadata(), resource=settings)
if without_expiry:
report.status = "FAIL"
report.status_extended = (
f"Organization {org} has {len(without_expiry)} active Compliance API key(s) "
f"that never expire: {', '.join(without_expiry)}."
)
else:
report.status = "PASS"
report.status_extended = (
f"All {len(active)} active Compliance API key(s) for organization {org} "
"have an expiry."
)
findings.append(report)
return findings