--fix flag rewrites workflow YAML in place for the categories where a safe, deterministic fix exists. After applying fixes, the scanner re-runs so the final report shows only what’s left.
What gets fixed
What it won’t fix
- The “generic
var := "..."” CICD-SEC-6 pattern — matches an enclosing assignment, not just the secret value; a blind rewrite would corrupt syntax. curl | shpatterns (BEST-PRAC-1). There’s no safe automatic rewrite; flagged for manual review.- Self-hosted runners (BEST-PRAC-3). Often intentional infra choice.
What you need before running
- Network access to
api.github.comfor CICD-SEC-3 — the fixer hits the GitHub API to resolve each tag to a commit SHA. If resolution fails, the action is left as-is and a warning is printed to stderr. - Write access to the workflow files — fixes are applied in place. Commit clean first so the diff is reviewable.
Repository-configuration auto-fix (--fix-settings)
--fix rewrites workflow YAML in your working tree. --fix-settings is the GitHub-API counterpart: it remediates the repository-configuration findings (branch protection, default GITHUB_TOKEN, Dependabot, secret scanning) by hitting the GitHub API directly. It’s a separate flag because the required token scopes are wider — opt in only when you want it.
What --fix-settings won’t touch
- BP-NO-REVIEW, BP-FEW-REVIEWERS, BP-STALE-REVIEWS: when BP-MISSING fires, the defaults the fixer installs already cover these. When BP exists but lacks one of them, the fix isn’t yet automated — coming in a follow-up.
- BP-NO-STATUS-CHECKS: we can’t infer which checks should be required.
- ACTIONS-ALL-ALLOWED: switching from
alltoselectedrequires building an allowlist; not automated.
Token requirements
The fixer uses the same--github-token (or $GITHUB_TOKEN or gh auth token) that the audit uses, but needs wider scopes for the writes:
administration: write— branch protection, secret scanning, Dependabotactions: write— workflow permissions
--dry-run
--dry-run short-circuits PUT/PATCH/POST before they hit GitHub but lets the GET requests through, so the printed action descriptions still reflect the real current state. Use it whenever you’re unsure.
Web app: open a fix PR
The web dashboard exposes the same fixers on a different surface: per-finding, click Open fix PR to have Pipefort fetch the workflow file from GitHub, run the fixer in memory, push the result to a branch namedpipefort/fix/<rule>/<file>, and open a pull request for human review.
Compared to the CLI’s --fix:
- The CLI mutates files in your local working tree; the web app opens a PR. Nothing lands on your default branch until you merge it.
- The web app uses the GitHub App installation token (see GitHub App permissions). The CLI uses whatever scopes are on the
--github-tokenyou pass. - Repeat clicks on the same finding converge on the same PR — the branch name is deterministic from
<rule_id>/<file>. Re-running the fix after the file changed pushes an updated commit to the same branch. - The web app re-scans the freshly-fetched file before applying the fix. If the finding has been remediated manually since the last scan, you get a clean “already remediated — nothing to change” response instead of an empty PR.
Recommended workflow
1
Commit clean
--fix mutates files. Start from a clean working tree so git diff shows only the fixer’s changes.2
Run the fixer
3
Review the diff
4
Commit and push
The fixer leaves a comment after each pinned SHA so reviewers can see the original tag.