·
Last changedVersion:
This version passed the hardening gate. Hardening applied 11 targeted changes and preserved all other text. Classified findings before hardening: 1. Classified findings closed: 1. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 19. Review findings remaining: 2.
1
None
Expand | File | Group | Subtype | Severity | Status |
|---|---|---|---|---|---|
SKILL.md | Excessive Agency & Rogue Autonomy | — | Medium | Closed |
1 finding
Comprehensive GitLab CI/CD pipeline patterns for automated testing, building, and deployment.
Create efficient GitLab CI pipelines with proper stage organization, caching, and deployment strategies.
The deploy job needs cluster credentials; configure them as shown in the Multi-Environment Deployment template, with scoped, protected variables. Validate manifests with a server side dry run and policy checks before applying, require code owner review for changes to the manifest directory and to access control rules, and use service accounts limited to one namespace that cannot create role bindings. Where possible, install dependencies with lifecycle scripts turned off, and limit protected variables to deploy jobs.
Pass the registry password on standard input rather than as a command argument, and log out of the registry when the job ends. Docker in Docker needs privileged runners; prefer rootless image builders, or run this job only on dedicated, short lived, isolated runners selected by tags and used only for protected branches. Build the image once and tag the scanned commit image as latest rather than rebuilding it, push latest only from main after the scan passes, and deploy by commit SHA.
Set KUBE_CA_CERT_FILE as a GitLab file variable containing the cluster CA certificate,
and provide KUBE_TOKEN through a protected, masked CI variable. The file variable
contains a path that kubectl uses to verify the API server certificate. Give
KUBE_TOKEN a separate environment scoped value for staging and for production, each bound to a service account limited to its own namespace. Make the production value available only to the protected production environment on main, with required approvers, so develop receives only the staging value. Define the cluster server URL and KUBE_CA_CERT_FILE as protected, environment scoped variables too, and limit pipeline variable overrides to maintainers or turn them off.
Review the saved plan output before triggering apply, and run apply through a protected environment with required approvers. Store backend and provider credentials as protected variables, and keep write capable credentials for the apply step. Plan files can hold secret values in clear text, so treat them as secrets, restrict who can download job artifacts, and mark sensitive Terraform variables as sensitive. The Terraform image entrypoint must be overridden to empty so script steps run.
Run the scan after the image build, give it registry credentials from the existing registry user and password variables, and make deploy jobs wait on it. Record documented exceptions in an ignore file so the gate stays blocking.
Keep separate caches for protected branches, key dependency caches on the lockfile, and pass build outputs as artifacts rather than cache.
Keep the generator from templating untrusted values such as branch names, merge request titles or external data into the YAML, lint the output before triggering it, and restrict child pipelines that use protected variables to protected branches.
github-actions-templates - For GitHub Actionsdeployment-pipeline-design - For architecturesecrets-management - For secrets handlingGet started with chainctlchainctl skill install public/wshobson/gitlab-ci-patterns:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/wshobson/plugins/cicd-automation/skills/gitlab-ci-patterns:latest
MIT
HARDENING.md
LICENSE
SKILL.md