Skip to content

claudex HARDEN W3: pnpm audit, Semgrep, ZAP baseline (issue #56) - #65

Open
yogex wants to merge 10 commits into
masterfrom
claudex-harden-w3
Open

yogex wants to merge 10 commits into
masterfrom
claudex-harden-w3

Conversation

@yogex

@yogex yogex commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Issue #56, W3: scanners. Stacked on #60 (W2), which is stacked on #59. Merge those first. This PR then retargets to master.

What changes

  • project/claudex.json gets two new checks, which the engine's local gate runs:
    • audit: pnpm audit --prod --audit-level=high
    • semgrep: semgrep scan --config p/typescript --config p/nextjs --severity ERROR --error
  • CI runs audit and semgrep as their own jobs, and the app checks job skips them.
    • Why: the audit is red until Part C upgrades sharp and happy-dom (V9). In its own job it doesn't turn every other check red.
    • How: checks.sh gets CLAUDEX_ONLY and CLAUDEX_SKIP, with 5 self-test cases (61 pass; the old checks.sh fails 3).
  • .github/workflows/claudex-zap.yml adds the ZAP baseline scan against a production build (pnpm build && pnpm start).
    • It runs only on PRs labelled harden or on claudex-harden-* branches.
    • It only reports for now: alerts go to the job summary and the zap-report artifact, with the report's sha256. Part C's V25 turns it into a gate.

Expected CI result

Things the owner should know

  • Semgrep's p/nextjs pack has 0 rules today. https://semgrep.dev/c/p/nextjs returns rules: []. It stays in the config, so it picks up rules if Semgrep adds any. Today, all coverage comes from p/typescript.
  • dangerouslySetInnerHTML is WARNING level in p/typescript, so the ERROR-level gate doesn't fail on it. Issue claudex: HARDEN pipeline: tests first, access matrix, scanners, red team, evidence-only verdict #56 gives it only as an example for V10. V10 uses an ERROR rule instead: react-insecure-request, a fetch to a plain http:// URL.
  • The engine's local gate now needs the semgrep binary. The lab environment's setup script doesn't install it yet.

Generated by Claude Code

Reads the Payload collections at test time and checks every collection x
operation x caller x channel (REST, GraphQL), judged from database state.
Expected outcomes in expected.json (draft, pending owner approval); a missing
entry fails. Adds the acceptance check and prints matrix totals in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoipS4sWRj5GT8zzaEGZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoipS4sWRj5GT8zzaEGZ
…g only

A broken app (V6 without a migration) stopped the matrix's setup, so the
'has an entry' tests never ran. They now need no database.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoipS4sWRj5GT8zzaEGZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoipS4sWRj5GT8zzaEGZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoipS4sWRj5GT8zzaEGZ
- project/claudex.json: audit (pnpm audit --prod --audit-level=high) and
  semgrep (p/typescript + p/nextjs, ERROR) checks.
- checks.sh: CLAUDEX_ONLY / CLAUDEX_SKIP so CI gives audit and semgrep their
  own jobs; the known-red audit (V9) no longer hides the other checks.
- claudex-zap.yml: ZAP baseline against a production build, on HARDEN PRs only,
  report-only until V25.
- selftest: 5 cases for ONLY/SKIP (61 pass; old checks.sh fails 3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoipS4sWRj5GT8zzaEGZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoipS4sWRj5GT8zzaEGZ
The V1, V2, V5-V11 log files cited in EVIDENCE.md were never tracked.
Their sha256 values match the recorded ones; gitleaks finds nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoipS4sWRj5GT8zzaEGZ

yogex commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

audit (pnpm audit --prod, high) is red on purpose. It is issue #56's V9: the new gate must fail on master's current dependencies, which have sharp GHSA-wq5f-xc86-pv6w and happy-dom GHSA-834v-8h66-3h79 and GHSA-c8p4-j97h-3vg8. #56 says not to upgrade them in this part; Part C does that through the engine. Every other check on 99bc54c passes: app checks, semgrep, harness, harden-guard, zap-baseline.


Generated by Claude Code

No conflicts: master already holds #59's CONTRACTS.md resolution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efois1hjx9JeuGhxWixrm
@yogex
yogex changed the base branch from claudex-harden-w2 to master December 3, 2026 22:03
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.

2 participants