Skip to main content

PagerDuty API Key

PagerDuty API keys are used to authenticate and authorize access to the PagerDuty platform, which provides incident management and response services. These keys allow applications and services to interact with PagerDuty's API to automate workflows, manage incidents, and retrieve data. Exposure of a PagerDuty API key can lead to unauthorized access to incident data, manipulation of incident workflows, and potential disruption of incident response processes, posing a significant security risk.


How Does It Look

PagerDuty API keys can appear in various contexts, such as:

  • Environment variables:

    export PAGERDUTY_API_KEY="pd_api_key_1234567890abcdef"
  • Configuration files (JSON, YAML, .env):

    {
    "pagerduty": {
    "apiKey": "pd_api_key_1234567890abcdef"
    }
    }
    pagerduty:
    apiKey: pd_api_key_1234567890abcdef
  • Code snippets:

    headers = {
    "Authorization": "Token token=pd_api_key_1234567890abcdef"
    }

Severity

  • 🟠 High

The severity of exposing a PagerDuty API key is high because it grants access to incident management functionalities. An attacker could potentially manipulate incident workflows, access sensitive incident data, and disrupt operational processes. The blast radius includes unauthorized access to incident data and potential manipulation of incident response actions.


What Can an Attacker Do?

With immediate access to a PagerDuty API key, an attacker can perform several actions that could compromise incident management and response:

An attacker can:

  • Access incident data: Retrieve sensitive incident information (if the credential has read permissions).
  • Modify incident workflows: Change incident statuses or reassign incidents (if write access is enabled).
  • Trigger false alerts: Create or escalate incidents to cause operational disruptions (if incident creation permissions are granted).
  • Access user information: Retrieve user details associated with incidents (if user data access is permitted).

Additionally, an attacker could escalate their access by leveraging the API key to gather more information about the PagerDuty account, potentially leading to lateral movement within the organization's incident management system.


Real-World Impact

Exposure of a PagerDuty API key poses significant business risks, including:

The primary impact includes unauthorized access to incident management systems, leading to:

  • Data Exposure: Incident details and user information (if the credential has read access to sensitive data).
  • Operational Disruption: False alerts or manipulated incident workflows (if the attacker has modify permissions).
  • Reputational Damage: Loss of trust in incident response capabilities.

In worst-case scenarios, an attacker could cause widespread operational disruptions by manipulating incident workflows, leading to cascading effects on the organization's ability to respond to real incidents effectively.


Prerequisites for Exploitation

To exploit a PagerDuty API key, an attacker needs:

  • Network access: Ability to send requests to the PagerDuty API.
  • Additional context: Knowledge of specific endpoints or account IDs to target.
  • Rate limits: Awareness of any API rate limits that could restrict the number of requests.

How to Verify If It's Active

To verify if a PagerDuty API key is active, use the following command:

curl -H "Authorization: Token token=[API_KEY]" https://api.pagerduty.com/incidents

Valid credential response: A successful response will return a list of incidents in JSON format.

Invalid/expired credential response: An error message indicating unauthorized access or invalid token.


Detection Patterns

Common Variable Names:

  • PAGERDUTY_API_KEY
  • PD_API_KEY
  • PAGERDUTY_TOKEN
  • PD_TOKEN
  • PAGERDUTY_KEY
  • PD_KEY

File Locations:

  • config.json
  • settings.yaml
  • .env
  • credentials.json
  • pd_config.yaml

Regex Pattern:

pd_api_key_[a-zA-Z0-9]{16,32}

Remediation Steps

  1. Revoke immediately - Go to PagerDuty > Integrations > API Access and delete the compromised API key.
  2. Audit access logs - Review PagerDuty audit logs for unauthorized access or changes during the exposure window.
  3. Assess blast radius - Identify all systems, applications, and environments that used the exposed credential.
  4. Rotate credential - Generate a new API key in PagerDuty with least-privilege permissions.
  5. Update dependent systems - Deploy the new credential to all applications and update CI/CD pipelines securely.
  6. Harden access controls - Enable IP allowlisting in PagerDuty and require multi-factor authentication for API access.
  7. Implement secrets management - Migrate credentials to a secrets manager (HashiCorp Vault, AWS Secrets Manager) to prevent hardcoding.
  8. Add detection controls - Set up pre-commit hooks and repository scanning to catch credential leaks before they reach production.

Credential exposures often go undetected for extended periods, increasing the window for exploitation. As a long-term strategy, plan to establish an internal process or engage an external vendor for continuous external exposure monitoring. This helps identify leaked secrets across public repositories, paste sites, dark web forums, and other external sources before attackers can leverage them. Proactive detection and rapid response are essential to minimizing the impact of credential leaks.


References