gosec v2.14 releases: Golang Security Checker
gosec – Golang Security Checker
Inspects source code for security problems by scanning the Go AST.
Usage
Gosec can be configured to only run a subset of rules, exclude certain file paths, and produce reports in different formats. By default, all rules will be run against the supplied input files. To recursively scan from the current directory you can supply ./… as the input argument.
Available rules
- G101: Look for hardcoded credentials
- G102: Bind to all interfaces
- G103: Audit the use of unsafe block
- G104: Audit errors not checked
- G106: Audit the use of ssh.InsecureIgnoreHostKey
- G107: Url provided to the HTTP request as taint input
- G108: Profiling endpoint automatically exposed on /debug/pprof
- G109: Potential Integer overflow made by strconv.Atoi result conversion to int16/32
- G110: Potential DoS vulnerability via decompression bomb
- G201: SQL query construction using a format string
- G202: SQL query construction using string concatenation
- G203: Use of unescaped data in HTML templates
- G204: Audit use of command execution
- G301: Poor file permissions used when creating a directory
- G302: Poor file permissions used with chmod
- G303: Creating tempfile using a predictable path
- G304: File path provided as taint input
- G305: File traversal when extracting zip/tar archive
- G306: Poor file permissions used when writing to a new file
- G307: Deferring a method which returns an error
- G401: Detect the usage of DES, RC4, MD5 or SHA1
- G402: Look for bad TLS connection settings
- G403: Ensure minimum RSA key length of 2048 bits
- G404: Insecure random number source (rand)
- G501: Import blocklist: crypto/md5
- G502: Import blocklist: crypto/des
- G503: Import blocklist: crypto/rc4
- G504: Import blocklist: net/http/cgi
- G505: Import blocklist: crypto/sha1
- G601: Implicit memory aliasing of items from a range statement
Retired rules
- G105: Audit the use of math/big.Int.Exp – CVE is fixed
Changelog v2.14
- 1af1d5b Pin release build to Go version 1.19.2 (#882)
- 0ae0174 Refactor to support duplicate imports with different aliases (#865)
- a2719d3 chore(deps): update all dependencies (#881)
- ed38681 go.mod: ginkgo/v2 v2.3.1, golang.org/x/text v0.3.8, update go versions (#880)
- 8466173 Update Go version to 1.19 in the makefile (#876)
- f9ad0d8 chore(deps): update all dependencies (#875)
- 6cd9e62 Add CWE-676 to cwe mapping (#874)
- bb4a1e3 chore(deps): update all dependencies (#872)
- 7ea37bb Add a way to use private repositories on GitHub (#869)
- e244c81 chore(deps): update all dependencies (#868)
- e9b2781 Check go version when installing govulncheck
- 88c23de Check go version when running govulncheck
- 84f6424 Add vulncheck to the test steps
- 180fc23 chore(deps): update all dependencies
- dfde579 Fix false positives for G404 with aliased packages
- aaaf80c chore(deps): update all dependencies
- ae58325 chore(deps): update all dependencies
- a892be9 fix: add a CWE ID mapping to rule G114
- a319b66 chore(deps): update golang.org/x/crypto digest to bc19a97