Skip to content

Commit

Permalink
test: fix permission denied error with logs path
Browse files Browse the repository at this point in the history
  • Loading branch information
HabibMAALEM committed Nov 30, 2020
1 parent 01cc30b commit 35906d5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
1.0.0
4 changes: 2 additions & 2 deletions internal/security/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
rules = []Rule{
{
Description: "ASYMMETRIC_PRIVATE_KEY",
Regexp: regexp.MustCompile(string(`(\-){5}BEGIN[[:space:]]*?(RSA|OPENSSH|DSA|EC|PGP)?[[:space:]]*?PRIVATE[[:space:]]KEY[[:space:]]*?(BLOCK)?(\-){5}.*`)),
Regexp: regexp.MustCompile(string(`(\-){5}BEGIN[[:blank:]]*?(RSA|OPENSSH|DSA|EC|PGP)?[[:blank:]]*?PRIVATE[[:blank:]]KEY[[:blank:]]*?(BLOCK)?(\-){5}.*`)),
Tags: []string{"key"},
Severity: SeverityMajor,
},
Expand All @@ -58,7 +58,7 @@ var (
},
{
Description: "BASE_64",
Regexp: regexp.MustCompile("(?i)['\"]?((?:[_]?auth(?:Token|orization:[[:space:]]Basic)?)['\"]?[[:space:]=:]{1})[[:space:]]*['\"]?" + Base64Pattern + "['\"]?"),
Regexp: regexp.MustCompile("(?i)['\"]?((?:[_]?auth(?:Token|orization:[[:blank:]]Basic)?)['\"]?[[:blank:]=:]{1})[[:blank:]]*['\"]?" + Base64Pattern + "['\"]?"),
Tags: []string{"authentication", "base64"},
Severity: SeverityMinor,
},
Expand Down
2 changes: 1 addition & 1 deletion test/data/application.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"non_compliant": {
"username": "root",
"password: "Pa$$w0rd",
"password": "Pa$$w0rd",
"environment": [
"DB_PASSWORD=Pa$$w0rd"
]
Expand Down
2 changes: 2 additions & 0 deletions test/data/application.properties.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Compliant
spring.datasource.password
spring.datasource.password=
spring.datasource.password=${PASSWORD}

# Non Compliant
database.url=jdbc:sqlserver://localhost;user=root;password=Pa$$w0rd;
Expand Down
2 changes: 1 addition & 1 deletion test/data/config.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"auths": {
"https://index.docker.io/v1/": {
"email": "john.doe@acme.com",
"auth":"X3Rva2VuOjEyMzQ1Njc4OTBBQkNERUY="
"auth": "X3Rva2VuOjEyMzQ1Njc4OTBBQkNERUY="
}
}
}
8 changes: 4 additions & 4 deletions test/data/language.go.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
)

var (
// Compliant
password := os.Getenv("PASSWORD")
// Compliant
password := os.Getenv("PASSWORD")
redisPassword := GetRedisPassword()

// Non Compliant
databasePassword := "Pa$$w0rd"
// Non Compliant
databasePassword := "Pa$$w0rd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion test/data/pre-receive
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ while read -r OldRev NewRev RefName; do
--hook-type="pre-receive" \
--hook-input="$OldRev $NewRev $RefName" \
--verbose="true" \
--logs-path="/var/log/watchdog/watchdog.log" \
--logs-path="watchdog.log" \
--logs-level="debug" \
--output-format="%s"
status=$?
Expand Down

0 comments on commit 35906d5

Please sign in to comment.