Skip to content

Commit 35906d5

Browse files
committed
test: fix permission denied error with logs path
1 parent 01cc30b commit 35906d5

7 files changed

+12
-10
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
1.0.0

internal/security/rule.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var (
4040
rules = []Rule{
4141
{
4242
Description: "ASYMMETRIC_PRIVATE_KEY",
43-
Regexp: regexp.MustCompile(string(`(\-){5}BEGIN[[:space:]]*?(RSA|OPENSSH|DSA|EC|PGP)?[[:space:]]*?PRIVATE[[:space:]]KEY[[:space:]]*?(BLOCK)?(\-){5}.*`)),
43+
Regexp: regexp.MustCompile(string(`(\-){5}BEGIN[[:blank:]]*?(RSA|OPENSSH|DSA|EC|PGP)?[[:blank:]]*?PRIVATE[[:blank:]]KEY[[:blank:]]*?(BLOCK)?(\-){5}.*`)),
4444
Tags: []string{"key"},
4545
Severity: SeverityMajor,
4646
},
@@ -58,7 +58,7 @@ var (
5858
},
5959
{
6060
Description: "BASE_64",
61-
Regexp: regexp.MustCompile("(?i)['\"]?((?:[_]?auth(?:Token|orization:[[:space:]]Basic)?)['\"]?[[:space:]=:]{1})[[:space:]]*['\"]?" + Base64Pattern + "['\"]?"),
61+
Regexp: regexp.MustCompile("(?i)['\"]?((?:[_]?auth(?:Token|orization:[[:blank:]]Basic)?)['\"]?[[:blank:]=:]{1})[[:blank:]]*['\"]?" + Base64Pattern + "['\"]?"),
6262
Tags: []string{"authentication", "base64"},
6363
Severity: SeverityMinor,
6464
},

test/data/application.json.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"non_compliant": {
77
"username": "root",
8-
"password: "Pa$$w0rd",
8+
"password": "Pa$$w0rd",
99
"environment": [
1010
"DB_PASSWORD=Pa$$w0rd"
1111
]

test/data/application.properties.golden

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Compliant
22
spring.datasource.password
3+
spring.datasource.password=
4+
spring.datasource.password=${PASSWORD}
35

46
# Non Compliant
57
database.url=jdbc:sqlserver://localhost;user=root;password=Pa$$w0rd;

test/data/config.json.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"auths": {
44
"https://index.docker.io/v1/": {
55
"email": "[email protected]",
6-
"auth":"X3Rva2VuOjEyMzQ1Njc4OTBBQkNERUY="
6+
"auth": "X3Rva2VuOjEyMzQ1Njc4OTBBQkNERUY="
77
}
88
}
99
}

test/data/language.go.golden

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import (
66
)
77

88
var (
9-
// Compliant
10-
password := os.Getenv("PASSWORD")
9+
// Compliant
10+
password := os.Getenv("PASSWORD")
1111
redisPassword := GetRedisPassword()
1212

13-
// Non Compliant
14-
databasePassword := "Pa$$w0rd"
13+
// Non Compliant
14+
databasePassword := "Pa$$w0rd"
1515
)
1616

1717
func main() {

test/data/pre-receive

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ while read -r OldRev NewRev RefName; do
66
--hook-type="pre-receive" \
77
--hook-input="$OldRev $NewRev $RefName" \
88
--verbose="true" \
9-
--logs-path="/var/log/watchdog/watchdog.log" \
9+
--logs-path="watchdog.log" \
1010
--logs-level="debug" \
1111
--output-format="%s"
1212
status=$?

0 commit comments

Comments
 (0)