Questions tagged [gosec]

The tag has no usage guidance.

gosec
Filter by
Sorted by
Tagged with
2 votes
1 answer
3k views

gosec linter: G101: Potential hardcoded credentials

I get this message from the gosec linter: foo/cloud.go:34:2: G101: Potential hardcoded credentials (gosec) fooAPIKeyENVVar = "Foo_API_KEY" How to disable this warning?
guettli's user avatar
  • 27.5k
4 votes
3 answers
4k views

How can I disable "TLS InsecureSkipVerify may be true" error

I have a code like this: if cfg.GetRedisTLS() { clientOpts.TLSConfig = &tls.Config{ MinVersion: tls.VersionTLS12, //nolint:gosec // need insecure TLS option for testing and ...
Rodolfo's user avatar
  • 1,111
3 votes
3 answers
4k views

GoLang untaint URL variable to fix gosec warning G107

If I run gosec on the below fragment I get a tainted URL warning: G107 (CWE-88): Potential HTTP request made with variable url (Confidence: MEDIUM, Severity: MEDIUM) I figured I should use the 'url' ...
user1016765's user avatar
  • 2,984