Install with brew/linuxbrew:
brew install tfsec
Install with Chocolatey:
choco install tfsec
You can also grab the binary for your system from the releases page.
Alternatively, install with Go:
go get -u github.com/tfsec/tfsec/cmd/tfsec
tfsec will scan the specified directory. If no directory is specified, the current working directory will be used.
The exit status will be non-zero if tfsec finds problems, otherwise the exit status will be zero.
As an alternative to installing and running tfsec on your system, you may run tfsec in a Docker container.
docker run --rm -it -v "$(pwd):/src" tfsec/tfsec /src
If you want to run tfsec on your repository as a GitHub Action, you can use https://github.com/marketplace/actions/run-tfsec-with-sarif-upload. See github action page for more details