@ericrisco/rsc 4.0.5 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/manifest.json +78 -84
- package/package.json +1 -1
- package/scripts/lib/default-skill-floor.js +5 -1
- package/scripts/lib/domains.js +1 -1
- package/scripts/lib/recommend.js +1 -1
- package/scripts/lib/retired-skills.js +4 -0
- package/scripts/skill-migration-brief.md +1 -1
- package/skills/accessibility/evals/README.md +1 -1
- package/skills/accessibility/evals/cases.yaml +1 -1
- package/skills/agent-safety/SKILL.md +2 -2
- package/skills/agent-safety/evals/README.md +1 -1
- package/skills/agent-safety/evals/cases.yaml +1 -1
- package/skills/analyze/evals/README.md +1 -1
- package/skills/analyze/evals/cases.yaml +2 -2
- package/skills/angular/SKILL.md +1 -1
- package/skills/api-connector-builder/SKILL.md +1 -1
- package/skills/api-design/SKILL.md +3 -3
- package/skills/api-design/evals/cases.yaml +1 -1
- package/skills/automation-strategy/SKILL.md +1 -1
- package/skills/automation-strategy/evals/README.md +1 -1
- package/skills/automation-strategy/evals/cases.yaml +2 -2
- package/skills/automation-strategy/references/orchestration-and-antipatterns.md +1 -1
- package/skills/aws-essentials/SKILL.md +3 -3
- package/skills/aws-essentials/evals/cases.yaml +2 -2
- package/skills/backups/SKILL.md +2 -2
- package/skills/backups/evals/cases.yaml +2 -2
- package/skills/bash-scripting/SKILL.md +1 -1
- package/skills/building-agents/SKILL.md +2 -2
- package/skills/building-agents/evals/cases.yaml +2 -2
- package/skills/chrome-extension/SKILL.md +1 -1
- package/skills/cloudflare/SKILL.md +1 -1
- package/skills/code-review/SKILL.md +2 -2
- package/skills/code-review/evals/cases.yaml +2 -2
- package/skills/compliance/SKILL.md +3 -3
- package/skills/compliance/evals/cases.yaml +1 -1
- package/skills/constitution/SKILL.md +2 -2
- package/skills/constitution/evals/README.md +2 -2
- package/skills/constitution/evals/cases.yaml +2 -2
- package/skills/constitution/references/constitution-template.md +1 -1
- package/skills/cpp/SKILL.md +2 -2
- package/skills/cpp/evals/README.md +1 -1
- package/skills/cpp/evals/cases.yaml +2 -2
- package/skills/csharp-dotnet/SKILL.md +3 -3
- package/skills/csharp-dotnet/evals/cases.yaml +1 -1
- package/skills/csharp-dotnet/references/aspnetcore.md +1 -1
- package/skills/data-policy/SKILL.md +2 -2
- package/skills/data-policy/evals/README.md +1 -1
- package/skills/data-policy/evals/cases.yaml +1 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/debug/evals/README.md +1 -1
- package/skills/decision-challenge/SKILL.md +2 -2
- package/skills/decision-challenge/evals/cases.yaml +1 -1
- package/skills/deployment/SKILL.md +2 -2
- package/skills/deployment/evals/README.md +1 -1
- package/skills/deployment/evals/cases.yaml +2 -2
- package/skills/django/SKILL.md +2 -2
- package/skills/django/evals/README.md +1 -1
- package/skills/django/evals/cases.yaml +1 -1
- package/skills/django/references/security.md +1 -1
- package/skills/docker/SKILL.md +3 -3
- package/skills/docker/evals/cases.yaml +1 -1
- package/skills/dynamodb/SKILL.md +2 -2
- package/skills/electron/SKILL.md +1 -1
- package/skills/electron/references/packaging-and-updates.md +1 -1
- package/skills/email-connector/SKILL.md +2 -2
- package/skills/email-deliverability/SKILL.md +1 -1
- package/skills/error-handling/SKILL.md +1 -1
- package/skills/expo/SKILL.md +2 -2
- package/skills/fastapi/SKILL.md +4 -4
- package/skills/fastapi/evals/README.md +2 -2
- package/skills/fastapi/evals/cases.yaml +2 -2
- package/skills/fastapi/references/security.md +2 -2
- package/skills/firebase/SKILL.md +1 -1
- package/skills/flutter/SKILL.md +1 -1
- package/skills/flutter/evals/cases.yaml +2 -2
- package/skills/fly-io/SKILL.md +1 -1
- package/skills/gamedev-multiplayer/SKILL.md +1 -1
- package/skills/gamedev-multiplayer/evals/README.md +1 -1
- package/skills/gamedev-multiplayer/evals/cases.yaml +2 -2
- package/skills/gamedev-shipping/SKILL.md +1 -1
- package/skills/gcp-essentials/SKILL.md +2 -2
- package/skills/gcp-essentials/evals/README.md +1 -1
- package/skills/gcp-essentials/evals/cases.yaml +2 -2
- package/skills/gdpr-privacy/SKILL.md +2 -2
- package/skills/gdpr-privacy/evals/cases.yaml +1 -1
- package/skills/github-actions/SKILL.md +2 -2
- package/skills/go/SKILL.md +4 -4
- package/skills/go/evals/README.md +1 -1
- package/skills/go/evals/cases.yaml +2 -2
- package/skills/google-workspace/SKILL.md +2 -2
- package/skills/hetzner/SKILL.md +1 -1
- package/skills/htmx/SKILL.md +4 -4
- package/skills/htmx/evals/cases.yaml +2 -2
- package/skills/implement/SKILL.md +1 -1
- package/skills/init/SKILL.md +2 -2
- package/skills/init/evals/cases.yaml +2 -2
- package/skills/init/references/discovery.md +1 -1
- package/skills/init/references/recommend-skills.md +5 -5
- package/skills/java/SKILL.md +3 -3
- package/skills/java/evals/README.md +1 -1
- package/skills/java/evals/cases.yaml +2 -2
- package/skills/laravel/SKILL.md +3 -3
- package/skills/laravel/evals/README.md +1 -1
- package/skills/laravel/evals/cases.yaml +1 -1
- package/skills/marketing/evals/README.md +1 -1
- package/skills/marketing/evals/cases.yaml +1 -1
- package/skills/mongodb/SKILL.md +2 -2
- package/skills/mongodb/evals/README.md +1 -1
- package/skills/mongodb/evals/cases.yaml +2 -2
- package/skills/nextjs/SKILL.md +3 -3
- package/skills/nextjs/evals/cases.yaml +2 -2
- package/skills/nextjs/references/security.md +2 -2
- package/skills/notion-connector/SKILL.md +3 -3
- package/skills/notion-connector/evals/README.md +1 -1
- package/skills/notion-connector/evals/cases.yaml +2 -2
- package/skills/php/SKILL.md +4 -4
- package/skills/php/evals/README.md +1 -1
- package/skills/php/evals/cases.yaml +1 -1
- package/skills/plan/evals/README.md +1 -1
- package/skills/postgresdb/SKILL.md +1 -1
- package/skills/postgresdb/evals/README.md +1 -1
- package/skills/postgresdb/evals/cases.yaml +2 -2
- package/skills/presentations/evals/README.md +1 -1
- package/skills/python/SKILL.md +3 -3
- package/skills/python/evals/README.md +1 -1
- package/skills/python/evals/cases.yaml +2 -2
- package/skills/rag/scripts/verify.sh +1 -1
- package/skills/review/SKILL.md +2 -2
- package/skills/review/evals/cases.yaml +3 -3
- package/skills/ruby/SKILL.md +1 -1
- package/skills/rust/SKILL.md +2 -2
- package/skills/rust/evals/README.md +1 -1
- package/skills/rust/evals/cases.yaml +2 -2
- package/skills/security-audit/SKILL.md +186 -0
- package/skills/security-audit/evals/cases.yaml +95 -0
- package/skills/security-audit/references/auditor-safety.md +69 -0
- package/skills/security-audit/references/classes/README.md +225 -0
- package/skills/security-audit/references/classes/ai-and-llm.md +247 -0
- package/skills/security-audit/references/classes/client-side.md +181 -0
- package/skills/security-audit/references/classes/cloud-and-deployment.md +167 -0
- package/skills/security-audit/references/classes/data-isolation.md +161 -0
- package/skills/security-audit/references/classes/desktop-mobile-ipc.md +167 -0
- package/skills/security-audit/references/classes/memory-and-binary.md +230 -0
- package/skills/security-audit/references/classes/protocols-and-messaging.md +151 -0
- package/skills/security-audit/references/classes/resource-exhaustion.md +141 -0
- package/skills/security-audit/references/classes/supply-chain.md +147 -0
- package/skills/security-audit/references/classes/web-and-auth.md +238 -0
- package/skills/security-audit/references/coverage-ledger.md +172 -0
- package/skills/security-audit/references/fixes-by-stack.md +972 -0
- package/skills/security-audit/references/fixing.md +200 -0
- package/skills/security-audit/references/hunting.md +146 -0
- package/skills/security-audit/references/isolated-execution.md +85 -0
- package/skills/security-audit/references/platforms.md +650 -0
- package/skills/security-audit/references/reconnaissance.md +73 -0
- package/skills/security-audit/references/resuming.md +55 -0
- package/skills/security-audit/references/scanners.md +347 -0
- package/skills/{secure-coding → security-audit}/references/secrets-and-supply-chain.md +78 -34
- package/skills/security-audit/references/secrets-discipline.md +173 -0
- package/skills/{secure-coding → security-audit}/references/threat-modeling.md +80 -32
- package/skills/security-audit/references/verification.md +118 -0
- package/skills/security-audit/schema/findings.schema.json +178 -0
- package/skills/security-audit/scripts/render-report.mjs +311 -0
- package/skills/security-audit/scripts/validate-findings.mjs +508 -0
- package/skills/skill-scout/scripts/verify.sh +1 -1
- package/skills/source-grounded-development/evals/cases.yaml +1 -1
- package/skills/specify/evals/README.md +1 -1
- package/skills/spring-boot/SKILL.md +3 -3
- package/skills/spring-boot/evals/README.md +1 -1
- package/skills/spring-boot/evals/cases.yaml +1 -1
- package/skills/spring-boot/references/security.md +1 -1
- package/skills/stripe/SKILL.md +2 -2
- package/skills/suggest/evals/cases.yaml +2 -2
- package/skills/supabase/SKILL.md +1 -1
- package/skills/tauri/SKILL.md +2 -2
- package/skills/testing-go/SKILL.md +1 -1
- package/skills/typescript/SKILL.md +2 -2
- package/skills/verify/SKILL.md +3 -3
- package/skills/verify/evals/README.md +2 -2
- package/skills/verify/evals/cases.yaml +2 -2
- package/skills/vue-nuxt/SKILL.md +2 -2
- package/skills/webhooks/SKILL.md +2 -2
- package/skills/wordpress/SKILL.md +2 -2
- package/skills/wordpress/evals/README.md +1 -1
- package/skills/wordpress/evals/cases.yaml +1 -1
- package/skills/worktrees/evals/README.md +1 -1
- package/targets/clone-bootstrap.mjs +1 -1
- package/targets/commands.js +1 -1
- package/skills/secure-coding/SKILL.md +0 -336
- package/skills/secure-coding/evals/README.md +0 -68
- package/skills/secure-coding/evals/cases.yaml +0 -55
- package/skills/secure-coding/references/authn-authz.md +0 -249
- package/skills/secure-coding/references/owasp-by-stack.md +0 -574
- package/skills/secure-coding/scripts/verify.sh +0 -208
- package/skills/security-scan/SKILL.md +0 -219
- package/skills/security-scan/evals/README.md +0 -14
- package/skills/security-scan/evals/cases.yaml +0 -50
- package/skills/security-scan/references/tools.md +0 -97
- package/skills/security-scan/references/triage.md +0 -92
- package/skills/security-scan/scripts/verify.sh +0 -108
package/skills/tauri/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: tauri
|
|
3
3
|
description: "Use when building a lightweight cross-platform desktop (or v2 mobile) app with Tauri — a Rust core plus the OS-native WebView: Rust commands and IPC, streaming to the frontend, the default-deny capabilities/permissions ACL, bundling and signed auto-updates. NOT a Chromium+Node shell needing Node APIs in a main process (that is electron)."
|
|
4
4
|
tags: [tauri, desktop, rust, cross-platform, ipc, webview]
|
|
5
|
-
recommends: [rust, electron, react,
|
|
5
|
+
recommends: [rust, electron, react, security-audit, github-actions]
|
|
6
6
|
origin: risco
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ so the same Rust core can ship to mobile.
|
|
|
23
23
|
This skill owns the **shell**: commands, IPC, the security ACL, the bundler, the updater.
|
|
24
24
|
It does **not** own the Rust language itself (that is the `rust` skill), the web UI inside
|
|
25
25
|
the window (the `react`/`nextjs` skills), a Chromium+Node shell (`../electron/SKILL.md`), or
|
|
26
|
-
app-code hardening beyond the IPC boundary (`../
|
|
26
|
+
app-code hardening beyond the IPC boundary (`../security-audit/SKILL.md`).
|
|
27
27
|
|
|
28
28
|
## Pick your starting shape
|
|
29
29
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: testing-go
|
|
3
3
|
description: "Use when writing or running Go tests — table-driven cases, named subtests, parallel isolation, fakes instead of mock frameworks, coverage profiles, benchmarks, fuzzing, golden files, and testing concurrent goroutines deterministically. NOT general Go code or modules (that is `go`), NOT pytest fixtures (that is `testing-py`), NOT browser user flows (that is `e2e-testing`)."
|
|
4
4
|
tags: [go, testing, table-driven-tests, benchmarks, coverage, synctest, mocks, fuzzing]
|
|
5
|
-
recommends: [go,
|
|
5
|
+
recommends: [go, security-audit, testing-py, e2e-testing]
|
|
6
6
|
origin: risco
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: typescript
|
|
3
3
|
description: "Use when writing or fixing TypeScript type code (.ts/.tsx/.d.ts), modeling data with generics/unions/branded types, diagnosing narrowing failures, or configuring tsconfig and the build toolchain. NOT runtime code, fs/streams/http (that is `nodejs`); NOT component/route typing (that is `react`/`nextjs`); NOT ORM type-gen (that is `drizzle-orm`)."
|
|
4
4
|
tags: [typescript, types, generics, tsconfig, type-safety]
|
|
5
|
-
recommends: [nodejs,
|
|
5
|
+
recommends: [nodejs, security-audit, drizzle-orm]
|
|
6
6
|
origin: risco
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@ Three layers, three owners. **Language + compiler config lives here** — generi
|
|
|
28
28
|
A `tsconfig` question is here; a "stream backpressure" question is `nodejs`; a "type my
|
|
29
29
|
`useReducer` state" question is `react`. Also delegate: ORM schema-to-type generation ->
|
|
30
30
|
`drizzle-orm` / `prisma-orm`; REST/contract shape design -> `api-design`; test runner and E2E
|
|
31
|
-
setup -> `testing-web` / `e2e-testing`; injection/authz review -> `
|
|
31
|
+
setup -> `testing-web` / `e2e-testing`; injection/authz review -> `security-audit`; Python
|
|
32
32
|
typing -> `python`; Go -> `go`.
|
|
33
33
|
|
|
34
34
|
## Decision rules
|
package/skills/verify/SKILL.md
CHANGED
|
@@ -13,7 +13,7 @@ origin: risco
|
|
|
13
13
|
|
|
14
14
|
The one rule everything else serves: **a claim of done is a claim about evidence. No evidence, no claim.** A green feeling is not green output.
|
|
15
15
|
|
|
16
|
-
This is a process skill. It does not own the lint/type/test tooling — the **stack skills do** (`../fastapi/SKILL.md`, `../go/SKILL.md`, `../nextjs/SKILL.md`, `../flutter/SKILL.md`, each shipping `scripts/verify.sh`; data-layer checks come from `../postgresdb/SKILL.md`, security from `../
|
|
16
|
+
This is a process skill. It does not own the lint/type/test tooling — the **stack skills do** (`../fastapi/SKILL.md`, `../go/SKILL.md`, `../nextjs/SKILL.md`, `../flutter/SKILL.md`, each shipping `scripts/verify.sh`; data-layer checks come from `../postgresdb/SKILL.md`, security from `../security-audit/SKILL.md`). `verify` orchestrates them and judges the whole against the spec.
|
|
17
17
|
|
|
18
18
|
Not this phase: still writing tests or production code → `../implement/SKILL.md` (TDD lives there); a check is failing and you need to know *why* → `../debug/SKILL.md` (`verify` reports the failure and hands off, it does not diagnose); reading the diff adversarially for design/correctness smells a test can't catch → `../review/SKILL.md`, or `../code-review/SKILL.md` when there is no spec/plan chain to key off; nothing to verify *against* → you're earlier in the chain, go to `../specify/SKILL.md` / `../plan/SKILL.md` / `../tasks/SKILL.md` first.
|
|
19
19
|
|
|
@@ -31,7 +31,7 @@ Report in the `orient` voice: pass/fail per gate, then one line of *why* per fai
|
|
|
31
31
|
|
|
32
32
|
| Mode | When | Scope | Output |
|
|
33
33
|
| --- | --- | --- | --- |
|
|
34
|
-
| **Per task** | step e of `implement`'s loop, every tier | the task's diff: **tests** (affected suite), **build** (compile + types), **security** (stack audit; `../
|
|
34
|
+
| **Per task** | step e of `implement`'s loop, every tier | the task's diff: **tests** (affected suite), **build** (compile + types), **security** (stack audit; `../security-audit/SKILL.md` on input/authz/secrets), **traceability** (every new behaviour traces to a spec criterion — untraced behaviour is a finding) | one line per control in the task's progress entry |
|
|
35
35
|
| **Closing** | ASDD stage 5, once, before `review` and `ship` | the whole branch against main: merge main in (or rebase) and run the full gate below on the result | the dated record, with a rollback plan |
|
|
36
36
|
|
|
37
37
|
**Both modes, one rule: a check that was not executed is listed as not run** — never as passed, never
|
|
@@ -84,7 +84,7 @@ If `config.yaml` provides `testing.commands.verify`, run those commands first or
|
|
|
84
84
|
| Next.js / React | `./scripts/verify.sh` (`../nextjs`) | eslint, tsc --noEmit, test, build |
|
|
85
85
|
| Flutter / Dart | `./scripts/verify.sh` (`../flutter`) | `dart format`, `flutter analyze`, `flutter test` |
|
|
86
86
|
| Postgres / data layer | migration + query checks (`../postgresdb`) | schema/migration apply, constraint + query checks |
|
|
87
|
-
| Security-sensitive change | audit per `../
|
|
87
|
+
| Security-sensitive change | audit per `../security-audit` | input/authz/secrets review, dependency vuln scan |
|
|
88
88
|
|
|
89
89
|
Rules for RUN:
|
|
90
90
|
|
|
@@ -16,7 +16,7 @@ pure shell runner.
|
|
|
16
16
|
phrasings like "are we ready for review yet?" and "prove the fix works").
|
|
17
17
|
- `should_not_trigger` — near-misses that must route to a real sibling
|
|
18
18
|
(`route_to`): writing tests (`fastapi`), debugging a flaky test (`go`),
|
|
19
|
-
building the gate script (`nextjs`), security audit (`
|
|
19
|
+
building the gate script (`nextjs`), security audit (`security-audit`),
|
|
20
20
|
migration/constraint checks (`postgresdb`). The recurring trap: anything that
|
|
21
21
|
WRITES or RUNS code, or OWNS the tooling, is a stack skill — `verify` only
|
|
22
22
|
orchestrates and judges.
|
|
@@ -30,7 +30,7 @@ Goal: the skill fires when a "done" claim is imminent and never on a near-miss.
|
|
|
30
30
|
1. Configure an agent with the **full catalog of skill descriptions** available
|
|
31
31
|
for routing (verify + the ASDD phase skills it chains to — implement,
|
|
32
32
|
debug, review, clarify, ship — plus the stack/process skills: fastapi, go,
|
|
33
|
-
nextjs, flutter, postgresdb,
|
|
33
|
+
nextjs, flutter, postgresdb, security-audit, deployment, harness, init) so
|
|
34
34
|
routing competes realistically.
|
|
35
35
|
2. For each `should_trigger` prompt: feed it cold, record whether `verify` is
|
|
36
36
|
the skill the agent loads. Run **3–5 trials** per prompt (fresh context).
|
|
@@ -49,8 +49,8 @@ should_not_trigger:
|
|
|
49
49
|
why: "Building/owning the stack gate script itself is the nextjs skill's job; verify consumes that script, it does not create the stack's tooling."
|
|
50
50
|
|
|
51
51
|
- prompt: "Audit this auth endpoint for injection and broken access control before we trust it."
|
|
52
|
-
route_to: "
|
|
53
|
-
why: "A security audit of code is owned by
|
|
52
|
+
route_to: "security-audit"
|
|
53
|
+
why: "A security audit of code is owned by security-audit; verify may invoke that audit as part of the gate but the hands-on review belongs to the security skill."
|
|
54
54
|
|
|
55
55
|
- prompt: "Check that this migration applies cleanly and the CHECK constraint behaves as expected."
|
|
56
56
|
route_to: "postgresdb"
|
package/skills/vue-nuxt/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: vue-nuxt
|
|
3
3
|
description: "Use when building or reviewing a Vue 3 + Nuxt 4 app — `<script setup>` reactivity, SSR/SSG/hybrid `routeRules`, the `app/`+`server/` layout, SSR-safe fetching (`useFetch`/`useAsyncData`) and state (`useState`/Pinia), Nitro routes, hydration mismatches, Nuxt 3→4 migration. NOT React/RSC (that is nextjs), NOT a static islands site (that is astro)."
|
|
4
4
|
tags: [vue, nuxt, frontend, web, ssr]
|
|
5
|
-
recommends: [design, deployment,
|
|
5
|
+
recommends: [design, deployment, security-audit]
|
|
6
6
|
origin: risco
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ Backend not in Nitro/JS → [`fastapi`](../fastapi/SKILL.md), [`go`](../go/SKILL
|
|
|
22
22
|
[`laravel`](../laravel/SKILL.md). Test *strategy* beyond the Vitest + `@vue/test-utils` +
|
|
23
23
|
`@nuxt/test-utils` setup named here → [`e2e-testing`](../e2e-testing/SKILL.md) /
|
|
24
24
|
[`testing-web`](../testing-web/SKILL.md). Generic security review →
|
|
25
|
-
[`
|
|
25
|
+
[`security-audit`](../security-audit/SKILL.md); SEO/content strategy →
|
|
26
26
|
[`marketing`](../marketing/SKILL.md); component visual language → [`design`](../design/SKILL.md).
|
|
27
27
|
|
|
28
28
|
## First: detect Nuxt vs plain Vue, and the version
|
package/skills/webhooks/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: webhooks
|
|
3
3
|
description: "Use when building the receiving end of a webhook — a provider-agnostic endpoint that proves pushed events are authentic and never processes one twice: raw-body HMAC, ~5-min replay window, idempotency on the event id, fast-ack-then-queue. NOT the Stripe-Signature scheme (that is stripe), NOT outbound clients you call (that is api-connector-builder)."
|
|
4
4
|
tags: [webhooks, inbound-webhooks, hmac-verification, idempotency, signature-verification, queue, connectors]
|
|
5
|
-
recommends: [stripe, email-connector, api-connector-builder, automation-flows, redis,
|
|
5
|
+
recommends: [stripe, email-connector, api-connector-builder, automation-flows, redis, security-audit]
|
|
6
6
|
profiles: []
|
|
7
7
|
origin: risco
|
|
8
8
|
---
|
|
@@ -25,7 +25,7 @@ happens to the event afterward is a different job:
|
|
|
25
25
|
- Multi-step orchestration after the event lands → `automation-flows`.
|
|
26
26
|
- Broker/queue tuning (BullMQ concurrency, DLQ ops) → `redis`.
|
|
27
27
|
- Constant-time compare, secret handling, supply-chain hygiene →
|
|
28
|
-
`../
|
|
28
|
+
`../security-audit/SKILL.md`.
|
|
29
29
|
|
|
30
30
|
## The pipeline
|
|
31
31
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: wordpress
|
|
3
3
|
description: "Use when building or hardening WordPress sites or WooCommerce stores and treating WordPress as the product rather than just writing PHP — block themes with theme.json, plugins with block.json and proper hooks, wp-config security hardening, performance (object cache, asset loading, autoloaded options), and WP-CLI operations. NOT a Laravel app (that is `laravel`)."
|
|
4
4
|
tags: [wordpress, woocommerce, block-themes, wp-cli, php, security-hardening, performance]
|
|
5
|
-
recommends: [php,
|
|
5
|
+
recommends: [php, security-audit, performance, mysql, shopify]
|
|
6
6
|
origin: risco
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -153,7 +153,7 @@ define( 'FORCE_SSL_ADMIN', true );
|
|
|
153
153
|
|
|
154
154
|
Use **Application Passwords** (WP 5.6+) for REST/API machine auth — individually revocable, cannot log into `wp-login.php`, and the right answer when a script or [nextjs](../nextjs/SKILL.md) front end needs to talk to WP. Never reuse the admin password in a script.
|
|
155
155
|
|
|
156
|
-
For the full block — file-permission matrix (dirs 755 / files 644 / wp-config 600), `DISALLOW_FILE_MODS`, nginx/.htaccess security headers, login lockdown, XML-RPC and user-enumeration disabling, version-disclosure removal — see [references/hardening.md](references/hardening.md). Generic OWASP/threat-modeling not tied to the WP attack surface is [
|
|
156
|
+
For the full block — file-permission matrix (dirs 755 / files 644 / wp-config 600), `DISALLOW_FILE_MODS`, nginx/.htaccess security headers, login lockdown, XML-RPC and user-enumeration disabling, version-disclosure removal — see [references/hardening.md](references/hardening.md). Generic OWASP/threat-modeling not tied to the WP attack surface is [security-audit](../security-audit/SKILL.md).
|
|
157
157
|
|
|
158
158
|
## Performance
|
|
159
159
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# Evals: wordpress
|
|
2
2
|
|
|
3
|
-
`cases.yaml` checks routing and capability for the wordpress skill. `should_trigger` lists prompts (including a non-obvious HPOS migration and Spanish/Catalan phrasings) that must select this skill; `should_not_trigger` lists adjacent prompts that must route to a named sibling (php, laravel, shopify,
|
|
3
|
+
`cases.yaml` checks routing and capability for the wordpress skill. `should_trigger` lists prompts (including a non-obvious HPOS migration and Spanish/Catalan phrasings) that must select this skill; `should_not_trigger` lists adjacent prompts that must route to a named sibling (php, laravel, shopify, security-audit, nextjs). The `capability` block is a scaffolding scenario with a `must_include` rubric. There is no automated runner here — evaluate by hand or with your harness: read each `should_trigger`/`should_not_trigger` prompt, confirm the skill description would (or would not) match and that the route_to sibling is the better home, then run the capability scenario against the skill and check the produced plugin hits every rubric line. A case fails if the skill mis-routes or the output misses a `must_include` item.
|
|
@@ -27,7 +27,7 @@ should_not_trigger:
|
|
|
27
27
|
route_to: shopify
|
|
28
28
|
why: Different commerce platform entirely.
|
|
29
29
|
- prompt: "Do an OWASP threat model of my Express API and its auth flow"
|
|
30
|
-
route_to:
|
|
30
|
+
route_to: security-audit
|
|
31
31
|
why: Generic web security not tied to the WordPress attack surface.
|
|
32
32
|
- prompt: "Build a Next.js front end that reads the WordPress REST API and renders posts"
|
|
33
33
|
route_to: nextjs
|
|
@@ -20,7 +20,7 @@ debug protocol, the workspace bootstrap).
|
|
|
20
20
|
skills for routing: the rsc-sdd phases (constitution, specify, clarify, plan, tasks, analyze,
|
|
21
21
|
implement, verify, review, ship, debug, parallel) and the stack/other skills (fastapi, nextjs,
|
|
22
22
|
go, postgresdb, flutter, design, marketing, presentations, course-storytelling, building-agents,
|
|
23
|
-
|
|
23
|
+
security-audit, deployment, harness, init). Do **not** load any skill bodies.
|
|
24
24
|
2. For each prompt in `should_trigger` and `should_not_trigger`, ask the agent which skill (if any)
|
|
25
25
|
it would invoke. Run **3–5 trials per prompt** at production temperature to catch flakiness.
|
|
26
26
|
3. Score:
|
|
@@ -95,7 +95,7 @@ export function readManifest(root) {
|
|
|
95
95
|
const ids = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string' && ID.test(x)) : []);
|
|
96
96
|
// Retired skills read as their successors. Canonical map: scripts/lib/retired-skills.js — inlined
|
|
97
97
|
// because this file cannot import anything, and tests/retired-skills.test.js holds the two equal.
|
|
98
|
-
const RETIRED = { eli5: 'orient', 'show-me': 'orient', bro: 'unslop', 'design-loop': 'design', 'design-dna': 'design', 'motion-craft': 'design', 'ui-engineering': 'ux', sdd: 'asdd' };
|
|
98
|
+
const RETIRED = { eli5: 'orient', 'show-me': 'orient', bro: 'unslop', 'design-loop': 'design', 'design-dna': 'design', 'motion-craft': 'design', 'ui-engineering': 'ux', sdd: 'asdd', 'secure-coding': 'security-audit', 'security-scan': 'security-audit' };
|
|
99
99
|
const skills = [...new Set(ids(parsed.skills).map((id) => (Object.hasOwn(RETIRED, id) ? RETIRED[id] : id)))];
|
|
100
100
|
const own = ids(parsed.ownSkills);
|
|
101
101
|
// A manifest with nothing declared is not a clone waiting to be equipped; there is nothing to offer.
|
package/targets/commands.js
CHANGED
|
@@ -46,7 +46,7 @@ const FIXED_COMMANDS = Object.freeze([
|
|
|
46
46
|
body: `Use the sello backing for this checkpoint: {{ARGS}}\nRun \`npx @ericrisco/rsc sello freeze\`, complete the required review, then run \`sello approve\` only with the observed lenses. Do not treat freeze as approval.`,
|
|
47
47
|
},
|
|
48
48
|
skillCommand('harness-audit', 'harness'),
|
|
49
|
-
skillCommand('security-
|
|
49
|
+
skillCommand('security-audit', 'security-audit'),
|
|
50
50
|
{
|
|
51
51
|
name: 'learn', kind: 'memory', backing: 'memory:learn',
|
|
52
52
|
description: 'Propose one local lesson; saving still requires individual explicit approval.',
|
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: secure-coding
|
|
3
|
-
description: "Use when securing application code: threat-modeling a feature, security-reviewing a diff, hardening auth/authz, secrets, CORS/CSP, or fixing OWASP-class bugs (access control, injection, SSRF, supply chain) in FastAPI, Next.js, Go or Flutter. NOT running the scanners (that is security-scan), NOT agent prompt-injection guardrails (that is agent-safety)."
|
|
4
|
-
tags: [security, owasp, stride, auth, review]
|
|
5
|
-
recommends: [deployment]
|
|
6
|
-
origin: risco
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Secure coding — threat modeling + OWASP across the stack
|
|
10
|
-
|
|
11
|
-
Threat-model a feature in PR-sized increments, fix OWASP-class bugs with
|
|
12
|
-
stack-correct vulnerable→fixed diffs, and gate the result with `verify.sh`.
|
|
13
|
-
Stacks: FastAPI/Python 3.12+, Next.js 15 / React 19 / TS, Go 1.22+,
|
|
14
|
-
Flutter/Dart 3, PostgreSQL 16.
|
|
15
|
-
|
|
16
|
-
Operating posture:
|
|
17
|
-
|
|
18
|
-
- **Read-only by default.** Identify → rank by exploitability → propose fixes
|
|
19
|
-
as diffs. Apply changes only when the user asks.
|
|
20
|
-
- **Exploitability over theory.** Rank like a bounty triager: reachable +
|
|
21
|
-
user-controlled + meaningful sink comes first. Do not dump a flat checklist.
|
|
22
|
-
- **Every finding ships a fix.** Never "consider sanitizing" — show the
|
|
23
|
-
corrected code for *this* stack.
|
|
24
|
-
|
|
25
|
-
Stay in lane — this is about **the application code the user ships**. Agent /
|
|
26
|
-
Claude-Code config security (`.claude/`, hooks, MCP, prompt injection,
|
|
27
|
-
sandboxing) is a *different* concern: [`agent-safety`](../agent-safety/SKILL.md),
|
|
28
|
-
[`building-agents`](../building-agents/SKILL.md). Running the scanners and
|
|
29
|
-
triaging their raw output: [`security-scan`](../security-scan/SKILL.md).
|
|
30
|
-
Infra/network firewalling with no code change: [`deployment`](../deployment/SKILL.md).
|
|
31
|
-
A pentest/bounty PoC against a third party is out of scope (legal) — this skill
|
|
32
|
-
defends code, it does not attack external targets. Don't gate trivial
|
|
33
|
-
non-security refactors through `verify.sh`.
|
|
34
|
-
|
|
35
|
-
## The 30-second model: lethal trifecta + trust boundaries
|
|
36
|
-
|
|
37
|
-
- **Lethal trifecta** (Simon Willison): private data **+** untrusted input **+**
|
|
38
|
-
ability to exfiltrate. Flag any handler where all three meet — that's where a
|
|
39
|
-
leak becomes a breach.
|
|
40
|
-
- **Trust-boundary rule:** every untrusted→trusted crossing is a checkpoint with
|
|
41
|
-
one owning defense: HTTP body→SQL, user string→shell/URL/HTML, JWT claim→authz
|
|
42
|
-
decision, filename→fs path, upload→disk/exec.
|
|
43
|
-
- **Least privilege / least agency** for tokens, DB roles, CORS origins and file
|
|
44
|
-
perms. It is the one control that still caps blast radius *after* one of the
|
|
45
|
-
defenses below fails, so it is never optional.
|
|
46
|
-
|
|
47
|
-
| Untrusted source | Dangerous sink | Defense | Ref |
|
|
48
|
-
|---|---|---|---|
|
|
49
|
-
| Request body | SQL query | Parameterize (bound params / ORM) | A03 |
|
|
50
|
-
| User URL | Outbound fetch | https-only + IP allowlist, block private ranges | A10 |
|
|
51
|
-
| User HTML | DOM render | Encode by context / DOMPurify allowlist | A03 |
|
|
52
|
-
| Filename | Filesystem path | Canonicalize + base-dir containment | A03 |
|
|
53
|
-
| JWT / claim | Authz decision | Verify signature + pinned alg + `aud`/`iss`/`exp` | `references/authn-authz.md` |
|
|
54
|
-
| Upload | Disk / exec | Type+size, sniff magic bytes, store outside web root | A01 |
|
|
55
|
-
|
|
56
|
-
A-numbers index `references/owasp-by-stack.md`: same section, vulnerable→fixed
|
|
57
|
-
code in all three stacks.
|
|
58
|
-
|
|
59
|
-
## Review workflow (PR-sized)
|
|
60
|
-
|
|
61
|
-
1. **Scope.** What data, which boundary, what auth context does the diff touch?
|
|
62
|
-
2. **Threat-model lite.** STRIDE on the changed element only → `references/threat-modeling.md`.
|
|
63
|
-
3. **Map sinks to OWASP.** Match each changed sink to a category → `references/owasp-by-stack.md`.
|
|
64
|
-
4. **Rank by exploitability.** Reachable? User-controlled? Meaningful sink? Report the highest-impact reachable findings first, not a checklist.
|
|
65
|
-
5. **Propose fixes as diffs** in the repo's actual stack (Good/Bad, copy-pasteable).
|
|
66
|
-
6. **Run `scripts/verify.sh`** in the repo root; resolve every high/critical before merge — a reachable CVE is a release blocker, not a follow-up ticket.
|
|
67
|
-
|
|
68
|
-
## OWASP Top 10 — fastest fix per category
|
|
69
|
-
|
|
70
|
-
| OWASP 2021 | The mistake you'll actually see | Stack-correct fix in one phrase |
|
|
71
|
-
|---|---|---|
|
|
72
|
-
| A01 Broken Access Control | `db.get(id)` returned to any authed user | Ownership-scoped query; 404 (not 403) on miss |
|
|
73
|
-
| A02 Cryptographic Failures | SHA-256 password hash; `random` token | Argon2id + CSPRNG (`secrets`/`crypto/rand`) |
|
|
74
|
-
| A03 Injection | f-string SQL / `shell=True` | Bound params / arg-list, no shell / canonicalize path |
|
|
75
|
-
| A04 Insecure Design | No rate limit, replayable payment | Lockout + idempotency-key `UNIQUE` constraint |
|
|
76
|
-
| A05 Security Misconfiguration | `debug=True`, `*`+credentials CORS | `debug=False`, explicit origin allowlist, headers |
|
|
77
|
-
| A06 Vulnerable Components | Ignored transitive CVE | Audit + upgrade/override/replace |
|
|
78
|
-
| A07 Auth Failures | Reusable session id, user enumeration | Lockout + rotate session id + generic error |
|
|
79
|
-
| A08 Data Integrity | `curl \| bash`, unpinned CDN script | `npm ci`/`go mod verify` + SRI |
|
|
80
|
-
| A09 Logging Failures | No authz-fail log; PII in logs | Structured log on `user_id`, redact secrets |
|
|
81
|
-
| A10 SSRF | Fetch user-supplied URL directly | https-only + IP allowlist + pin dialed IP |
|
|
82
|
-
|
|
83
|
-
Flagship: **A01 Broken Access Control / IDOR** (the #1, stack-agnostic in
|
|
84
|
-
shape). Authorize on the **server**, per object, on **every** request, deny by
|
|
85
|
-
default: the id in the URL is attacker-controlled, so the ownership predicate in
|
|
86
|
-
the query is the only thing standing between a stranger and the row.
|
|
87
|
-
|
|
88
|
-
```python
|
|
89
|
-
# Python — FastAPI 3.12 + SQLAlchemy 2.0
|
|
90
|
-
# BAD — any authenticated user can read any document.
|
|
91
|
-
@router.get("/documents/{doc_id}")
|
|
92
|
-
def get_doc(doc_id: int, db: Session = Depends(get_db)):
|
|
93
|
-
return db.get(Document, doc_id)
|
|
94
|
-
|
|
95
|
-
# GOOD — ownership-scoped query; 404 on miss; injected current_user.
|
|
96
|
-
@router.get("/documents/{doc_id}")
|
|
97
|
-
def get_doc(doc_id: int, db: Session = Depends(get_db),
|
|
98
|
-
user: User = Depends(get_current_user)) -> DocumentOut:
|
|
99
|
-
doc = db.execute(
|
|
100
|
-
select(Document).where(Document.id == doc_id, Document.owner_id == user.id)
|
|
101
|
-
).scalar_one_or_none()
|
|
102
|
-
if doc is None:
|
|
103
|
-
raise HTTPException(status_code=404, detail="Not found") # 404 not 403
|
|
104
|
-
return DocumentOut.model_validate(doc)
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
```ts
|
|
108
|
-
// TS — Next.js 15 App Router Route Handler / Server Action
|
|
109
|
-
// BAD — trusts the id and assumes a session exists.
|
|
110
|
-
export async function GET(_req: Request, { params }: { params: Promise<{ id: string }> }) {
|
|
111
|
-
const { id } = await params; // Next.js 15: params is a Promise — await it.
|
|
112
|
-
return Response.json(await db.document.findUnique({ where: { id } }));
|
|
113
|
-
}
|
|
114
|
-
// GOOD — auth() guard + ownership scope + notFound().
|
|
115
|
-
import { auth } from "@/auth";
|
|
116
|
-
import { notFound } from "next/navigation";
|
|
117
|
-
export async function GET(_req: Request, { params }: { params: Promise<{ id: string }> }) {
|
|
118
|
-
const { id } = await params;
|
|
119
|
-
const session = await auth();
|
|
120
|
-
if (!session) notFound();
|
|
121
|
-
const doc = await db.document.findFirst({
|
|
122
|
-
where: { id, ownerId: session.user.id },
|
|
123
|
-
});
|
|
124
|
-
if (!doc) notFound();
|
|
125
|
-
return Response.json(doc);
|
|
126
|
-
}
|
|
127
|
-
// NOTE: Server Actions are public POST endpoints — re-authorize server-side.
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
```go
|
|
131
|
-
// Go — 1.22 ServeMux + slog
|
|
132
|
-
// BAD — r.PathValue("id") straight into the query, no ownership check.
|
|
133
|
-
// GOOD — userID from context; scoped query; 404 on miss.
|
|
134
|
-
mux.HandleFunc("GET /documents/{id}", func(w http.ResponseWriter, r *http.Request) {
|
|
135
|
-
userID, ok := r.Context().Value(userKey).(int64)
|
|
136
|
-
if !ok { http.Error(w, "unauthorized", http.StatusUnauthorized); return }
|
|
137
|
-
var body string
|
|
138
|
-
err := db.QueryRowContext(r.Context(),
|
|
139
|
-
"SELECT body FROM documents WHERE id=$1 AND owner_id=$2",
|
|
140
|
-
r.PathValue("id"), userID).Scan(&body)
|
|
141
|
-
if err == sql.ErrNoRows {
|
|
142
|
-
slog.Warn("authz_miss", "user", userID)
|
|
143
|
-
http.Error(w, "not found", http.StatusNotFound); return
|
|
144
|
-
}
|
|
145
|
-
if err != nil { http.Error(w, "internal error", http.StatusInternalServerError); return }
|
|
146
|
-
_, _ = w.Write([]byte(body))
|
|
147
|
-
})
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Full vulnerable→fixed code for **all 10 categories in all three stacks** lives
|
|
151
|
-
in `references/owasp-by-stack.md`.
|
|
152
|
-
|
|
153
|
-
## Input validation & output encoding
|
|
154
|
-
|
|
155
|
-
Validate at the boundary with a schema and never trust the shape that arrived —
|
|
156
|
-
an unbounded or extra field is how the next sink gets its payload.
|
|
157
|
-
|
|
158
|
-
```python
|
|
159
|
-
# BAD — raw body, unbounded, unknown fields silently accepted.
|
|
160
|
-
data = await request.json()
|
|
161
|
-
# GOOD — Pydantic v2: bounded + reject unknown fields.
|
|
162
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
163
|
-
class CreateUser(BaseModel):
|
|
164
|
-
model_config = ConfigDict(extra="forbid")
|
|
165
|
-
email: str = Field(max_length=254)
|
|
166
|
-
name: str = Field(min_length=1, max_length=100)
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
```ts
|
|
170
|
-
// GOOD — Zod .strict() parsed inside the Server Action (Go: struct + go-playground/validator).
|
|
171
|
-
const Schema = z.object({ email: z.string().email(), name: z.string().max(100) }).strict();
|
|
172
|
-
const data = Schema.parse(await req.json()); // BAD: `body as any`
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
**XSS:** React auto-escapes — the bug is `dangerouslySetInnerHTML`. **Stored**
|
|
176
|
-
(persisted then served), **reflected** (echoed from the request), and **DOM**
|
|
177
|
-
(client writes user data into the DOM) XSS all need encoding/sanitizing. Encode
|
|
178
|
-
on output *by context* (HTML / attribute / JS / URL); never build HTML by
|
|
179
|
-
concatenating user strings.
|
|
180
|
-
|
|
181
|
-
```tsx
|
|
182
|
-
// BAD — raw user HTML into the DOM.
|
|
183
|
-
<div dangerouslySetInnerHTML={{ __html: userHtml }} />
|
|
184
|
-
// GOOD — DOMPurify allowlist sanitize, or render as text.
|
|
185
|
-
import DOMPurify from "isomorphic-dompurify";
|
|
186
|
-
<div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(userHtml, { ALLOWED_TAGS: ["b","i","p"] }) }} />
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
**Upload validation:** size cap + **sniffed** content-type (magic bytes, not the
|
|
190
|
-
client-sent `file.type`) + extension allowlist + store outside the web root +
|
|
191
|
-
random filename.
|
|
192
|
-
|
|
193
|
-
```python
|
|
194
|
-
# GOOD — sniff magic bytes; never trust the client content-type.
|
|
195
|
-
import secrets, filetype
|
|
196
|
-
head = await file.read(512); await file.seek(0)
|
|
197
|
-
kind = filetype.guess(head)
|
|
198
|
-
if kind is None or kind.mime not in {"image/png", "image/jpeg"}:
|
|
199
|
-
raise HTTPException(415, "unsupported media type")
|
|
200
|
-
dest = UPLOAD_DIR / f"{secrets.token_hex(16)}.{kind.extension}" # outside web root
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
```ts
|
|
204
|
-
// GOOD — magic-byte sniff on the first bytes; reject SVG.
|
|
205
|
-
import { fileTypeFromBuffer } from "file-type";
|
|
206
|
-
const buf = Buffer.from(await file.arrayBuffer());
|
|
207
|
-
const ft = await fileTypeFromBuffer(buf);
|
|
208
|
-
if (!ft || !["image/png", "image/jpeg"].includes(ft.mime)) throw new Error("bad type");
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
## AuthN / AuthZ in 60 seconds
|
|
212
|
-
|
|
213
|
-
- **Library note (2026):** Auth.js / NextAuth v5 is still maintained (now under
|
|
214
|
-
the Better Auth team; security patches continue) and the `auth()` patterns
|
|
215
|
-
below are valid — but for *new* Next.js projects, evaluate Better Auth too. The
|
|
216
|
-
principles here (server-side authz, `HttpOnly` cookies, pinned-alg JWT) are
|
|
217
|
-
library-agnostic.
|
|
218
|
-
- **Sessions vs JWT:** server-side session = easy revocation, default for
|
|
219
|
-
first-party web; JWT = stateless, short access (5–15 min) + rotating refresh
|
|
220
|
-
with reuse detection + a revocation story.
|
|
221
|
-
- **Cookie flags:** `HttpOnly; Secure; SameSite=Lax` (`Strict` for sensitive),
|
|
222
|
-
`__Host-` prefix, scoped `Path=/`. BAD = token in `localStorage` (XSS steals it).
|
|
223
|
-
- **Password hashing:** Argon2id (`time_cost=3, memory_cost=65536, parallelism=4`)
|
|
224
|
-
via `argon2-cffi` (Py) / `golang.org/x/crypto/argon2` (Go); bcrypt `cost>=12`
|
|
225
|
-
fallback; never SHA-256/MD5. (These exceed the OWASP floor of `m=19456, t=2,
|
|
226
|
-
p=1` or `m=47104, t=1, p=1` — `≥` the minimum on every axis is the bar; tune
|
|
227
|
-
`memory_cost` up until a hash takes ~0.5s on prod hardware.)
|
|
228
|
-
- **CSRF:** needed for cookie-auth state-changing requests; double-submit token
|
|
229
|
-
or framework token; SameSite is defense-in-depth, not sufficient alone.
|
|
230
|
-
|
|
231
|
-
```python
|
|
232
|
-
# GOOD — verify a JWT with pinned algorithms + audience + issuer (PyJWT).
|
|
233
|
-
import jwt
|
|
234
|
-
claims = jwt.decode(
|
|
235
|
-
token, public_key,
|
|
236
|
-
algorithms=["RS256"], # pinned: rejects alg:none and HS-when-RS
|
|
237
|
-
audience="api://my-service", issuer="https://issuer.example.com/",
|
|
238
|
-
options={"require": ["exp", "aud", "iss"]},
|
|
239
|
-
)
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
Sessions/OIDC/RBAC/ABAC/MFA/refresh-rotation details: `references/authn-authz.md`.
|
|
243
|
-
|
|
244
|
-
## CORS, security headers, TLS, rate limiting, logging
|
|
245
|
-
|
|
246
|
-
```python
|
|
247
|
-
# CORS — BAD: allow_origins=["*"] with allow_credentials=True (illegal + dangerous).
|
|
248
|
-
# GOOD — explicit origin allowlist.
|
|
249
|
-
from fastapi.middleware.cors import CORSMiddleware
|
|
250
|
-
app.add_middleware(CORSMiddleware,
|
|
251
|
-
allow_origins=["https://app.example.com"], allow_credentials=True,
|
|
252
|
-
allow_methods=["GET", "POST"], allow_headers=["authorization", "content-type"])
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
```ts
|
|
256
|
-
// Security headers — next.config.ts. CSP without unsafe-inline/unsafe-eval
|
|
257
|
-
// (use nonces/hashes for inline scripts); HSTS only when all subdomains are HTTPS.
|
|
258
|
-
const headers = [
|
|
259
|
-
{ key: "Content-Security-Policy", value: "default-src 'self'; object-src 'none'; frame-ancestors 'none'; base-uri 'self'" },
|
|
260
|
-
{ key: "Strict-Transport-Security", value: "max-age=63072000; includeSubDomains; preload" },
|
|
261
|
-
{ key: "X-Content-Type-Options", value: "nosniff" },
|
|
262
|
-
{ key: "X-Frame-Options", value: "DENY" },
|
|
263
|
-
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
|
|
264
|
-
];
|
|
265
|
-
export default { async headers() { return [{ source: "/:path*", headers }]; } };
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
- **Rate limiting:** per-IP **and** per-identity, stricter on auth/OTP/search.
|
|
269
|
-
In-memory limiters are **not** multi-instance safe — use Redis behind >1 replica.
|
|
270
|
-
- **Fail closed:** generic error to the client, detail to the logs. A stack
|
|
271
|
-
trace or DB message in a response is free reconnaissance for the attacker.
|
|
272
|
-
- **Logging without PII:** redact tokens/passwords/PAN/email; log `user_id`,
|
|
273
|
-
not email; structured (`slog`/`structlog`); never log auth-route bodies.
|
|
274
|
-
|
|
275
|
-
## Secrets & supply chain (the part that gets you breached)
|
|
276
|
-
|
|
277
|
-
- Env/secret-manager, never repo; `.env` gitignored. Only `NEXT_PUBLIC_*` is
|
|
278
|
-
public — **BAD: a secret read in a Client Component ships to the browser.**
|
|
279
|
-
In a [`harness`](../harness/SKILL.md) project they live in
|
|
280
|
-
`01-TOOLS/<PROVIDER>/.env` (gitignored) — same rule, never in the repo.
|
|
281
|
-
- Pin + commit the lockfile; install with `npm ci` / `pnpm i --frozen-lockfile`
|
|
282
|
-
/ `go mod verify` / `pip install --require-hashes`.
|
|
283
|
-
- Audit per stack: `pip-audit`, `npm audit --omit=dev --audit-level=high` or
|
|
284
|
-
`osv-scanner scan source -L pnpm-lock.yaml` (lockfile-aware, multi-ecosystem,
|
|
285
|
-
v2 CLI), `govulncheck ./...` (reachability-aware — only vulns you call),
|
|
286
|
-
`dart pub outdated`. Fix by upgrading to the fixed version; constrain or
|
|
287
|
-
override transitive pins.
|
|
288
|
-
- On exposure: **rotate the credential first, then scrub history** (`gitleaks
|
|
289
|
-
dir . --redact` for the working tree, `gitleaks git .` for history, to
|
|
290
|
-
confirm). SBOM via `syft`; provenance via `cosign`/SLSA.
|
|
291
|
-
|
|
292
|
-
Full runbook: `references/secrets-and-supply-chain.md`.
|
|
293
|
-
|
|
294
|
-
## Anti-patterns
|
|
295
|
-
|
|
296
|
-
| What gets said | Reality |
|
|
297
|
-
|---|---|
|
|
298
|
-
| "It's behind auth, so IDOR doesn't matter." | Authenticated ≠ authorized. Check object ownership on every request. |
|
|
299
|
-
| "The frontend already validates / hides the button." | Client checks are UX. Re-authorize and re-validate on the server. Server Actions and API routes are public. |
|
|
300
|
-
| "I'll sanitize with a blacklist of bad chars." | Allowlist + parameterize/encode. Blacklists are bypassable. |
|
|
301
|
-
| "JWT in localStorage is fine, it's just an access token." | Any XSS steals it instantly. Use `HttpOnly` cookies; short TTLs. |
|
|
302
|
-
| "`allow_origins=['*']` with credentials is convenient." | The browser rejects it and it's dangerous. Use an explicit origin allowlist. |
|
|
303
|
-
| "npm audit shows criticals but they're transitive." | Transitive is still in your bundle. Pin/override or replace. |
|
|
304
|
-
| "I'll log the payload to debug, remove it later." | "Later" never comes; PII/secrets leak to logs. Redact now. |
|
|
305
|
-
| "We'll add rate limiting after launch." | Auth/OTP endpoints get brute-forced on day one. |
|
|
306
|
-
| "It's an internal URL fetch, SSRF isn't a risk." | Internal is exactly the SSRF target (metadata, RDS). Allowlist hosts and block `169.254.169.254`, `10/8`, `172.16/12`, `192.168/16`, `127/8`, `::1`, `fc00::/7`, `fe80::/10`. |
|
|
307
|
-
| "Error stack to the client speeds debugging." | It leaks internals to attackers. Generic to client, detail to logs. |
|
|
308
|
-
| "Secrets in `.env.example` are placeholders; real ones in CI YAML are fine." | Use the secret store; never inline real secrets in CI files. |
|
|
309
|
-
| "Argon2 is overkill, SHA-256 is fast." | Fast = brute-forceable. Use Argon2id (or bcrypt cost≥12). |
|
|
310
|
-
|
|
311
|
-
## verify.sh — the gate
|
|
312
|
-
|
|
313
|
-
`scripts/verify.sh` runs gitleaks + semgrep (`--config=auto --severity ERROR`
|
|
314
|
-
gates; WARNING is informational) + the per-stack CVE audit
|
|
315
|
-
(pip-audit/osv-scanner/govulncheck). It is **the user's to run in their own repo
|
|
316
|
-
root** — it auto-detects the stack, skips (does not fail) when a tool is
|
|
317
|
-
missing, and exits non-zero **only** on real high/critical findings. The CI
|
|
318
|
-
equivalent is in `references/secrets-and-supply-chain.md`.
|
|
319
|
-
|
|
320
|
-
## Project grounding
|
|
321
|
-
|
|
322
|
-
In a project with a `02-DOCS/` layer ([`harness`](../harness/SKILL.md)), this
|
|
323
|
-
project's security decisions live in `02-DOCS/wiki/stack/security.md`, indexed
|
|
324
|
-
from `02-DOCS/wiki/index.md` (the Knowledge map; root `CLAUDE.md` keeps only a
|
|
325
|
-
pointer to it). Read it first and stay consistent; if it is missing or stale,
|
|
326
|
-
create/update it with the real choices — threat model, auth model, secrets
|
|
327
|
-
backend, CI security gates, accepted risks — index it, and bump its `Updated`
|
|
328
|
-
date in the same change. No `02-DOCS/` layer? Skip silently (optionally suggest
|
|
329
|
-
`harness`): technical conventions are *recorded, not gated* — never block the
|
|
330
|
-
task on this.
|
|
331
|
-
|
|
332
|
-
Stack skills ([`fastapi`](../fastapi/SKILL.md), [`nextjs`](../nextjs/SKILL.md),
|
|
333
|
-
[`go`](../go/SKILL.md), [`flutter`](../flutter/SKILL.md),
|
|
334
|
-
[`postgresdb`](../postgresdb/SKILL.md), [`deployment`](../deployment/SKILL.md))
|
|
335
|
-
defer security to this skill; where one doesn't exist yet, this is the canonical
|
|
336
|
-
reference it would point to.
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# Eval harness — secure-coding
|
|
2
|
-
|
|
3
|
-
These evals are run through an **agent harness** (an agent with skills loadable
|
|
4
|
-
on demand), not a pure shell script. `cases.yaml` is the fixture; this file is
|
|
5
|
-
the procedure. Two things are measured: **triggering** (does the skill fire when
|
|
6
|
-
it should and stay quiet when it shouldn't) and **capability** (does the skill
|
|
7
|
-
make the answer materially better).
|
|
8
|
-
|
|
9
|
-
## Setup
|
|
10
|
-
|
|
11
|
-
- Use the same agent/model for every trial; vary only which skills are loaded.
|
|
12
|
-
- Triggering trials: load the **full skill catalog** (so the agent can route to
|
|
13
|
-
siblings) and observe which skill the agent selects.
|
|
14
|
-
- Capability trials: compare **only this skill loaded** vs **no skill loaded**.
|
|
15
|
-
|
|
16
|
-
## 1. Triggering
|
|
17
|
-
|
|
18
|
-
For each item in `should_trigger` and `should_not_trigger`:
|
|
19
|
-
|
|
20
|
-
1. Start a fresh agent session with the full catalog available.
|
|
21
|
-
2. Feed the `prompt` verbatim as the user message.
|
|
22
|
-
3. Record which skill (if any) the agent invokes.
|
|
23
|
-
4. Run **3–5 trials** per prompt (the decision is stochastic).
|
|
24
|
-
|
|
25
|
-
Pass conditions:
|
|
26
|
-
|
|
27
|
-
- `should_trigger`: **secure-coding** is invoked in the majority of trials.
|
|
28
|
-
- `should_not_trigger`: secure-coding is **not** invoked; ideally the agent
|
|
29
|
-
routes to the listed `route_to` sibling (or correctly declines when `none`).
|
|
30
|
-
|
|
31
|
-
**Pass bar: >= 90% trigger accuracy** across all trials (a single prompt that
|
|
32
|
-
flaps below majority counts as a fail for that prompt; >= 90% of prompts must
|
|
33
|
-
pass clean).
|
|
34
|
-
|
|
35
|
-
## 2. Capability
|
|
36
|
-
|
|
37
|
-
For each `capability` scenario, run two arms:
|
|
38
|
-
|
|
39
|
-
- **WITH**: only secure-coding loaded.
|
|
40
|
-
- **WITHOUT**: no skill loaded (baseline model behavior).
|
|
41
|
-
|
|
42
|
-
Run each arm 3 times. Grade every response against the scenario's
|
|
43
|
-
`must_include` rubric — one point per checkable item that is genuinely present
|
|
44
|
-
(correct, stack-appropriate, not hand-waved).
|
|
45
|
-
|
|
46
|
-
Pass conditions:
|
|
47
|
-
|
|
48
|
-
- **WITH** the skill covers **>= 80%** of `must_include` items on average.
|
|
49
|
-
- The skill **measurably improves** the output: WITH coverage must beat WITHOUT
|
|
50
|
-
by a clear margin (target >= 25 percentage points). A skill that doesn't move
|
|
51
|
-
the needle fails even if the baseline was already decent.
|
|
52
|
-
|
|
53
|
-
## Scoring summary
|
|
54
|
-
|
|
55
|
-
| Dimension | Metric | Pass bar |
|
|
56
|
-
|---|---|---|
|
|
57
|
-
| Triggering | trigger accuracy across all prompts/trials | >= 90% |
|
|
58
|
-
| Capability | rubric coverage WITH skill | >= 80% |
|
|
59
|
-
| Capability | WITH minus WITHOUT (lift) | >= 25 pts |
|
|
60
|
-
|
|
61
|
-
## Notes / honesty
|
|
62
|
-
|
|
63
|
-
- These are LLM-graded, stochastic evals — re-run on skill edits and treat
|
|
64
|
-
small score deltas as noise, not signal.
|
|
65
|
-
- `route_to` targets assume the sibling skills (fastapi, nextjs, go, postgresdb,
|
|
66
|
-
flutter, building-agents, deployment, …) are present in the catalog; a missing
|
|
67
|
-
sibling can cause a near-miss to mis-route without it being a secure-coding
|
|
68
|
-
fault — note it, don't count it against this skill.
|