Skip to main content

CLI & CI Agent

The apposture agent (agent.sh) is a portable, dependency-light shell script (curl + tar/git) that wires scanning into any pipeline. It's downloaded and checksum-verified before it runs - never a blind curl | sh.

Install (checksum-pinned)

curl -fsSL "$APPOSTURE_URL/api/v1/ci/agent.sh" -o apposture
curl -fsSL "$APPOSTURE_URL/api/v1/ci/agent.sh.sha256" | sha256sum -c -
chmod +x apposture

Commands

CommandWhat it does
apposture testRun source scanners (SAST/SCA/secrets/IaC) and gate the build. (default)
apposture monitorSnapshot the default branch to set the baseline; never fails the build.
apposture uploadSend a SARIF report only (bring-your-own scanner).
apposture container --image XScan a built image with Trivy on the runner; upload its SARIF.

Environment & flags

Variable / flagPurpose
APPOSTURE_URLe.g. https://aspm.apposture.com
APT_TOKENa write-capable apt_ token (set as a CI secret)
--app NAME / --service NAMEwhich application/service this run belongs to
--severity-thresholdcritical|high|medium|low|none
--fail-onnew (only new vs baseline) or all
--scannerssast,sca,secrets,iac
--no-gatereport only, never fail

The agent auto-detects GitHub Actions / GitLab CI / Jenkins (repo, branch, commit, PR id) and sends a delta of changed files on PRs so unchanged scanner classes are skipped. It waits for the gate verdict and relays the exit code - non-zero fails the stage (unless the gate is in Monitor mode, which never breaks the build).

GitHub Actions

- name: apPosture security gate
env:
APPOSTURE_URL: https://aspm.apposture.com
APT_TOKEN: ${{ secrets.APPOSTURE_TOKEN }}
run: |
curl -fsSL "$APPOSTURE_URL/api/v1/ci/agent.sh" -o apposture
curl -fsSL "$APPOSTURE_URL/api/v1/ci/agent.sh.sha256" | sha256sum -c -
chmod +x apposture
./apposture test --app "$GITHUB_REPOSITORY" --severity-threshold high --fail-on new

Ready-to-paste snippets for GitLab CI, Jenkins, Azure and Bitbucket are on the in-app CI/CD → Setup page. See CI/CD Setup for the full flow, including zero-pipeline webhook scanning.