infraudit CLI is designed to work as a security gate in automated pipelines. Use --output json with jq to parse results programmatically and fail the build when critical findings are present.
Authentication in CI
Never store credentials in the repository or hardcode them in pipeline files. Pass them via CI secrets:INFRAUDIT_SERVER_URL as a CI secret rather than hardcoding your server address:
GitHub Actions
The following workflow runs a drift scan and vulnerability scan on every push tomain and on a daily schedule. It fails the job if any critical findings are present:
GitLab CI
Shell script pattern
For custom pipeline environments or cron jobs:Tips
Parse specific fields from JSON output
Parse specific fields from JSON output
All list commands support
-o json. Pipe the output to jq to extract fields or count results:Exit codes
Exit codes
The CLI exits with code
1 on errors and unexpected conditions. Failures propagate naturally to the CI build status without extra logic.Caching the binary
Caching the binary
To avoid reinstalling the CLI on every run, cache the
$HOME/go/bin directory using your CI platform’s caching mechanism. In GitHub Actions, use actions/cache keyed on the CLI version.