add testing files and create create scan command

This commit is contained in:
Maidul Islam
2023-05-17 13:08:00 -04:00
parent b3e68cf3fb
commit 8249043826
137 changed files with 1883 additions and 573 deletions

2
cli/testdata/repos/small/README.md vendored Normal file
View File

@@ -0,0 +1,2 @@
# test
This is a repo used for testing gitleaks

7
cli/testdata/repos/small/api/api.go vendored Normal file
View File

@@ -0,0 +1,7 @@
package api
import "fmt"
func PrintHello() {
fmt.Println("hello")
}

View File

@@ -0,0 +1 @@
removing secret from foo package

View File

@@ -0,0 +1 @@
2e1db472eeba53f06c4026ae4566ea022e36598e branch 'main' of github.com:gitleaks/test

1
cli/testdata/repos/small/dotGit/HEAD vendored Normal file
View File

@@ -0,0 +1 @@
ref: refs/heads/main

View File

@@ -0,0 +1 @@
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587

13
cli/testdata/repos/small/dotGit/config vendored Normal file
View File

@@ -0,0 +1,13 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = git@github.com:gitleaks/test.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
remote = origin
merge = refs/heads/main

View File

@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.

BIN
cli/testdata/repos/small/dotGit/index vendored Normal file

Binary file not shown.

View File

@@ -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]
# *~

View File

@@ -0,0 +1,13 @@
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896329 -0500 clone: from github.com:gitleaks/test.git
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896362 -0500 checkout: moving from main to remove-secrets
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 906335481df9a4b48906c90318b4fac76b67fe73 Zach Rice <zricer@protonmail.com> 1635896426 -0500 commit: load token via env var
906335481df9a4b48906c90318b4fac76b67fe73 a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896518 -0500 commit: add api package
a122b33c6bad3ee54724f52f2caad385ab1982ab a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896543 -0500 checkout: moving from remove-secrets to api-pkg
a122b33c6bad3ee54724f52f2caad385ab1982ab 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896644 -0500 checkout: moving from api-pkg to main
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896648 -0500 pull origin main: Fast-forward
2e1db472eeba53f06c4026ae4566ea022e36598e 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896716 -0500 checkout: moving from main to foo
2e1db472eeba53f06c4026ae4566ea022e36598e 491504d5a31946ce75e22554cc34203d8e5ff3ca Zach Rice <zricer@protonmail.com> 1635896886 -0500 commit: adding foo package with secret
491504d5a31946ce75e22554cc34203d8e5ff3ca f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635896931 -0500 commit: removing secret from foo package
f1b58b97808f8e744f6a23c693859df5b5968901 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635897009 -0500 checkout: moving from foo to main
2e1db472eeba53f06c4026ae4566ea022e36598e f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635897062 -0500 checkout: moving from main to foo
f1b58b97808f8e744f6a23c693859df5b5968901 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635897508 -0500 checkout: moving from foo to main

View File

@@ -0,0 +1 @@
0000000000000000000000000000000000000000 a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896543 -0500 branch: Created from HEAD

View File

@@ -0,0 +1,3 @@
0000000000000000000000000000000000000000 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896716 -0500 branch: Created from HEAD
2e1db472eeba53f06c4026ae4566ea022e36598e 491504d5a31946ce75e22554cc34203d8e5ff3ca Zach Rice <zricer@protonmail.com> 1635896886 -0500 commit: adding foo package with secret
491504d5a31946ce75e22554cc34203d8e5ff3ca f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635896931 -0500 commit: removing secret from foo package

View File

@@ -0,0 +1,2 @@
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896329 -0500 clone: from github.com:gitleaks/test.git
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896648 -0500 pull origin main: Fast-forward

View File

@@ -0,0 +1,3 @@
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896362 -0500 branch: Created from HEAD
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 906335481df9a4b48906c90318b4fac76b67fe73 Zach Rice <zricer@protonmail.com> 1635896426 -0500 commit: load token via env var
906335481df9a4b48906c90318b4fac76b67fe73 a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896518 -0500 commit: add api package

View File

@@ -0,0 +1 @@
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896329 -0500 clone: from github.com:gitleaks/test.git

View File

@@ -0,0 +1 @@
0000000000000000000000000000000000000000 a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896552 -0500 update by push

View File

@@ -0,0 +1 @@
0000000000000000000000000000000000000000 f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635896935 -0500 update by push

View File

@@ -0,0 +1 @@
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896648 -0500 pull origin main: fast-forward

View File

@@ -0,0 +1 @@
xU<>1 <0B>0`<60>ܯ8nJ<6E><4A>.<2E><><EFBFBD>:*(8<><38>\<5C><>ɕ$<24> <20>w3 Nox<6F>{<7B>$6<>f1<66>~<7E>wF'0<>YbF

View File

@@ -0,0 +1,3 @@
x<01><>M
<EFBFBD>0F]<5D>s%<25><>t
"<22><><EFBFBD><EFBFBD>I2<49>E۔<10><><EFBFBD><EFBFBD> <0C>>x<>_<><5F>2w@;<3B>z㑈ءC<D8A1>X<EFBFBD><58>@<40><><EFBFBD>6 5<>)<0E><><EFBFBD>M<EFBFBD>&<26><><EFBFBD>F:l'<27>F<EFBFBD>THďFF<46>1<EFBFBD><31>iP<69><50>Sm<53><6D>4<EFBFBD>cN<02>o;<3B>ݷV{]<17>ߗT<DF97><1B>`=<3D><>a<EFBFBD><61><EFBFBD>Z<EFBFBD><5A><17><><15>w<EFBFBD> <0C><>d<EFBFBD>}f<>u<EFBFBD><75><EFBFBD><EFBFBD>KK<4B>

View File

@@ -0,0 +1,2 @@
# pack-refs with: peeled fully-peeled sorted
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 refs/remotes/origin/main

View File

@@ -0,0 +1 @@
a122b33c6bad3ee54724f52f2caad385ab1982ab

View File

@@ -0,0 +1 @@
f1b58b97808f8e744f6a23c693859df5b5968901

View File

@@ -0,0 +1 @@
2e1db472eeba53f06c4026ae4566ea022e36598e

View File

@@ -0,0 +1 @@
a122b33c6bad3ee54724f52f2caad385ab1982ab

View File

@@ -0,0 +1 @@
ref: refs/remotes/origin/main

View File

@@ -0,0 +1 @@
a122b33c6bad3ee54724f52f2caad385ab1982ab

View File

@@ -0,0 +1 @@
f1b58b97808f8e744f6a23c693859df5b5968901

View File

@@ -0,0 +1 @@
2e1db472eeba53f06c4026ae4566ea022e36598e

27
cli/testdata/repos/small/main.go vendored Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"fmt"
"os"
)
func main() {
var a = "initial"
fmt.Println(a)
var b, c int = 1, 2
fmt.Println(b, c)
var d = true
fmt.Println(d)
var e int
fmt.Println(e)
// load secret via env
awsToken := os.Getenv("AWS_TOKEN")
f := "apple"
fmt.Println(f)
}