SKY-D301 · CI/CD pipelines
Container registry password written in the workflow
A job that runs inside a private container image, or starts a private service container, gives GitHub a credentials: block with a username and password for the registry. SKY-D301 reports a password written as plain text there instead of read from secrets.
- Languages
- GitHub Actions workflows
- Quality gate
- counted toward the gate limits (full and diff scans)
- Finding type
- review
- Catalog name
- GitHub Actions hardcoded container credential
Why it matters
Everyone who can read the repository, its forks or its Git history can copy the password and pull, or with a write token push, images in your registry. A pushed image then runs in every job and deployment that uses that tag.
What Skylos flags
name: Integration testson: push: branches: [main]permissions: contents: readjobs: integration: runs-on: ubuntu-latest container: image: acme/ci-runner:2024.10 credentials: username: acme-ci password: dckr_pat_Handbook0nlyDemoValue12345 steps: - run: make integrationWhat Skylos leaves alone
name: Integration testson: push: branches: [main]permissions: contents: readjobs: integration: runs-on: ubuntu-latest container: image: acme/ci-runner:2024.10 credentials: username: acme-ci password: ${{ secrets.DOCKERHUB_TOKEN }} services: postgres: image: postgres:16 env: POSTGRES_PASSWORD: postgres steps: - run: make integrationWhy Skylos leaves it alone
The registry password comes from a secret. POSTGRES_PASSWORD is a password too, but it only sets up a throwaway test database inside the job, and the rule reads nothing but the password of a credentials: block.
How Skylos decides
- Reads workflow files under
.github/workflows, not composite actions. - For each job, looks at
container.credentialsand atservices.<name>.credentials. - Reports the
passwordwhen it is a text value that does not contain${{. Any expression counts as safe (secrets.*,vars.*,env.*); a number, or a password left out, is not reported. - One HIGH finding per job container or service, on the first line of the file that contains the password text.
How to fix it
Revoke the exposed token in the registry first, because it stays in Git history. Store a new one as a repository or environment secret and read it with ${{ secrets.NAME }}.
name: Integration testson: push: branches: [main]permissions: contents: readjobs: integration: runs-on: ubuntu-latest container: image: acme/ci-runner:2024.10 credentials: username: acme-ciRemoved: password: dckr_pat_Handbook0nlyDemoValue12345Added: password: ${{ secrets.DOCKERHUB_TOKEN }} steps: - run: make integrationWhen it can be wrong
- A placeholder such as
password: changemein a template workflow is reported like a real one. - The line is the first one in the file containing the password text, so a short password that also appears earlier (for example equal to the username) is reported on that earlier line.
- The flagged example also gets SKY-D296 for its image tagged
2024.10rather than pinned by digest.
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-D301]on the reported line or on the line directly above it, one rule per marker. Rotating the password is the better answer.YAML # skylos: ignore[SKY-D301] read-only token for a public mirrorpassword: public-mirror-read[tool.skylos] ignore = ["SKY-D301"]turns the rule off for the whole project.A baseline works, but it records the absolute file path and the line, so it stops matching when the checkout moves or lines above shift.