BuildGuard CLI
Compliance scanning for GitHub organizations.
Overview
BuildGuard is a Go-based CLI that scans GitHub organizations for compliance violations. The open-source version includes 5 built-in policies covering Docker security, code ownership, secret exposure, branch protection, and SOX separation of duties.
Results are displayed in a human-readable table format or exported as JSON Lines for SIEM ingestion (Splunk, Wazuh, Elastic).
For the full product overview including additional policies and framework mappings, see the BuildGuard product page.
Installation
Homebrew (Recommended)
Direct Download
See the Downloads page for all platforms.
Commands
buildguard auth
Manage GitHub authentication. Opens your browser to create a GitHub Personal Access Token with the required scopes (repo, read:org) pre-selected, then stores it securely.
- •
login— Opens browser to create PAT, stores token in~/.config/buildguard/credentials - •
status— Show current authentication status and token source - •
logout— Remove stored credentials
GITHUB_TOKENenvironment variableBUILDGUARD_TOKENenvironment variable- Stored credentials (
~/.config/buildguard/credentials) - GitHub CLI (
gh auth token)
buildguard scan
Runs a compliance audit across all repositories in a GitHub organization. Evaluates 5 built-in policies and displays a compliance summary.
- •
--org, -o— GitHub organization to scan (required) - •
--config, -c— Path to buildguard.json configuration file - •
--format, -f— Output format:pretty(default) orjsonl - •
--dry-run— Run without making changes
- •
pretty— Human-readable table with compliance score and policy breakdown - •
jsonl— JSON Lines format for SIEM ingestion (Wazuh, Splunk, Elastic)
buildguard init
Interactive setup wizard that creates a buildguard.json configuration file. Prompts for organization name, default branch, and per-policy enablement.
buildguard validate
Validates a buildguard.json configuration file and displays the parsed settings.
- •
--config, -c— Path to the configuration file to validate (defaults tobuildguard.json)
buildguard version
Displays the current BuildGuard version.
Configuration
BuildGuard reads from a buildguard.json file. Generate one with buildguard init or create it manually. The CLI also searches these default locations: buildguard.json, .buildguard.json, config/buildguard.json, ~/.buildguard.json
- •
organization.fallback_branches— Branches to check if default_branch doesn't exist - •
secret_exposure.patterns— Additional file patterns to check for secrets - •
branch_protection.min_reviewers— Minimum required reviewers (default: 1) - •
branch_protection.require_dismiss_stale— Require stale review dismissal - •
branch_protection.require_admin_enforcement— Require admins to follow rules
Built-in Policies
BuildGuard OSS includes 5 built-in policies. All are enabled by default. Disable or change severity per-policy in buildguard.json.
| ID | Name | Severity | Description |
|---|---|---|---|
| POL-SEC-01 | Docker Root User | Critical | Detects Dockerfiles running as root user |
| POL-GOV-02 | CODEOWNERS | Medium | Enforces presence of CODEOWNERS file |
| POL-SEC-03 | Secret Exposure | Critical | Prevents secrets from being committed |
| POL-SEC-04 | Branch Protection | High | Validates branch protection rules are enabled |
| POL-SOX-01 | SOX Separation | Critical | Enforces separation of duties for SOX compliance |
Need more policies? BuildGuard Team and Enterprise include 20+ policies with framework mappings (SOC2, SOX, NIST 800-53, ISO 27001, PCI-DSS, FedRAMP, CIS, HIPAA). View pricing →
Environment Variables
GITHUB_TOKEN
GitHub access token (optional if using buildguard auth login)
BUILDGUARD_TOKEN
Alternative to GITHUB_TOKEN
BUILDGUARD_ORG
Default organization name (overridden by --org flag)
BUILDGUARD_DEFAULT_BRANCH
Default branch to check (defaults to main)
CI Integration
Run BuildGuard in your CI pipeline using the pre-built binaries or Docker image.
GitHub Actions Example
Docker Example
Need More?
BuildGuard Team and Enterprise include:
- • 20+ policies with auto-remediation
- • Framework mappings (SOC2, SOX, NIST, ISO 27001, PCI-DSS, FedRAMP, CIS, HIPAA)
- • HTML, JSON, and PDF reports
- • PostgreSQL evidence ledger
- • Web dashboard
- • Slack/email notifications