scans repos for credentials and then shouts if it finds them
Pre-built versions of the cred-alert-cli
binary are available for download. To
install download the correct version (macOs or Linux),
rename the file cred-alert-cli
, make it executable, and move it to a directory in ${PATH}
.
os_name=$(uname | awk '{print tolower($1)}')
curl -o cred-alert-cli \
https://s3.amazonaws.com/cred-alert/cli/current-release/cred-alert-cli_${os_name}
chmod 755 cred-alert-cli
mv cred-alert-cli /usr/local/bin # <= or other directory in ${PATH}
The command line application can be built with the following command. Your
$GOPATH
should already be set correctly by direnv
.
$ go install github.com/pivotal-cf/cred-alert
The default behavior of the cli is to read from standard input, scan for secrets, and report any matches on standard output. It can also be used to recursively scan files in a directory. Use --help to see all options.
$ ./cred-alert scan -f src/cred-alert/product.zip
$ ./cred-alert scan -f .
$ cat sniff/patterns/samples_for_test.go | ./cred-alert scan
Cred alert supports scanning diffs on standard input. When scanning a diff use the
--diff
flag.
$ git diff | ./cred-alert scan --diff
To override the default RegExp in order to scan for a specific vulnerability, use --regexp for a single RegExp or --regexp-file for newline delimited RegExp file
$ git diff | ./cred-alert scan --diff --regexp-file custom-regexp
0
No error occurred and no credentials found
1
Miscellaneous error occurred
3
Found credentials
Cred-Alert CLI Instructions - SIMPLE
The tests can be run using the ginkgo
command line tool. This can be
installed with:
$ go install github.com/onsi/ginkgo/ginkgo
The fakes can be generated using the counterfeiter
tool. This can be
installed with:
$ go get github.com/maxbrunsfeld/counterfeiter
You can generate a pretty commit message by running scripts/commit-with-log
.