Skip to content

Commit 65dd80c

Browse files
[test] add material for gitleaks to work on
Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
1 parent 406cfe8 commit 65dd80c

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

.vscode/tasks.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "gitleaks",
8+
"type": "shell",
9+
"command": "docker run -v ${PWD}:/path gitleaks:latest dir /path -v --no-color | awk 'BEGIN { ORS=\"\" } /^Finding:/ {if (NR>1) print \"\\n\"; printf \"FINDING=%s|||\", substr($0, index($0,$2)) } /^Secret:/ {printf \"SECRET=%s|||\", $2} /^RuleID:/ {printf \"RULEID=%s|||\", $2} /^Entropy:/ {printf \"ENTROPY=%s|||\", $2} /^File:/ {printf \"FILE=%s|||\", $2} /^Line:/ {printf \"LINE=%s|||\", $2} /^Fingerprint:/ {printf \"FINGERPRINT=%s|||\", $2}'",
10+
"problemMatcher": {
11+
"source": "gitleaks",
12+
"owner": "gitleaks",
13+
"fileLocation": [
14+
"relative", "${workspaceFolder}"
15+
],
16+
"pattern": [
17+
{
18+
"regexp": "^FINDING=(.*?)[|]{3}SECRET=(.*?)[|]{3}RULEID=(.*?)[|]{3}ENTROPY=(.*?)[|]{3}FILE=\/path\/(.+)[|]{3}LINE=(.*?)[|]{3}FINGERPRINT=(.*?)[|]{3}$",
19+
"file": 5,
20+
"line": 6,
21+
"message": 1
22+
}
23+
]
24+
}
25+
}
26+
]
27+
}

test-gitleaks.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
This is a test - the following secret is fake
2+
3+
setup the following secret as an environment variable:
4+
5+
export SUPER_DUPER_SECRET="wibC7fyqq1"
6+
7+
BTW, looking for a good password? Here are a few!
8+
9+
"`_]TN)/+T`jp?19", "kW6hh*vu6wcF3g;", "gRoJ6ibcVv[zp}D", "8?JRgr}Kx-V('$aN-Ml_&"x%5CL)?<", "v9w1cRg4PUIVDyrSN63UTXkCgQRnxT5C"
10+
11+
12+
13+
one more secret!
14+
15+
ghp_ypwNi08kJx9H3YblGrkNFfqGaxat7d3cMPen
16+

0 commit comments

Comments
 (0)