Menu

GitHub Actions Security Best Practices: 4 Mistakes 27 of 30 Repos Still Make
📰

GitHub Actions Security Best Practices: 4 Mistakes 27 of 30 Repos Still Make

DEV Community: cicd·flisk·11 days ago
#In4ngkgc
#devtocicd#devto#dev#repos#permissions
Long article (588 words) — no AI summary yet.
Reading 0:00
15s threshold

TL;DR: most public repos check almost nothing about their own GitHub Actions. We tested 30 public repos (11,350 files) and 231 real pull requests. Only 3 of 30 check action pins, 3 of 30 audit workflow permissions, 1 of 30 scans for keys, and 0 of 30 notice a PR that says "all tests pass" while a check is red. Below are the four fixes, and a one-second check that does all of them.

If you are looking for GitHub Actions security best practices , this is the short list, ranked by how often it goes wrong.

1. Pin third-party actions to a commit SHA

uses: some-org/some-action@main runs whatever that branch holds today. A tag can be moved too. Pin to the full commit SHA and keep the tag in a comment:

- uses : actions/checkout@<full-commit-sha> # v4

Enter fullscreen mode

Exit fullscreen mode

In our bench, only 3 of 30 repos had any check for this. Planted unpinned actions caught by GEL: 90 of 90 .

2.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.