CmdID

CmdID / Commands

gosec

Inspect Go source code for security problems. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Inspect Go source code for security problems. Note: ./... is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.

Scan a Go package recursively in the current directory

gosec ./...Identify

Scan a specific Go package

gosec path/to/packageIdentify

Scan a Go package recursively and save results to a file

gosec -fmt json -out path/to/report ./...Identify

Only include a specific set of rules (by default, all rules will run)

gosec -include G101,G203,G401,... ./...Identify

Exclude directories from scanning

gosec -exclude-dir path/to/excluded_directory ./...Identify

Scan with a specific severity or confidence level

gosec -severity low -confidence low ./...Identify

Exclude a specific set of rules from scanning

gosec -exclude G101,G304,G401,... ./...Identify

Scan test files as well

gosec -tests ./...Identify