Repository navigation
Workflow security
What it does. The repository's security scans in one workflow: CodeQL (the actions language included by default),
gitleaks over the full history, a dependency audit, dependency review on pull requests, Semgrep, optional Snyk Code and Snyk
Open Source, and optional OpenSSF Scorecard. Results land in the Security tab as SARIF. What each scan catches, where it
reports and how to dismiss a finding honestly is on Security scanning explained; this
page is the reference for calling it.
Why it exists. The threat is a secret or a compromise leaving a CI job, and the ways in differ, so there is one scan per
class. Only one job is Python-shaped, and only by default: the dependency audit runs pip-audit when
pip-audit-requirements names a file and whatever audit-command names otherwise. A shell-only repository therefore calls
it with codeql-languages: actions and pip-audit-requirements: "" and changes nothing else.
| Job | Holds | Runs on |
|---|---|---|
| CodeQL |
contents: read, security-events: write
|
Every event |
| Secret scan (gitleaks) |
contents: read, security-events: write
|
Every event. No id-token, no Doppler, no secret |
| Dependency audit | contents: read |
Every event |
| Dependency review |
contents: read, pull-requests: write
|
Pull requests only |
| Semgrep |
contents: read, security-events: write
|
Every event, with its own egress policy and list |
| Snyk |
contents: read, security-events: write, id-token: write
|
Never on a pull request; the weekly schedule and manual runs by default |
| Scorecard |
contents: read, security-events: write, id-token: write
|
The default branch (push or schedule) only |
Snyk and Scorecard are the only jobs with an OIDC grant, and neither runs on a pull request. gitleaks lost its id-token
and its Doppler fetch in issue #90: the licence-gated action was replaced with the MIT binary, pinned by sha256 and checked
with sha256sum -c before extraction, and a canary step plants an AWS-shaped key in a scratch repository and fails the job
unless the same invocation exits 1 on it. A .gitleaks.toml at the repository root is honoured. gitleaks-scope (pr-commits by default, all-refs as the opt-in) scopes a pull request's
scan to its own commits plus the tree; pushes and schedules always scan every ref. See
Security scanning explained for the table and what it does not cover.
A pull request's tree scan can only match a file:rule:line ignore entry, not the commit-bound form
(commit:file:rule:line) gitleaks writes for a history finding; the job warns about such entries by line number, file and rule
(never the commit or a value) and the README's "Migrating .gitleaksignore entries" says how to move them.
When a gitleaks history or working-tree scan finds a secret shape, the separate reporting step runs scripts/gitleaks_findings.py, which reads the scan's redacted JSON reports and lists at most 100 findings in the job log and job summary using only the rule id, file, start line and entropy, plus the short commit id for history findings. Control characters are escaped; matched text, secret values and other content fields are not printed. The redacted JSON reports are also available for 5 days in the gitleaks-findings artifact, even when gitleaks-upload-sarif: false or advanced-security: false makes code scanning unavailable.
When Semgrep finds an issue, a separate post-scan step runs scripts/semgrep_findings.py, which lists at most 100 findings in the job log and job summary using only the rule id, file, start line and severity and writes the safe retained JSON. Control characters are escaped, and matched code, messages and snippets are never printed. A redacted JSON report containing only those four fields for at most 100 findings is retained for 5 days in the semgrep-findings artifact, even when the scan fails or advanced-security: false makes code scanning unavailable. The raw semgrep.sarif stays local to the job except for the existing code scanning upload when enabled. These reporting steps do not mask or replace the scan's exit code.
The runs-on input is a JSON string that every job reads through fromJSON(inputs.runs-on), because runs-on takes a
string, an array or an object: '"ubuntu-latest"' (the default), '["self-hosted","linux"]' or
'{"group":"my-group","labels":["linux"]}'. Nothing can validate it before runs-on resolves, so invalid JSON fails the job
at expression time. A job that follows egress-policy-secretless reaches audit only on a GitHub-hosted runner with a label
in the hosted list of EX-0001, so every other runner gets block. On a self-hosted runner step-security/harden-runner needs
a StepSecurity Enterprise subscription; without one it is a no-op, so block is not enforced there (verified against its
README on 2026-11-25; the workflow header has the details).
A step right after harden-runner in every job enforces the trust domain: on any runner that is not GitHub-hosted the job fails unless
allow-self-hosted: true, which is the caller's attestation that the runner is ephemeral, one job per VM, and isolated from
secrets and the network. Even then, a self-hosted runner takes only push, schedule, workflow_dispatch, release and
same-repository pull_request events; merge_group, workflow_run, issue_comment, pull_request_target, a fork's pull
request, a pull request with an unnamed head repository and any unknown event fail. This keeps out code from outside the
repository's own writers; it does not isolate the runner, so a persistent runner must not be shared with a job that holds OIDC
or Doppler access. Secret-bearing jobs belong on GitHub-hosted runners or a distinct ephemeral trusted pool.
The pinned digests and the mutation tests (tests/test_runs_on_input.py) catch accidental and partial changes to the egress
policy check and the self-hosted guard. A change that edits a guarded script and its pinned digest together is stopped only by
review, which is what .github/CODEOWNERS is for. Branch protection does not yet require code-owner review, so until it does
that review is a convention, not an enforced rule.
security.yml has no gate job. A repository whose only GYST caller is this one adds a gate job that calls
ci-gate over security (if: always(), permissions: {}), and requires gate / CI green in branch
protection. The README's Security caller example has it.
.githooks/pre-commit runs the gitleaks scan on the staged changes, so a secret is caught before it is in history. It uses
the version and SHA-256 that security.yml pins (a test holds the two equal), keeps the verified release under
~/.cache/gyst/gitleaks/<version>/, checks it against the pin on every run, and honours .gitleaks.toml. A finding refuses the
commit and prints the rule, file and line, never the secret. With no cached binary and no network it warns and allows. It only
protects a checkout that ran git config core.hooksPath .githooks; push protection and the CI scan are the two that always run.
scripts/new-repo.sh copies the file byte for byte into an adopted repository and adds that one line to its README's Developing
section.
on:
push: { branches: [main] }
pull_request:
schedule:
- cron: '0 6 * * 1' # weekly, so new advisories surface between commits
workflow_dispatch:
jobs:
security:
uses: ChiefGyk3D/git-your-ship-together/.github/workflows/security.yml@<sha> # vX.Y.Z
permissions:
contents: read
security-events: write
pull-requests: write
id-token: write
secrets:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
with:
snyk: true
scorecard: true
egress-policy: block
doppler-project: ci
doppler-config: ci
doppler-identity-id: ${{ vars.DOPPLER_IDENTITY_ID }}-
Snyk and the free plan. It meters tests per month across the account. Ten repositories on
pushspent a month's Snyk Code tests on 2026-10-04 (34 runs), sosnyk-ondefaults toschedule. Findings do not fail the job; Snyk failing to run does. -
Snyk's pip resolver refuses a universal lock. A
uv pip compile --universallock always has lines pip skips (markers for other Pythons), and Snyk exits 2 with "Missing required packages".--skip-unresolved=truechanged nothing, measured on four repositories on 2026-10-03. The workflow therefore scans apip freezeof the environment the lock installed. A repository with no lock names its install insnyk-install-command. -
Semgrep for shell. No
p/bashorp/shellregistry pack exists (the earlier default 404'd, issue #66), so shell-only repositories usep/github-actionsandp/secrets, and bash-ci's ShellCheck covers the shell. -
pip-audit and Semgrep are hash-locked. Both install under
--require-hashes --no-deps --only-binary=:all:from locks carried inside the workflow (source:.github/requirements/, copied in byscripts/tool_locks.py), because Scorecard flags an unhashedpip install(issue #87). The Semgrep version is therefore the lock's.semgrep-versionis deprecated and will be removed: empty or equal to the locked version is accepted, anything else fails the install step naming the locked version. A Snykpip-audit-requirementsfile with no hashes now fails rather than installing unchecked. -
Private repositories without Advanced Security: set
advanced-security: false(issue #248). Without it the run fails, even on a clean scan. Observed on 2026-10-30 on a private repository without Advanced Security: dependency review fails with "Dependency review is not supported on this repository. Please ensure that Dependency graph is enabled along with GitHub Advanced Security"; CodeQL, Semgrep and the gitleaks SARIF upload each fail with "Resource not accessible by integration" (the failing call is the SARIF upload; the same text also shows as a telemetry warning). Putadvanced-security: falseonce underwith:in the caller. Then dependency review and CodeQL are skipped (shown as skipped, not failed), the Semgrep and gitleaks SARIF uploads are skipped, and both jobs write a job-summary note. Semgrep and gitleaks still run and still fail the job on a finding. The default istrue, so every existing caller is unchanged. The value must be exactlytrueorfalse: a new always-running job,advanced-security-check, fails the call, loudly, on anything else (False, empty, a typo). It is not a gate: the scans do not wait for it and run as before, so a check that fails for another reason (a flaky canary) never switches a scan off. Only the literalfalse(any casing) skips CodeQL and dependency review; any other bad value runs them and still fails the check. Do not mask that red run:continue-on-erroron the calling job, or a downstream aggregator that treats a skipped or failed called workflow as success, hides it. - Semgrep suppression is partly unsettled (issue #83); see the scanning page.
-
The Actions allow-list needs subdirectory forms for
github/codeql-action/initandsnyk/actions/setup; see The baseline and the weekly audit. -
Scorecard findings are filed as issues weekly; one open item (#87) is a
pip installin this workflow not yet pinned by hash.
Inputs (44), read from security.yml:
| Input | Type | Default | Meaning |
|---|---|---|---|
advanced-security |
string | true |
Whether the repository has GitHub Advanced Security - exactly true (default, unchanged behavior) or false. A private repository without Advanced Security sets false; dependency review and CodeQL are then skipped, and Semgrep and gitleaks still run and still fail on a finding but do not upload SARIF, and the job summary says so. Any other value (including False or an empty string) fails the advanced-security-check job, and so the whole call, though the scans still run. |
codeql |
boolean | true |
Run CodeQL. |
codeql-languages |
string | python,actions |
CodeQL languages, comma-separated. actions scans the workflow files themselves and fits every repository; a repository with no Python passes actions alone, since CodeQL fails on a language with no source. |
codeql-queries |
string | security-extended |
CodeQL query suite. |
codeql-config |
string | empty | Inline CodeQL configuration (YAML), for example paths-ignore. |
gitleaks |
boolean | true |
Run the gitleaks scan (what it covers is set by gitleaks-scope). |
gitleaks-scope |
string | pr-commits |
What the gitleaks history scan covers - exactly pr-commits (default) or all-refs (opt-in, every ref in the clone). pr-commits narrows only a pull_request run, to the commits of the pull request (base..head) plus a scan of the checked-out tree, so a key on some other unmerged branch no longer fails every pull request; a push (the default branch included), a schedule, a workflow_dispatch and any other event scan the full history whatever this is set to. Any other value fails the gitleaks job. On a pull_request event, in both scopes, the scan reads .gitleaks.toml and .gitleaksignore from the base commit rather than the pull request's tree. |
gitleaks-hash-manifest-paths |
string | empty | Newline-separated repository-relative file paths of content-hash manifests (for example an asset manifest that records the SHA-256 of discord.svg), default empty (no allowlist). The default gitleaks rule discord-api-token reads a 64-hex SHA-256 on a line keyed discord as a token. For exactly the listed files, a finding of that one rule whose value is exactly 64 lowercase hex characters is allowed (an AND of path and value; each path is matched whole, anchored at both ends, with no globs); every other rule, path and value is still reported. The allowlist is layered on the configuration the scan already uses (on a pull request, the base commit's .gitleaks.toml), so a pull request cannot allowlist itself with its own tree. The list comes from the caller's workflow file. Each line must be a plain path of letters, digits, _, ., - and / with no .., at most 100 lines; anything else fails the gitleaks job. |
gitleaks-version |
string | 8.30.1 |
gitleaks release to download (gitleaks/gitleaks), without the v. Changing it means changing gitleaks-sha256. |
gitleaks-sha256 |
string | 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb |
SHA-256 of the gitleaks linux_x64 tarball for that version. |
gitleaks-upload-sarif |
boolean | true |
Upload the gitleaks SARIF to code scanning. Turn it off on a private repository without GitHub Advanced Security, where code scanning is unavailable and the upload fails the job; the scan still runs and still fails on a finding. |
pip-audit-requirements |
string | requirements.txt |
Requirements file audited by pip-audit; empty skips that step. With audit-command empty too, the job is skipped. |
pip-audit-continue-on-error |
boolean | false |
Report advisories without failing the job. A migration aid, not a resting state. |
pip-audit-extra-args |
string | empty | Extra pip-audit arguments, e.g. --ignore-vuln PYSEC-2026-3740 for an advisory with no fix yet. Name the reason in the caller. |
audit-install-command |
string | empty | Shell run before audit-command, e.g. npm ci --ignore-scripts or cargo install cargo-audit; empty installs nothing. Python is available. |
audit-command |
string | empty | A dependency audit that is not pip-shaped, e.g. npm audit --audit-level=high, govulncheck ./..., cargo audit; empty runs none. Runs in the same job as pip-audit, after it. |
audit-continue-on-error |
boolean | false |
Report audit-command findings without failing the job. A migration aid, not a resting state. |
dependency-review |
boolean | true |
Run dependency-review on pull requests. |
dependency-review-severity |
string | moderate |
Fail the review at this severity or above. |
dependency-review-deny-licenses |
string | AGPL-3.0, GPL-3.0, GPL-2.0, LGPL-3.0, SSPL-1.0 |
Comma-separated SPDX identifiers the review fails on when a pull request adds a dependency under one of them. Empty means no licence rule. A dependency whose licence cannot be detected is reported, not failed. |
dependency-review-allow-dependencies-licenses |
string | empty | Comma-separated package URLs (pkg:pypi/semgrep) the licence rule does not apply to. For a tool the repository runs but does not link or ship, such as a CLI under LGPL whose hash lock is a manifest the review reads. Empty exempts nothing. Licence only; advisories still fail the review. |
dependency-review-allow-ghsas |
string | empty | Comma-separated GitHub Advisory IDs the review may not fail on. Each one must have an entry in the shared repository's baseline/risk-register.yaml (the audit checks); an advisory with no fixed release is the usual case. |
semgrep |
boolean | true |
Run Semgrep over the repository and upload the SARIF. |
semgrep-config |
string | empty | Space-separated Semgrep configs, each passed as --config (registry packs or repository paths). Empty selects p/github-actions p/secrets, adding p/python when tracked Python files exist. |
semgrep-version |
string | empty | Deprecated, and will be removed. Semgrep is installed from a hash lock (.github/requirements/semgrep.txt), so the version is the lock's. Leave empty; a value that is not the locked version fails the install step. |
semgrep-continue-on-error |
boolean | false |
Report findings without failing the job (they still reach the Security tab). A migration aid, not a resting state. |
semgrep-egress-policy |
string | block |
harden-runner egress policy for the Semgrep job only - audit logs outbound connections, block allows only semgrep-allowed-endpoints and extra-allowed-endpoints. |
semgrep-allowed-endpoints |
string | api.github.com:443 files.pythonhosted.org:443 github.com:443 pypi.org:443 semgrep.dev:443 |
harden-runner allow-list for the Semgrep job in block, space-separated host:port entries. The default is the pip install of Semgrep, the rule registry, and the SARIF upload. Wildcards are not supported and a newline-separated list matches nothing. |
snyk |
boolean | false |
Run Snyk Code and Snyk Open Source. Needs SNYK_TOKEN in the Doppler config. |
snyk-on |
string | schedule |
When the Snyk job runs. schedule (default) runs it on the weekly schedule and on workflow_dispatch only; push also runs it on every push to the default branch and every tag. Snyk's free plan meters tests per month (one Snyk Code test and one Snyk Open Source test per run) across every repository on the account, and ten repositories on push used the month's Code tests in a day (measured 2026-10-04, 34 runs). Weekly across the same ten is about a tenth of that. Never on a pull request in either mode. |
snyk-install-command |
string | empty | Shell that installs the project's dependencies for Snyk Open Source when pip-audit-requirements is empty, for a repository that declares them in pyproject.toml and keeps no lock (pip install ., pip install .[all]). Snyk then scans a freeze of the result, written over pyproject.toml in the checkout so the SARIF names the file that declares the dependencies. Empty with an empty pip-audit-requirements leaves Snyk's own discovery, which reads no PEP 621 pyproject.toml and ends in a "nothing to scan" warning. |
scorecard |
boolean | false |
Run OpenSSF Scorecard and publish the result. Runs only on the default branch (push or schedule). |
python-version |
string | 3.13 |
Python for pip-audit and Snyk. |
egress-policy |
string | audit |
harden-runner egress policy for every job - audit logs outbound connections, block allows only allowed-endpoints. Jobs that hold no secret follow egress-policy-secretless instead (EX-0001). |
egress-policy-secretless |
string | block |
harden-runner egress policy for the jobs that hold no stored secret, no OIDC token and no write-scoped or publish-capable token (read-only contents, a SARIF upload at most; dependency-review also holds its comment-scoped pull-requests write grant, a stated EX-0001 deviation), and whose output no privileged job consumes - exactly audit or block. Defaults to block since security exception EX-0001 (GitHub-hosted runners in westus2 broke harden-runner block) was closed on 2026-11-02 after harden-runner v2.22.3 passed on westus2; see docs/security/exceptions/. Every job still has the default read-only job token. Set audit to opt out if the defect recurs. Any other job follows egress-policy. Any other value fails the job. |
allowed-endpoints |
string | api.deps.dev:443 api.doppler.com:443 api.github.com:443 api.osv.dev:443 api.scorecard.dev:443 api.securityscorecards.dev:443 api.snyk.io:443 app.snyk.io:443 codeload.github.com:443 deeproxy.snyk.io:443 downloads.snyk.io:443 files.pythonhosted.org:443 fulcio.sigstore.dev:443 github.com:443 oss-fuzz-build-logs.storage.googleapis.com:443 pypi.org:443 rekor.sigstore.dev:443 release-assets.githubusercontent.com:443 static.snyk.io:443 tuf-repo-cdn.sigstore.dev:443 uploads.github.com:443 www.bestpractices.dev:443 |
harden-runner allow-list for block, space-separated host:port entries. The default is every endpoint this workflow's jobs reached in audit mode across the calling repositories; the runner's own infrastructure needs no entry. Wildcards are not supported and a newline-separated list matches nothing. |
extra-allowed-endpoints |
string | empty | Appended to allowed-endpoints, for hosts only this repository reaches, such as an apt repository its Dockerfile adds. Same format. |
doppler-project |
string | empty | Doppler project slug. |
doppler-config |
string | empty | Doppler config slug holding CI secrets. |
doppler-identity-id |
string | empty | Doppler Service Account Identity UUID for OIDC. |
doppler-trusted-refs-only |
boolean | true |
Fetch CI secrets only on the default branch, a version tag (vN.N.N) or a schedule; never on a pull request or another branch. false restores fetching on every same-repository run. |
timeout-minutes |
number | 15 |
Per-job timeout. |
runs-on |
string | "ubuntu-latest" |
Runner for every job, as a JSON string, because runs-on takes a string, an array or an object: "ubuntu-latest", ["self-hosted","linux"] or {"group":"my-group","labels":["linux"]}. The default parses to the label this workflow always used. Invalid JSON fails the job at expression time. Jobs that follow egress-policy-secretless reach audit only on a GitHub-hosted runner and a label in the hosted list (EX-0001); see the workflow header for how harden-runner behaves on a self-hosted runner. |
allow-self-hosted |
boolean | false |
Let these jobs run on a self-hosted runner (default false: on any runner that is not GitHub-hosted the job fails). Setting it true is the caller's attestation that the runner is ephemeral, one job per VM, and isolated from secrets and the network. Even then a self-hosted runner takes only push, schedule, workflow_dispatch, release and same-repository pull_request events. Secret-bearing jobs belong on GitHub-hosted runners or a distinct ephemeral trusted pool. |
Secrets a caller may pass, by name:
| Secret | Required | Meaning |
|---|---|---|
DOPPLER_TOKEN |
no | Doppler Service Token fallback when OIDC is not configured. |
It never runs a token-holding scan on a pull request, never fetches Doppler secrets on one (doppler-trusted-refs-only is on
by default), and never turns a missing token into a pass: an expired Snyk token fails the job and names itself.
Generated from docs/wiki/ at commit f3af2fa0bae3. Do not edit this wiki: the next push to main replaces every page. Corrections go to docs/wiki/ by pull request.
GYST
- Home
- Why GYST exists
- Getting started
- Design rules
- Secrets: Doppler and OIDC
- Security scanning explained
- The baseline and the weekly audit
- Releases and supply chain
- Keeping a project board current
- Adopting GYST in your own project
- Glossary
- Roadmap
Learn and contribute
- Learning path
- Which workflow do I need?
- Repository map
- Egress control
- Troubleshooting
- Lessons learned
- Testing and the contract
- Contributing and developing
- Maintaining this wiki
- Verify main
- FAQ
CI
Security
Release
- container-release
- python-docker-release
- python-package-release
- artifact-release
- verify-published
- base-image-digest
Docs and project
- docs-pages
- wiki-publish
- project-sync
- threat-model
- lory-audit
- agent-scan
- token-drift
- node-typecheck
- pr-title-lint
- vendored-drift
- upstream-sync
- repin
- pin-comments
Tools