Skip to content

Oss 133 new detector vault approle auth for hashicorp #4362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

SyedAliHamad
Copy link
Contributor

@SyedAliHamad SyedAliHamad commented Aug 1, 2025

Description:

This PR introduces a new detector for HashiCorp Vault AppRole authentication credentials.

Detection:
Keyword Filtering: scans for related keywords to identify relevant data chunks
Multi-Component Pattern Matching: Uses regex to find three required components:

  • role_id: hexadecimal UUID format
  • secret_id: hexadecimal UUID format
  • vault_url: HashiCorp Cloud URLs matching *.hashicorp.cloud pattern

all 3 components creates verifiable combination results

Deduplication: Ensures each unique credential combination is tested only once to prevent redundant API calls

Verification:
Validates credentials against Vault's /v1/auth/approle/login endpoint using detected URLs

200 OK: Credentials are valid and active
401/403: Invalid credentials or insufficient permissions
404 Not Found: AppRole auth method not enabled

Testing:
Pattern Tests: Comprehensive validation of formats, keyword detection, and URL pattern matching
Integration Tests: Live API verification with both active and inactive credentials

image

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@SyedAliHamad SyedAliHamad marked this pull request as ready for review August 4, 2025 09:05
@SyedAliHamad SyedAliHamad requested review from a team as code owners August 4, 2025 09:05
Copy link
Contributor

@amanfcp amanfcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @SyedAliHamad

@amanfcp
Copy link
Contributor

amanfcp commented Aug 6, 2025

@shahzadhaider1 can you please review this again?

@amanfcp amanfcp merged commit d8658ce into trufflesecurity:main Aug 7, 2025
13 checks passed
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.

3 participants