Hadolint Dockerfile check Integration with DefectDojo
Hadolint is an open-source Dockerfile linter written in Haskell that parses Dockerfiles into Abstract Syntax Trees to check for security vulnerabilities, performance issues, and adherence to best practices, while leveraging ShellCheck to validate inline Bash code within RUN instructions. The tool identifies common misconfigurations including the use of latest tags, missing version pinning, inefficient layer caching, security risks, and non-compliance with CIS Docker Benchmarks, providing detailed feedback with severity ratings to help developers create optimized, secure container images before deployment.
Data Granularity: What Gets Imported
The following fields are captured from Hadolint Dockerfile check results and surfaced in DefectDojo findings:
| Field | Source | Notes |
|---|---|---|
| Title | Finding name from the scan | Matched to the tool's own naming |
| Severity | Critical / High / Medium / Low / Info | Mapped from the tool's own severity scale |
| Description | Finding detail from the report | Includes what the issue is and why it matters |
| Mitigation | Remediation guidance | Where the tool provides it |
Importing Into DefectDojo
Use the DefectDojo import API to create a new Test under the relevant Engagement for your product. The request body:
{
"scan_type": "Hadolint Dockerfile check",
"engagement": "<engagement-id>",
"file": "results.json"
}