Secure CI/CD with GitLab
For people who know Git and Docker basics. Run GitLab CE 19.5 and a Runner in a lab VM, build pipelines with rules, artifacts and reusable templates, then treat the pipeline as something an attacker wants: protected refs, isolated runners, masked and hidden variables, short-lived secrets from OpenBao, SAST, secret detection, dependency, image and DAST scans, signed releases and controlled deployments. Seventeen lessons, every lab command run on GitLab 19.5.3 with the Free tier features, plus a final exam.
01Your first GitLab pipelineStages, jobs and a runner, from a green pipeline to a red one and back.15 min02Runners, executors and tagsHow a job finds a runner, why a job waits forever, and what concurrency changes.13 min03Rules, needs and merge request pipelinesWhich pipelines run, which jobs join them, and in what order.15 min04Artifacts, reports and cacheWhat a job hands on, what GitLab keeps, and what only speeds things up.13 min05Includes, templates and componentsShare pipeline code across projects, and pin it so nobody else changes your pipeline.14 min
01Threat-model your pipelineWhat a branch push, a fork and one button can reach.14 min02Protected branches, tags and variablesWho can change main, who can cut a release, and which pipelines get the secrets.13 min03Runner isolationProtected runners, the Docker socket problem, and allowed images.14 min04CI/CD variables, masking and hidden valuesVariable types, what masking hides, and what it misses.13 min05Job identity with ID tokens and OpenBaoShort-lived secrets for protected branches only, and the job token allowlist.15 min
01SAST with the GitLab templateFind bugs in your own code, and make the findings fail the pipeline.13 min02Secret detectionCatch a committed token, and why deleting it is not enough.12 min03Dependency scanning with TrivyThe vulnerabilities you inherit from your libraries.12 min04Container image scanningAn old base image, a current one, and a gate on criticals.12 min05DAST with ZAPTest the running app as a job service, then fix what it finds.13 min
Progress is saved in this browser only — no account required.
Quick reference
GitLab CI/CD cheat sheetCheat sheetCI/CD interview questionsInterview guideDevSecOps & supply-chain security interview questionsInterview guide
Final exam
Test yourself on everything
34 questions drawn from all 4 sections — every answer explained as you pick.