New Relic Personal API Key
A New Relic Personal API Key is a credential used to authenticate and interact with New Relic's monitoring and observability services. This key allows users to access their account data, configure monitoring settings, and retrieve performance metrics. Exposure of this credential is a significant security concern as it can lead to unauthorized access to sensitive application performance data and potentially allow malicious actors to manipulate monitoring configurations.
How Does It Look
Personal API Keys can appear in various contexts, such as:
-
Environment variables:
export NEW_RELIC_API_KEY="NRP-XXXXXXXXXXXXXXXXXXXX" -
Configuration files (JSON, YAML, .env):
{
"newRelicApiKey": "NRP-XXXXXXXXXXXXXXXXXXXX"
}new_relic_api_key: NRP-XXXXXXXXXXXXXXXXXXXX -
Code snippets:
new_relic_api_key = "NRP-XXXXXXXXXXXXXXXXXXXX"
Severity
🟠 High
This credential provides access to New Relic account data and monitoring configurations. If compromised, an attacker could manipulate monitoring settings, access sensitive performance data, and potentially disrupt application monitoring. The blast radius includes all applications and services monitored by New Relic under the affected account.
What Can an Attacker Do?
With immediate access to a New Relic Personal API Key, an attacker can:
- Access sensitive performance data (if the credential has read permissions)
- Modify monitoring configurations (if the credential has write permissions)
- Disable alerts and notifications (if alert management permissions are granted)
- Extract application metrics for competitive intelligence or malicious purposes
An attacker could escalate their access by leveraging the monitoring data to identify vulnerabilities or weaknesses in the application infrastructure, potentially leading to further exploitation or lateral movement within the network.
Real-World Impact
Exposure of a New Relic Personal API Key poses significant business risks:
- Data Exposure: Application performance metrics and logs (if the credential has read access to sensitive data)
- Financial Loss: Increased costs due to unauthorized resource usage or service disruptions (if billing/resource creation is permitted)
- Operational Disruption: Inaccurate monitoring and alerting, leading to undetected issues (if the attacker has modify permissions)
- Reputational Damage: Loss of trust from stakeholders due to compromised monitoring integrity
In worst-case scenarios, attackers could use the compromised data to orchestrate further attacks, leading to cascading effects across the organization's IT infrastructure.
Prerequisites for Exploitation
- Network access requirements: Internet access to New Relic's API endpoints
- Additional context needed: Account ID and specific API endpoints
- Rate limits or restrictions: API rate limits may apply, potentially slowing down exploitation
How to Verify If It's Active
To verify if a New Relic Personal API Key is active, use the following command:
curl -X GET "https://api.newrelic.com/v2/applications.json" \
-H "X-Api-Key:[API_KEY]"
Valid credential response: A successful response will return a JSON object with application data.
Invalid/expired credential response: An error message indicating authentication failure or invalid API key.
Detection Patterns
Common Variable Names:
- NEW_RELIC_API_KEY
- newRelicApiKey
- NR_API_KEY
- NR_KEY
- new_relic_key
- newRelicKey
File Locations:
.envconfig.jsonsettings.yamlapplication.propertiescredentials.txt
Regex Pattern:
NRP-[A-Za-z0-9]{20}
Remediation Steps
- Revoke immediately - Go to New Relic > Account Settings > API Keys and delete the compromised key.
- Audit access logs - Review New Relic audit logs for unauthorized access or configuration changes during the exposure window.
- Assess blast radius - Identify all systems, applications, and environments that used the exposed credential.
- Rotate credential - Generate a new Personal API Key in New Relic with least-privilege permissions.
- Update dependent systems - Deploy the new credential to all applications and update CI/CD pipelines securely.
- Harden access controls - Enable IP allowlisting in New Relic and require multi-factor authentication for account access.
- Implement secrets management - Migrate credentials to a secrets manager (HashiCorp Vault, AWS Secrets Manager) to prevent hardcoding.
- 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.