Skip to content

Add Scorecard, Trivy misconfig scan, and actionlint#11

Merged
wnstfy merged 2 commits into
mainfrom
harden/security-tooling
May 21, 2026
Merged

Add Scorecard, Trivy misconfig scan, and actionlint#11
wnstfy merged 2 commits into
mainfrom
harden/security-tooling

Conversation

@wnstfy

@wnstfy wnstfy commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Three complementary CI security tools, layered on top of the existing Renovate + Trivy image scan + CodeQL stack.

Workflow What it catches Trigger
pr-misconfig-scan.yml Compose/Dockerfile/k8s misconfigurations — missing cap_drop, privileged containers, host network mode, mounted docker sockets, etc. (HIGH + CRITICAL) Every PR
scorecard.yml OSSF Scorecard — branch protection, pinned actions, dangerous workflow patterns, SAST coverage, ~20 criteria total Weekly + branch-protection-rule changes
actionlint.yml Workflow YAML linting — shell injection, dead code, unused secrets, deprecated patterns PR touches .github/workflows/**

Why each one

  • Misconfig scan complements the image CVE scan: image-CVE checks what's inside the image; misconfig checks how the image is run. Different concerns, same tool — already-installed Trivy supports both.
  • Scorecard is the standard OSS security posture tool: catches regressions in branch protection, action pinning, etc., and posts a public badge.
  • actionlint would have caught the ${{ }}-in-bash anti-pattern I fixed manually in Harden CI: SHA-pin actions, isolate PR scripts, pin Trivy installer #10. Cheap insurance.

Supply-chain hardening (consistent with previous PRs)

Local test

  • actionlint v1.7.12 ran clean against all 5 workflow files locally before push

Operating notes after merge

  • pr-misconfig-scan is informational (uses --exit-code 0). When you've triaged current findings — either fixed them or added entries to .trivyignore — flip the gate by removing --exit-code 0 and adding the misconfig check to branch protection.
  • scorecard will run once on this merge to main and produce a baseline. Future score regressions will be visible in code-scanning.
  • actionlint will run as a non-required check unless you add it to branch protection's required list.

Test plan

  • actionlint self-validates this PR (lints its own workflow + the two siblings)
  • scan (PR CVE gate) passes trivially — no compose changes
  • On merge, scorecard.yml fires once via the push: main trigger and produces a baseline SARIF

Three complementary CI security tools, all SHA-pinned and budgeted to
not duplicate what we already run:

- pr-misconfig-scan.yml: trivy config on every PR. Catches compose-spec
  misconfigurations (missing cap_drop, privileged containers, host
  network mode, mounted docker sockets, etc.) that the image-CVE scan
  can't see — Trivy's image scan looks at what's INSIDE the image;
  misconfig looks at HOW the image is run. Posts a sticky PR comment.
  Informational only; flip --exit-code to gate later once known
  intentional findings are recorded in .trivyignore.

- scorecard.yml: OpenSSF Scorecard weekly + on branch-protection-rule
  changes. Audits the repo against ~20 OSS security criteria and
  uploads SARIF to GitHub code-scanning. Catches regressions in
  branch protection, action pinning, dangerous workflow patterns,
  etc.

- actionlint.yml: lints workflow YAML on PRs that touch
  .github/workflows/**. Catches shell injection, dead code, unused
  secrets, deprecated patterns, syntax errors. The binary download is
  pinned to v1.7.12 and verified with the upstream-published SHA256.

All new actions are SHA-pinned with the version in a trailing comment,
matching the convention established in the previous hardening PR.
helpers:pinGitHubActionDigests in renovate.json will keep them current.
@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Trivy misconfiguration findings (HIGH + CRITICAL)

Findings below. Fix the issue or add an ignore entry to .trivyignore with a justification.


Report Summary

┌────────┬──────┬───────────────────┐
│ Target │ Type │ Misconfigurations │
├────────┼──────┼───────────────────┤
│   -    │  -   │         -         │
└────────┴──────┴───────────────────┘
Legend:
- '-': Not scanned
- '0': Clean (no security findings detected)

actionlint (newly added in this branch) caught two SC2155 warnings in
the scan() helper: combining `local` with command-substitution masks
the assigned command's return value. If slug() failed, the failure
would be invisible.

Split into separate declarations so any non-zero exit from slug() (or
future helpers) propagates as the function's exit code.
@wnstfy
wnstfy merged commit 42c38ab into main May 21, 2026
5 checks passed
@wnstfy
wnstfy deleted the harden/security-tooling branch May 21, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant