- Define environment variables:
TARGET_ORG
: the name of the GitHUb organisation to crawl, examplesnyk
GH_TOKEN
: a GitHub token with read permissions on all the repositoriesDH_USERNAME
: (Optional) Docker hub username to access base image history from DockerhubDH_PASSWORD_OR_PAT
: (Optional) Docker hub passwor to access base image history from DockerhubGOOGLE_SERVICE_ACCOUNT_JSON
: (Optional) Google Cloud SA key for accessing the container registry
- Build the
static-detector
and copy it in thesrc
folder - Run
./static_scan.sh
in the context of thecrawler
folder - Alternatively, run the 2 components independently:
./collect_dockerfiles.sh
./scan_dockerfiles.sh
- Build the container image:
docker build . -f gh_crawler/docker/Dockerfile -t static-scanner:latest
- Run the container image:
docker run -e TARGET_ORG -e GH_TOKEN -e DH_USERNAME -e DH_PASSWORD_OR_PAT -e GOOGLE_SERVICE_ACCOUNT_JSON static-scanner:latest
The attached circleci.yaml
shows how to use the static detector to crawl & scan all Dockerfiles in a given org.