Pārlūkot izejas kodu

golangci-lint: enable gosec linter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 6 gadi atpakaļ
vecāks
revīzija
c9553897f3
2 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 10 0
      hack/validate/golangci-lint.yml
  2. 1 0
      testutil/registry/registry.go

+ 10 - 0
hack/validate/golangci-lint.yml

@@ -4,6 +4,7 @@ linters:
     - gofmt
     - goimports
     - golint
+    - gosec
     - gosimple
     - govet
     - ineffassign
@@ -29,3 +30,12 @@ linters:
 linters-settings:
   govet:
     check-shadowing: false
+
+issues:
+  exclude-rules:
+    - text: "G201: SQL string formatting"
+      linters:
+        - gosec
+    - text: "G202: SQL string concatenation"
+      linters:
+        - gosec

+ 1 - 0
testutil/registry/registry.go

@@ -84,6 +84,7 @@ http:
 	case "htpasswd":
 		htpasswdPath := filepath.Join(tmp, "htpasswd")
 		// generated with: htpasswd -Bbn testuser testpassword
+		// #nosec G101
 		userpasswd := "testuser:$2y$05$sBsSqk0OpSD1uTZkHXc4FeJ0Z70wLQdAX/82UiHuQOKbNbBrzs63m"
 		username = "testuser"
 		password = "testpassword"