pack-gha-security-dast
Skill166 starsChanged 6 days agoApache-2.0View on GitHub
Checklist and measured gotchas for reviewing or writing GitHub Actions workflows (SHA pinning, least-privilege permissions, caller/reusable-workflow permission matching, expression injection, pull_request_target, egress block mode, branch-protection force-push bypass) and OWASP ZAP / DAST automation (context XML parsing, Java regex scope, loopback scope, sign-in proof, report redaction, digest binding). Load for .github/workflows changes, reusable-workflow callers, security scan jobs, or ZAP configuration. Not for general CI speed or caching questions.
In this repository63 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/copilot-instructions.mdCopilot instructions
- pack-ad-disclosureSkill
- pack-asset-productionSkill
- pack-audience-data-privacySkill
- pack-awsSkill
- pack-clip-deskSkill
- pack-copy-reviewSkill
- pack-cyber-tier-reviewSkill
- pack-delivery-business-mgmtSkill
- pack-digitaloceanSkill
- pack-front-doorSkill
- pack-grc-controlsSkill
- pack-implementer-self-checkSkill
- pack-linux-platformSkill
- pack-local-llm-routingSkill
- pack-marketing-grcSkill
- pack-media-dispatchSkill
- pack-media-kit-claimsSkill
- pack-opentofu-spaceliftSkill
- pack-org-dispatchSkill
- pack-org-operating-modelSkill
- pack-platform-data-termsSkill
- pack-python-untrusted-inputSkill
- pack-review-protocolSkill
- pack-rf-emcommSkill
- pack-safe-liveSkill
- pack-stage-crewSkill
- pack-threat-detectionSkill
- pack-threat-modelSkill
- pack-twingate-dopplerSkill
- pack-web-qualitySkill
- pack-ad-disclosureSkill
- pack-asset-productionSkill
- pack-audience-data-privacySkill
- pack-awsSkill
- pack-clip-deskSkill
- pack-copy-reviewSkill
- pack-cyber-tier-reviewSkill
- pack-delivery-business-mgmtSkill
- pack-digitaloceanSkill
- pack-front-doorSkill
- pack-gha-security-dastSkill
- pack-grc-controlsSkill
- pack-implementer-self-checkSkill
- pack-linux-platformSkill
- pack-local-llm-routingSkill
- pack-marketing-grcSkill
- pack-media-dispatchSkill
- pack-media-kit-claimsSkill
- pack-opentofu-spaceliftSkill
- pack-org-dispatchSkill
- pack-org-operating-modelSkill
- pack-platform-data-termsSkill
- pack-python-untrusted-inputSkill
- pack-review-protocolSkill
- pack-rf-emcommSkill
- pack-safe-liveSkill
- pack-stage-crewSkill
- pack-threat-detectionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
pull_request_targetandworkflow_run: run with the base repo's secrets. - Distinctive: line 33
HTTPS probes: Check that the probe keeps the scheme.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Generated by scripts/generate.py (release 0.4.0) from packs/gha-security-dast/PACK.md, updated 2026-10-30. sha256:afbf6ba1c3dee2996ef0df472c7cd50221d51ec569dc5eaf7997e4ed2b95d814. Do not edit; run the generator. -->Pack: GitHub Actions security and ZAP/DAST
Status: pilot pack, written 2026-10-08 from the 2026-10-07 session findings. Items marked UNVERIFIED were not reproduced; treat them as questions to check, not facts.
A workflow file is code that runs with credentials. Most defects below were not syntax errors: the gate was green while the control was missing, masked, or satisfied by the wrong evidence. Review the claim a job makes ("scanned", "signed in", "pinned") and ask what proves it.
Checklist: workflows
- Pin by commit SHA, with the version in a trailing comment (
uses: owner/repo/.github/workflows/x.yml@<40-hex> # vX.Y.Z). Tags and branches move. In a repo that calls several shared workflows, all calls share one pinned commit, and tests or docs that name the old SHA or version move with them. Re-pin every caller together, not only the one that changed. - Least-privilege
permissions:at workflow level (defaultcontents: read), widened per job only for what that job needs. Nowrite-all. - Callers must grant every permission a called reusable workflow declares. Permissions are checked statically at parse time, so a job that is skipped at runtime still counts. If the called workflow declares
id-token: writeand the caller job does not grant it, every run ends instartup_failure. Diff the callee's declared permissions against the caller job's grants. - No
${{ }}insiderun:for anything an outsider can influence (issue titles, PR titles and branch names, commit messages,github.head_ref, inputs). Pass it throughenv:and quote"$VAR"in the script. pull_request_targetandworkflow_runrun with the base repo's secrets. Never check out or execute PR head code in such a job. If a privileged job must read PR output, treat it as data.- Egress control. Where the runner-hardening step has a block mode, use block with an explicit allow-list; audit mode only reports. UNVERIFIED for any given repo: confirm the mode that is actually configured before claiming the control exists.
- No opt-outs to get green.
continue-on-error: true,*-continue-on-error: true,require-non-root: false,nosemgrep,|| trueon a gate step, skipped tests, and narrower scan scope are escalations to the human, never fixes. A pin-asserting test must collect loosely and assert strictly (assert the collection is non-empty; add a negative test with an unpinned@main, a missing version comment, and a second workflow file; confirm it goes red). - Secrets come from the configured secret manager or
secrets.*; never from the repo. Do not echo them; do not write them into SARIF, step summaries, or artifacts. - Artifact and digest binding between jobs. A rescan or publish job must consume the bytes an earlier job verified (image by digest, SBOM passed as an artifact), not a re-pulled mutable tag or re-downloaded file. An empty platform or matrix list must fail, not pass with nothing scanned.
- Branch protection force-push bypass. REST
allow_force_pushescan report enabled while a GraphQL bypass list exists, and a REST PUT offalsedoes not clear it (observed 2026-10-07 on one repo). Check with GraphQLbranchProtectionRules { allowsForcePushes bypassForcePushAllowances { ... } }and clear withupdateBranchProtectionRule(allowsForcePushes: false, bypassForcePushActorIds: []).
Checklist: ZAP / DAST automation
- Parse the context with ZAP's own reader semantics, not yours. ZAP reads each element's own text. A check using Python
itertext()accepted a login URL whose loopback host sat in a child element followed by an external host (mixed content, 2026-10-07, ZAP 2.17.0). CDATA, entities, and namespaces are further differentials (a CDATA bypass of the context guard was found the same day). Test hostile files against the realZapXmlConfigurationrather than reasoning about it. - Scope regexes are Java regexes. Python regex knowledge does not transfer:
\Q..\E, possessive and lazy quantifiers, inline flags(?i),\x2f, and top-level|all appeared in bypass attempts. Prefer a grammar whitelist of allowed shapes over blacklisting substrings, and verify candidates withjava.util.regex.Pattern.compileandmatches. Round-one whitelist grammars were themselves bypassed by/?.*,/*.*,/+.*, unescaped[::1], and:8080@evilforms. - Loopback-only scope. Parse the authority properly: userinfo (
host:80@evil), decimal and IPv4-mapped IPv6 hosts, and trailing-dot hosts are all ways a loopback-looking string reaches somewhere else. Both the target URL and every include regex must resolve inside scope. - Sign-in proof. "Signed in" must be proved by a protected request that returns authenticated content as the selected user, and fails closed if it does not. Evidence satisfied by the login response itself, or no evidence at all, allowed anonymous scans to be reported as authenticated (three separate findings, 2026-10-07).
- HTTPS probes. Check that the probe keeps the scheme. A probe that sent an origin-form request and dropped the scheme sent plaintext to a TLS port.
- Redaction. Credentials and tokens must be scrubbed before reports, SARIF, or logs are written or uploaded, including values echoed back in request/response evidence.
- Digest binding. The ZAP image used for the scan is pinned by digest and the scanned artifact is tied to the verified build; see workflow item 9.
GYST callers and release
Rules for a repo whose CI calls the shared reusable workflows of git-your-ship-together (GYST). Each ends with where it was measured: GYST files are in that repo, SAFO files are in scrum-around-and-find-out. A line marked INFERRED was not reproduced.
- One commit for every caller. All calls of the shared workflows in a repo name the same commit, each with a version comment (
@<40-hex> # vX.Y.Z); a test or doc that names the old pin moves with them. (Source: GYSTdocs/wiki/Releases-and-supply-chain.md, "Pins by commit SHA"; this repo'sCLAUDE.md, last bullet.) - Re-pin every caller when GYST bumps. A change in GYST reaches a caller only when that caller re-pins, so a bump is not done until every caller of every shared workflow moved to the new commit. zizmor fails a comment that names a tag which does not exist. (Source: GYST
CHANGELOG.mdintro;docs/wiki/Contributing-and-developing.md, "Fetch first".) - The gate is named
CI green. Each shared CI workflow ends in a jobCI greenthat needs every other job and fails if any failed; the required check is<caller job> / CI green, one per language. (Source: GYSTBASELINE.mdsection 2;docs/DESIGN.md, "CI".) - Branch protection before the first merge, and read the required check from it. Do not assume the name:
gh api repos/OWNER/REPO/branches/main/protection -q '.required_status_checks.checks[].context'and compare to the caller. A caller that lacks a permission the callee declares ends instartup_failurewith no check run, so the required check never appears and a merge goes through (see workflow item 3). (Source: GYSTdocs/wiki/Getting-started.md, "id-token: write", measured 2026-10-03; the command was run read-only on 2026-10-30. The "before the first merge" timing is a stated requirement in issue #70, not a measurement.) - A conflicting PR gets no checks. It has no merge ref, so no
pull_requestrun starts and closing and reopening does nothing. When no checks are reported, readmergeablefirst:gh api repos/OWNER/REPO/pulls/N -q .mergeable. (Source: SAFOdocs/lessons.md, "A pull request with a merge conflict gets no checks at all", GYST issue 114. Anullresult while GitHub computes it is INFERRED; read again.) - Orphaned CodeQL categories. GitHub closes an alert only when a later analysis of the same category and ref omits it. After a workflow is retired its categories (
/language:python) are never analyzed again, so their alerts stay open (25 of 29 on one repo, 2026-10-04). List open alerts'analysis_key, find keys of workflows that no longer exist, then delete that category's last analysis on the default branch through the code-scanning DELETE endpoint (exact call in the source page, which needs?confirm_delete). Trust the PR check summary ("1 configuration not found"), not the analysis list. (Source: GYSTdocs/wiki/Security-scanning-explained.md, "Where results land".) - Merge through one tested watcher. It pins the head SHA and requires the
CI greencheck run to exist; a hand-rolled merge-state loop passes on a stale or missing run (five stale watcher reports on 2026-10-25). (Source: SAFOdocs/done-means-verified.md, "The rule in four parts" and "Why: 2026-10-25".) - GitHub API limits. A secondary rate limit rejects bursts while the hourly quota still shows headroom: on 2026-10-29 GraphQL "rate limit exceeded" errors arrived with about 3600 of 5000 points left, after a burst of per-card board listings, issue and PR reads, and a per-dispatch lookup (SAFO issue 204). So: serialize requests; wait at least 1 s between writes (POST, PATCH, PUT, DELETE); never list a whole board per card (list once, keep the ids); read through REST rather than
gh issue view/gh pr/gh project; on 403 or 429 honorretry-after, else wait forx-ratelimit-resetwhenx-ratelimit-remainingis 0, else at least a minute; report a limit as "rate limited, retry after T", never as "does not exist" (SAFO issue 204 asks for this). The docs cap concurrency at 100 requests, shared by REST and GraphQL, and say to prefer webhooks to polling. (Source: docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api and .../rate-limits-for-the-rest-api, both read 2026-10-30 with curl, text extracted; SAFO issue 204 body. Which SAFO calls caused the burst is the issue author's account, not reproduced here.)
How to verify (commands)
- Pins:
grep -rnE 'uses: .+@' .github/workflows | grep -vE '@[0-9a-f]{40}( |$)'lists every non-SHA reference (some local./actions are expected). Missing version comments:grep -rnE '@[0-9a-f]{40}\s*$' .github/workflows. - Interpolation in run steps:
grep -rnE '\$\{\{' .github/workflowsthen inspect each hit that sits inside arun:block. - Permissions diff: read the callee's top-level and job-level
permissions:and compare to the caller job. - Lint:
actionlintandzizmorif installed (UNVERIFIED which are installed on a given box; if absent, report NOT RUN). - Opt-outs added in a diff:
git diff <base>... | grep -nE '^\+.*(continue-on-error: *true|require-non-root: *false|nosemgrep|\|\| *true)'. - Pin-guard test bites: temporarily change one pin to
@mainin a scratch copy and run the test; it must fail. - Regex scope: write a small Java snippet (
jshellor a one-file class) that runsPattern.compile(regex).matcher(candidate).matches()over a hostile list. - GYST callers: every
uses:of the shared workflows shows one commit (grep -rhoE 'git-your-ship-together/\S+@[0-9a-f]{40}' .github/workflows | sed 's/.*@//' | sort -uprints one line). Required check: thegh apicommand in GYST item 4. Mergeable: item 5. - Force-push bypass:
gh api graphql -f query='...'as above (UNVERIFIED query text; check the schema withgh api graphqlintrospection if it errors).
Reviewer reminders
- Show the mutation: delete the control, confirm something goes red.
- A green gate plus "73 checks passed" is not evidence for a security claim; the checks may not look at it.
- Reusable-workflow, ZAP, and artifact-identity semantics are external-system behavior. If you did not run it, say NOT VERIFIED.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

