adding alt config test

This commit is contained in:
zach rice committed 2019-11-10 19:28:02 -05:00
1 parent 41ef2a8cd2
commit 2ccd40677d
65 files changed
+283

No files matched your search

+10
View File
@@ -137,6 +137,16 @@ func TestAudit(t *testing.T) {
},
wantPath: "../test_data/test_entropy.json",
},
{
description: "test local repo four entropy alternative config",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_4",
Report: "../test_data/test_local_repo_four_alt_config_entropy.json.got",
RepoConfig: true,
},
wantPath: "../test_data/test_local_repo_four_alt_config_entropy.json.got",
},
}
for _, test := range tests {
+140
View File
@@ -236,5 +236,145 @@
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:26-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "more secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "64cfcee9aad1c84581631636bfc54f2050718d1a",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:36:22-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "dev branch\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:35:03-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "AKIALALEMEL33243OLIB",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS",
"severity": ""
},
{
"line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "AKIALALEMEL33243OLIA",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "adding aws key\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, AWS",
"severity": ""
}
]
@@ -0,0 +1,30 @@
[
{
"line": " Just moments after the Cessna's inquiry, a Twin Beech piped up on frequency, in a rather superior tone, asking for his ground speed. \"I have you at one hundred and twenty-five knots of ground spe",
"offender": "Entropy range [{P1:4.5 P2:4.7}]",
"commit": "d8ac0b73aeeb45843319cdc5ce506516eb49bf7a",
"repo": "test_repo_4",
"rule": "entropy",
"commitMessage": "removing secret.pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secret.pem",
"date": "2019-10-25T13:08:39-04:00",
"tags": "entropy",
"severity": ""
},
{
"line": " Just moments after the Cessna's inquiry, a Twin Beech piped up on frequency, in a rather superior tone, asking for his ground speed. \"I have you at one hundred and twenty-five knots of ground spe",
"offender": "Entropy range [{P1:4.5 P2:4.7}]",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_4",
"rule": "entropy",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secret.pem",
"date": "2019-10-25T13:07:41-04:00",
"tags": "entropy",
"severity": ""
}
]
@@ -0,0 +1 @@
gitleaks toml
@@ -0,0 +1 @@
ref: refs/heads/master
@@ -0,0 +1,7 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.
Binary file not shown.
@@ -0,0 +1,6 @@
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
@@ -0,0 +1,18 @@
0000000000000000000000000000000000000000 85699e429f33e75541530998a5b5d457a12e6285 zach rice <zricer@protonmail.com> 1572022632 -0400 commit (initial): init
85699e429f33e75541530998a5b5d457a12e6285 b10b3e2cb320a8c211fda94c4567299d37de7776 zach rice <zricer@protonmail.com> 1572022719 -0400 commit: adding aws key
b10b3e2cb320a8c211fda94c4567299d37de7776 51f6dcf6b89b93f4075ba92c400b075631a6cc93 zach rice <zricer@protonmail.com> 1572022773 -0400 commit: no secrets
51f6dcf6b89b93f4075ba92c400b075631a6cc93 17471a5fda722a9e423f1a0d3f0d267ea009d41c zach rice <zricer@protonmail.com> 1572022887 -0400 commit: wait this is actually adding an aws secret
17471a5fda722a9e423f1a0d3f0d267ea009d41c 996865bb912f3bc45898a370a13aadb315014b55 zach rice <zricer@protonmail.com> 1572023261 -0400 commit: committing pem
996865bb912f3bc45898a370a13aadb315014b55 d8ac0b73aeeb45843319cdc5ce506516eb49bf7a zach rice <zricer@protonmail.com> 1572023319 -0400 commit: removing secret.pem
d8ac0b73aeeb45843319cdc5ce506516eb49bf7a b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba zach rice <zricer@protonmail.com> 1572023528 -0400 commit: adding another one
b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba f61cd8587b7ac1d75a89a0c9af870a2f24c60263 zach rice <zricer@protonmail.com> 1572023552 -0400 commit: rm secrets again
f61cd8587b7ac1d75a89a0c9af870a2f24c60263 f61cd8587b7ac1d75a89a0c9af870a2f24c60263 zach rice <zricer@protonmail.com> 1572024822 -0400 checkout: moving from master to dev
f61cd8587b7ac1d75a89a0c9af870a2f24c60263 deea550dd6c7acaf0e59432600593533984a2125 zach rice <zricer@protonmail.com> 1572024903 -0400 commit: dev branch
deea550dd6c7acaf0e59432600593533984a2125 64cfcee9aad1c84581631636bfc54f2050718d1a zach rice <zricer@protonmail.com> 1572024982 -0400 commit: rm secrets
64cfcee9aad1c84581631636bfc54f2050718d1a f61cd8587b7ac1d75a89a0c9af870a2f24c60263 zach rice <zricer@protonmail.com> 1572024992 -0400 checkout: moving from dev to master
f61cd8587b7ac1d75a89a0c9af870a2f24c60263 84ac4e80d4dbf2c968b64e9d4005f5079795bb81 zach rice <zricer@protonmail.com> 1572026048 -0400 commit: more secrets
84ac4e80d4dbf2c968b64e9d4005f5079795bb81 cd5eb8bef855f73c46b97b4c088badffdc40ebe9 zach rice <zricer@protonmail.com> 1572026066 -0400 commit: rm secrets
cd5eb8bef855f73c46b97b4c088badffdc40ebe9 828595723b76e4a35b5253d9f2ccb4f897f1845a zach rice <zricer@protonmail.com> 1573429084 -0500 commit: adding repo config
828595723b76e4a35b5253d9f2ccb4f897f1845a ce835da266b3f8c34e4b7f398693ed068f67cb30 zach rice <zricer@protonmail.com> 1573431270 -0500 commit: epstein didnt kill himself
ce835da266b3f8c34e4b7f398693ed068f67cb30 5accbc40c35906d99f073881fb8746c314f9d59f zach rice <zricer@protonmail.com> 1573431335 -0500 commit: removing a really important link
5accbc40c35906d99f073881fb8746c314f9d59f 7b2eba252004b7c867413def2a0984d545daab8b zach rice <zricer@protonmail.com> 1573431386 -0500 commit: gitleaks toml
@@ -0,0 +1,3 @@
0000000000000000000000000000000000000000 f61cd8587b7ac1d75a89a0c9af870a2f24c60263 zach rice <zricer@protonmail.com> 1572024822 -0400 branch: Created from HEAD
f61cd8587b7ac1d75a89a0c9af870a2f24c60263 deea550dd6c7acaf0e59432600593533984a2125 zach rice <zricer@protonmail.com> 1572024903 -0400 commit: dev branch
deea550dd6c7acaf0e59432600593533984a2125 64cfcee9aad1c84581631636bfc54f2050718d1a zach rice <zricer@protonmail.com> 1572024982 -0400 commit: rm secrets
@@ -0,0 +1,14 @@
0000000000000000000000000000000000000000 85699e429f33e75541530998a5b5d457a12e6285 zach rice <zricer@protonmail.com> 1572022632 -0400 commit (initial): init
85699e429f33e75541530998a5b5d457a12e6285 b10b3e2cb320a8c211fda94c4567299d37de7776 zach rice <zricer@protonmail.com> 1572022719 -0400 commit: adding aws key
b10b3e2cb320a8c211fda94c4567299d37de7776 51f6dcf6b89b93f4075ba92c400b075631a6cc93 zach rice <zricer@protonmail.com> 1572022773 -0400 commit: no secrets
51f6dcf6b89b93f4075ba92c400b075631a6cc93 17471a5fda722a9e423f1a0d3f0d267ea009d41c zach rice <zricer@protonmail.com> 1572022887 -0400 commit: wait this is actually adding an aws secret
17471a5fda722a9e423f1a0d3f0d267ea009d41c 996865bb912f3bc45898a370a13aadb315014b55 zach rice <zricer@protonmail.com> 1572023261 -0400 commit: committing pem
996865bb912f3bc45898a370a13aadb315014b55 d8ac0b73aeeb45843319cdc5ce506516eb49bf7a zach rice <zricer@protonmail.com> 1572023319 -0400 commit: removing secret.pem
d8ac0b73aeeb45843319cdc5ce506516eb49bf7a b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba zach rice <zricer@protonmail.com> 1572023528 -0400 commit: adding another one
b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba f61cd8587b7ac1d75a89a0c9af870a2f24c60263 zach rice <zricer@protonmail.com> 1572023552 -0400 commit: rm secrets again
f61cd8587b7ac1d75a89a0c9af870a2f24c60263 84ac4e80d4dbf2c968b64e9d4005f5079795bb81 zach rice <zricer@protonmail.com> 1572026048 -0400 commit: more secrets
84ac4e80d4dbf2c968b64e9d4005f5079795bb81 cd5eb8bef855f73c46b97b4c088badffdc40ebe9 zach rice <zricer@protonmail.com> 1572026066 -0400 commit: rm secrets
cd5eb8bef855f73c46b97b4c088badffdc40ebe9 828595723b76e4a35b5253d9f2ccb4f897f1845a zach rice <zricer@protonmail.com> 1573429084 -0500 commit: adding repo config
828595723b76e4a35b5253d9f2ccb4f897f1845a ce835da266b3f8c34e4b7f398693ed068f67cb30 zach rice <zricer@protonmail.com> 1573431270 -0500 commit: epstein didnt kill himself
ce835da266b3f8c34e4b7f398693ed068f67cb30 5accbc40c35906d99f073881fb8746c314f9d59f zach rice <zricer@protonmail.com> 1573431335 -0500 commit: removing a really important link
5accbc40c35906d99f073881fb8746c314f9d59f 7b2eba252004b7c867413def2a0984d545daab8b zach rice <zricer@protonmail.com> 1573431386 -0500 commit: gitleaks toml
@@ -0,0 +1,3 @@
x²▌A
1 E]В╧─р╓²f
"^%M#8S╘uЦИ╞ЮЙц{<Ьзжu@4F7┐■ ╖■EfC ЛФ␍ё╣─яФX╚о╤ В■nш─┌╬#-│╪лJ┬╥*9j°Sн5p5fNNчЦч:|DОп58~с╞очFшVY'mКpbРDл▌>zОv╨_ЖWЛ╤/сnЦЕ╬ЩfGН
@@ -0,0 +1 @@
x²▌Qj!ВшSТ╡ьшз*└░╚hOо╝Л8bысgr┘|<ЙAIo╜N╦╧p≥C0zDt╔■Ю╒▒┘qе(ы%Ni ╓▀╡≤#щ'┬FРK╬1Zё░SWбJ)r:EкqЕ ┘╛и_Ся╪╡<`TQxЩa|ёо╬╥\╥╚ТЖХ9B"oж[kнУL°З╞ЁзЗwщО░ahч╤╗МХcФ3~╚ШсЭvЙPK
@@ -0,0 +1,5 @@
x}’1OΓ0…™σ+u@B΅��T��²tB*00ΊΝµ6qΞQl+2Ώ�»$-!Hd�ΗΎ{ο»··nΛϋΕΥl6ƒ7m<�E88
Κ�ο*�‡ƒ‡,ΛV› =,AcΚΑ!Ή!Υ†dέ@ές~€ΦX ^»— �ρ£Λ·η‡kγu¶ZΕ���\:Rΐf1έ.z
`�+Α�’uIU*Υ�:�­ΨLΛoΨJ�i§shPY›�F·Φ{οl hΣτΌ8(‚“;+‡*�—w†NηυτΆVZε ¶@4υΞ�‘(‰).;ξo�Ν!΅�Γ+bΞς‘ΰγε½g?λΐ σ�Jτ‚ώβ�7γ΅
9S(LΑdKβimwωμ�μ'¬s F­Οd®•΅¦bω—�…ό$€έό+Fµ(Aϋ„V–'½��G―�αΦν␍6βα3ϊΐΑ­ω―ς ΅³μί0
*$–�®qH�Πc@ƒdaτ�b�ΖγιΈ$®�gΩ7ΧD
@@ -0,0 +1,3 @@
xќОQ
В0PїsЉЅЂІY“l
"^e»ЭТ‚1’ЖOoх~Н0р`ґ–Іv вCofђт€„q в^tђyдђИ<з@вU™ОИЮ=ҐЩЈГњјN9fYФO%тc™Qh¦  )ќќјъRјEh«\ЮЯh·g«Ѕ>Љ¬ч“Цr™vЃ!ГўЫЧэb·ї°+µl¦Нъж>љџG–
@@ -0,0 +1,3 @@
xќЋK
В0@]чse2щЊЇ2M&¶`љ⦧·.јЂ«јXKY:Ќ§ЮT5¦ *‚‡мЈ¤+2‹ъIЇЋРyvh§‡Mљ® ;6вs&’QЩl“Н�(°
в�њ‰ѓјы\мghKTён_ґЗЦjЇk‘еu‰µЬБx&$KБАвpШc±л_сЇ^Ц'lZ†џ>J$
@@ -0,0 +1,3 @@
xťŽ]
Â0„}Î)öJÜćDĽJ˛ŮŇ‚iĘ6ľôôĆ+ř40ó1Ôj]; ÚKf09á}ŔčË4Q(Ţ3k‰l¦Á‚etXÔž„·Á$2t1%ĎHŃ…ě Çb´¶łŐ>úhsw•>}ig˘d%†Çů yíŇzŰjZß7jő wëQŁÓÎÁUŤí¸Řůݱ’
“p?Ô íG|
@@ -0,0 +1 @@
xťŽAjÄ0 EgíSč-ŽlE ĄW‘™�‰ăป9}Ó+tőŕ?>ĽÔj-ĐOŹŃU!z¶ŮňŠ"#96D ”$Î3#-Ń«MÂ攮ǀp»…]äY˝8Š„äÖ%cJŃç°pž‚'1ň3¶Öá-i�^’Âóý‡ţ}ö6ÚQĄěź©Ő/��ťw˛…KÖš{˝‡ţëlôĽ†–Ö˛ŢąŻ˛ď°•zéžÍ/FŰMq
@@ -0,0 +1 @@
x��Aj1 E»צ)t��²b BָUdEIךסא¸]הפ™^!«ןkom™1}ֽadֲ%ֺWO¨†$\3#'־¨Y �pֳ�ױm2l�ְ|,GוC¼aױD…‹`צPהZ1�©9ש��>א%ת€±¨ֱיץ?ד²�>��dש9hog״�ׁGְִנם“קn§�ֵiֹnXכֻz‡§י°y״¬¹7¥&J/
@@ -0,0 +1,2 @@
x�ŽA
à E»ös�5JéUÆ™I¨1»Éé›^¡«ÿxðàS-eé`séM<{ŠÁ:‰!I&J‚.Ÿä§äÌèGQ6Y;d+yp8J1âÄ);DLÌ>Rdì'ã8£ÂOŸkƒi†¶�ÀýøM{n­öº\Þ7ªåÆ«íཅ«vZ«Óž»ü«V`jÒwÀ.«úÜÃKÝ
@@ -0,0 +1 @@
64cfcee9aad1c84581631636bfc54f2050718d1a
@@ -0,0 +1 @@
7b2eba252004b7c867413def2a0984d545daab8b
@@ -0,0 +1,6 @@
[[rules]]
description = "entropy"
entropies = [
"4.5-4.7",
]
tags = ["entropy"]
@@ -0,0 +1 @@
### This file does not contain any secrets
@@ -0,0 +1,21 @@
### This file contains some secrets
<Cthon98> hey, if you type in your pw, it will show as stars
<Cthon98> ********* see!
<AzureDiamond> hunter2
<AzureDiamond> doesnt look like stars to me
<Cthon98> <AzureDiamond> *******
<Cthon98> thats what I see
<AzureDiamond> oh, really?
<Cthon98> Absolutely
<AzureDiamond> you can go hunter2 my hunter2-ing hunter2
<AzureDiamond> haha, does that look funny to you?
<Cthon98> lol, yes. See, when YOU type hunter2, it shows to us as *******
<AzureDiamond> thats neat, I didnt know IRC did that
<Cthon98> yep, no matter how many times you type hunter2, it will show to us as *******
<AzureDiamond> awesome!
<AzureDiamond> wait, how do you know my pw?
<Cthon98> er, I just copy pasted YOUR ******'s and it appears to YOU as hunter2 cause its your pw
<AzureDiamond> oh, ok.