← Mon, Nov 23 digest

De-fanging dangerous triggers in GitHub Actions across an organization

read article ↗ hn thread ↗

GitHub Actions triggers like pull_request_target expose secrets to external code, but organization-wide event allowlists can effectively lock them down.

read it Provides exact CLI commands, JSON policy templates, and clear operational advice for securing GitHub Actions against supply-chain attacks.

summary

GitHub Actions triggers like pull_request_target and issue_comment allow arbitrary external code or inputs to run with full repository secrets, driving numerous recent supply-chain attacks. Python Software Foundation engineers Mike Fiedler and Seth Larson outline how to audit workflows using GitHub CLI and tools like zizmor. They provide practical instructions for enforcing organization-wide allowlist policies, including how to test them safely in evaluate mode. The guide covers strategies for both paid enterprise plans and free organization tiers.

key points

  1. Triggers like pull_request_target run un-reviewed external code with write permissions and secrets access, enabling recent supply-chain compromises across multiple packages.
  2. Administrators can audit repositories using GitHub CLI queries or the open-source linter zizmor to find vulnerable workflow files.
  3. Organizations should implement an explicit event allowlist policy via the GitHub API, testing changes safely in evaluation mode before active enforcement.

who should read it

GitHub organization administrators, DevOps engineers, and open-source maintainers.

discussion warm

consensus

Commenters strongly endorse tightening GitHub Actions security defaults and recommend using tools like zizmor to immediately audit codebases for vulnerable triggers.

pushback

A minority viewpoint argues that using the same CI infrastructure for testing, building, and publishing is an inherently flawed architectural pattern.

best comment by darkamaul ↗

That's a great change by Github here. pull_request_target has been the source of numerous security incidents (see the examples listed in the blogpost), with little benefits to the user.

zizmor [0], a linter for GitHub Actions, flags it as part of its default audits. I would also recommend everyone to check the results of the default scan of zizmor on their project:

```

cd <my-project>

uvx zizmor .

```

[0] https://zizmor.sh/

It provides a ready-to-run CLI command using uvx zizmor that instantly audits a project for vulnerable triggers.

Generated by an LLM from the article and thread. Check the sources before relying on it.