Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(query): passwords and secrets fp for run after triggers#7713

Merged
cx-ricardo-jesus merged 9 commits intomasterfrom
AST-112469-FP-Passwords_and_Secrets_Generic_Token_ARM
Sep 24, 2025
Merged

fix(query): passwords and secrets fp for run after triggers#7713
cx-ricardo-jesus merged 9 commits intomasterfrom
AST-112469-FP-Passwords_and_Secrets_Generic_Token_ARM

Conversation

@cx-andre-pereira
Copy link
Contributor

@cx-andre-pereira cx-andre-pereira commented Sep 11, 2025

Reason for Proposed Changes

  • Currently the regex_rules from passwords and secrets are flagging the following fields :
"HTTP_-_Get_OAuth_Token" : ...
"Parse_JSON_-_OAuth_Token": ...
"Try_-_Get_OAuth_Token": ...
"Catch_-_Get_OAuth_Token": ...
  • These should be assumed as "Microsoft.Logic workflows" actions since they follow a specific naming convention and can only have preset values (7 possible) and not sensitive information.
  • These False Positives are happening when "actions" with "runAfter" triggers define said triggers as such:
"runAfter_164": {
       "HTTP_-_Get_OAuth_Token": [
                                     "Succeeded"
                               ]
        }

or

"runAfter_164": {
       "HTTP_-_Get_OAuth_Token": ["Succeeded"]
        }
  • Given the limitations of the passwords_and_secrets's queries it is impossible to distinguish these cases in scenarios that rely on different naming schemes that also finish with "token". An action like "HTTP2_-_Get_OAuth_Token" would also be flagged even after this fix because it is impossible to predict how a user will name an action.

  • Considering the first example it is also impossible to filter by value associated with the field like "Succeeded". Since the scan will be line by line it is likely that said value is not available; otherwise , knowing the 7 possible values, the filtering process could be applicable to many more samples and still safe enough to not cause new False Negatives.

Proposed Changes

{
   "description": "Avoiding Run After Triggers",
   "regex": "(?i)['\"](HTTP|Parse_JSON|Try|Catch)_-_(Get_)?OAuth_Token['\"]?\\s*[:=]\\s*['\"]?([[A-Za-z0-9/~^_!@&%()=?*+-]+)['\"]?"
}

I submit this contribution under the Apache-2.0 license.

@github-actions github-actions bot added the query New query feature label Sep 11, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2025

kics-logo

KICS version: v2.1.13

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

@github-actions github-actions bot added arm Azure Resource Manager query azure PR related with Azure Cloud labels Sep 11, 2025
@cx-andre-pereira cx-andre-pereira marked this pull request as ready for review September 11, 2025 12:53
@cx-andre-pereira cx-andre-pereira requested a review from a team as a code owner September 11, 2025 12:53
Copy link
Contributor

@cx-artur-ribeiro cx-artur-ribeiro left a comment

Choose a reason for hiding this comment

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

Despite the description, all good to me.

@gitguardian
Copy link

gitguardian bot commented Sep 23, 2025

⚠️ 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
20838717 Triggered Generic Password 51230b8 assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative8.json 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.

Copy link
Contributor

@cx-artur-ribeiro cx-artur-ribeiro left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@cx-artur-ribeiro cx-artur-ribeiro left a comment

Choose a reason for hiding this comment

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

LGTM

@cx-ricardo-jesus cx-ricardo-jesus merged commit a56d84e into master Sep 24, 2025
26 of 27 checks passed
@cx-ricardo-jesus cx-ricardo-jesus deleted the AST-112469-FP-Passwords_and_Secrets_Generic_Token_ARM branch September 24, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arm Azure Resource Manager query azure PR related with Azure Cloud query New query feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments