# GitHub posture rules

The VNX-GH rules vulnetix gha evaluates: workflow injection and privilege flaws, the action supply chain, and repository and organisation settings.

63 rules. The same engine runs in the `vulnetix gha` posture commands and in the Software Factory on GitHub App events, so a finding means the same thing in both places. The commands, their flags and the GitHub token each one needs are on [GitHub posture commands](/cli/commands/gha.md).

| Context | Meaning |
|---|---|
| needs | The rule only runs when those GitHub facts were read through the API. Without them it is reported as not evaluated, never as passed. |
| uses | The rule runs on the files alone, and reads those facts when present to lower or raise the severity of each finding. |

## Workflows (`vulnetix gha workflows`)

| Rule | Severity | Context |
|---|---|---|
| [VNX-GH-001](/cli/github-rules/vnx-gh-001.md): Untrusted input expanded into an executed script | Critical | uses repo |
| [VNX-GH-002](/cli/github-rules/vnx-gh-002.md): Untrusted input written to GITHUB_ENV or GITHUB_PATH | High |  |
| [VNX-GH-003](/cli/github-rules/vnx-gh-003.md): Privileged workflow runs code from an untrusted pull request | Critical | uses repo, environments |
| [VNX-GH-004](/cli/github-rules/vnx-gh-004.md): Checkout credentials persisted into an uploaded workspace | High |  |
| [VNX-GH-005](/cli/github-rules/vnx-gh-005.md): Privileged workflow consumes artifacts from an untrusted run | High |  |
| [VNX-GH-006](/cli/github-rules/vnx-gh-006.md): Release workflow restores a cache writable by untrusted runs | High |  |
| [VNX-GH-007](/cli/github-rules/vnx-gh-007.md): Workflow token permissions not declared | Medium | uses repo |
| [VNX-GH-008](/cli/github-rules/vnx-gh-008.md): Excessive token permissions | Medium |  |
| [VNX-GH-009](/cli/github-rules/vnx-gh-009.md): OIDC token minted outside a protected environment | Medium | uses environments |
| [VNX-GH-010](/cli/github-rules/vnx-gh-010.md): All secrets passed to a reusable workflow | Medium | uses repo |
| [VNX-GH-011](/cli/github-rules/vnx-gh-011.md): Secrets context exposed in bulk | High |  |
| [VNX-GH-012](/cli/github-rules/vnx-gh-012.md): Hard-coded container registry credentials | High |  |
| [VNX-GH-013](/cli/github-rules/vnx-gh-013.md): Deprecated workflow commands re-enabled | High |  |
| [VNX-GH-014](/cli/github-rules/vnx-gh-014.md): Authorisation by spoofable actor name | High |  |
| [VNX-GH-015](/cli/github-rules/vnx-gh-015.md): Condition always evaluates to true | High |  |
| [VNX-GH-016](/cli/github-rules/vnx-gh-016.md): Self-hosted runner reachable from pull requests | High | uses repo, runner groups |
| [VNX-GH-017](/cli/github-rules/vnx-gh-017.md): Secret printed to the job log | Medium |  |
| [VNX-GH-018](/cli/github-rules/vnx-gh-018.md): Comment-triggered workflow without an author check | High | uses repo |
| [VNX-GH-019](/cli/github-rules/vnx-gh-019.md): Obfuscated action reference or expression | Low |  |
| [VNX-GH-020](/cli/github-rules/vnx-gh-020.md): Pull request head ref used as a branch or tag name without quoting | Medium |  |
| [VNX-GH-021](/cli/github-rules/vnx-gh-021.md): Secrets sent to an external host | Critical |  |
| [VNX-GH-022](/cli/github-rules/vnx-gh-022.md): Privileged job restores a cache keyed on contributor input | High |  |

## Actions and images (`vulnetix gha actions`)

| Rule | Severity | Context |
|---|---|---|
| [VNX-GH-101](/cli/github-rules/vnx-gh-101.md): Action or reusable workflow not pinned to a commit SHA | Medium | uses action refs, actions policy, repo |
| [VNX-GH-102](/cli/github-rules/vnx-gh-102.md): SHA pin does not match its version comment | High | needs action refs |
| [VNX-GH-103](/cli/github-rules/vnx-gh-103.md): Pinned commit is not in the action's repository | Critical | needs action refs |
| [VNX-GH-104](/cli/github-rules/vnx-gh-104.md): Action repository archived, missing or hijackable | High | needs action refs |
| [VNX-GH-105](/cli/github-rules/vnx-gh-105.md): Action version has a published vulnerability | High | needs action refs |
| [VNX-GH-106](/cli/github-rules/vnx-gh-106.md): Container image not pinned to a digest | Low |  |
| [VNX-GH-107](/cli/github-rules/vnx-gh-107.md): Action major version runs on a retired runtime | Low |  |
| [VNX-GH-108](/cli/github-rules/vnx-gh-108.md): Action not permitted by the allowed-actions policy | Medium | needs actions policy |
| [VNX-GH-109](/cli/github-rules/vnx-gh-109.md): Action owner resembles a popular publisher | High |  |
| [VNX-GH-111](/cli/github-rules/vnx-gh-111.md): Remote script piped into an interpreter | Medium |  |

