Issue
When running HawkScan in GitLab, the following error appears in the GitLab runner logs and the scan fails to run:
General Configuration Error: No default configuration file (stackhawk.yml,stackhawk.yaml) found in /hawk"
Cause
One or more of the following issues with the Docker configuration is present in GitLab's Docker runner config (config.toml):
Docker isn't running in privileged mode (
privileged = true) in the GitLab runnerThe Docker UNIX socket (
docker.sock) isn't mounted within the runnerVolume mounting issues associated with using the
docker.dindimage inconfig.toml
Solution
Configure Docker to run:
In privileged mode
With
docker.sockin thevolumesconfiguration inconfig.tomlWith
"/builds:/builds"in thevolumeslist inconfig.toml(see Issue 4794 on GitLab's issue list for more details)
For example:
[[runners]]
name = "stackhawk-test"
url = "https://git.example.org/"
token = "xxxxxxxxxxxxxxxxxxxx"
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:stable"
privileged = true
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock","/cache","/builds:/builds"]
shm_size = 0
Additional Information
Other Incarnations:
This docker socket issue in can manifest elsewhere in the GitLab environment, such as:
at the
docker runstage (error:<output indicates no files found, meaning the local dir was not mounted>)"
File doesn't exist" error when attempting to read in an OpenAPI specification
