From 46252aa23849f169f11c587d2a06ec36e71da68e Mon Sep 17 00:00:00 2001 From: Alex Schapiro Date: Fri, 23 Oct 2026 03:33:17 +0000 Subject: [PATCH] feat(sandbox): add Strix rule for GitHub-owned actions not pinned to a commit SHA --- containers/Dockerfile | 4 ++ ...owned-action-not-pinned-to-commit-sha.yaml | 37 +++++++++++++++++++ strix/skills/tooling/opengrep.md | 2 +- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 containers/opengrep-rules/github-owned-action-not-pinned-to-commit-sha.yaml diff --git a/containers/Dockerfile b/containers/Dockerfile index 2195bdee1..3e1e0fba1 100644 --- a/containers/Dockerfile +++ b/containers/Dockerfile @@ -227,6 +227,10 @@ RUN set -eux; \ find . -type d -empty -delete; \ chmod -R a+rX /opt/opengrep-rules +# Strix-authored rules that close gaps in the community ruleset. +COPY containers/opengrep-rules/ /opt/opengrep-rules/strix/ +RUN chmod -R a+rX /opt/opengrep-rules/strix + USER pentester RUN pipx install bandit diff --git a/containers/opengrep-rules/github-owned-action-not-pinned-to-commit-sha.yaml b/containers/opengrep-rules/github-owned-action-not-pinned-to-commit-sha.yaml new file mode 100644 index 000000000..0640684bf --- /dev/null +++ b/containers/opengrep-rules/github-owned-action-not-pinned-to-commit-sha.yaml @@ -0,0 +1,37 @@ +rules: + - id: github-owned-action-not-pinned-to-commit-sha + patterns: + - pattern-inside: "{steps: ...}" + - pattern: | + uses: "$USES" + - metavariable-regex: + metavariable: $USES + regex: '^(actions|github)/' + - metavariable-pattern: + metavariable: $USES + language: generic + patterns: + - pattern-not-regex: "@[0-9a-f]{40}$" + message: >- + GitHub-owned action `$USES` is referenced by a mutable tag or branch + instead of a full-length commit SHA. Tags can be moved, so a compromised + or force-pushed release changes what this workflow runs. Pin to the + commit SHA of the release you reviewed and let a bot keep it current. + languages: + - yaml + severity: WARNING + metadata: + cwe: + - "CWE-1357: Reliance on Insufficiently Trustworthy Component" + - "CWE-353: Missing Support for Integrity Check" + owasp: A06:2021 - Vulnerable and Outdated Components + references: + - https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions + category: security + technology: + - github-actions + subcategory: + - vuln + likelihood: LOW + impact: LOW + confidence: HIGH diff --git a/strix/skills/tooling/opengrep.md b/strix/skills/tooling/opengrep.md index efda02b33..ae4a416b9 100644 --- a/strix/skills/tooling/opengrep.md +++ b/strix/skills/tooling/opengrep.md @@ -13,7 +13,7 @@ Canonical syntax: `opengrep scan [flags] [targets]` Bundled rules: -- `/opt/opengrep-rules` holds the full ruleset, one directory per language (`python`, `javascript`, `typescript`, `go`, `java`, `php`, `ruby`, …) plus `generic/secrets`, `dockerfile`, `terraform`, `yaml` +- `/opt/opengrep-rules` holds the full ruleset, one directory per language (`python`, `javascript`, `typescript`, `go`, `java`, `php`, `ruby`, …) plus `generic/secrets`, `dockerfile`, `terraform`, `yaml`, and `strix` (Strix-authored rules, e.g. GitHub-owned actions not pinned to a commit SHA) - Framework rules sit under the language (`python/django`, `python/flask`, `javascript/express`, …) High-signal flags: