### Install via Install Script (Windows) Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Downloads and runs the official install script for Windows using PowerShell. Requires PowerShell. ```powershell irm https://raw.githubusercontent.com/armis/armis-cli/main/scripts/install.ps1 | iex ``` -------------------------------- ### Install via Install Script (Linux/macOS) Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Downloads and runs the official install script for Linux and macOS. Requires curl and bash. ```bash curl -sSL https://raw.githubusercontent.com/armis/armis-cli/main/scripts/install.sh | bash ``` -------------------------------- ### Works Immediately Output Example Source: https://github.com/armissecurity/armis-cli/blob/main/docs/INSTALL-IMPROVEMENTS.md Output when installation works immediately without shell restart, including instructions for other terminals. ```text ✅ Armis CLI installed successfully! Location: /usr/local/bin/armis-cli Version: armis-cli version 1.0.2 🎉 Ready to use! The command is available in your PATH. Try it now: armis-cli --help 💡 Note: If you have other terminal windows open, you may need to: • Run 'hash -r' in those terminals, or • Open new terminal windows ``` -------------------------------- ### Upgrade Output Example Source: https://github.com/armissecurity/armis-cli/blob/main/docs/INSTALL-IMPROVEMENTS.md Shows the output when upgrading an existing installation, including current and new versions. ```text 📦 Upgrading existing installation... Current: armis-cli version 1.0.1 ✅ Armis CLI installed successfully! Location: /usr/local/bin/armis-cli Version: armis-cli version 1.0.2 ``` -------------------------------- ### Install via Go Install Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Installs the Armis CLI directly using the Go toolchain. Requires Go to be installed. ```bash go install github.com/ArmisSecurity/armis-cli/cmd/armis-cli@latest ``` -------------------------------- ### Install via Scoop (Windows) Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Adds the Armis Scoop bucket and installs the armis-cli package. Requires Scoop to be installed on Windows. ```powershell scoop bucket add armis https://github.com/ArmisSecurity/scoop-bucket scoop install armis-cli ``` -------------------------------- ### Test Release Process with GoReleaser Snapshot Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Commands to install GoReleaser locally, test the release configuration with a snapshot, and check the generated artifacts in the dist/ directory. ```bash # Install GoReleaser locally brew install goreleaser # Test the release configuration goreleaser release --snapshot --skip-publish --clean # Check the dist/ directory for generated artifacts ls -la dist/ ``` -------------------------------- ### Quick Install Script for Linux/macOS Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Downloads and runs the install script. Installs to ~/.local/bin (no sudo) or /usr/local/bin as fallback, verifies installation, and checks PATH. ```bash curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash ``` -------------------------------- ### Fish shell completion setup Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Generate and install the Fish completion script for armis-cli. Use the first command for the current session and the second for persistent setup. ```fish # Current shell session armis-cli completion fish | source ``` ```fish # Every new session armis-cli completion fish > ~/.config/fish/completions/armis-cli.fish ``` -------------------------------- ### Install via Homebrew (macOS/Linux) Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Installs the Armis CLI using Homebrew from the armis tap. Requires Homebrew to be installed on macOS or Linux. ```bash brew install armis/tap/armis-cli ``` -------------------------------- ### GitHub Actions Manual Installation Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Manual installation and execution of the CLI for full control. Installs via curl script, then runs scan with SARIF output and uploads results. ```yaml name: Security Scan on: [push, pull_request] jobs: security-scan: runs-on: ubuntu-latest permissions: contents: read actions: read security-events: write steps: - uses: actions/checkout@v4 - name: Install Armis CLI run: | curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash - name: Scan Repository env: ARMIS_CLIENT_ID: ${{ secrets.ARMIS_CLIENT_ID }} ARMIS_CLIENT_SECRET: ${{ secrets.ARMIS_CLIENT_SECRET }} run: | armis-cli scan repo . \ --format sarif \ --fail-on HIGH,CRITICAL \ > results.sarif - uses: github/codeql-action/upload-sarif@v4 if: always() with: sarif_file: results.sarif ``` -------------------------------- ### Zsh shell completion setup Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Generate and install the Zsh completion script for armis-cli. Enable completion once with `echo "autoload -U compinit; compinit" >> ~/.zshrc`. Use the first command for the current session, the second for persistent setup on Linux, and the third for macOS. ```zsh # Current shell session source <(armis-cli completion zsh) ``` ```zsh # Every new session (Linux) armis-cli completion zsh > "${fpath[1]}/_armis-cli" ``` ```zsh # Every new session (macOS) armis-cli completion zsh > $(brew --prefix)/share/zsh/site-functions/_armis-cli ``` -------------------------------- ### Create First Release with Git Tag Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Commands to tag a new version and push the tag to trigger the release workflow, which builds binaries, signs checksums, creates a GitHub release, and updates Homebrew and Scoop. ```bash # Tag a new version git tag -a v1.0.0 -m "First release with new distribution setup" # Push the tag (this triggers the release workflow) git push origin v1.0.0 ``` -------------------------------- ### Needs Shell Reload Output Example Source: https://github.com/armissecurity/armis-cli/blob/main/docs/INSTALL-IMPROVEMENTS.md Output when PATH modification is required, showing the reload command and direct execution path. ```text ✅ Armis CLI installed successfully! Location: /Users/user/.local/bin/armis-cli Version: armis-cli version 1.0.2 📝 Adding /Users/user/.local/bin to PATH in /Users/user/.zshrc... ✅ PATH updated in /Users/user/.zshrc 📋 To use armis-cli, you need to reload your shell configuration: source ~/.zshrc Or open a new terminal window. You can also run it directly: /Users/user/.local/bin/armis-cli --help ``` -------------------------------- ### Manual installation and scan workflow Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Use this workflow to install the Armis CLI manually and run a scan, providing maximum control. It uses `curl` to fetch the install script, sets credentials via environment variables, and outputs SARIF results. The scan fails on HIGH and CRITICAL findings. ```yaml name: Security Scan on: [push, pull_request] jobs: security-scan: runs-on: ubuntu-latest permissions: contents: read security-events: write steps: - uses: actions/checkout@v4 - name: Install Armis CLI run: | curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash - name: Run Security Scan env: ARMIS_CLIENT_ID: ${{ secrets.ARMIS_CLIENT_ID }} ARMIS_CLIENT_SECRET: ${{ secrets.ARMIS_CLIENT_SECRET }} run: | armis-cli scan repo . \ --format sarif \ --fail-on HIGH,CRITICAL \ > results.sarif - name: Upload SARIF uses: github/codeql-action/upload-sarif@v4 if: always() with: sarif_file: results.sarif ``` -------------------------------- ### Bash shell completion setup Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Generate and install the Bash completion script for armis-cli. Requires the bash-completion package. Use the first command for the current session, the second for persistent setup on Linux, and the third for macOS. ```bash # Current shell session source <(armis-cli completion bash) ``` ```bash # Every new session (Linux) armis-cli completion bash > /etc/bash_completion.d/armis-cli ``` ```bash # Every new session (macOS) armis-cli completion bash > $(brew --prefix)/etc/bash_completion.d/armis-cli ``` -------------------------------- ### PowerShell shell completion setup Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Generate and install the PowerShell completion script for armis-cli. Use the first command for the current session; for persistent setup, add the output of that command to your PowerShell profile. ```powershell # Current shell session armis-cli completion powershell | Out-String | Invoke-Expression ``` -------------------------------- ### Download GitHub Actions reusable workflow Source: https://github.com/armissecurity/armis-cli/blob/main/docs/ci-examples/README.md Copy the recommended reusable workflow file to .github/workflows/ in your repository using curl. ```bash # Recommended: Reusable workflow curl -o .github/workflows/security-scan.yml \ https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/docs/ci-examples/github-actions-reusable.yml ``` -------------------------------- ### Install and Run Armis CLI for Other CI Platforms Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md For CI platforms other than GitHub Actions, install the Armis CLI via the provided script and run a scan with JWT authentication. Set the `ARMIS_CLIENT_ID` and `ARMIS_CLIENT_SECRET` environment variables, then execute `armis-cli scan repo .` with SARIF output and fail on CRITICAL vulnerabilities. ```bash # Install curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash # Run scan (JWT auth - recommended) export ARMIS_CLIENT_ID="your-client-id" export ARMIS_CLIENT_SECRET="your-client-secret" armis-cli scan repo . --format sarif --fail-on CRITICAL ``` -------------------------------- ### Scan Container Image Examples Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Shows examples for scanning a remote image, a local image, and a tarball. ```bash # Scan remote image armis-cli scan image nginx:latest # Scan local image armis-cli scan image my-app:v1.0.0 # Scan tarball armis-cli scan image --tarball ./image.tar ``` -------------------------------- ### Create Scoop Bucket Repository Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Command to create the ArmisSecurity/scoop-bucket repository, which will be auto-populated by GoReleaser on each release. ```bash # Create repository: ArmisSecurity/scoop-bucket # This will be auto-populated by GoReleaser on each release ``` -------------------------------- ### JWT Authentication Example Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Set environment variables for JWT authentication and run a repository scan. The tenant ID is automatically extracted from the JWT token, so no separate tenant ID is needed. ```bash export ARMIS_CLIENT_ID="your-client-id" export ARMIS_CLIENT_SECRET="your-client-secret" armis-cli scan repo . ``` -------------------------------- ### Create Homebrew Tap Repository Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Command to create the ArmisSecurity/homebrew-tap repository, which will be auto-populated by GoReleaser on each release. ```bash # Create repository: ArmisSecurity/homebrew-tap # This will be auto-populated by GoReleaser on each release ``` -------------------------------- ### Run security scan locally with make Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-SETUP.md Build the CLI and run the same security scan used in CI. Requires prior setup of Armis CLI and authentication. ```bash make build make scan ``` -------------------------------- ### Smart Directory Selection Function Source: https://github.com/armissecurity/armis-cli/blob/main/docs/INSTALL-IMPROVEMENTS.md Selects the installation directory based on writability and PATH inclusion. Prefers /usr/local/bin if writable, then ~/.local/bin if in PATH, otherwise falls back to /usr/local/bin (may require sudo). ```bash choose_install_dir() { # 1. Writable /usr/local/bin (best case) if [ -d "$SYSTEM_BIN" ] && [ -w "$SYSTEM_BIN" ]; then echo "$SYSTEM_BIN" return fi # 2. ~/.local/bin already in PATH if [ -d "$USER_BIN" ] && is_in_path "$USER_BIN"; then echo "$USER_BIN" return fi # 3. Fall back to /usr/local/bin (may need sudo) echo "$SYSTEM_BIN" } ``` -------------------------------- ### Generate SBOM and VEX with armis-cli scan Source: https://github.com/armissecurity/armis-cli/blob/main/docs/ci-examples/README.md Run a repository scan with SBOM and VEX generation. Use --sbom and --vex flags to enable generation, and --sbom-output/--vex-output to set custom output paths. Defaults are .armis/-sbom.json and .armis/-vex.json. ```bash armis-cli scan repo . \ --sbom --vex \ --sbom-output ./artifacts/sbom.json \ --vex-output ./artifacts/vex.json ``` -------------------------------- ### Install armis-cli and run supply-chain check Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Install armis-cli via Homebrew and run a supply-chain check on a project directory containing a supported lockfile (e.g., package-lock.json, poetry.lock, pom.xml). No Armis account needed. ```bash brew install armissecurity/tap/armis-cli cd path/to/your/project armis-cli supply-chain check ``` -------------------------------- ### PowerShell install script for Windows runners Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Use this command to install the Armis CLI on Windows runners (`windows-latest`) as an alternative to the GitHub Action, which only supports Linux and macOS. The script is fetched from the official repository and executed via `iex`. ```powershell irm https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.ps1 | iex ``` -------------------------------- ### Verify SLSA Provenance with slsa-verifier Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Installs slsa-verifier, downloads the provenance file for the Linux binary, and verifies SLSA Level 3 provenance. Requires Go to install slsa-verifier. The provenance file is named with .intoto.jsonl extension. ```bash # Install slsa-verifier go install github.com/slsa-framework/slsa-verifier/v2/cli/slsa-verifier@latest # Download provenance curl -LO https://github.com/ArmisSecurity/armis-cli/releases/latest/download/armis-cli-linux-amd64.tar.gz.intoto.jsonl # Verify SLSA Level 3 provenance slsa-verifier verify-artifact \ --provenance-path armis-cli-linux-amd64.tar.gz.intoto.jsonl \ --source-uri github.com/ArmisSecurity/armis-cli \ armis-cli-linux-amd64.tar.gz ``` -------------------------------- ### Verify Release Signature and Checksum Source: https://github.com/armissecurity/armis-cli/blob/main/docs/DISTRIBUTION-SETUP.md Downloads the release artifacts, verifies the cosign signature using keyless signing via GitHub OIDC, and checks the checksum. Requires cosign and sha256sum. The certificate identity regexp matches the release workflow for tags. ```bash # Download files curl -LO https://github.com/ArmisSecurity/armis-cli/releases/latest/download/armis-cli-linux-amd64.tar.gz curl -LO https://github.com/ArmisSecurity/armis-cli/releases/latest/download/armis-cli-checksums.txt curl -LO https://github.com/ArmisSecurity/armis-cli/releases/latest/download/armis-cli-checksums.txt.sig # Verify signature cosign verify-blob \ --certificate-identity-regexp 'https://github.com/ArmisSecurity/armis-cli/.github/workflows/release.yml@refs/tags/.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ --signature armis-cli-checksums.txt.sig \ armis-cli-checksums.txt # Verify checksum sha256sum --ignore-missing -c armis-cli-checksums.txt ``` -------------------------------- ### armis-cli scan sbom examples Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Shows common invocations for scanning a single SBOM file, a directory of SBOMs, a pre-built tarball, and options to download the generated OpenVEX document (--vex-output) or set a custom path for the raw-findings JSON dump (--sbom-output). ```bash # Single SBOM file armis-cli scan sbom ./sbom.json # Directory of SBOMs armis-cli scan sbom ./sboms/ # Pre-built tarball armis-cli scan sbom ./inventory.tar.gz # Also download the generated OpenVEX document armis-cli scan sbom ./sbom.json --vex-output ./out/vex.json # Custom path for the raw-findings JSON dump armis-cli scan sbom ./sbom.json --sbom-output ./out/findings.json ``` -------------------------------- ### CI workflow: install with compliance report, gate, and upload Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Use this GitHub Actions workflow to generate a machine-readable JSON compliance report via ARMIS_SUPPLY_CHAIN_REPORT, gate the build on the report's install_status and warned_through fields, and upload the report as an artifact. The report includes the effective policy, enforcement mode, and checked/blocked/resolved/warned_through/conflicts sets. ```yaml - name: Install dependencies (age-enforced) with compliance report env: ARMIS_SUPPLY_CHAIN_REPORT: supply-chain-report.json run: npm ci - name: Gate on the compliance report run: | jq -e '.install_status == "ok" and (.warned_through | length) == 0' \ supply-chain-report.json - name: Upload compliance report if: always() uses: actions/upload-artifact@v4 with: name: supply-chain-report path: supply-chain-report.json ``` -------------------------------- ### npm install blocked by supply-chain policy (output) Source: https://github.com/armissecurity/armis-cli/blob/main/docs/FEATURES.md Example output when the proxy withholds a brand-new release and a transitive dependency becomes unsatisfiable. The one-hop constraint check names the culprit package and the required version range. ```text [armis supply-chain] the install did not complete. This tool withheld brand-new releases on purpose — a common supply-chain attack vector... → scheduler has no version older than the 3-day policy that satisfies ^0.24.0 (required by react-dom) — this is the likely cause. ``` -------------------------------- ### Install git pre-commit hook Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Install a git pre-commit hook that blocks commits unless scanning passed. Use `--fail-open` to warn instead of block, or `--remove` to uninstall. ```bash # Install a git pre-commit hook that blocks commits unless scanning passed. # Use --fail-open to warn instead of block, or --remove to uninstall. armis-cli hook init ``` -------------------------------- ### GitHub Action workflow for Armis Security Scan Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Use this workflow to run an Armis security scan via the GitHub Action, pinning to `@v1` for non-breaking updates. It requires `client-id` and `client-secret` secrets, outputs SARIF, and fails on HIGH and CRITICAL findings. The action installs the latest CLI binary by default. ```yaml name: Security Scan on: [push, pull_request] jobs: security-scan: runs-on: ubuntu-latest permissions: contents: read security-events: write steps: - uses: actions/checkout@v4 - name: Run Armis Security Scan uses: ArmisSecurity/armis-cli@v1 with: scan-type: repo client-id: ${{ secrets.ARMIS_CLIENT_ID }} client-secret: ${{ secrets.ARMIS_CLIENT_SECRET }} format: sarif output-file: results.sarif fail-on: HIGH,CRITICAL - name: Upload SARIF uses: github/codeql-action/upload-sarif@v4 if: always() with: sarif_file: results.sarif ``` -------------------------------- ### Verify installation on Linux/macOS Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Checks that armis-cli is in PATH and displays its version. ```bash which armis-cli armis-cli --version ``` -------------------------------- ### Install and manage MCP server Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Install the Armis AppSec MCP server and register it with detected AI editors. Use `mcp update` to update the server and re-register editors, and `mcp doctor` to diagnose why an editor doesn't see or can't use the server. ```bash armis-cli install # install and register with detected editors armis-cli mcp update # update the server and re-register editors armis-cli mcp doctor # diagnose why an editor doesn't see or can't use the server ``` -------------------------------- ### Check if armis-cli is installed (Linux/macOS) Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Lists the armis-cli binary in common installation directories. ```bash ls -la ~/.local/bin/armis-cli # or ls -la /usr/local/bin/armis-cli ``` -------------------------------- ### Verify installation on Windows PowerShell Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Checks that armis-cli is available and displays its version. ```powershell Get-Command armis-cli armis-cli --version ``` -------------------------------- ### Inspect SBOM with jq and CycloneDX CLI (Bash) Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Downloads the CycloneDX JSON SBOM for the Linux binary, views dependencies with jq, and validates the SBOM using the CycloneDX CLI. Requires jq and optionally npm to install cyclonedx-cli. ```bash # Download SBOM (CycloneDX JSON format) curl -LO https://github.com/ArmisSecurity/armis-cli/releases/latest/download/armis-cli-linux-amd64.tar.gz.sbom.cdx.json # View dependencies cat armis-cli-linux-amd64.tar.gz.sbom.cdx.json | jq '.components[] | {name: .name, version: .version}' # Or use CycloneDX CLI tools npm install -g @cyclonedx/cyclonedx-cli cyclonedx-cli validate --input-file armis-cli-linux-amd64.tar.gz.sbom.cdx.json ``` -------------------------------- ### GitHub Actions Reusable Workflow Basic Usage Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Use the reusable workflow to run Armis scans on pull requests. It handles CLI installation, SARIF upload, PR comments, and artifact storage. Configure fail-on severity levels and provide client credentials as secrets. ```yaml name: Security Scan on: pull_request: branches: [main, develop] permissions: contents: read security-events: write pull-requests: write jobs: security-scan: uses: ArmisSecurity/armis-cli/.github/workflows/reusable-security-scan.yml@main with: fail-on: 'CRITICAL,HIGH' pr-comment: true secrets: client-id: ${{ secrets.ARMIS_CLIENT_ID }} client-secret: ${{ secrets.ARMIS_CLIENT_SECRET }} ``` -------------------------------- ### Verify Checksums with Cosign (Bash) Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Downloads the Linux binary, checksums, and signature from the latest release, then verifies the signature with cosign and checks the checksum with sha256sum. Requires cosign to be installed. The certificate identity regexp matches the release workflow for tags. ```bash # Download the binary, checksums, and signature curl -LO https://github.com/ArmisSecurity/armis-cli/releases/latest/download/armis-cli-linux-amd64.tar.gz curl -LO https://github.com/ArmisSecurity/armis-cli/releases/latest/download/armis-cli-checksums.txt curl -LO https://github.com/ArmisSecurity/armis-cli/releases/latest/download/armis-cli-checksums.txt.sig # Verify the signature cosign verify-blob \ --certificate-identity-regexp 'https://github.com/ArmisSecurity/armis-cli/.github/workflows/release.yml@refs/tags/.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ --signature armis-cli-checksums.txt.sig \ armis-cli-checksums.txt # Verify the checksum sha256sum --ignore-missing -c armis-cli-checksums.txt ``` -------------------------------- ### Bitbucket Pipelines configuration for Armis CLI security scan Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md YAML pipeline configuration for Bitbucket Pipelines that runs an Armis CLI security scan on pull requests and the main branch. It installs the CLI via curl and runs `armis-cli scan repo . --format json --fail-on CRITICAL`. Requires `ARMIS_CLIENT_ID` and `ARMIS_CLIENT_SECRET` as secured repository variables. ```yaml pipelines: pull-requests: '**': - step: name: Security Scan image: alpine:latest script: - apk add --no-cache curl bash - curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash - armis-cli scan repo . --format json --fail-on CRITICAL branches: main: - step: name: Security Scan image: alpine:latest script: - apk add --no-cache curl bash - curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash - armis-cli scan repo . --format json --fail-on CRITICAL ``` -------------------------------- ### Example Grouped Output Source: https://github.com/armissecurity/armis-cli/blob/main/docs/FEATURES.md Illustrates the output format when grouping findings, showing a CWE section with count and a critical severity example. ```text ┌─────────────────────────────────────────────────────────────┐ │ CWE: CWE-89 │ │ Count: 3 │ └─────────────────────────────────────────────────────────────┘ 🔴 CRITICAL SQL Injection vulnerability detected... ``` -------------------------------- ### GitLab CI pipeline for Armis CLI security scan Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Defines a GitLab CI job that runs the Armis CLI security scan on merge requests and the default branch. Uses the alpine:latest image, installs the CLI via curl, and fails on CRITICAL findings. Credentials are configured as protected CI/CD variables. ```yaml stages: - security security-scan: stage: security image: alpine:latest rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH before_script: - apk add --no-cache curl bash - curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash script: - armis-cli scan repo . --format json --fail-on CRITICAL variables: ARMIS_CLIENT_ID: $ARMIS_CLIENT_ID ARMIS_CLIENT_SECRET: $ARMIS_CLIENT_SECRET ``` -------------------------------- ### GitHub Actions workflow: Build and scan image after build Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Workflow triggered on push to main that builds a Docker image, scans it with ArmisSecurity/armis-cli@v1 using scan-type image, and uploads SARIF results. Requires ARMIS_CLIENT_ID and ARMIS_CLIENT_SECRET secrets. Fails on CRITICAL and HIGH findings. ```yaml name: Build and Scan Image on: push: branches: [main] jobs: build-and-scan: runs-on: ubuntu-latest permissions: contents: read security-events: write steps: - uses: actions/checkout@v4 - name: Build Docker Image run: docker build -t myapp:${{ github.sha }} . - name: Run Armis Image Scan uses: ArmisSecurity/armis-cli@v1 with: scan-type: image scan-target: myapp:${{ github.sha }} client-id: ${{ secrets.ARMIS_CLIENT_ID }} client-secret: ${{ secrets.ARMIS_CLIENT_SECRET }} format: sarif output-file: image-results.sarif fail-on: CRITICAL,HIGH - name: Upload SARIF uses: github/codeql-action/upload-sarif@v4 if: always() with: sarif_file: image-results.sarif category: container-scan ``` -------------------------------- ### Make build commands Source: https://github.com/armissecurity/armis-cli/blob/main/CLAUDE.md Common build, test, lint, and release commands for the Armis CLI. Requires Go 1.25+, golangci-lint v2.0+, and Make. ```bash make build # Build binary to bin/armis-cli make install # Install binary to /usr/local/bin (or PREFIX) make test # Run all tests with verbose output (uses gotestsum if installed) make lint # Run golangci-lint make clean # Remove build artifacts make release # Build for all platforms (linux/darwin/windows, amd64/arm64) make scan # Run security scan on this repository (requires built binary) make tools # Install dev tools (gotestsum) ``` -------------------------------- ### Register IdP with Armis using armis-cli auth setup Source: https://github.com/armissecurity/armis-cli/blob/main/docs/SSO-SETUP.md Run from an admin machine to register your IdP with Armis. Auto-detects region and tenant from credentials, then prompts for IdP type, issuer, client ID, client secret, and group claim. The client secret is sent only in this request and is never printed, stored locally, or returned by the API. On success, prints environment variables for deployment in Step 3. ```bash armis-cli auth setup \ --client-id "$ARMIS_CLIENT_ID" \ --client-secret "$ARMIS_CLIENT_SECRET" ``` -------------------------------- ### Run security scan manually with armis-cli Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-SETUP.md Manually run the scan with JWT authentication and fail on CRITICAL or HIGH findings. Requires ARMIS_CLIENT_ID and ARMIS_CLIENT_SECRET environment variables. ```bash export ARMIS_CLIENT_ID="your-client-id" export ARMIS_CLIENT_SECRET="your-client-secret" armis-cli scan repo . --fail-on CRITICAL,HIGH ``` -------------------------------- ### GitHub Actions workflow for SBOM and VEX generation Source: https://github.com/armissecurity/armis-cli/blob/main/docs/FEATURES.md Example GitHub Actions steps to generate SBOM and VEX as part of a CI pipeline. It sets ARMIS_CLIENT_ID and ARMIS_CLIENT_SECRET from secrets, runs the scan with custom output paths, and uploads the artifacts using actions/upload-artifact@v4. ```yaml # GitHub Actions example - name: Security Scan with SBOM env: ARMIS_CLIENT_ID: ${{ secrets.ARMIS_CLIENT_ID }} ARMIS_CLIENT_SECRET: ${{ secrets.ARMIS_CLIENT_SECRET }} run: | armis-cli scan repo . \ --sbom --vex \ --sbom-output ./artifacts/sbom.json \ --vex-output ./artifacts/vex.json - name: Upload SBOM Artifact uses: actions/upload-artifact@v4 with: name: sbom-vex path: ./artifacts/ ``` -------------------------------- ### Bitbucket Pipelines with Armis CLI Security Scan Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Bitbucket Pipelines configuration that runs a security scan on the default branch. Uses the alpine:latest image, installs curl and bash, then installs the Armis CLI and runs a scan with JSON output, failing on CRITICAL findings. ```yaml pipelines: default: - step: name: Security Scan image: alpine:latest script: - apk add --no-cache curl bash - curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash - armis-cli scan repo . --format json --fail-on CRITICAL ``` -------------------------------- ### Generate compliance report with wrapped npm install and check subcommand Source: https://github.com/armissecurity/armis-cli/blob/main/docs/FEATURES.md Two commands to emit a machine-readable JSON report. The wrapped install uses an environment variable (since it can't take flags) and '-' writes to stderr; the check subcommand accepts a flag directly. ```bash # Wrapped install (wrap can't take flags — use the env var; "-" writes to stderr): ARMIS_SUPPLY_CHAIN_REPORT=supply-chain-report.json npm install # The check subcommand parses flags, so a flag is fine there: armis-cli supply-chain check --report supply-chain-report.json ``` -------------------------------- ### Group by Flag Examples Source: https://github.com/armissecurity/armis-cli/blob/main/docs/FEATURES.md Shows how to use the --group-by flag to group findings by CWE, severity, file, or no grouping (default). ```bash # Group by CWE (Common Weakness Enumeration) armis-cli scan repo . --group-by cwe # Group by severity level armis-cli scan repo . --group-by severity # Group by file armis-cli scan repo . --group-by file # No grouping (default) armis-cli scan repo . --group-by none ``` -------------------------------- ### Generate shell completion script Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Generate a shell completion script for bash, zsh, fish, or PowerShell. The example shows redirecting zsh completion to the fpath directory. ```bash # Generate a shell completion script (bash, zsh, fish, PowerShell). armis-cli completion zsh > "${fpath[1]}/_armis-cli" ``` -------------------------------- ### Enforce supply-chain policy locally during installs Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Wraps package managers in ~/.bashrc / ~/.zshrc for interactive use. Use --dry-run to preview changes without writing, --mode config to generate a committable policy file (.armis-supply-chain.yaml), status to show the active policy and shell status, and uninit to remove the shell wrappers. ```bash # Wrap your package managers in ~/.bashrc / ~/.zshrc (interactive) armis-cli supply-chain init # Preview changes without writing armis-cli supply-chain init --dry-run # Generate a committable policy file (.armis-supply-chain.yaml) armis-cli supply-chain init --mode config # Show the active policy, detected ecosystems, and shell status armis-cli supply-chain status # Remove the shell wrappers armis-cli supply-chain uninit ``` -------------------------------- ### Exclude paths with .armisignore Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-SETUP.md Create a .armisignore file in the repository root to exclude paths from scans. Uses gitignore-compatible syntax; matching files are excluded before the upload archive is created. ```text test/* vendor/* ``` -------------------------------- ### armis-cli scan status examples Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Shows how to look up a specific scan by its 24-character scan_id, re-check the most recently initiated scan on this machine, and request machine-readable output with --format json. The command reports states: PENDING_UPLOAD, UPLOADED, INITIATED, IN_PROGRESS, COMPLETED, FAILED, STOPPED. ```bash # Look up a specific scan by its 24-character scan_id armis-cli scan status 507f1f77bcf86cd799439011 # Re-check the most recently initiated scan on this machine armis-cli scan status # Machine-readable output armis-cli scan status --format json ``` -------------------------------- ### Customize severity thresholds in GitHub Actions workflow Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-SETUP.md Edit .github/workflows/cli-self-scan.yml to add MEDIUM to the fail-on list. The comment indicates where to add it. ```yaml - name: Run security scan (SARIF) run: | armis-cli scan repo . \ --format sarif \ --fail-on CRITICAL,HIGH,MEDIUM \ # Add MEDIUM here --output armis-results.sarif ``` -------------------------------- ### Check if armis-cli is installed (Windows PowerShell) Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Tests whether the armis-cli.exe exists in the expected location. ```powershell Test-Path "$env:LOCALAPPDATA\armis-cli\armis-cli.exe" ``` -------------------------------- ### .armisignore File Example Source: https://github.com/armissecurity/armis-cli/blob/main/docs/FEATURES.md Create a .armisignore file in the repository root to exclude files and directories from scans. Supports gitignore-compatible syntax, glob patterns, directory exclusions, negation patterns, and comments. Exclusions are applied before creating the upload archive to reduce upload time, scan time, bandwidth usage, and false positives. ```text # Exclude build outputs dist/ build/ *.o # Exclude dependencies node_modules/ vendor/ # Exclude logs *.log # Include specific files (negation) !important.log ``` -------------------------------- ### Run a single test Source: https://github.com/armissecurity/armis-cli/blob/main/CLAUDE.md Run a specific test in the internal/api package or all tests in internal/output. ```bash go test -v ./internal/api -run TestClientStartIngest go test -v ./internal/output/... -run TestHumanFormatter ``` -------------------------------- ### SBOM and VEX Generation with Armis CLI (GitHub Actions) Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Generates Software Bill of Materials and VEX documents for compliance and supply chain security. SBOM and VEX are generated server-side during the scan and downloaded after completion. Store artifacts for compliance and audit purposes; VEX helps prioritize vulnerabilities that are actually exploitable. ```yaml name: Security Scan with SBOM/VEX on: push: branches: [main] permissions: contents: read security-events: write jobs: security-scan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Armis CLI run: | curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash - name: Run Security Scan with SBOM/VEX env: ARMIS_CLIENT_ID: ${{ secrets.ARMIS_CLIENT_ID }} ARMIS_CLIENT_SECRET: ${{ secrets.ARMIS_CLIENT_SECRET }} run: | armis-cli scan repo . \ --format sarif \ --sbom --vex \ --sbom-output ./artifacts/sbom.json \ --vex-output ./artifacts/vex.json \ > results.sarif - name: Upload SARIF uses: github/codeql-action/upload-sarif@v4 if: always() with: sarif_file: results.sarif - name: Upload SBOM/VEX Artifacts uses: actions/upload-artifact@v4 if: always() with: name: sbom-vex-${{ github.sha }} path: ./artifacts/ retention-days: 90 ``` -------------------------------- ### GitHub Actions Direct Action Usage Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Use the ArmisSecurity/armis-cli action directly for more control. Pin to @v1 for non-breaking updates, or to an exact tag/SHA to freeze the action definition. Note: the action installs the latest CLI binary by default. ```yaml name: Security Scan on: [push, pull_request] jobs: security-scan: runs-on: ubuntu-latest permissions: contents: read actions: read security-events: write steps: - uses: actions/checkout@v4 - uses: ArmisSecurity/armis-cli@v1 with: scan-type: repo client-id: ${{ secrets.ARMIS_CLIENT_ID }} client-secret: ${{ secrets.ARMIS_CLIENT_SECRET }} format: sarif output-file: results.sarif fail-on: HIGH,CRITICAL - uses: github/codeql-action/upload-sarif@v4 if: always() with: sarif_file: results.sarif ``` -------------------------------- ### CI status badge markdown Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-SETUP.md Markdown badge showing the current CI status for the Armis CLI repository. Updates automatically based on the latest workflow run. ```markdown ![CI](https://github.com/ArmisSecurity/armis-cli/actions/workflows/cli-self-scan.yml/badge.svg) ``` -------------------------------- ### Run CI on specific branches only Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-SETUP.md Edit the 'on' section in .github/workflows/cli-self-scan.yml to restrict workflow triggers to specific branches. ```yaml on: push: branches: [ "main", "develop" ] # Only these branches pull_request: branches: [ "main" ] # Only PRs to main ``` -------------------------------- ### GitLab CI Pipeline Source: https://github.com/armissecurity/armis-cli/blob/main/README.md GitLab CI job that installs the CLI and runs a scan with JSON output, failing on CRITICAL severity. Uses ARMIS_CLIENT_ID and ARMIS_CLIENT_SECRET variables. ```yaml security-scan: stage: test image: alpine:latest before_script: - apk add --no-cache curl bash - curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash script: - armis-cli scan repo . --format json --fail-on CRITICAL variables: ARMIS_CLIENT_ID: $ARMIS_CLIENT_ID ARMIS_CLIENT_SECRET: $ARMIS_CLIENT_SECRET ``` -------------------------------- ### Dry-run supply chain wrap to verify registry setup Source: https://github.com/armissecurity/armis-cli/blob/main/docs/FEATURES.md Runs the wrap command in dry-run mode to print the approved registry, credential status, enforcement posture, and CA bundle without executing the package manager. Useful for checking configuration before relying on it. ```bash armis-cli supply-chain wrap --dry-run npm ``` -------------------------------- ### Build from source (Windows without Make) Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Clone the repository and build the CLI using go build. The binary will be placed in bin\armis-cli.exe. ```powershell git clone https://github.com/ArmisSecurity/armis-cli.git cd armis-cli go build -o bin\armis-cli.exe ./cmd/armis-cli ``` -------------------------------- ### GitHub Actions workflow: Save image as tarball and scan Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Workflow steps to save a Docker image as a tarball and then scan it using ArmisSecurity/armis-cli@v1 with image-tarball input. Requires ARMIS_CLIENT_ID and ARMIS_CLIENT_SECRET secrets. ```yaml - name: Save Image as Tarball run: docker save myapp:latest -o image.tar - name: Scan Image Tarball uses: ArmisSecurity/armis-cli@v1 with: scan-type: image image-tarball: image.tar client-id: ${{ secrets.ARMIS_CLIENT_ID }} client-secret: ${{ secrets.ARMIS_CLIENT_SECRET }} ``` -------------------------------- ### Development commands Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Run tests, linters, and build for all platforms using make targets. ```bash # Run tests make test # Run linters make lint # Build for all platforms make release ``` -------------------------------- ### GitHub Actions Reusable Workflow Configuration Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Add this YAML to `.github/workflows/security-scan.yml` to integrate Armis scanning into GitHub Actions. It triggers on pull requests to the main branch, uses the reusable workflow, and requires the `ARMIS_CLIENT_ID` and `ARMIS_CLIENT_SECRET` secrets. The workflow scans the repository, posts PR comments, uploads findings to GitHub Code Scanning, and fails on CRITICAL vulnerabilities. ```yaml name: Security Scan on: pull_request: branches: [main] jobs: scan: uses: ArmisSecurity/armis-cli/.github/workflows/reusable-security-scan.yml@main secrets: client-id: ${{ secrets.ARMIS_CLIENT_ID }} client-secret: ${{ secrets.ARMIS_CLIENT_SECRET }} ``` -------------------------------- ### Build from source (Linux/macOS) Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Clone the repository and build the CLI using make. The binary will be placed in bin/armis-cli. ```bash git clone https://github.com/ArmisSecurity/armis-cli.git cd armis-cli make build ``` -------------------------------- ### Scheduled Repository Security Scan (GitHub Actions) Source: https://github.com/armissecurity/armis-cli/blob/main/docs/CI-INTEGRATION.md Runs comprehensive scans on a schedule for ongoing monitoring. Set fail-on to an empty string for monitoring without blocking, disable PR comments since there is no PR context, and increase the timeout for comprehensive scans. Results are still uploaded to GitHub Code Scanning. ```yaml name: Scheduled Security Scan on: workflow_dispatch: # Manual trigger schedule: - cron: '0 6 * * *' # Daily at 06:00 UTC permissions: contents: read security-events: write jobs: scan: uses: ArmisSecurity/armis-cli/.github/workflows/reusable-security-scan.yml@main with: fail-on: '' # Don't fail - monitoring only pr-comment: false # No PR context upload-artifact: true scan-timeout: 120 # Allow more time for full scan secrets: client-id: ${{ secrets.ARMIS_CLIENT_ID }} client-secret: ${{ secrets.ARMIS_CLIENT_SECRET }} ``` -------------------------------- ### Diagnose and repair MCP server with mcp doctor Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Run `mcp doctor --fix` to automatically repair issues like re-registering editors, rebuilding a broken venv, and configuring the system proxy. Use `--bundle` to write a zip for Armis support (credential values are never included). `--no-handshake` performs structural checks only without starting servers or making network calls. ```bash # Diagnose, then repair what can be repaired automatically: re-register # editors, rebuild a broken venv, and configure the system proxy for the # server when it works but the server isn't using it armis-cli mcp doctor --fix # Write a zip for Armis support (report, server stderr and logs, VS Code MCP # log, settings excerpts). Credential values are never included. armis-cli mcp doctor --bundle armis-cli mcp doctor --bundle-path C:\Users\me\Desktop\armis-doctor.zip # Structural checks only (don't start servers or make network calls) armis-cli mcp doctor --no-handshake ``` -------------------------------- ### Scan Repository with Options Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Shows common options for scanning a repository: --format, --fail-on, --sbom, --vex, and --sbom-format. The --sbom flag generates an SBOM document, and --sbom-format spdx generates an SPDX 2.3 SBOM instead of the default CycloneDX. ```bash armis-cli scan repo ./my-app --format json --fail-on HIGH,CRITICAL # Generate SBOM and VEX documents armis-cli scan repo ./my-app --sbom --vex # Generate an SPDX 2.3 SBOM instead of the default CycloneDX armis-cli scan repo ./my-app --sbom --sbom-format spdx ``` -------------------------------- ### Check PATH (Linux/macOS) Source: https://github.com/armissecurity/armis-cli/blob/main/README.md Displays the current PATH environment variable. ```bash echo $PATH ```