package
0.0.0-20180901114220-8afd9cbb6cfb
Repository: https://github.com/golangci/gosec.git
Documentation: pkg.go.dev
# Functions
NewLogger returns a logger and the buffer that it will be written to.
NewMockVisitor creates a new empty struct, the Context and Callback must be set manually.
NewTestPackage will create a new and empty package.
# Variables
SampleCode601 - Go build tags.
SampleCodeG101 code snippets for hardcoded credentials.
SampleCodeG102 code snippets for network binding.
SampleCodeG103 find instances of unsafe blocks for auditing purposes.
SampleCodeG104 finds errors that aren't being handled.
SampleCodeG105 - bignum overflow.
SampleCodeG106 - ssh InsecureIgnoreHostKey.
SampleCodeG201 - SQL injection via format string.
SampleCodeG202 - SQL query string building via string concatenation.
SampleCodeG203 - Template checks.
SampleCodeG204 - Subprocess auditing.
SampleCodeG301 - mkdir permission check.
SampleCodeG302 - file create / chmod permissions check.
SampleCodeG303 - bad tempfile permissions & hardcoded shared path.
SampleCodeG304 - potential file inclusion vulnerability.
SampleCodeG305 - File path traversal when extracting zip archives.
SampleCodeG401 - Use of weak crypto MD5.
SampleCodeG401b - Use of weak crypto SHA1.
SampleCodeG402 - TLS settings.
SampleCodeG403 - weak key strength.
SampleCodeG404 - weak random number.
SampleCodeG501 - Blacklisted import MD5.
SampleCodeG502 - Blacklisted import DES.
SampleCodeG503 - Blacklisted import RC4.
SampleCodeG504 - Blacklisted import CGI.
SampleCodeG505 - Blacklisted import SHA1.
# Structs
CodeSample encapsulates a snippet of source code that compiles, and how many errors should be detected.
MockVisitor is useful for stubbing out ast.Visitor with callback and looking for specific conditions to exist.
TestPackage is a mock package for testing purposes.