agentleFS
autheggauthegg/agent-skills/skills/ci-security-pipeline/SKILL.md

ci-security-pipeline

Skill2 starsChanged 9 months agoMITView on GitHub

Generate and enforce security scanning stages in CI/CD pipelines. Use when creating or editing GitHub Actions workflows, GitLab CI, CircleCI, Jenkins, or any CI pipeline that builds Docker images or deploys containers. Covers Dockerfile linting with Hadolint, CVE scanning with Trivy, secret detection, SBOM generation, image signing, and deployment gates. Activates on keywords like "CI pipeline", "GitHub Actions", "security scanning", "Trivy", "Hadolint", "SBOM", or "deploy gate".

  • Pipes a download into a shell
  • Installs packages

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the user mentions "CI security", "pipeline scanning", "deploy gate", or any CI system name

    line 17
  2. Distinctive:

    Every container CI pipeline MUST include these stages in order:

    line 21
  3. Distinctive:

    Use BuildKit. Never cache from untrusted sources.

    line 44
  4. Distinctive:

    Check for misconfigurations and leaked secrets in the repo.

    line 77
  5. Distinctive:

    All checks must pass before deployment is allowed.

    line 119
  6. Distinctive:

    Always set in production CI:

    line 139
  7. Distinctive:

    If not using pre-built actions:

    line 149

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CI Security Pipeline

Generate CI/CD pipeline configurations with built-in security scanning stages. Supports GitHub Actions, GitLab CI, and generic pipeline patterns.

When to Use

  • Creating new CI/CD pipelines for Docker-based projects
  • Adding security scanning to existing pipelines
  • Setting up deployment gates that block insecure images
  • Generating SBOM and image signing workflows
  • When the user mentions "CI security", "pipeline scanning", "deploy gate", or any CI system name

Required Pipeline Stages

Every container CI pipeline MUST include these stages in order:

Stage 1: Dockerfile Lint

Catch misconfigurations before building. Use Hadolint.

# GitHub Actions
- name: Lint Dockerfile
  uses: hadolint/hadolint-action@v3.1.0
  with:
    dockerfile: Dockerfile
    failure-threshold: warning
# Generic
hadolint Dockerfile
hadolint --failure-threshold warning Dockerfile

Stage 2: Build Image

Use BuildKit. Never cache from untrusted sources.

- name: Build
  run: |
    DOCKER_BUILDKIT=1 docker build \
      --no-cache \
      --tag $IMAGE:$SHA \
      .

Stage 3: Vulnerability Scan

Scan the built image for CVEs. Fail on CRITICAL and HIGH.

# GitHub Actions — Trivy
- name: Scan for vulnerabilities
  uses: aquasecurity/trivy-action@master
  with:
    image-ref: ${{ env.IMAGE }}
    exit-code: '1'
    severity: 'CRITICAL,HIGH'
    ignore-unfixed: true
# Generic
trivy image --severity HIGH,CRITICAL --exit-code 1 $IMAGE

Stage 4: Config and Secret Scan

Check for misconfigurations and leaked secrets in the repo.

- name: Config scan
  uses: aquasecurity/trivy-action@master
  with:
    scan-type: 'config'
    scan-ref: '.'
    exit-code: '1'
    severity: 'CRITICAL,HIGH'

- name: Secret scan
  uses: aquasecurity/trivy-action@master
  with:
    scan-type: 'fs'
    scan-ref: '.'
    scanners: 'secret'
    exit-code: '1'

Stage 5: SBOM Generation

Generate and archive a Software Bill of Materials.

- name: Generate SBOM
  uses: aquasecurity/trivy-action@master
  with:
    image-ref: ${{ env.IMAGE }}
    format: 'cyclonedx'
    output: 'sbom.json'

- name: Archive SBOM
  uses: actions/upload-artifact@v4
  with:
    name: sbom
    path: sbom.json
    retention-days: 90

Stage 6: Security Gate

All checks must pass before deployment is allowed.

security-gate:
  needs: [lint, scan, sbom]
  runs-on: ubuntu-latest
  steps:
    - run: echo "All security checks passed. Image approved."

Complete GitHub Actions Template

See references/github-actions-template.md for the full ready-to-use workflow file.

Complete GitLab CI Template

See references/gitlab-ci-template.md for the .gitlab-ci.yml version.

Environment Variables

Always set in production CI:

DOCKER_CONTENT_TRUST=1          # Only pull signed images
DOCKER_BUILDKIT=1               # Enable BuildKit features
TRIVY_SEVERITY=CRITICAL,HIGH    # Scan threshold

Tool Installation

If not using pre-built actions:

# Trivy
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin

# Hadolint
wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64
chmod +x /usr/local/bin/hadolint

# Syft (SBOM)
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin

# Cosign (Image Signing)
go install github.com/sigstore/cosign/v2/cmd/cosign@latest

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.