Skip to content

fix(query): fix fp in password and secrets Generic Passwords#7512

Merged
cx-miguel-dasilva merged 5 commits into
masterfrom
AST-74743
Jul 1, 2025
Merged

fix(query): fix fp in password and secrets Generic Passwords#7512
cx-miguel-dasilva merged 5 commits into
masterfrom
AST-74743

Conversation

@cx-romeu-silva

Copy link
Copy Markdown
Contributor

Reason for Proposed Changes

  • The rule "Generic Password" is currently flagging some cases that do not represent actual vulnerabilities:
    • Placeholders: While it's context-dependent whether a value is a placeholder, the likelihood of it being a real password is very low compared to how often it's a false positive. Common placeholder delimiters include $(...), ${{...}} and {{...}}.

      vmAdminPassword: '$(VM_ADMIN_PASSWORD)'
      sqlAdminPassword: '$(SQL_ADMIN_PASSWORD)'
      yetanotherAdminPassword: '${{SQL_ADMIN_PASSWORD}}'
      andyetanotherAdminPassword: '${{ SQL_ADMIN_PASSWORD }}'
    • Empty values: The password/secret is not hardcoded, so it should not be flagged.

      anotherAdminPassword: ''

Proposed Changes

  • Add rules to the allowRules section of the "Generic Password" rule to Allow placeholder patterns and Exclude empty string values.

I submit this contribution under the Apache-2.0 license.

@github-actions github-actions Bot added community Community contribution query New query feature labels Jun 27, 2025
@cx-romeu-silva cx-romeu-silva self-assigned this Jun 27, 2025
@github-actions

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.7

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

@cx-romeu-silva cx-romeu-silva marked this pull request as ready for review June 30, 2025 16:02
@cx-romeu-silva cx-romeu-silva requested a review from a team as a code owner June 30, 2025 16:02
@gitguardian

gitguardian Bot commented Jul 1, 2025

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
4266028 Triggered Generic Password 6180751 assets/queries/terraform/azure/mssql_server_auditing_disabled/test/positive2.tf View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@cx-miguel-dasilva cx-miguel-dasilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

@cx-miguel-dasilva cx-miguel-dasilva merged commit a15cbf8 into master Jul 1, 2025
24 checks passed
@cx-miguel-dasilva cx-miguel-dasilva deleted the AST-74743 branch July 1, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Community contribution query New query feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants