GitLab CI/CD checklist¶
Copy this list into a pull request, design review or project kickoff and tick what applies. Rules are grouped by level and sorted by score (criteria). Each links to the file that explains it and cites its sources. Automatable names tools that can check the rule in CI (see the file's "How to enforce" section).
Also apply the general checklist.
This file is generated by python3 scripts/rank.py fix from the guidelines. Don't edit it by hand.
Strongly recommended (9–10)¶
-
GITLAB-1(9) Pin everyincludeand CI/CD component to a commit SHA or to a protected tag, pin job images by digest, and let a bot such as Renovate propose updates. (specific/gitlab-ci) Automatable: Plumber. -
GITLAB-2(9) Keep secrets in an external secrets manager. If a secret must be a CI/CD variable, make it masked and hidden, and protected so that only pipelines for protected branches and tags receive it. (specific/gitlab-ci) Automatable: Plumber.
Recommended (6–8)¶
-
GITLAB-3(8) Authenticate to cloud providers and secret managers with ID tokens (id_tokens) instead of stored credentials, and restrict the trust policy to specific projects and protected branches or tags. (specific/gitlab-ci) -
GITLAB-4(8) Run a pipeline in the parent project for a merge request from a fork only after reviewing its changes, including changes to.gitlab-ci.yml. (specific/gitlab-ci) -
GITLAB-5(8) Don't use the shell executor or privileged Docker containers on runners that run jobs from several projects or untrusted users. Run privileged jobs only on isolated, ephemeral machines, and let runners that hold secrets or run privileged jobs take jobs from protected branches only. (specific/gitlab-ci) -
GITLAB-6(7) Keep the CI/CD job token allowlist enabled, and add only the groups and projects that need cross-project access. (specific/gitlab-ci) Automatable: GitLab CI/CD settings. -
GITLAB-7(7) Pass parameters to pipelines as typed CI/CD inputs, and set the minimum role to use pipeline variables tono_one_allowedor Maintainer. (specific/gitlab-ci) Automatable: GitLab CI/CD settings, poutine. -
GITLAB-11(7) Userulesinstead of the deprecatedonlyandexcept, and don't mix them in one pipeline. Addworkflow:rulesthat choose between branch and merge request pipelines, so that a push to a branch with an open merge request doesn't start two pipelines. (specific/gitlab-ci) Automatable: Checkov GitLab CI checks, CI Lint. -
GITLAB-15(7) Deploy to production only through a protected environment: limit who can deploy, require deployment approvals, and scope production variables to that environment. (specific/gitlab-ci) -
GITLAB-16(7) Give each deployment job aresource_group, so that only one deployment to an environment runs at a time, and turn on "Prevent outdated deployment jobs". (specific/gitlab-ci) Automatable: GitLab CI/CD settings. -
GITLAB-8(6) Never commitCI_DEBUG_TRACEto CI configuration, and turn on debug logging only temporarily, while only team members can view job logs. (specific/gitlab-ci) Automatable: Plumber, poutine. -
GITLAB-9(6) Keep separate caches for protected and unprotected branches, which is the default, and don't setcache:unprotect. Pass build outputs between jobs as artifacts, and use the cache only for dependencies such as downloaded packages. (specific/gitlab-ci) Automatable: GitLab CI/CD settings. -
GITLAB-10(6) Require Code Owner approval for changes to.gitlab-ci.ymland other CI configuration on protected branches. (specific/gitlab-ci) -
GITLAB-12(6) Run merge request pipelines, and enable merged results pipelines so that each merge request is tested combined with the latest target branch. Add merge trains when many merge requests are ready to merge at the same time. (specific/gitlab-ci) -
GITLAB-13(6) Declare job dependencies withneeds, so that each job starts as soon as the jobs it depends on finish, and give jobs that depend on nothing, such as linters,needs: []. (specific/gitlab-ci) -
GITLAB-14(6) Share CI configuration as versioned CI/CD components with inputs instead of copying YAML between projects. (specific/gitlab-ci)