Skip to content

feat: add Rancher/Cattle token detector - #4630

Closed
majiayu000 wants to merge 1 commit into
trufflesecurity:mainfrom
majiayu000:fix-4622-rancher-tokens-1231-0502
Closed

feat: add Rancher/Cattle token detector#4630
majiayu000 wants to merge 1 commit into
trufflesecurity:mainfrom
majiayu000:fix-4622-rancher-tokens-1231-0502

Conversation

@majiayu000

Copy link
Copy Markdown

Fixes #4622

Summary

  • Adds new detector for Rancher/Cattle tokens (54-64 lowercase alphanumeric chars)
  • Pattern detects tokens in env files, shell exports, YAML configs, and Terraform HCL
  • Context-aware detection requires CATTLE_TOKEN, RANCHER_TOKEN, CATTLE_BOOTSTRAP_PASSWORD, RANCHER_API_TOKEN, or RANCHER_SECRET_KEY variable names
  • Validates against Rancher API v3 endpoint with Bearer auth

Test plan

  • All pattern tests pass (env files, YAML, Terraform, various variable names)
  • Edge cases tested (too short, too long, uppercase tokens)
  • No false positives on context-free alphanumeric strings
  • go build passes
  • gofmt and go vet clean

Add a new secret detector for Rancher/Cattle tokens used to access
Kubernetes management platform.

- Detects tokens in env files, shell exports, YAML configs, and Terraform
- Pattern matches 54-64 lowercase alphanumeric token format
- Validates against Rancher API v3 endpoint with Bearer auth
- Includes context-aware detection for CATTLE_TOKEN, RANCHER_TOKEN, etc.

Closes trufflesecurity#4622

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000
majiayu000 requested review from a team December 30, 2025 21:20
@majiayu000
majiayu000 requested a review from a team as a code owner December 30, 2025 21:20
@CLAassistant

CLAassistant commented Dec 30, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@majiayu000

Copy link
Copy Markdown
Author

Closing this PR due to extended inactivity. Happy to reopen if there's still interest — feel free to comment.

@majiayu000 majiayu000 closed this Mar 20, 2026
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.

Rancher Tokens

2 participants