Skip to content

TCE-1591 Create custom rule to detect hardcoded tokens for yaml files - #34

Merged
DMarinhoCodacy merged 2 commits into
mainfrom
create-custom-rule-hardcoded-tokens
Sep 11, 2026
Merged

DMarinhoCodacy merged 2 commits into
mainfrom
create-custom-rule-hardcoded-tokens

Conversation

@DMarinhoCodacy

Copy link
Copy Markdown
Contributor

No description provided.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

The token-detection rule has a substantive coverage gap: common token key names and YAML scalar representations are not detected, so hardcoded tokens can bypass the rule. This should be addressed before merging.

The acceptance criteria around token detection and SSRF mapping lack automated test coverage. Codacy reports the PR as up to standards, but no coverage data is available for these changes.

About this PR

  • Please document the supported token-key/value syntax and add automated tests for the rule and OWASP mapping. The unrelated SSRF mapping change also needs its relationship to this PR clarified.

Test suggestions

  • Detect a quoted hardcoded value for a key such as access_token or api-token.
  • Detect token keys in common forms such as token, token_value, and TOKEN_VALUE.
  • Do not report token keys whose values are absent or non-hardcoded placeholders, according to the intended rule behavior.
  • Map A10:2021 server-side request forgery and its abbreviated form to InputValidation.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Detect a quoted hardcoded value for a key such as access_token or api-token.
2. Detect token keys in common forms such as token, token_value, and TOKEN_VALUE.
3. Do not report token keys whose values are absent or non-hardcoded placeholders, according to the intended rule behavior.
4. Map A10:2021 server-side request forgery and its abbreviated form to InputValidation.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Comment thread docs/codacy-rules.yaml Outdated
@DMarinhoCodacy DMarinhoCodacy changed the title Create custom rule to detect hardcoded tokens TCE-1591 Create custom rule to detect hardcoded tokens Sep 11, 2026
@DMarinhoCodacy DMarinhoCodacy changed the title TCE-1591 Create custom rule to detect hardcoded tokens TCE-1591 Create custom rule to detect hardcoded tokens for yaml files Sep 11, 2026
@DMarinhoCodacy
DMarinhoCodacy merged commit 5df4707 into main Sep 11, 2026
7 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.

2 participants