Skip to content

Conversation

@shahzadhaider1
Copy link
Contributor

This PR updates the Artifactory detector to properly detect Artifactory API keys with the AKCp prefix format.

Problem

The existing Artifactory detector was using a very generic regex pattern that detected any 73 or 64 character alphanumeric strings, leading to potential false positives. The detector was not specifically targeting the old Artifactory API key format (AKCp prefix).

Changes

1. Updated Regex Pattern

  • Changed from generic pattern: \b([a-zA-Z0-9]{64,73})\b
  • To specific pattern: \b(AKCp[A-Za-z0-9]{69})\b
  • This matches the standard Artifactory API key format

2. Updated Keywords

  • Added AKCp to the keywords list for better pre-filtering

3. Updated Tests

  • Unit tests: Updated to match the new AKCp prefix pattern
  • Integration tests: Using mock secrets due to API key deprecation (see note below)

Important Note on Testing

JFrog deprecated Artifactory API keys (format AKCp*) and disabled the ability to create new API keys at the end of Q3 2024.

Sources:

Since real AKCp API keys can no longer be generated:

  • Integration tests use mock secrets with proper format
  • Tests validate detection (regex matching) rather than verification
  • This is acceptable as the primary goal is to detect leaked secrets in codebases, where old API keys may still exist

Checklist:

  • Updated regex pattern to match AKCp prefix format
  • Updated keywords for efficient pre-filtering
  • Updated unit tests
  • Updated integration tests with mock secrets
  • Added documentation comments explaining testing limitations
  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@shahzadhaider1 shahzadhaider1 requested a review from a team January 21, 2026 12:31
@shahzadhaider1 shahzadhaider1 requested a review from a team as a code owner January 21, 2026 12:31
@shahzadhaider1 shahzadhaider1 linked an issue Jan 28, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Artifactory API Key Detection

2 participants