// module 06 · Hardening GitHub Actions
OIDC, environments and runners
A cloud access key stored as a repo secret works from any branch, any workflow and any laptop it leaks to, until someone rotates it. OIDC replaces it with a token GitHub signs for one job, which the cloud accepts only if its claims match a trust policy. We print the real claims of a job's token, put a `prod` environment with a required reviewer and a branch policy in front of it, and show the trust condition that matters. Then we close the self-hosted runner door on the org, and look at what the OIDC subject template and runner groups cost on Free.
Learning Objectives
- Request a GitHub OIDC token in a job and read its claims without exposing the token
- Write a cloud trust condition on `sub` that names one repo and one environment, and explain why wildcards are dangerous
- Protect a deployment with an environment: required reviewers, a deployment branch policy and environment secrets
- Keep self-hosted runners off public repos and limit who can register them
- Customize the OIDC subject claim at org and repo level, and know what opting in means
This lesson is for enrolled learners
Log in, then enroll to read the full lesson, run its lab and take the quiz.