## Repository settings (`vulnetix gha settings`)

| Rule | Severity | Context |
|---|---|---|
| [VNX-GH-201](/cli/github-rules/vnx-gh-201.md): Default branch is not protected | High | needs repo, branches |
| [VNX-GH-202](/cli/github-rules/vnx-gh-202.md): Default branch merges without review | High | needs repo, branches |
| [VNX-GH-203](/cli/github-rules/vnx-gh-203.md): Approvals survive new commits | Medium | needs repo, branches |
| [VNX-GH-204](/cli/github-rules/vnx-gh-204.md): Workflow changes bypass code owners | Medium | needs repo, branches, codeowners |
| [VNX-GH-205](/cli/github-rules/vnx-gh-205.md): Force pushes or deletion allowed on the default branch | High | needs repo, branches |
| [VNX-GH-206](/cli/github-rules/vnx-gh-206.md): Branch protection can be bypassed | Medium | needs repo, branches |
| [VNX-GH-207](/cli/github-rules/vnx-gh-207.md): No required status checks | Low | needs repo, branches |
| [VNX-GH-208](/cli/github-rules/vnx-gh-208.md): Workflow token defaults to write | Medium | needs repo, actions policy |
| [VNX-GH-209](/cli/github-rules/vnx-gh-209.md): GitHub Actions can approve pull requests | Medium | needs repo, actions policy |
| [VNX-GH-210](/cli/github-rules/vnx-gh-210.md): Fork pull request workflows run without approval | Medium | needs repo, actions policy |
| [VNX-GH-211](/cli/github-rules/vnx-gh-211.md): Any action may run | Low | needs repo, actions policy |
| [VNX-GH-212](/cli/github-rules/vnx-gh-212.md): Secret scanning or push protection disabled | Medium | needs repo, security and analysis |
| [VNX-GH-213](/cli/github-rules/vnx-gh-213.md): Dependabot alerts or security updates disabled | Low | needs repo, security and analysis |
| [VNX-GH-214](/cli/github-rules/vnx-gh-214.md): Environment secrets deployable without approval | High | needs repo, environments |
| [VNX-GH-215](/cli/github-rules/vnx-gh-215.md): Deploy key with write access, or unused | Medium | needs deploy keys |
| [VNX-GH-216](/cli/github-rules/vnx-gh-216.md): Webhook deliveries can be forged or intercepted | Medium | needs webhooks |
| [VNX-GH-217](/cli/github-rules/vnx-gh-217.md): Outside collaborator with admin access | Medium | needs collaborators |
| [VNX-GH-218](/cli/github-rules/vnx-gh-218.md): Signed commits not required | Low | needs repo, branches |
| [VNX-GH-219](/cli/github-rules/vnx-gh-219.md): Repository secret used by an untrusted-trigger workflow | High | needs repo |
| [VNX-GH-220](/cli/github-rules/vnx-gh-220.md): Public repository has no private vulnerability reporting | Low | needs repo, security and analysis |
| [VNX-GH-221](/cli/github-rules/vnx-gh-221.md): Security policy files missing | Low | needs repo, repo files |
| [VNX-GH-222](/cli/github-rules/vnx-gh-222.md): Actions secret not rotated in a year | Low | needs secrets |

## Organisation settings (`vulnetix gha org`)

| Rule | Severity | Context |
|---|---|---|
| [VNX-GH-301](/cli/github-rules/vnx-gh-301.md): Organisation does not require two-factor authentication | High | needs org |
| [VNX-GH-302](/cli/github-rules/vnx-gh-302.md): Broad default repository permission for members | Medium | needs org |
| [VNX-GH-303](/cli/github-rules/vnx-gh-303.md): Members can create public repositories | Low | needs org |
| [VNX-GH-304](/cli/github-rules/vnx-gh-304.md): Organisation allows any action | Medium | needs org |
| [VNX-GH-305](/cli/github-rules/vnx-gh-305.md): Organisation workflow token defaults to write | Medium | needs org |
| [VNX-GH-306](/cli/github-rules/vnx-gh-306.md): Organisation secret visible to every repository | Medium | needs org |
| [VNX-GH-307](/cli/github-rules/vnx-gh-307.md): Self-hosted runners available to public repositories | High | needs runner groups |
| [VNX-GH-308](/cli/github-rules/vnx-gh-308.md): Organisation lets Actions approve pull requests | Medium | needs org |
| [VNX-GH-309](/cli/github-rules/vnx-gh-309.md): Organisation webhook deliveries can be forged or intercepted | Medium | needs org |
