Usage
Installation
You can install the CybeDefend CLI using one of the following methods:1. Pre-built Binaries
Supported Platforms:- macOS:
cybedefend-darwin-amd64
(Intel) orcybedefend-darwin-arm64
(Apple Silicon M1/M2) - Linux:
cybedefend-linux-amd64
(64-bit) orcybedefend-linux-386
(32-bit) - Windows:
cybedefend-windows-amd64.exe
(64-bit) orcybedefend-windows-386.exe
(32-bit)
- Download the latest release for your platform from the GitHub Releases page
- Make Executable (Linux/macOS):
- Move to PATH:
- Verify Installation:
2. Build from Source
3. Docker Image
A pre-built Docker image is available on GitHub Container Registry:Configuration
Config File (config.yaml
in ./
, $HOME/.cybedefend
, or /etc/cybedefend
):
CYBEDEFEND_API_URL
- API base URLCYBEDEFEND_REGION
- Platform region (us
oreu
). Ignored ifCYBEDEFEND_API_URL
is setCYBEDEFEND_API_KEY
- API key for authenticationCYBEDEFEND_PROJECT_ID
- Default project ID
--region
- Platform region (us
oreu
). Selectshttps://api-us.cybedefend.com
orhttps://api-eu.cybedefend.com
--api-url
- API base URL (manual override; takes precedence over--region
)--api-key
- API key--project-id
- Project ID
Commands
1. scan
--dir, -d
- Directory to scan (will be zipped before uploading). Cannot be used with--file
--file, -f
- Pre-zipped file to scan. Cannot be used with--dir
--project-id
- Project ID for the scan (required if not set in config/env)--api-key
- API key for authentication (can be set via config or env var)--region
- Platform region:us
(default) oreu
--api-url
- Manual API URL override (takes precedence over--region
)--wait, -w
- Wait for scan completion before exiting (default:true
)--interval
- Polling interval in seconds when waiting (default:5
)--break-on-fail
- Exit with error code if scan fails (default:false
)--break-on-severity
- Exit with error code if vulnerabilities of specified severity or higher are found. Values:critical
,high
,medium
,low
--ci
- CI/CD-friendly output (no colors, ASCII art, or extra formatting)
Examples
2. results
results.json
in the current directory.
Flags:
--project-id
- Project ID to fetch results (required if not set in config/env)--type, -t
- Type of results:sast
(default) oriac
--page, -p
- Page number to fetch (default:1
). Ignored if--all
is set--all, -a
- Fetch all results across all pages--output, -o
- Output format:json
(default),html
, orsarif
--filename, -f
- Output file name (default:results.json
)--filepath
- Path to save file (default:.
)--ci
- CI/CD-friendly output
Examples
3. version
Displays the CLI version:
4. completion
Generates shell autocompletion for bash, zsh, etc.:
CI/CD Integration
Combine thescan
and results
commands in your pipelines. The scan
command’s --wait
, --break-on-fail
, and --break-on-severity
flags are particularly useful for controlling pipeline flow based on scan outcomes.
For example, in GitHub Actions:
--ci
for minimal logs during the scan. The --break-on-*
flags allow automatic build failure based on your security policies. You can still use cybedefend results
to fetch detailed reports if the scan passes the break conditions or if you need the data regardless.
Related: Code Repository Scanning · CI/CD Integrations · GitHub CLI Repository