Interview Prep/CI/CD/GitHub Actions and GitLab CI in Production

How do you keep GitHub Actions workflow files themselves safe from unauthorised changes?

IntermediateProductionGitHub Actions and GitLab CI in Production
Answer

CODEOWNERS entry /.github/workflows/ @acme/platform-security with required code owner review; restrict permissions: to least privilege per workflow; limit which actions may run in organisation settings (allow GitHub-owned and an approved list, with SHA pinning required); require approval for workflows from outside collaborators; and scan workflows in CI with zizmor and actionlint.

All CI/CD questions Roadmap: GitLab CI/CD

More on GitHub Actions and GitLab CI in Production