-
Notifications
You must be signed in to change notification settings - Fork 0
Improve keyword key for secret detection #17
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,11 +21,11 @@ rules: | |||||
| languages: | ||||||
| - java | ||||||
| patterns: | ||||||
| - pattern-either: | ||||||
| - pattern-either: | ||||||
| - pattern: String $PASSWORD = "$VALUE"; | ||||||
| - metavariable-regex: | ||||||
| metavariable: "$PASSWORD" | ||||||
| regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|clave|parola|secret|pwd|key).*" | ||||||
| - metavariable-regex: | ||||||
| metavariable: "$PASSWORD" | ||||||
| regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|parola|secret|pwd|(api|secret|private|access|aws|ssh|auth|session|encryption|decryption|gcp)[_-]?key).*" | ||||||
| message: Hardcoded passwords are a security risk. They can be easily found by attackers and used to gain unauthorized access to the system. | ||||||
| metadata: | ||||||
| owasp: | ||||||
|
|
@@ -45,7 +45,7 @@ rules: | |||||
| - pattern: var $PASSWORD = "$VALUE"; | ||||||
| - metavariable-regex: | ||||||
| metavariable: "$PASSWORD" | ||||||
| regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|clave|parola|secret|pwd|key).*" | ||||||
| regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|clave|parola|secret|pwd|(api|secret|private|access|aws|ssh|auth|session|encryption|decryption|gcp)[_-]?key).*" | ||||||
| message: Hardcoded passwords are a security risk. They can be easily found by attackers and used to gain unauthorized access to the system. | ||||||
| metadata: | ||||||
| owasp: | ||||||
|
|
@@ -74,7 +74,7 @@ rules: | |||||
| - pattern: var $PASSWORD = `$VALUE` | ||||||
| - metavariable-regex: | ||||||
| metavariable: "$PASSWORD" | ||||||
| regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|clave|parola|secret|pwd|key).*" | ||||||
| regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|clave|parola|secret|pwd|(api|secret|private|access|aws|ssh|auth|session|encryption|decryption|gcp)[_-]?key).*" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ LOW RISK Suggestion: The keyword
Suggested change
|
||||||
| message: Hardcoded passwords are a security risk. They can be easily found by attackers and used to gain unauthorized access to the system. | ||||||
| metadata: | ||||||
| owasp: | ||||||
|
|
@@ -105,7 +105,7 @@ rules: | |||||
| $PASSWORD VARCHAR2($LENGTH) := $...VALUE; | ||||||
| - metavariable-regex: | ||||||
| metavariable: "$PASSWORD" | ||||||
| regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|clave|parola|secret|pwd|key).*" | ||||||
| regex: "(?i).*(password|motdepasse|heslo|adgangskode|wachtwoord|salasana|passwort|passord|senha|geslo|clave|losenord|clave|parola|secret|pwd|(api|secret|private|access|aws|ssh|auth|session|encryption|decryption|gcp)[_-]?key).*" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ LOW RISK Suggestion: Duplicate keyword
Suggested change
|
||||||
| options: | ||||||
| generic_ellipsis_max_span: 0 | ||||||
| message: > | ||||||
|
|
@@ -322,9 +322,9 @@ rules: | |||||
| languages: | ||||||
| - generic | ||||||
| patterns: | ||||||
| - pattern-either: | ||||||
| - pattern-regex: "(?i)\\bselect\\b(?!(?:[^;\\n]*\\n)*(?:(?!--)[^;\\n])*\\blanguage\\b)(?:[^;\\n]*\\n)*(?:(?!--)[^;\\n])*\\blookup_type\\b" | ||||||
| - pattern-regex: "(?im)^(?:(?!(?:--|/\\*))[^\\n])*?apps\\.fnd_lookup_values" | ||||||
| - pattern-regex: "(?im)^(?:(?!--|/\\*)[^\\n])*\\bapps\\.fnd_lookup_values\\b" | ||||||
| - pattern-regex: "(?im)^(?:(?!--|/\\*)[^\\n])*\\blookup_type\\b" | ||||||
| - pattern-not-regex: "(?im)^(?:(?!--|/\\*)[^\\n])*\\blanguage\\b" | ||||||
|
Comment on lines
+325
to
+327
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 HIGH RISK The removal of |
||||||
| paths: | ||||||
| include: | ||||||
| - "*.sql" | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ LOW RISK
Suggestion: The keyword
claveis duplicated in the regex string. Removing the second instance will make the regex cleaner and maintain consistency with the Java rule update on line 28.