Build a Secure GitLab CI Delivery Pipeline
8 steps · about 2 h 42 min · Intermediate
- Define an explicit pipeline graph (doc, GitLab Docs, 24 min)
Stages, needs, rules and includes determine what runs and which untrusted inputs can reach it.
- Map pipeline threat boundaries (doc, GitLab Docs, 20 min)
Merge requests, forks, variables and included configuration create distinct trust levels.
- Constrain runner scope and tags (doc, GitLab Docs, 20 min)
Runner ownership and job selection decide where privileged code can execute.
- Keep secrets out of ordinary variables (doc, GitLab Docs, 18 min)
External secret providers and short-lived identity reduce long-lived credentials exposed to jobs.
- Limit job-token reach (doc, GitLab Docs, 18 min)
Job tokens should access only required projects and APIs for the duration of the job.
- Protect production deployment authority (doc, GitLab Docs, 18 min)
Protected environments restrict who can trigger a sensitive deployment independently of repository write access.
- Set artifact contents and retention deliberately (doc, GitLab Docs, 16 min)
Artifacts can carry build outputs or secrets across stages and must not persist by accident.
- Exercise an approved production deployment (tutorial, GitLab Docs, 28 min)
A final run should show immutable inputs, an independent approval, deployment evidence and a usable rollback reference.