Skip to main content
The 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:
Or authenticate with an API token:
Set 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 to main 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

All list commands support -o json. Pipe the output to jq to extract fields or count results:
The CLI exits with code 1 on errors and unexpected conditions. Failures propagate naturally to the CI build status without extra logic.
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.