-
Notifications
You must be signed in to change notification settings - Fork 18
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
Password with hardcoded value is not detected (.yaml file) #80
Comments
I think my bigger concern here is that feature like this is based on heuristics, and can give a lot of False Positives. For example, the field may be: password: "YOUR_PASSWORD_HERE" |
I see your point. In KICS, we trigger a vulnerability result on this cases. I tried gitleaks and the same file have as result: no leaks found. |
We will support it and the user will be able to disable it. Need to research about ignoring patterns like |
can be done as part of #98 |
Examples: var userID = $sessionStorage['userID'] ? $sessionStorage[' userID '] : 'HardcodedUserIDinplaintext';
var headers = { authorization : "Basic " + btoa(unescape(encodeURIComponent(userID + ":" + 'HardcodedPasswordinplaintext'))),…………………}; {
username: 'HardcodedUsernameinplaintext',
password: ' HardcodedPasswordinplaintext ',
} document.getElementById('userName').value = " HardcodedUsernameinplaintext ";
document.getElementById('password').value = " HardcodedPasswordinplaintext "; M_DB_USER= HardcodedUsernameinplaintext
M_DB_PASSWORD= HardcodedPasswordinplaintext private static final String CIPHER_KEY = "HardcodedCipherKey in Numeric"; "... \"access-key\": \"AKIAWIPE......\", ..." (Waiting for gitleaks/gitleaks#1267) <password>something_here</password>
<element password="something" /> (Waiting for gitleaks/gitleaks#1265) |
you can run 2MS with adding This is the whole config: 😂 regex:
- password[:>=] *"?.*[ <"] and they will find these: results:
73ca2669271427b1e4b7ee88701166ed49b82233:
- id: 73ca2669271427b1e4b7ee88701166ed49b82233
source: project/10k-most-common.txt
ruleid: custom-regex-1
startline: 1
endline: 1
startcolumn: 3
endcolumn: 26
value: password>something_here<
76dab5351fa6c906c96f80d03868e8a5a143f021:
- id: 76dab5351fa6c906c96f80d03868e8a5a143f021
source: project/10k-most-common.txt
ruleid: custom-regex-1
startline: 0
endline: 0
startcolumn: 1
endcolumn: 30
value: 'password: "YOUR_PASSWORD_HERE"'
b7eee319f6c69bcaccbdf49cf58c3d1da9a019cf:
- id: b7eee319f6c69bcaccbdf49cf58c3d1da9a019cf
source: project/10k-most-common.txt
ruleid: custom-regex-1
startline: 2
endline: 2
startcolumn: 11
endcolumn: 31
value: 'password="something" ' |
Steps to reproduce
running the command:
./2ms repository --path "<file_to_scan>"
where
<file_to_scan>
is this file.Expected result
2ms finds a hardcoded secret at line 8
Actual result
The text was updated successfully, but these errors were encountered: