Skip to content

Commit c263e06

Browse files
DloomPlzgit
andauthored
Adding multiple signatures (#58)
* Adding multiple signatures * Adding path formatting for windows user Co-authored-by: git <stanislas.molveau@michelin.com>
1 parent 270327c commit c263e06

2 files changed

Lines changed: 88 additions & 4 deletions

File tree

config.yaml

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,6 @@ signatures:
281281
- part: 'filename'
282282
regex: '^\.?env$'
283283
name: 'Environment configuration file'
284-
- part: 'contents'
285-
regex: '-----BEGIN [EC|RSA|DSA|OPENSSH] PRIVATE KEY----'
286-
name: 'Contains a private key'
287284
- part: 'contents'
288285
regex: '(A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'
289286
name: 'AWS Access Key ID Value'
@@ -380,3 +377,90 @@ signatures:
380377
- part: 'contents'
381378
regex: 'hawk\.[0-9A-Za-z\-_]{20}\.[0-9A-Za-z\-_]{20}'
382379
name: 'StackHawk API Key'
380+
- part: 'extension'
381+
match: '.ppk'
382+
name: 'Potential PuTTYgen private key'
383+
- part: 'filename'
384+
match: 'heroku.json'
385+
name: 'Heroku config file'
386+
- part: 'extension'
387+
match: '.sqldump'
388+
name: 'SQL Data dump file'
389+
- part: 'filename'
390+
match: 'dump.sql'
391+
name: 'MySQL dump w/ bcrypt hashes'
392+
- part: 'filename'
393+
match: 'id_rsa_pub'
394+
name: 'Public ssh key'
395+
- part: 'filename'
396+
match: 'mongoid.yml'
397+
name: 'Mongoid config file'
398+
- part: 'filename'
399+
match: 'salesforce.js'
400+
name: 'Salesforce credentials in a nodejs project'
401+
- part: 'extension'
402+
match: '.netrc'
403+
name: 'netrc with SMTP credentials'
404+
- part: 'filename'
405+
regex: '.remote-sync.json$'
406+
name: 'Created by remote-sync for Atom, contains FTP and/or SCP/SFTP/SSH server details and credentials'
407+
- part: 'filename'
408+
regex: '.esmtprc$'
409+
name: 'esmtp configuration'
410+
- part: 'filename'
411+
regex: '^deployment-config.json?$'
412+
name: 'Created by sftp-deployment for Atom, contains server details and credentials'
413+
- part: 'filename'
414+
regex: '.ftpconfig$'
415+
name: 'Created by sftp-deployment for Atom, contains server details and credentials'
416+
- part: 'contents'
417+
regex: '-----BEGIN (EC|RSA|DSA|OPENSSH|PGP) PRIVATE KEY'
418+
name: 'Contains a private key'
419+
- part: 'contents'
420+
regex: 'define(.{0,20})?(DB_CHARSET|NONCE_SALT|LOGGED_IN_SALT|AUTH_SALT|NONCE_KEY|DB_HOST|DB_PASSWORD|AUTH_KEY|SECURE_AUTH_KEY|LOGGED_IN_KEY|DB_NAME|DB_USER)(.{0,20})?[''|"].{10,120}[''|"]'
421+
name: 'WP-Config'
422+
- part: 'contents'
423+
regex: '(?i)(aws_access_key_id|aws_secret_access_key)(.{0,20})?=.[0-9a-zA-Z\/+]{20,40}'
424+
name: 'AWS cred file info'
425+
- part: 'contents'
426+
regex: '(?i)(facebook|fb)(.{0,20})?(?-i)[''\"][0-9a-f]{32}[''\"]'
427+
name: 'Facebook Secret Key'
428+
- part: 'contents'
429+
regex: '(?i)(facebook|fb)(.{0,20})?[''\"][0-9]{13,17}[''\"]'
430+
name: 'Facebook Client ID'
431+
- part: 'contents'
432+
regex: '(?i)twitter(.{0,20})?[''\"][0-9a-z]{35,44}[''\"]'
433+
name: 'Twitter Secret Key'
434+
- part: 'contents'
435+
regex: '(?i)twitter(.{0,20})?[''\"][0-9a-z]{18,25}[''\"]'
436+
name: 'Twitter Client ID'
437+
- part: 'contents'
438+
regex: '(?i)github(.{0,20})?(?-i)[''\"][0-9a-zA-Z]{35,40}[''\"]'
439+
name: 'Github Key'
440+
- part: 'contents'
441+
regex: '(?i)heroku(.{0,20})?[''"][0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[''"]'
442+
name: 'Heroku API key'
443+
- part: 'contents'
444+
regex: '(?i)linkedin(.{0,20})?(?-i)[''\"][0-9a-z]{12}[''\"]'
445+
name: 'Linkedin Client ID'
446+
- part: 'contents'
447+
regex: '(?i)linkedin(.{0,20})?[''\"][0-9a-z]{16}[''\"]'
448+
name: 'LinkedIn Secret Key'
449+
- part: 'path'
450+
regex: '\.?idea[\\\/]WebServers.xml$'
451+
name: 'Created by Jetbrains IDEs, contains webserver credentials with encoded passwords (not encrypted!)'
452+
- part: 'path'
453+
regex: '\.?vscode[\\\/]sftp.json$'
454+
name: 'Created by vscode-sftp for VSCode, contains SFTP/SSH server details and credentials'
455+
- part: 'path'
456+
regex: 'web[\\\/]ruby[\\\/]secrets.yml'
457+
name: 'Ruby on rails secrets.yml file (contains passwords)'
458+
- part: 'path'
459+
regex: '\.?docker[\\\/]config.json$'
460+
name: 'Docker registry authentication file'
461+
- part: 'path'
462+
regex: 'ruby[\\\/]config[\\\/]master.key$'
463+
name: 'Rails master key (used for decrypting credentials.yml.enc for Rails 5.2+)'
464+
- part: 'path'
465+
regex: '\.?mozilla[\\\/]firefox[\\\/]logins.json$'
466+
name: 'Firefox saved password collection (can be decrypted using keys4.db)'

core/match.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type MatchFile struct {
1515
}
1616

1717
func NewMatchFile(path string) MatchFile {
18+
path = filepath.ToSlash(path)
1819
_, filename := filepath.Split(path)
1920
extension := filepath.Ext(path)
2021
contents, _ := ioutil.ReadFile(path)
@@ -68,7 +69,6 @@ func GetMatchingFiles(dir string) []MatchFile {
6869
if err != nil || f.IsDir() || uint(f.Size()) > maxFileSize || IsSkippableFile(path) {
6970
return nil
7071
}
71-
7272
fileList = append(fileList, NewMatchFile(path))
7373
return nil
7474
})

0 commit comments

Comments
 (0)