C.W.K.
Stream
Lesson 11 of 12 · published

Security Best Practices

~11 min · security, checklist, hardening

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

The checklist

The whole secrets/permissions track condenses to a checklist worth running on every repo. Most teams pass 5 of the 10 on first audit.

  1. Org default for GITHUB_TOKEN is restricted (read-all). Set in Org Settings → Actions → Workflow permissions.
  2. Every workflow has explicit permissions: at the top level, defaulting to read.
  3. Third-party actions are SHA-pinned — never floating tags for actions you don't own.
  4. Cloud auth uses OIDC — no long-lived keys for AWS / GCP / Azure.
  5. Production environment has required reviewers + branch policy.
  6. Secret scanning + push protection enabled on the repo.
  7. No pull_request_target + checkout of PR head SHA anywhere.
  8. Dependabot version updates enabled with automerge for security patches.
  9. CodeQL workflow exists and runs weekly.
  10. Secret rotation procedure documented — when (quarterly), how (provider rotate + repo update), and tested at least once.

Code

Self-audit one-liner — what permissions does each workflow declare?·bash
for f in .github/workflows/*.yml; do
  echo "== $f =="
  awk '/^permissions:/,/^[a-z]/ { print }' "$f" | head -10
  echo
done
# Workflows missing top-level permissions: block? They default to whatever
# the org permits. Add explicit permissions:read-all and re-run.

External links

Exercise

Pick one repo. Walk the 10-item checklist above. For each failed item, file an issue (don't fix yet) and tag it security-hardening. Now you have your roadmap.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.