CI pipelines

yawast was built to run unattended. Its output is versioned and machine-readable, its rule IDs and fingerprints are stable, and its exit codes are part of its contract.

GitHub Actions

Scan a deployed environment, upload the results to GitHub code scanning, and fail the job on high-severity findings:

name: security-scan
on:
  workflow_dispatch:
  schedule:
    - cron: "0 6 * * 1"

permissions:
  contents: read
  security-events: write   # to upload SARIF

jobs:
  yawast:
    runs-on: ubuntu-latest
    steps:
      - name: Install yawast
        run: |
          version=$(curl -fsSL https://api.github.com/repos/adcaudill/yawast2/releases/latest | jq -r .tag_name)
          curl -fsSL "https://github.com/adcaudill/yawast2/releases/download/${version}/yawast_${version#v}_linux_amd64.tar.gz" | tar xz yawast
          sudo install yawast /usr/local/bin/

      - name: Scan staging
        run: yawast scan https://staging.example.com --format sarif -o yawast.sarif --fail-on high

      - uses: github/codeql-action/upload-sarif@v4
        if: always()
        with:
          sarif_file: yawast.sarif
          category: yawast

Findings then appear in the repository’s Security → Code scanning tab. Each rule’s description and remediation come with it.

Failing the build

--fail-on <severity> makes yawast exit 1 when any finding is at or above that severity. Without it, a scan that runs exits 0 whatever it finds. A usage or runtime error, including an unreachable target, exits 2, so a broken scan doesn’t pass as a clean one.

yawast scan https://staging.example.com --fail-on medium

Observations (technologies, TLS details, DNS records) never affect the exit code, SARIF, or fingerprints.

Keeping scans fast and focused

A pull request pipeline rarely needs everything. Scope the scan:

# Passive checks only: no attack payloads
yawast scan "$PREVIEW_URL" --level passive --fail-on high

# The checks that matter for this service
yawast scan "$PREVIEW_URL" --checks 'http.*,inject.*' --max-time 10m

# Just the TLS configuration
yawast tls api.example.com:443 --fail-on medium

Tracking findings over time

Each finding has a fingerprint: a hash of its rule, normalized URL, method, parameter, and key. It stays the same from run to run as long as the issue is the same, so you can diff two JSON reports, or suppress known findings by fingerprint.

Other CI systems

yawast is a single binary with no dependencies, so any runner that can download a file can run it. Use --format json (or jsonl, for long scans that stream results) and the exit codes. See Output formats for the report schema.