Skip to main content
โ† All controls
AC-2 / IA-4 / CIS-5.4 NIST SP 800-53 Rev 5

Inventory of API tokens / PATs

Demonstrate that the organization maintains a comprehensive, up-to-date inventory of all API tokens and personal access tokens with documented ownership, scope, and lifecycle metadata.

Description

What this control does

This control requires maintaining a complete, centralized inventory of all API tokens, personal access tokens (PATs), and service account credentials used across systems, applications, and cloud environments. The inventory should document token purpose, scope, ownership, creation date, expiration status, and last-use timestamp. Organizations must implement automated discovery mechanisms to detect untracked tokens and enforce registration requirements before tokens are issued. This control is critical because API tokens often possess powerful privileges and are frequently over-permissioned, long-lived, or orphaned when employees leave or projects end.

Control objective

What auditing this proves

Demonstrate that the organization maintains a comprehensive, up-to-date inventory of all API tokens and personal access tokens with documented ownership, scope, and lifecycle metadata.

Associated risks

Risks this control addresses

  • Attackers exploit orphaned or forgotten tokens that retain elevated privileges long after their original use case has ended
  • Former employees or contractors retain valid tokens after offboarding, maintaining unauthorized access to production systems
  • Shadow IT generates untracked tokens with excessive permissions that bypass approval workflows and logging requirements
  • Stolen tokens remain active indefinitely because no expiration enforcement or rotation policy exists for undocumented credentials
  • Security teams cannot identify or revoke compromised tokens during incident response because no central registry exists
  • Over-permissioned tokens grant unnecessary access because scope creep occurs without periodic review or least-privilege validation
  • Compliance violations occur when auditors cannot trace API access to authorized personnel or business purposes

Testing procedure

How an auditor verifies this control

  1. Obtain the organization's current API token and PAT inventory from the designated system of record (spreadsheet, CMDB, secrets management platform, or identity governance tool).
  2. Review the inventory schema to verify it captures token identifier, owner name or service account, creation date, expiration date, scope/permissions, associated system or application, and last-use timestamp.
  3. Select three critical systems or cloud platforms (e.g., GitHub, AWS, Azure DevOps, Salesforce) and query their native token management interfaces to export all active tokens.
  4. Compare exported token lists against the centralized inventory to identify any tokens present in production systems but absent from the inventory documentation.
  5. Select a sample of 15-20 tokens from the inventory spanning multiple systems and verify each entry's metadata by cross-referencing with source system records and owner confirmation.
  6. Interview token owners or administrators to confirm understanding of token purpose, validate current business need, and assess whether permissions align with documented scope.
  7. Review automated discovery mechanisms (scanning scripts, API integrations, or governance tools) and examine execution logs from the past 30 days to verify continuous monitoring is operational.
  8. Test token lifecycle procedures by requesting evidence of at least three recent token deprovisioning events triggered by employee offboarding or project closure, verifying removal from both inventory and production systems.
Evidence required Artefacts include the complete API token inventory export with metadata fields, configuration exports from token management interfaces for sampled systems (GitHub PAT list, AWS IAM access keys report, Azure DevOps personal access tokens), automated discovery tool logs or scan results from the past quarter, screenshots of token registration workflows or approval processes, change tickets or service desk records documenting token deprovisioning events, and email or system notifications confirming owner verification activities.
Pass criteria The centralized inventory contains at least 95% of all active API tokens and PATs discovered across sampled production systems, all required metadata fields are populated for sampled entries, automated discovery runs at least monthly with documented results, and evidence confirms tokens are removed from both inventory and systems within 24 hours of offboarding events.

Where this control is tested

Audit programs including this control