VNX-SEC-052 – Artifactory / JFrog API Key
Overview
This rule detects artifactory / jfrog api key matching the AKCp..., cmVmd... pattern hardcoded anywhere in source files. Detects Artifactory and JFrog API keys (AKCp or cmVmd prefix) hardcoded in source code.
Severity: Critical | CWE: CWE-798 – Use of Hard-coded Credentials
Why This Matters
Hardcoded artifactory / jfrog api key values are routinely scraped by automated bots within minutes of a public push, and then used to access the account, exfiltrate data, or pivot into downstream services. Once the credential is in git history it is permanently in third-party hands.
Remediation
- Revoke the leaked credential in the provider’s console immediately.
- Replace with a short-lived alternative — OAuth 2.0 access tokens, IAM role assumption, OIDC federation — wherever the platform supports it.
- Store the new credential in a secrets manager (AWS Secrets Manager, HashiCorp Vault, GitHub Actions secrets, Doppler).
- Audit the provider’s access logs for activity you did not initiate between the leak and the revocation.
- Purge from git history with
git filter-repoor BFG, then re-scan with gitleaks/truffleHog to confirm no other secrets remain. - Enable push protection so future commits are blocked at the developer machine.
References
- CWE-798: Use of Hard-coded Credentials
- gitleaks
artifactory-api-key,artifactory-reference-token - truffleHog
- OWASP Credentials Management Cheat Sheet
- MITRE ATT&CK T1552.001 – Credentials In Files
- git-filter-repo