Deprecated GitLab SAST orchestrator that runs Docker-based analyzers to perform static application security testing on source code and emit gl-sast-report.json results.
As of GitLab %13.4, Docker-in-Docker (DinD) for SAST is not supported anymore, and this project is no longer in use.
GitLab SAST performs Static Application Security Testing on given source code. It's written in Go using the common library shared by SAST, Dependency Scanning and their analyzers.
cd into the directory of the source code you want to scan
Run the Docker image:
docker run \
--interactive --tty --rm \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
registry.gitlab.com/gitlab-org/security-products/sast:${VERSION:-latest} /app/bin/run /code
VERSION can be replaced with the latest available release matching your GitLab version. See Versioning for more details.
The results will be displayed and also stored in gl-sast-report.json
Why mounting the Docker socket?
SAST acts as a container orchestrator: it will pull and run analyzers (Docker images) based on the languages and frameworks detected.
See https://docs.gitlab.com/ee/user/application_security/sast/#available-variables.
Go 1.13 or higher is highly recommended to build this SAST.
go build -o sast
To run the command locally and perform the scan on /tmp/code:
CI_PROJECT_DIR=/tmp/code ./sast
To run the integration tests:
./test.sh
To write a custom analyzer that will integrate into the GitLab application a minimum number of features are required.
For integration into the GitLab product itself, the license must be evaluated.
Please check the Release Process documentation.
If you want to help and extend the list of supported scanners, read the contribution guidelines.