Running HawkScan

Running HawkScan through the Docker CLI

The most straightforward way to kick off a HawkScan is through the command line. Kick off a scan by running the following docker command:


Run the following from a PowerShell prompt.

To set up the environment:

mkdir "~\.hawk"
echo '$env:HAWK_API_KEY="hawk.kkAAAKAWkAWWkkAAWWwW.kkAAAKAWkAWWkkAAWWwW"' > $home\.hawk\hawk.ps1

To run the scan:

& "~\.hawk\hawk.ps1"
docker run -e API_KEY=$env:HAWK_API_KEY --rm -v ${PWD}:/hawk:rw -it stackhawk/hawkscan:latest


Run the following from a shell.

To set up the environment:

mkdir ~/.hawk
echo "API_KEY=hawk.kkAAAKAWkAWWkkAAWWwW.kkAAAKAWkAWWkkAAWWwW" > ~/.hawk/hawk.rc

To run the scan:

docker run --rm -v $(pwd):/hawk:rw --network host --env-file=~/.hawk/hawk.rc -it stackhawk/hawkscan:latest stackhawk.yml

To better understand what this command does, let’s break it down:

  • docker run is how you run a new command in a Docker container
  • --rm tells Docker to automatically remove the HawkScan container once the scan has completed
  • -v $(pwd):/hawk:rw will mount the current working directory into the container, giving HawkScan access to local files in the repository, including the stackhawk.yml configuration file
  • -it stackhawk/hawkscan:latest will run Docker with the stackhawk/hawkscan image, creating an interactive bash shell in the running container. The :latest at the end of the command specifies the HawkScan docker image tagged with the latest update should be pulled down and used.

The last parameter stackhawk.yml is input into the Docker container, specifying the name of the applicable configuration file(s) to use. This last input is optional; if not provided, it will instead find and use the stackhawk.yml configuration in the current working directory.