- Issues
- ISSUE-404
Forbidden include version
Control:CTRL-404Pipeline must not use forbidden ref in includes
📋 What is this?
A CI/CD template in your pipeline is included using a version that is forbidden by your configuration.
⚠️ Impact
Using forbidden tags can result in insecure templates running in your CI/CD pipelines or unexpected breaking changes. For instance, if you include a template using the main version (default branch of the source repository), it might pull a compromised, untested, or breaking template.
🔧 How to fix
Update the template include version to a version allowed by your Policy controls.
# .gitlab-ci.yml: ❌ Uses forbidden version referencesinclude: - component: gitlab.com/components/sast/sast@latest
- project: my-org/ci-templates ref: main file: /templates/security.yml
- component: gitlab.com/my-org/custom-scanner/scan@HEAD# .gitlab-ci.yml: ✅ Uses specific version tagsinclude: - component: gitlab.com/components/sast/sast@1.5.2
- project: my-org/ci-templates ref: v2.1.0 file: /templates/security.yml
- component: gitlab.com/my-org/custom-scanner/scan@3.0.1💡 Tips
- Default forbidden versions:
latest,~latest,main,master,HEAD. - Set
defaultBranchIsForbiddenVersion: trueto also forbid using the project's default branch name.
⚙️ Configure this control
On the Plumber Platform: open the Policies page and set control CTRL-404 on the policy that governs the project.
With the CLI alone: set it in your configuration file. Every field and default is in the controls configuration reference, CTRL-404.