Lion Cipher Lab
Audit your repository's Actions settings through the GitHub API and tighten them (CI/CD assessment 2 of 7)
- Penetration Testing / Red Team
- Intermediate
- ~45 min
- Free · no account required
Why it matters
A workflow file says what a pipeline asks for. A repository setting says what it actually gets. If the default token permission is read and write, every workflow that forgot a permissions key silently has write power over your code, and a stolen or hijacked run inherits it. The settings are also easy to read and change from the command line, which means they are easy to check regularly. This is an assessor's second question after the inventory: not what is there, but what is allowed.
What you'll learn
- reading repository Actions settings with gh api
- knowing what the default GITHUB_TOKEN permission controls
- explaining why Actions approving pull requests is a risk
- reading the allowed-actions policy and the SHA-pinning setting
- reading the fork pull request approval policy
- changing a setting through the API and checking it took
Steps in this lab
- The rule first: your repository, a test one before a real one
- Read the three settings with gh api
- Write the audit script and try it on sample settings
- Grade your own repository and keep the output
- Change the safe settings and read them again
- The defender's view: where the settings live and how drift happens
Open the full interactive lab →