SKY-D315 · CI/CD pipelines
GitLab CI unpinned external include
include: pulls jobs and scripts from other files into your pipeline. SKY-D315 reports includes from outside the repository that can change without a commit to it: another project's file at a branch or tag instead of a commit SHA, and a remote URL without an integrity checksum.
- Languages
- GitLab CI
- Quality gate
- counted toward the gate limits (full and diff scans)
- Finding type
- review
Why it matters
The included file becomes part of your pipeline and runs with your jobs' variables and tokens. Anyone who can push to the template project's main branch, or who controls the remote server, can change what every pipeline that includes it does, including your release job.
What Skylos flags
include: - project: platform/ci-templates ref: main file: /templates/python-test.yml - local: /ci/lint.yml stages: [lint, test] unit-tests: extends: .python-test script: - pytestWhat Skylos leaves alone
include: - project: platform/ci-templates ref: 4f1d2c9b7a6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c file: /templates/python-test.yml - remote: https://ci.example.com/templates/sast.yml integrity: sha256-L6yQx2PbQk6n2Hq9Zr1J3vT0wYd8sF5mBc7aUe4iKoE= - local: /ci/lint.yml - template: Jobs/Secret-Detection.gitlab-ci.yml stages: [lint, test] unit-tests: extends: .python-test script: - pytestWhy Skylos leaves it alone
The project include names a full 40-character commit SHA, and the remote include carries an integrity hash, so neither can change silently. local: files live in this repository and template: files ship with GitLab itself; the rule does not check either.
How Skylos decides
- Runs with
--danger(and-a). Reads every file named exactly.gitlab-ci.ymlin the scanned folder, skipping.git,node_modules,.venv,venv,build,distand cache folders. A subfolder scan of a Git repository also reads the repository's top-level.gitlab-ci.yml. The included files themselves are not read. - Skips a file that PyYAML's safe loader cannot read, without a warning. That includes every file that uses GitLab's
!referencetag. - Walks the top-level
include:entries, flattening nested lists. - A string entry that starts with
http://orhttps://is reported: the short form cannot carry a checksum. - An entry with
project:is reported unless itsref:is a full 40-character hexadecimal commit SHA. A missingref, a branch and a tag such asv1.4.0are all reported. - An entry with
remote:is reported unless it has a non-emptyintegrity:value. Skylos does not check the hash itself. local:,template:andcomponent:entries are never reported. Every finding is HIGH, on the first line of the file that contains the project name or URL.
How to fix it
Point ref: at a commit SHA of the template project, and give every remote include an integrity: hash (GitLab's format is sha256- and the base64 SHA-256 of the file). Update the SHA on purpose when you want the template's changes.
include: - project: platform/ci-templatesRemoved: ref: mainAdded: ref: 4f1d2c9b7a6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c # v3.2.0 file: /templates/python-test.yml - local: /ci/lint.yml stages: [lint, test] unit-tests: extends: .python-test script: - pytestWhen it can be wrong
- A tag or a protected branch is reported, even in a project where only maintainers can push. Skylos accepts only a commit SHA.
- Two includes of the same project both point at the first line that names it.
- CI/CD catalog components (
component: …@1.0) are not checked, even when their version is a moving tag such as~latest.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Put
# skylos: ignore[SKY-D315]and a reason on the reported line, or on the line directly above it. Skylos looks for that exact text, so write one rule per marker, with the ID in upper case.YAML include: # skylos: ignore[SKY-D315] owned by our team, protected branch - project: platform/ci-templates ref: mainA baseline hides the findings that exist today. Each entry records the rule, the absolute file path and the line, so it stops matching when the line moves or the checkout is at another path.
[tool.skylos] ignore = ["SKY-D315"]turns the rule off for the whole project.