Ryan Shah GitHub

Command line, CI and hooks

Common flags

These flags exist on scan, posture, hunt, exposure, report, diff and explain.

Flag Default Meaning
--format text (md for report and exposure) text, json, sarif, md or html
--config jackproof.yaml in the first path Path to the configuration file
--rules-dir none Directory of extra rule files, merged with the built-in catalogue
--min-confidence none Hide findings below high, medium or low
--fail-on high Exit with status 1 when a finding has at least this severity

Flags may come before or after paths. Exit code 0 means no finding at or above --fail-on. Exit code 1 means findings were found. Exit code 2 means a usage or runtime error.

Commands

GitHub Action

on: pull_request

permissions:
  contents: read
  pull-requests: write
  security-events: write

jobs:
  jackproof:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: ryankshah/jackproof@v1.0.2
        with:
          strict: "true"
          fail-on: high

The action installs jackproof, runs jackproof diff between the pull request base and head, posts one comment and updates it on later runs, and uploads a SARIF report of the head revision to code scanning. It fails the job only when strict is true and the pull request adds a finding at or above fail-on. Pull requests from forks get no comment, because their token is read-only.

pre-commit

repos:
  - repo: https://github.com/ryankshah/jackproof
    rev: v1.0.2
    hooks:
      - id: jackproof-scan

The hook runs jackproof scan --staged --fail-on high. It scans the staged content, not the working tree.

Docker

The image is distroless and runs as a non-root user. Mount the code read-only and run with a read-only root file system:

docker run --rm --read-only -v "$PWD:/work:ro" jackproof scan .

The image has no git, so diff and scan --staged need the binary on the host.