CtrlK
BlogDocsLog inGet started
Tessl Logo

nitinjain999/platform-skills

Production-grade platform engineering handbook — Kubernetes, Terraform, Flux CD, GitHub Actions, AWS, and more.

67

Quality

84%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

README.mdexamples/github-actions/composite-actions/security-scan/

security-scan

Scan a container image or filesystem with Trivy. Posts annotations for CRITICAL and HIGH findings, writes a job summary, and optionally fails the workflow when vulnerabilities are found.

Status: Stable

Quick start

- uses: your-org/actions/security-scan@v1
  with:
    scan_target: ghcr.io/org/my-service:${{ github.sha }}

Inputs

InputTypeRequiredSecretDefaultDescription
scan_targetstringYesNoImage URI or path to scan
scan_typechoiceNoNoimageimage / fs / repo
severitystringNoNoHIGH,CRITICALSeverity levels to report
fail_on_findingsbooleanNoNotrueFail when findings found
ignore_unfixedbooleanNoNofalseSkip findings with no fix
trivy_versionstringNoNo0.58.0Trivy version to install
output_formatchoiceNoNotabletable / json / sarif
registry_usernamestringNoNo''Registry username (private images)
registry_passwordstringNoYes''Registry password — pass from secrets

Outputs

OutputDescription
vulnerability_countTotal findings at or above severity threshold
scan_resultpass or fail
sarif_pathPath to SARIF file (when output_format: sarif)

Variables and secrets

Only registry_password is a secret and only needed for private registries:

# Public image or GHCR via GITHUB_TOKEN — no credentials needed
- uses: your-org/actions/security-scan@v1
  with:
    scan_target: ghcr.io/org/my-service:latest

# Private registry
- uses: your-org/actions/security-scan@v1
  with:
    scan_target: registry.example.com/org/service:latest
    registry_username: robot-scanner
    registry_password: ${{ secrets.REGISTRY_PASSWORD }}   # SECRET

Permissions

permissions:
  contents: read
  security-events: write   # upload SARIF to GitHub Code Scanning (when output_format: sarif)

Idempotency

Idempotent — scanning the same image twice produces the same findings. Safe to re-run.


Full example — scan after build, gate before deploy

name: Build, scan, deploy

on:
  push:
    branches: [main]

permissions:
  contents: read
  packages: write
  id-token: write
  security-events: write

jobs:
  build:
    runs-on: ubuntu-latest
    outputs:
      image_uri: ${{ steps.build.outputs.image_uri }}
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2
      - id: build
        uses: your-org/actions/docker-build-push@v1
        with:
          image_name: my-service

  scan:
    runs-on: ubuntu-latest
    needs: build
    steps:
      - uses: your-org/actions/security-scan@v1
        with:
          scan_target: ${{ needs.build.outputs.image_uri }}
          severity: HIGH,CRITICAL
          fail_on_findings: true

  deploy:
    runs-on: ubuntu-latest
    needs: [build, scan]   # only runs if scan passes
    steps:
      - uses: your-org/actions/k8s-deploy@v1
        with:
          kubeconfig: ${{ secrets.KUBECONFIG }}
          namespace: production
          manifest_path: deploy/

Changelog

See CHANGELOG.md

examples

BEFORE_AFTER.md

CHANGELOG.md

CODE_OF_CONDUCT.md

COMMANDS.md

CONTRIBUTING.md

EDITOR_INTEGRATIONS.md

GETTING_STARTED.md

HOW_IT_WORKS.md

install.sh

INSTALLATION.md

LAUNCH.md

PROMPTS.md

QUICKSTART.md

README.md

renovate.json

SECURITY.md

SKILL.md

tessl.json

tile.json