Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Eljakani/ward/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Ward uses standard Unix exit codes to indicate scan results. This is essential for CI/CD pipeline integration where the exit code determines whether a build passes or fails.Exit Code Reference
The scan completed successfully with no errors.This exit code is returned when:
- No
--fail-onthreshold is specified (regardless of findings) - A threshold is specified but no findings meet or exceed it
- The scan found no security issues at all
The scan failed or findings exceeded the severity threshold.This exit code is returned when:
- Findings at or above the
--fail-onthreshold were discovered - The scan encountered an error (missing config, invalid path, etc.)
Fail-On Threshold Behavior
The--fail-on flag sets a severity threshold that triggers exit code 1 when met or exceeded.
Severity Hierarchy
Severities are ordered from lowest to highest:- Info (lowest)
- Low
- Medium
- High
- Critical (highest)
Threshold Is Inclusive
When you set a threshold, Ward exits with code 1 if any finding at that severity level or higher is discovered.Implementation Details
Ward’s exit code logic is implemented in thecheckFailOn function:
Source: cmd/scan.go:177
CI/CD Examples
GitHub Actions
GitLab CI
Conditional Failure
You can use shell logic to customize exit behavior:Error Messages
Findings Exceed Threshold
- The threshold that was set (
high) - Count of findings at each severity level that met or exceeded the threshold
Configuration Errors
If Ward encounters configuration issues, it exits with code 1 and displays an error:Baseline Errors
--baseline.
Best Practices
Start Permissive
Begin with
--fail-on high in CI to avoid blocking on minor issues while you remediate existing findings.Use Baselines
Generate a baseline to suppress known findings, then use
--fail-on to prevent new issues.Gradual Strictness
Over time, lower the threshold from
high → medium → low as you improve security posture.Always Save Reports
Use
if: always() or when: always to save reports even when scans fail, for debugging.