@zigrivers/scaffold 2.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/LICENSE +21 -0
- package/README.md +477 -0
- package/dist/cli/commands/adopt.d.ts +12 -0
- package/dist/cli/commands/adopt.d.ts.map +1 -0
- package/dist/cli/commands/adopt.js +107 -0
- package/dist/cli/commands/adopt.js.map +1 -0
- package/dist/cli/commands/adopt.test.d.ts +2 -0
- package/dist/cli/commands/adopt.test.d.ts.map +1 -0
- package/dist/cli/commands/adopt.test.js +277 -0
- package/dist/cli/commands/adopt.test.js.map +1 -0
- package/dist/cli/commands/build.d.ts +12 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +105 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/build.test.d.ts +2 -0
- package/dist/cli/commands/build.test.d.ts.map +1 -0
- package/dist/cli/commands/build.test.js +272 -0
- package/dist/cli/commands/build.test.js.map +1 -0
- package/dist/cli/commands/dashboard.d.ts +14 -0
- package/dist/cli/commands/dashboard.d.ts.map +1 -0
- package/dist/cli/commands/dashboard.js +102 -0
- package/dist/cli/commands/dashboard.js.map +1 -0
- package/dist/cli/commands/dashboard.test.d.ts +2 -0
- package/dist/cli/commands/dashboard.test.d.ts.map +1 -0
- package/dist/cli/commands/dashboard.test.js +142 -0
- package/dist/cli/commands/dashboard.test.js.map +1 -0
- package/dist/cli/commands/decisions.d.ts +13 -0
- package/dist/cli/commands/decisions.d.ts.map +1 -0
- package/dist/cli/commands/decisions.js +62 -0
- package/dist/cli/commands/decisions.js.map +1 -0
- package/dist/cli/commands/decisions.test.d.ts +2 -0
- package/dist/cli/commands/decisions.test.d.ts.map +1 -0
- package/dist/cli/commands/decisions.test.js +154 -0
- package/dist/cli/commands/decisions.test.js.map +1 -0
- package/dist/cli/commands/info.d.ts +12 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +110 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/info.test.d.ts +2 -0
- package/dist/cli/commands/info.test.d.ts.map +1 -0
- package/dist/cli/commands/info.test.js +392 -0
- package/dist/cli/commands/info.test.js.map +1 -0
- package/dist/cli/commands/init.d.ts +13 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +46 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/init.test.d.ts +2 -0
- package/dist/cli/commands/init.test.d.ts.map +1 -0
- package/dist/cli/commands/init.test.js +156 -0
- package/dist/cli/commands/init.test.js.map +1 -0
- package/dist/cli/commands/knowledge.d.ts +4 -0
- package/dist/cli/commands/knowledge.d.ts.map +1 -0
- package/dist/cli/commands/knowledge.js +346 -0
- package/dist/cli/commands/knowledge.js.map +1 -0
- package/dist/cli/commands/knowledge.test.d.ts +2 -0
- package/dist/cli/commands/knowledge.test.d.ts.map +1 -0
- package/dist/cli/commands/knowledge.test.js +293 -0
- package/dist/cli/commands/knowledge.test.js.map +1 -0
- package/dist/cli/commands/list.d.ts +12 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +73 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/list.test.d.ts +2 -0
- package/dist/cli/commands/list.test.d.ts.map +1 -0
- package/dist/cli/commands/list.test.js +166 -0
- package/dist/cli/commands/list.test.js.map +1 -0
- package/dist/cli/commands/next.d.ts +12 -0
- package/dist/cli/commands/next.d.ts.map +1 -0
- package/dist/cli/commands/next.js +75 -0
- package/dist/cli/commands/next.js.map +1 -0
- package/dist/cli/commands/next.test.d.ts +2 -0
- package/dist/cli/commands/next.test.d.ts.map +1 -0
- package/dist/cli/commands/next.test.js +236 -0
- package/dist/cli/commands/next.test.js.map +1 -0
- package/dist/cli/commands/reset.d.ts +13 -0
- package/dist/cli/commands/reset.d.ts.map +1 -0
- package/dist/cli/commands/reset.js +105 -0
- package/dist/cli/commands/reset.js.map +1 -0
- package/dist/cli/commands/reset.test.d.ts +2 -0
- package/dist/cli/commands/reset.test.d.ts.map +1 -0
- package/dist/cli/commands/reset.test.js +211 -0
- package/dist/cli/commands/reset.test.js.map +1 -0
- package/dist/cli/commands/run.d.ts +14 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +379 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/run.test.d.ts +2 -0
- package/dist/cli/commands/run.test.d.ts.map +1 -0
- package/dist/cli/commands/run.test.js +535 -0
- package/dist/cli/commands/run.test.js.map +1 -0
- package/dist/cli/commands/skip.d.ts +13 -0
- package/dist/cli/commands/skip.d.ts.map +1 -0
- package/dist/cli/commands/skip.js +123 -0
- package/dist/cli/commands/skip.js.map +1 -0
- package/dist/cli/commands/skip.test.d.ts +2 -0
- package/dist/cli/commands/skip.test.d.ts.map +1 -0
- package/dist/cli/commands/skip.test.js +339 -0
- package/dist/cli/commands/skip.test.js.map +1 -0
- package/dist/cli/commands/status.d.ts +12 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +79 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/status.test.d.ts +2 -0
- package/dist/cli/commands/status.test.d.ts.map +1 -0
- package/dist/cli/commands/status.test.js +245 -0
- package/dist/cli/commands/status.test.js.map +1 -0
- package/dist/cli/commands/update.d.ts +11 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +159 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/commands/update.test.d.ts +2 -0
- package/dist/cli/commands/update.test.d.ts.map +1 -0
- package/dist/cli/commands/update.test.js +140 -0
- package/dist/cli/commands/update.test.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +12 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +65 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/validate.test.d.ts +2 -0
- package/dist/cli/commands/validate.test.d.ts.map +1 -0
- package/dist/cli/commands/validate.test.js +159 -0
- package/dist/cli/commands/validate.test.js.map +1 -0
- package/dist/cli/commands/version.d.ts +13 -0
- package/dist/cli/commands/version.d.ts.map +1 -0
- package/dist/cli/commands/version.js +89 -0
- package/dist/cli/commands/version.js.map +1 -0
- package/dist/cli/commands/version.test.d.ts +2 -0
- package/dist/cli/commands/version.test.d.ts.map +1 -0
- package/dist/cli/commands/version.test.js +63 -0
- package/dist/cli/commands/version.test.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +72 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/index.test.d.ts +2 -0
- package/dist/cli/index.test.d.ts.map +1 -0
- package/dist/cli/index.test.js +8 -0
- package/dist/cli/index.test.js.map +1 -0
- package/dist/cli/middleware/output-mode.d.ts +21 -0
- package/dist/cli/middleware/output-mode.d.ts.map +1 -0
- package/dist/cli/middleware/output-mode.js +27 -0
- package/dist/cli/middleware/output-mode.js.map +1 -0
- package/dist/cli/middleware/output-mode.test.d.ts +2 -0
- package/dist/cli/middleware/output-mode.test.d.ts.map +1 -0
- package/dist/cli/middleware/output-mode.test.js +41 -0
- package/dist/cli/middleware/output-mode.test.js.map +1 -0
- package/dist/cli/middleware/project-root.d.ts +21 -0
- package/dist/cli/middleware/project-root.d.ts.map +1 -0
- package/dist/cli/middleware/project-root.js +54 -0
- package/dist/cli/middleware/project-root.js.map +1 -0
- package/dist/cli/middleware/project-root.test.d.ts +2 -0
- package/dist/cli/middleware/project-root.test.d.ts.map +1 -0
- package/dist/cli/middleware/project-root.test.js +112 -0
- package/dist/cli/middleware/project-root.test.js.map +1 -0
- package/dist/cli/output/auto.d.ts +18 -0
- package/dist/cli/output/auto.d.ts.map +1 -0
- package/dist/cli/output/auto.js +43 -0
- package/dist/cli/output/auto.js.map +1 -0
- package/dist/cli/output/context.d.ts +19 -0
- package/dist/cli/output/context.d.ts.map +1 -0
- package/dist/cli/output/context.js +15 -0
- package/dist/cli/output/context.js.map +1 -0
- package/dist/cli/output/context.test.d.ts +2 -0
- package/dist/cli/output/context.test.d.ts.map +1 -0
- package/dist/cli/output/context.test.js +335 -0
- package/dist/cli/output/context.test.js.map +1 -0
- package/dist/cli/output/error-display.d.ts +31 -0
- package/dist/cli/output/error-display.d.ts.map +1 -0
- package/dist/cli/output/error-display.js +79 -0
- package/dist/cli/output/error-display.js.map +1 -0
- package/dist/cli/output/error-display.test.d.ts +2 -0
- package/dist/cli/output/error-display.test.d.ts.map +1 -0
- package/dist/cli/output/error-display.test.js +230 -0
- package/dist/cli/output/error-display.test.js.map +1 -0
- package/dist/cli/output/interactive.d.ts +22 -0
- package/dist/cli/output/interactive.d.ts.map +1 -0
- package/dist/cli/output/interactive.js +126 -0
- package/dist/cli/output/interactive.js.map +1 -0
- package/dist/cli/output/json.d.ts +17 -0
- package/dist/cli/output/json.d.ts.map +1 -0
- package/dist/cli/output/json.js +62 -0
- package/dist/cli/output/json.js.map +1 -0
- package/dist/cli/types.d.ts +11 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/config/loader.d.ts +22 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +159 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/loader.test.d.ts +2 -0
- package/dist/config/loader.test.d.ts.map +1 -0
- package/dist/config/loader.test.js +226 -0
- package/dist/config/loader.test.js.map +1 -0
- package/dist/config/migration.d.ts +15 -0
- package/dist/config/migration.d.ts.map +1 -0
- package/dist/config/migration.js +39 -0
- package/dist/config/migration.js.map +1 -0
- package/dist/config/migration.test.d.ts +2 -0
- package/dist/config/migration.test.d.ts.map +1 -0
- package/dist/config/migration.test.js +44 -0
- package/dist/config/migration.test.js.map +1 -0
- package/dist/config/schema.d.ts +121 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +22 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/schema.test.d.ts +2 -0
- package/dist/config/schema.test.d.ts.map +1 -0
- package/dist/config/schema.test.js +126 -0
- package/dist/config/schema.test.js.map +1 -0
- package/dist/core/adapters/adapter.d.ts +64 -0
- package/dist/core/adapters/adapter.d.ts.map +1 -0
- package/dist/core/adapters/adapter.js +25 -0
- package/dist/core/adapters/adapter.js.map +1 -0
- package/dist/core/adapters/adapter.test.d.ts +2 -0
- package/dist/core/adapters/adapter.test.d.ts.map +1 -0
- package/dist/core/adapters/adapter.test.js +175 -0
- package/dist/core/adapters/adapter.test.js.map +1 -0
- package/dist/core/adapters/claude-code.d.ts +9 -0
- package/dist/core/adapters/claude-code.d.ts.map +1 -0
- package/dist/core/adapters/claude-code.js +34 -0
- package/dist/core/adapters/claude-code.js.map +1 -0
- package/dist/core/adapters/claude-code.test.d.ts +2 -0
- package/dist/core/adapters/claude-code.test.d.ts.map +1 -0
- package/dist/core/adapters/claude-code.test.js +100 -0
- package/dist/core/adapters/claude-code.test.js.map +1 -0
- package/dist/core/adapters/codex.d.ts +10 -0
- package/dist/core/adapters/codex.d.ts.map +1 -0
- package/dist/core/adapters/codex.js +61 -0
- package/dist/core/adapters/codex.js.map +1 -0
- package/dist/core/adapters/codex.test.d.ts +2 -0
- package/dist/core/adapters/codex.test.d.ts.map +1 -0
- package/dist/core/adapters/codex.test.js +122 -0
- package/dist/core/adapters/codex.test.js.map +1 -0
- package/dist/core/adapters/universal.d.ts +10 -0
- package/dist/core/adapters/universal.d.ts.map +1 -0
- package/dist/core/adapters/universal.js +45 -0
- package/dist/core/adapters/universal.js.map +1 -0
- package/dist/core/adapters/universal.test.d.ts +2 -0
- package/dist/core/adapters/universal.test.d.ts.map +1 -0
- package/dist/core/adapters/universal.test.js +121 -0
- package/dist/core/adapters/universal.test.js.map +1 -0
- package/dist/core/assembly/context-gatherer.d.ts +17 -0
- package/dist/core/assembly/context-gatherer.d.ts.map +1 -0
- package/dist/core/assembly/context-gatherer.js +49 -0
- package/dist/core/assembly/context-gatherer.js.map +1 -0
- package/dist/core/assembly/context-gatherer.test.d.ts +2 -0
- package/dist/core/assembly/context-gatherer.test.d.ts.map +1 -0
- package/dist/core/assembly/context-gatherer.test.js +252 -0
- package/dist/core/assembly/context-gatherer.test.js.map +1 -0
- package/dist/core/assembly/depth-resolver.d.ts +11 -0
- package/dist/core/assembly/depth-resolver.d.ts.map +1 -0
- package/dist/core/assembly/depth-resolver.js +23 -0
- package/dist/core/assembly/depth-resolver.js.map +1 -0
- package/dist/core/assembly/depth-resolver.test.d.ts +2 -0
- package/dist/core/assembly/depth-resolver.test.d.ts.map +1 -0
- package/dist/core/assembly/depth-resolver.test.js +100 -0
- package/dist/core/assembly/depth-resolver.test.js.map +1 -0
- package/dist/core/assembly/engine.d.ts +22 -0
- package/dist/core/assembly/engine.d.ts.map +1 -0
- package/dist/core/assembly/engine.js +215 -0
- package/dist/core/assembly/engine.js.map +1 -0
- package/dist/core/assembly/engine.test.d.ts +2 -0
- package/dist/core/assembly/engine.test.d.ts.map +1 -0
- package/dist/core/assembly/engine.test.js +462 -0
- package/dist/core/assembly/engine.test.js.map +1 -0
- package/dist/core/assembly/instruction-loader.d.ts +16 -0
- package/dist/core/assembly/instruction-loader.d.ts.map +1 -0
- package/dist/core/assembly/instruction-loader.js +40 -0
- package/dist/core/assembly/instruction-loader.js.map +1 -0
- package/dist/core/assembly/instruction-loader.test.d.ts +2 -0
- package/dist/core/assembly/instruction-loader.test.d.ts.map +1 -0
- package/dist/core/assembly/instruction-loader.test.js +109 -0
- package/dist/core/assembly/instruction-loader.test.js.map +1 -0
- package/dist/core/assembly/knowledge-loader.d.ts +34 -0
- package/dist/core/assembly/knowledge-loader.d.ts.map +1 -0
- package/dist/core/assembly/knowledge-loader.js +204 -0
- package/dist/core/assembly/knowledge-loader.js.map +1 -0
- package/dist/core/assembly/knowledge-loader.test.d.ts +2 -0
- package/dist/core/assembly/knowledge-loader.test.d.ts.map +1 -0
- package/dist/core/assembly/knowledge-loader.test.js +205 -0
- package/dist/core/assembly/knowledge-loader.test.js.map +1 -0
- package/dist/core/assembly/meta-prompt-loader.d.ts +13 -0
- package/dist/core/assembly/meta-prompt-loader.d.ts.map +1 -0
- package/dist/core/assembly/meta-prompt-loader.js +91 -0
- package/dist/core/assembly/meta-prompt-loader.js.map +1 -0
- package/dist/core/assembly/meta-prompt-loader.test.d.ts +2 -0
- package/dist/core/assembly/meta-prompt-loader.test.d.ts.map +1 -0
- package/dist/core/assembly/meta-prompt-loader.test.js +232 -0
- package/dist/core/assembly/meta-prompt-loader.test.js.map +1 -0
- package/dist/core/assembly/methodology-change.d.ts +27 -0
- package/dist/core/assembly/methodology-change.d.ts.map +1 -0
- package/dist/core/assembly/methodology-change.js +41 -0
- package/dist/core/assembly/methodology-change.js.map +1 -0
- package/dist/core/assembly/methodology-change.test.d.ts +2 -0
- package/dist/core/assembly/methodology-change.test.d.ts.map +1 -0
- package/dist/core/assembly/methodology-change.test.js +145 -0
- package/dist/core/assembly/methodology-change.test.js.map +1 -0
- package/dist/core/assembly/methodology-resolver.d.ts +11 -0
- package/dist/core/assembly/methodology-resolver.d.ts.map +1 -0
- package/dist/core/assembly/methodology-resolver.js +19 -0
- package/dist/core/assembly/methodology-resolver.js.map +1 -0
- package/dist/core/assembly/methodology-resolver.test.d.ts +2 -0
- package/dist/core/assembly/methodology-resolver.test.d.ts.map +1 -0
- package/dist/core/assembly/methodology-resolver.test.js +87 -0
- package/dist/core/assembly/methodology-resolver.test.js.map +1 -0
- package/dist/core/assembly/preset-loader.d.ts +26 -0
- package/dist/core/assembly/preset-loader.d.ts.map +1 -0
- package/dist/core/assembly/preset-loader.js +146 -0
- package/dist/core/assembly/preset-loader.js.map +1 -0
- package/dist/core/assembly/preset-loader.test.d.ts +2 -0
- package/dist/core/assembly/preset-loader.test.d.ts.map +1 -0
- package/dist/core/assembly/preset-loader.test.js +107 -0
- package/dist/core/assembly/preset-loader.test.js.map +1 -0
- package/dist/core/assembly/update-mode.d.ts +25 -0
- package/dist/core/assembly/update-mode.d.ts.map +1 -0
- package/dist/core/assembly/update-mode.js +70 -0
- package/dist/core/assembly/update-mode.js.map +1 -0
- package/dist/core/assembly/update-mode.test.d.ts +2 -0
- package/dist/core/assembly/update-mode.test.d.ts.map +1 -0
- package/dist/core/assembly/update-mode.test.js +235 -0
- package/dist/core/assembly/update-mode.test.js.map +1 -0
- package/dist/core/dependency/dependency.d.ts +20 -0
- package/dist/core/dependency/dependency.d.ts.map +1 -0
- package/dist/core/dependency/dependency.js +104 -0
- package/dist/core/dependency/dependency.js.map +1 -0
- package/dist/core/dependency/dependency.test.d.ts +2 -0
- package/dist/core/dependency/dependency.test.d.ts.map +1 -0
- package/dist/core/dependency/dependency.test.js +166 -0
- package/dist/core/dependency/dependency.test.js.map +1 -0
- package/dist/core/dependency/eligibility.d.ts +17 -0
- package/dist/core/dependency/eligibility.d.ts.map +1 -0
- package/dist/core/dependency/eligibility.js +60 -0
- package/dist/core/dependency/eligibility.js.map +1 -0
- package/dist/core/dependency/eligibility.test.d.ts +2 -0
- package/dist/core/dependency/eligibility.test.d.ts.map +1 -0
- package/dist/core/dependency/eligibility.test.js +198 -0
- package/dist/core/dependency/eligibility.test.js.map +1 -0
- package/dist/core/dependency/graph.d.ts +12 -0
- package/dist/core/dependency/graph.d.ts.map +1 -0
- package/dist/core/dependency/graph.js +34 -0
- package/dist/core/dependency/graph.js.map +1 -0
- package/dist/core/knowledge/knowledge-update-assembler.d.ts +24 -0
- package/dist/core/knowledge/knowledge-update-assembler.d.ts.map +1 -0
- package/dist/core/knowledge/knowledge-update-assembler.js +46 -0
- package/dist/core/knowledge/knowledge-update-assembler.js.map +1 -0
- package/dist/core/knowledge/knowledge-update-assembler.test.d.ts +2 -0
- package/dist/core/knowledge/knowledge-update-assembler.test.d.ts.map +1 -0
- package/dist/core/knowledge/knowledge-update-assembler.test.js +93 -0
- package/dist/core/knowledge/knowledge-update-assembler.test.js.map +1 -0
- package/dist/core/knowledge/knowledge-update-template.md +55 -0
- package/dist/dashboard/generator.d.ts +37 -0
- package/dist/dashboard/generator.d.ts.map +1 -0
- package/dist/dashboard/generator.js +42 -0
- package/dist/dashboard/generator.js.map +1 -0
- package/dist/dashboard/generator.test.d.ts +2 -0
- package/dist/dashboard/generator.test.d.ts.map +1 -0
- package/dist/dashboard/generator.test.js +186 -0
- package/dist/dashboard/generator.test.js.map +1 -0
- package/dist/dashboard/template.d.ts +4 -0
- package/dist/dashboard/template.d.ts.map +1 -0
- package/dist/dashboard/template.js +190 -0
- package/dist/dashboard/template.js.map +1 -0
- package/dist/e2e/commands.test.d.ts +9 -0
- package/dist/e2e/commands.test.d.ts.map +1 -0
- package/dist/e2e/commands.test.js +499 -0
- package/dist/e2e/commands.test.js.map +1 -0
- package/dist/e2e/init.test.d.ts +10 -0
- package/dist/e2e/init.test.d.ts.map +1 -0
- package/dist/e2e/init.test.js +180 -0
- package/dist/e2e/init.test.js.map +1 -0
- package/dist/e2e/knowledge.test.d.ts +2 -0
- package/dist/e2e/knowledge.test.d.ts.map +1 -0
- package/dist/e2e/knowledge.test.js +103 -0
- package/dist/e2e/knowledge.test.js.map +1 -0
- package/dist/e2e/pipeline.test.d.ts +8 -0
- package/dist/e2e/pipeline.test.d.ts.map +1 -0
- package/dist/e2e/pipeline.test.js +295 -0
- package/dist/e2e/pipeline.test.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/project/adopt.d.ts +28 -0
- package/dist/project/adopt.d.ts.map +1 -0
- package/dist/project/adopt.js +49 -0
- package/dist/project/adopt.js.map +1 -0
- package/dist/project/adopt.test.d.ts +2 -0
- package/dist/project/adopt.test.d.ts.map +1 -0
- package/dist/project/adopt.test.js +220 -0
- package/dist/project/adopt.test.js.map +1 -0
- package/dist/project/claude-md.d.ts +33 -0
- package/dist/project/claude-md.d.ts.map +1 -0
- package/dist/project/claude-md.js +112 -0
- package/dist/project/claude-md.js.map +1 -0
- package/dist/project/claude-md.test.d.ts +2 -0
- package/dist/project/claude-md.test.d.ts.map +1 -0
- package/dist/project/claude-md.test.js +151 -0
- package/dist/project/claude-md.test.js.map +1 -0
- package/dist/project/detector.d.ts +7 -0
- package/dist/project/detector.d.ts.map +1 -0
- package/dist/project/detector.js +78 -0
- package/dist/project/detector.js.map +1 -0
- package/dist/project/detector.test.d.ts +2 -0
- package/dist/project/detector.test.d.ts.map +1 -0
- package/dist/project/detector.test.js +137 -0
- package/dist/project/detector.test.js.map +1 -0
- package/dist/project/frontmatter.d.ts +17 -0
- package/dist/project/frontmatter.d.ts.map +1 -0
- package/dist/project/frontmatter.js +236 -0
- package/dist/project/frontmatter.js.map +1 -0
- package/dist/project/frontmatter.test.d.ts +2 -0
- package/dist/project/frontmatter.test.d.ts.map +1 -0
- package/dist/project/frontmatter.test.js +218 -0
- package/dist/project/frontmatter.test.js.map +1 -0
- package/dist/project/signals.d.ts +12 -0
- package/dist/project/signals.d.ts.map +1 -0
- package/dist/project/signals.js +2 -0
- package/dist/project/signals.js.map +1 -0
- package/dist/state/completion.d.ts +22 -0
- package/dist/state/completion.d.ts.map +1 -0
- package/dist/state/completion.js +82 -0
- package/dist/state/completion.js.map +1 -0
- package/dist/state/completion.test.d.ts +2 -0
- package/dist/state/completion.test.d.ts.map +1 -0
- package/dist/state/completion.test.js +246 -0
- package/dist/state/completion.test.js.map +1 -0
- package/dist/state/decision-logger.d.ts +16 -0
- package/dist/state/decision-logger.d.ts.map +1 -0
- package/dist/state/decision-logger.js +80 -0
- package/dist/state/decision-logger.js.map +1 -0
- package/dist/state/decision-logger.test.d.ts +2 -0
- package/dist/state/decision-logger.test.d.ts.map +1 -0
- package/dist/state/decision-logger.test.js +182 -0
- package/dist/state/decision-logger.test.js.map +1 -0
- package/dist/state/lock-manager.d.ts +18 -0
- package/dist/state/lock-manager.d.ts.map +1 -0
- package/dist/state/lock-manager.js +134 -0
- package/dist/state/lock-manager.js.map +1 -0
- package/dist/state/lock-manager.test.d.ts +2 -0
- package/dist/state/lock-manager.test.d.ts.map +1 -0
- package/dist/state/lock-manager.test.js +190 -0
- package/dist/state/lock-manager.test.js.map +1 -0
- package/dist/state/state-manager.d.ts +37 -0
- package/dist/state/state-manager.d.ts.map +1 -0
- package/dist/state/state-manager.js +125 -0
- package/dist/state/state-manager.js.map +1 -0
- package/dist/state/state-manager.test.d.ts +2 -0
- package/dist/state/state-manager.test.d.ts.map +1 -0
- package/dist/state/state-manager.test.js +240 -0
- package/dist/state/state-manager.test.js.map +1 -0
- package/dist/types/adapter.d.ts +24 -0
- package/dist/types/adapter.d.ts.map +1 -0
- package/dist/types/adapter.js +2 -0
- package/dist/types/adapter.js.map +1 -0
- package/dist/types/assembly.d.ts +89 -0
- package/dist/types/assembly.d.ts.map +1 -0
- package/dist/types/assembly.js +2 -0
- package/dist/types/assembly.js.map +1 -0
- package/dist/types/claude-md.d.ts +11 -0
- package/dist/types/claude-md.d.ts.map +1 -0
- package/dist/types/claude-md.js +2 -0
- package/dist/types/claude-md.js.map +1 -0
- package/dist/types/cli.d.ts +15 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +2 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/types/config.d.ts +40 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/decision.d.ts +14 -0
- package/dist/types/decision.d.ts.map +1 -0
- package/dist/types/decision.js +2 -0
- package/dist/types/decision.js.map +1 -0
- package/dist/types/dependency.d.ts +12 -0
- package/dist/types/dependency.d.ts.map +1 -0
- package/dist/types/dependency.js +2 -0
- package/dist/types/dependency.js.map +1 -0
- package/dist/types/enums.d.ts +23 -0
- package/dist/types/enums.d.ts.map +1 -0
- package/dist/types/enums.js +11 -0
- package/dist/types/enums.js.map +1 -0
- package/dist/types/enums.test.d.ts +2 -0
- package/dist/types/enums.test.d.ts.map +1 -0
- package/dist/types/enums.test.js +13 -0
- package/dist/types/enums.test.js.map +1 -0
- package/dist/types/errors.d.ts +24 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +2 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/frontmatter.d.ts +43 -0
- package/dist/types/frontmatter.d.ts.map +1 -0
- package/dist/types/frontmatter.js +2 -0
- package/dist/types/frontmatter.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +14 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/lock.d.ts +10 -0
- package/dist/types/lock.d.ts.map +1 -0
- package/dist/types/lock.js +2 -0
- package/dist/types/lock.js.map +1 -0
- package/dist/types/state.d.ts +49 -0
- package/dist/types/state.d.ts.map +1 -0
- package/dist/types/state.js +2 -0
- package/dist/types/state.js.map +1 -0
- package/dist/types/wizard.d.ts +14 -0
- package/dist/types/wizard.d.ts.map +1 -0
- package/dist/types/wizard.js +2 -0
- package/dist/types/wizard.js.map +1 -0
- package/dist/utils/errors.d.ts +42 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +232 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/errors.test.d.ts +2 -0
- package/dist/utils/errors.test.d.ts.map +1 -0
- package/dist/utils/errors.test.js +91 -0
- package/dist/utils/errors.test.js.map +1 -0
- package/dist/utils/fs.d.ts +11 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +20 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/fs.test.d.ts +2 -0
- package/dist/utils/fs.test.d.ts.map +1 -0
- package/dist/utils/fs.test.js +93 -0
- package/dist/utils/fs.test.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/levenshtein.d.ts +11 -0
- package/dist/utils/levenshtein.d.ts.map +1 -0
- package/dist/utils/levenshtein.js +37 -0
- package/dist/utils/levenshtein.js.map +1 -0
- package/dist/utils/levenshtein.test.d.ts +2 -0
- package/dist/utils/levenshtein.test.d.ts.map +1 -0
- package/dist/utils/levenshtein.test.js +34 -0
- package/dist/utils/levenshtein.test.js.map +1 -0
- package/dist/validation/config-validator.d.ts +10 -0
- package/dist/validation/config-validator.d.ts.map +1 -0
- package/dist/validation/config-validator.js +11 -0
- package/dist/validation/config-validator.js.map +1 -0
- package/dist/validation/dependency-validator.d.ts +10 -0
- package/dist/validation/dependency-validator.d.ts.map +1 -0
- package/dist/validation/dependency-validator.js +34 -0
- package/dist/validation/dependency-validator.js.map +1 -0
- package/dist/validation/frontmatter-validator.d.ts +12 -0
- package/dist/validation/frontmatter-validator.d.ts.map +1 -0
- package/dist/validation/frontmatter-validator.js +50 -0
- package/dist/validation/frontmatter-validator.js.map +1 -0
- package/dist/validation/index.d.ts +19 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +64 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/index.test.d.ts +2 -0
- package/dist/validation/index.test.d.ts.map +1 -0
- package/dist/validation/index.test.js +241 -0
- package/dist/validation/index.test.js.map +1 -0
- package/dist/validation/state-validator.d.ts +15 -0
- package/dist/validation/state-validator.d.ts.map +1 -0
- package/dist/validation/state-validator.js +104 -0
- package/dist/validation/state-validator.js.map +1 -0
- package/dist/wizard/questions.d.ts +18 -0
- package/dist/wizard/questions.d.ts.map +1 -0
- package/dist/wizard/questions.js +46 -0
- package/dist/wizard/questions.js.map +1 -0
- package/dist/wizard/suggestion.d.ts +10 -0
- package/dist/wizard/suggestion.d.ts.map +1 -0
- package/dist/wizard/suggestion.js +17 -0
- package/dist/wizard/suggestion.js.map +1 -0
- package/dist/wizard/wizard.d.ts +19 -0
- package/dist/wizard/wizard.d.ts.map +1 -0
- package/dist/wizard/wizard.js +104 -0
- package/dist/wizard/wizard.js.map +1 -0
- package/dist/wizard/wizard.test.d.ts +2 -0
- package/dist/wizard/wizard.test.d.ts.map +1 -0
- package/dist/wizard/wizard.test.js +167 -0
- package/dist/wizard/wizard.test.js.map +1 -0
- package/knowledge/core/adr-craft.md +281 -0
- package/knowledge/core/api-design.md +501 -0
- package/knowledge/core/database-design.md +380 -0
- package/knowledge/core/domain-modeling.md +317 -0
- package/knowledge/core/operations-runbook.md +513 -0
- package/knowledge/core/security-review.md +523 -0
- package/knowledge/core/system-architecture.md +402 -0
- package/knowledge/core/task-decomposition.md +372 -0
- package/knowledge/core/testing-strategy.md +409 -0
- package/knowledge/core/user-stories.md +337 -0
- package/knowledge/core/user-story-innovation.md +171 -0
- package/knowledge/core/ux-specification.md +380 -0
- package/knowledge/finalization/apply-fixes-and-freeze.md +93 -0
- package/knowledge/finalization/developer-onboarding.md +376 -0
- package/knowledge/finalization/implementation-playbook.md +404 -0
- package/knowledge/product/gap-analysis.md +305 -0
- package/knowledge/product/prd-craft.md +324 -0
- package/knowledge/product/prd-innovation.md +204 -0
- package/knowledge/review/review-adr.md +203 -0
- package/knowledge/review/review-api-contracts.md +233 -0
- package/knowledge/review/review-database-schema.md +229 -0
- package/knowledge/review/review-domain-modeling.md +288 -0
- package/knowledge/review/review-implementation-tasks.md +202 -0
- package/knowledge/review/review-methodology.md +215 -0
- package/knowledge/review/review-operations.md +212 -0
- package/knowledge/review/review-prd.md +235 -0
- package/knowledge/review/review-security.md +213 -0
- package/knowledge/review/review-system-architecture.md +296 -0
- package/knowledge/review/review-testing-strategy.md +176 -0
- package/knowledge/review/review-user-stories.md +172 -0
- package/knowledge/review/review-ux-spec.md +208 -0
- package/knowledge/validation/critical-path-analysis.md +203 -0
- package/knowledge/validation/cross-phase-consistency.md +181 -0
- package/knowledge/validation/decision-completeness.md +218 -0
- package/knowledge/validation/dependency-validation.md +233 -0
- package/knowledge/validation/implementability-review.md +252 -0
- package/knowledge/validation/scope-management.md +223 -0
- package/knowledge/validation/traceability.md +198 -0
- package/methodology/custom-defaults.yml +43 -0
- package/methodology/deep.yml +42 -0
- package/methodology/mvp.yml +42 -0
- package/package.json +58 -0
- package/pipeline/architecture/review-architecture.md +44 -0
- package/pipeline/architecture/system-architecture.md +45 -0
- package/pipeline/decisions/adrs.md +45 -0
- package/pipeline/decisions/review-adrs.md +39 -0
- package/pipeline/finalization/apply-fixes-and-freeze.md +39 -0
- package/pipeline/finalization/developer-onboarding-guide.md +36 -0
- package/pipeline/finalization/implementation-playbook.md +45 -0
- package/pipeline/modeling/domain-modeling.md +57 -0
- package/pipeline/modeling/review-domain-modeling.md +41 -0
- package/pipeline/planning/implementation-tasks.md +57 -0
- package/pipeline/planning/review-tasks.md +38 -0
- package/pipeline/pre/create-prd.md +45 -0
- package/pipeline/pre/innovate-prd.md +47 -0
- package/pipeline/pre/innovate-user-stories.md +47 -0
- package/pipeline/pre/review-prd.md +44 -0
- package/pipeline/pre/review-user-stories.md +43 -0
- package/pipeline/pre/user-stories.md +48 -0
- package/pipeline/quality/operations.md +42 -0
- package/pipeline/quality/review-operations.md +37 -0
- package/pipeline/quality/review-security.md +40 -0
- package/pipeline/quality/review-testing.md +39 -0
- package/pipeline/quality/security.md +44 -0
- package/pipeline/quality/testing-strategy.md +42 -0
- package/pipeline/specification/api-contracts.md +44 -0
- package/pipeline/specification/database-schema.md +41 -0
- package/pipeline/specification/review-api.md +40 -0
- package/pipeline/specification/review-database.md +39 -0
- package/pipeline/specification/review-ux.md +38 -0
- package/pipeline/specification/ux-spec.md +43 -0
- package/pipeline/validation/critical-path-walkthrough.md +37 -0
- package/pipeline/validation/cross-phase-consistency.md +35 -0
- package/pipeline/validation/decision-completeness.md +36 -0
- package/pipeline/validation/dependency-graph-validation.md +36 -0
- package/pipeline/validation/implementability-dry-run.md +36 -0
- package/pipeline/validation/scope-creep-check.md +38 -0
- package/pipeline/validation/traceability-matrix.md +36 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-review
|
|
3
|
+
description: OWASP Top 10, authentication, authorization, data protection, and threat modeling
|
|
4
|
+
topics: [security, owasp, authentication, authorization, threat-modeling, secrets-management, dependency-auditing]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## OWASP Top 10
|
|
8
|
+
|
|
9
|
+
The OWASP Top 10 represents the most critical security risks to web applications. Every project should evaluate each risk and implement appropriate mitigations.
|
|
10
|
+
|
|
11
|
+
### A01: Broken Access Control
|
|
12
|
+
|
|
13
|
+
Users act outside their intended permissions: accessing other users' data, modifying records they shouldn't, escalating privileges.
|
|
14
|
+
|
|
15
|
+
**Attack patterns:**
|
|
16
|
+
- Modifying URL parameters to access another user's resource (`/api/users/123` -> `/api/users/456`)
|
|
17
|
+
- Bypassing access control checks by sending requests directly to the API (skipping frontend checks)
|
|
18
|
+
- Privilege escalation by manipulating JWT claims or session data
|
|
19
|
+
- Accessing admin endpoints without admin role
|
|
20
|
+
|
|
21
|
+
**Mitigations:**
|
|
22
|
+
- Deny by default: every endpoint requires explicit permission grants
|
|
23
|
+
- Verify resource ownership on every request, not just at the UI level
|
|
24
|
+
- Use parameterized access control (the user can access records where `owner_id = authenticated_user_id`)
|
|
25
|
+
- Server-side enforcement — never rely on client-side checks alone
|
|
26
|
+
- Log and alert on access control failures
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
// BAD: Only checks if user is authenticated, not if they own the resource
|
|
30
|
+
app.get('/api/orders/:id', requireAuth, async (req, res) => {
|
|
31
|
+
const order = await db.orders.findById(req.params.id);
|
|
32
|
+
res.json(order);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// GOOD: Verifies the authenticated user owns the requested resource
|
|
36
|
+
app.get('/api/orders/:id', requireAuth, async (req, res) => {
|
|
37
|
+
const order = await db.orders.findById(req.params.id);
|
|
38
|
+
if (!order || order.userId !== req.user.id) {
|
|
39
|
+
return res.status(404).json({ error: { code: 'NOT_FOUND' } });
|
|
40
|
+
}
|
|
41
|
+
res.json(order);
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### A02: Cryptographic Failures
|
|
46
|
+
|
|
47
|
+
Sensitive data exposed due to weak or missing encryption.
|
|
48
|
+
|
|
49
|
+
**At-risk data:** Passwords, credit card numbers, health records, personal data, API keys, session tokens.
|
|
50
|
+
|
|
51
|
+
**Mitigations:**
|
|
52
|
+
- Classify data by sensitivity (public, internal, confidential, restricted)
|
|
53
|
+
- Encrypt sensitive data at rest (database encryption, encrypted backups)
|
|
54
|
+
- Use TLS 1.2+ for all data in transit (HTTPS everywhere, no mixed content)
|
|
55
|
+
- Hash passwords with bcrypt, scrypt, or Argon2 (NEVER MD5 or SHA-256 for passwords)
|
|
56
|
+
- Don't store sensitive data you don't need — the safest data is data you don't have
|
|
57
|
+
|
|
58
|
+
### A03: Injection
|
|
59
|
+
|
|
60
|
+
Untrusted data sent to an interpreter as part of a command or query, causing unintended execution.
|
|
61
|
+
|
|
62
|
+
**SQL injection:**
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
// BAD: String concatenation — vulnerable
|
|
66
|
+
const query = `SELECT * FROM users WHERE email = '${email}'`;
|
|
67
|
+
|
|
68
|
+
// GOOD: Parameterized query — safe
|
|
69
|
+
const query = `SELECT * FROM users WHERE email = $1`;
|
|
70
|
+
const result = await db.query(query, [email]);
|
|
71
|
+
|
|
72
|
+
// GOOD: ORM with parameterized API — safe
|
|
73
|
+
const user = await db.users.findFirst({ where: { email } });
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**NoSQL injection:**
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
// BAD: User input directly in query object
|
|
80
|
+
db.users.find({ email: req.body.email, password: req.body.password });
|
|
81
|
+
// Attacker sends: { "password": { "$ne": "" } } — bypasses password check
|
|
82
|
+
|
|
83
|
+
// GOOD: Validate and sanitize input types before use
|
|
84
|
+
const email = String(req.body.email);
|
|
85
|
+
const passwordHash = await hash(String(req.body.password));
|
|
86
|
+
db.users.find({ email, passwordHash });
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Command injection:**
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
// BAD: User input in shell command
|
|
93
|
+
exec(`convert ${userFilename} output.png`);
|
|
94
|
+
|
|
95
|
+
// GOOD: Use library APIs instead of shell commands
|
|
96
|
+
sharp(userFilePath).toFile('output.png');
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Prevention rules:**
|
|
100
|
+
- Use parameterized queries for all database access
|
|
101
|
+
- Use ORM/query builders that parameterize automatically
|
|
102
|
+
- Validate and sanitize all user input at the boundary
|
|
103
|
+
- Never construct shell commands from user input
|
|
104
|
+
|
|
105
|
+
### A04: Insecure Design
|
|
106
|
+
|
|
107
|
+
Security flaws from missing or ineffective control design, as opposed to implementation bugs. These are architectural problems.
|
|
108
|
+
|
|
109
|
+
**Examples:**
|
|
110
|
+
- Password reset via security questions (attackable)
|
|
111
|
+
- No rate limiting on login endpoint (brute force possible)
|
|
112
|
+
- No account lockout policy (unlimited password attempts)
|
|
113
|
+
- Returning different error messages for "user not found" vs. "wrong password" (user enumeration)
|
|
114
|
+
|
|
115
|
+
**Mitigations:**
|
|
116
|
+
- Threat model during design phase, not after implementation
|
|
117
|
+
- Use established security patterns (don't invent custom auth)
|
|
118
|
+
- Rate limit all authentication endpoints
|
|
119
|
+
- Return generic error messages for auth failures ("Invalid credentials" for both wrong email and wrong password)
|
|
120
|
+
- Require MFA for sensitive operations
|
|
121
|
+
|
|
122
|
+
### A05: Security Misconfiguration
|
|
123
|
+
|
|
124
|
+
Default credentials, unnecessary features enabled, verbose error messages, missing security headers.
|
|
125
|
+
|
|
126
|
+
**Common misconfigurations:**
|
|
127
|
+
- Debug mode enabled in production (stack traces exposed)
|
|
128
|
+
- Default database passwords unchanged
|
|
129
|
+
- Directory listing enabled on web server
|
|
130
|
+
- Unnecessary HTTP methods enabled (TRACE, OPTIONS returning too much)
|
|
131
|
+
- Missing security headers (CSP, X-Frame-Options, X-Content-Type-Options)
|
|
132
|
+
|
|
133
|
+
**Mitigations:**
|
|
134
|
+
- Hardened configuration for each environment (dev uses relaxed settings; production uses strict settings)
|
|
135
|
+
- Remove default accounts and sample data before deployment
|
|
136
|
+
- Disable stack traces and verbose error messages in production
|
|
137
|
+
- Set security headers on all responses:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
Content-Security-Policy: default-src 'self'; script-src 'self'
|
|
141
|
+
X-Content-Type-Options: nosniff
|
|
142
|
+
X-Frame-Options: DENY
|
|
143
|
+
Strict-Transport-Security: max-age=31536000; includeSubDomains
|
|
144
|
+
Referrer-Policy: strict-origin-when-cross-origin
|
|
145
|
+
Permissions-Policy: camera=(), microphone=(), geolocation=()
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### A06: Vulnerable and Outdated Components
|
|
149
|
+
|
|
150
|
+
Using libraries with known vulnerabilities.
|
|
151
|
+
|
|
152
|
+
**Mitigations:**
|
|
153
|
+
- Run dependency audit on every CI build (`npm audit`, `pip audit`, `cargo audit`)
|
|
154
|
+
- Subscribe to security advisories for critical dependencies
|
|
155
|
+
- Update dependencies regularly (weekly for patch versions, monthly for minor)
|
|
156
|
+
- Pin dependency versions (use lockfiles: `package-lock.json`, `poetry.lock`)
|
|
157
|
+
- Remove unused dependencies
|
|
158
|
+
- Prefer dependencies with active maintenance and security response processes
|
|
159
|
+
|
|
160
|
+
### A07: Identification and Authentication Failures
|
|
161
|
+
|
|
162
|
+
Broken authentication mechanisms that allow attackers to assume identities.
|
|
163
|
+
|
|
164
|
+
**Common failures:**
|
|
165
|
+
- Permitting weak passwords ("123456", "password")
|
|
166
|
+
- Storing passwords in plaintext or with reversible encryption
|
|
167
|
+
- Missing brute-force protection
|
|
168
|
+
- Session tokens in URLs (exposed in logs and browser history)
|
|
169
|
+
- Session not invalidated after logout or password change
|
|
170
|
+
|
|
171
|
+
**Mitigations:**
|
|
172
|
+
- Enforce password complexity requirements (minimum 8 characters, no common passwords list)
|
|
173
|
+
- Hash passwords with Argon2id, bcrypt (cost factor 12+), or scrypt
|
|
174
|
+
- Rate limit login attempts (5 failures per minute per IP and per account)
|
|
175
|
+
- Implement account lockout (lock after 10 consecutive failures, unlock after 30 minutes)
|
|
176
|
+
- Invalidate all sessions when password changes
|
|
177
|
+
- Use secure, HttpOnly, SameSite cookies for session tokens
|
|
178
|
+
- Implement MFA for sensitive applications
|
|
179
|
+
|
|
180
|
+
### A08: Software and Data Integrity Failures
|
|
181
|
+
|
|
182
|
+
Code and infrastructure that doesn't verify integrity: unverified CI/CD pipelines, auto-updated dependencies, unsigned software.
|
|
183
|
+
|
|
184
|
+
**Mitigations:**
|
|
185
|
+
- Verify dependency integrity (lockfile checksums)
|
|
186
|
+
- Use signed commits for critical code paths
|
|
187
|
+
- Review CI/CD pipeline configuration changes with the same rigor as application code
|
|
188
|
+
- Don't auto-merge dependency updates without CI verification
|
|
189
|
+
- Use Subresource Integrity (SRI) for CDN-loaded scripts
|
|
190
|
+
|
|
191
|
+
### A09: Security Logging and Monitoring Failures
|
|
192
|
+
|
|
193
|
+
Insufficient logging to detect, investigate, or alert on attacks.
|
|
194
|
+
|
|
195
|
+
**What to log:**
|
|
196
|
+
- All authentication attempts (success and failure, with IP and user agent)
|
|
197
|
+
- Authorization failures (user tried to access something they shouldn't)
|
|
198
|
+
- Input validation failures (potential injection attempts)
|
|
199
|
+
- Changes to user permissions or roles
|
|
200
|
+
- Administrative actions (user creation, role changes, config changes)
|
|
201
|
+
- Application errors (5xx responses with context)
|
|
202
|
+
|
|
203
|
+
**What NEVER to log:**
|
|
204
|
+
- Passwords (even failed ones — they might be the correct password for a different account)
|
|
205
|
+
- Session tokens, API keys, or JWT tokens
|
|
206
|
+
- Credit card numbers, SSNs, or other PII
|
|
207
|
+
- Full request bodies of sensitive endpoints (login, payment)
|
|
208
|
+
|
|
209
|
+
**Log format:** Use structured logging (JSON) with correlation IDs for request tracing. Include timestamp, severity, source, action, actor, target, and result.
|
|
210
|
+
|
|
211
|
+
### A10: Server-Side Request Forgery (SSRF)
|
|
212
|
+
|
|
213
|
+
The application fetches a URL provided by the user, allowing the attacker to make requests from the server's network position (accessing internal services, cloud metadata endpoints).
|
|
214
|
+
|
|
215
|
+
**Mitigations:**
|
|
216
|
+
- Validate and whitelist allowed URL schemes (only `https://`)
|
|
217
|
+
- Block requests to internal IP ranges (10.x, 172.16-31.x, 192.168.x, 169.254.x, localhost)
|
|
218
|
+
- Block requests to cloud metadata endpoints (169.254.169.254)
|
|
219
|
+
- Use a URL parser to normalize and validate before fetching
|
|
220
|
+
- Run URL-fetching services in an isolated network segment
|
|
221
|
+
|
|
222
|
+
## Authentication Patterns
|
|
223
|
+
|
|
224
|
+
### Session-Based Authentication
|
|
225
|
+
|
|
226
|
+
**How it works:**
|
|
227
|
+
1. User submits credentials
|
|
228
|
+
2. Server validates credentials, creates a session record (in database or Redis)
|
|
229
|
+
3. Server sends a session ID in a Set-Cookie header (HttpOnly, Secure, SameSite)
|
|
230
|
+
4. Browser automatically sends the cookie on subsequent requests
|
|
231
|
+
5. Server looks up the session record to identify the user
|
|
232
|
+
|
|
233
|
+
**When to use:** Server-rendered web applications, applications where the backend controls the frontend.
|
|
234
|
+
|
|
235
|
+
**Security requirements:**
|
|
236
|
+
- Session IDs must be cryptographically random (128+ bits of entropy)
|
|
237
|
+
- Store sessions server-side (never trust session data stored client-side)
|
|
238
|
+
- Set cookie flags: `HttpOnly` (no JavaScript access), `Secure` (HTTPS only), `SameSite=Lax` or `Strict` (CSRF protection)
|
|
239
|
+
- Rotate session ID after login (prevent session fixation)
|
|
240
|
+
- Set session expiration (absolute timeout: 24 hours, idle timeout: 30 minutes)
|
|
241
|
+
- Invalidate sessions on logout, password change, and privilege change
|
|
242
|
+
|
|
243
|
+
### JWT Authentication
|
|
244
|
+
|
|
245
|
+
**How it works:**
|
|
246
|
+
1. User submits credentials
|
|
247
|
+
2. Server validates credentials, generates a signed JWT containing claims (user ID, roles, expiration)
|
|
248
|
+
3. Server returns the JWT in the response body
|
|
249
|
+
4. Client stores the JWT (typically in memory, NOT in localStorage)
|
|
250
|
+
5. Client sends the JWT in the `Authorization: Bearer <token>` header on each request
|
|
251
|
+
6. Server validates the JWT signature and extracts claims
|
|
252
|
+
|
|
253
|
+
**When to use:** API-first applications, SPAs, mobile apps, microservices where session sharing is impractical.
|
|
254
|
+
|
|
255
|
+
**Security requirements:**
|
|
256
|
+
- Sign with a strong algorithm (RS256 or ES256, not HS256 with a weak secret)
|
|
257
|
+
- Set short expiration (15-60 minutes)
|
|
258
|
+
- Use refresh tokens (stored HttpOnly cookie) for re-authentication
|
|
259
|
+
- Never store JWTs in localStorage (XSS-accessible) — use HttpOnly cookies or in-memory only
|
|
260
|
+
- Include only necessary claims (don't put sensitive data in the payload — it's base64, not encrypted)
|
|
261
|
+
- Validate the token on every request (signature, expiration, issuer, audience)
|
|
262
|
+
|
|
263
|
+
### Multi-Factor Authentication (MFA)
|
|
264
|
+
|
|
265
|
+
Add MFA for any application that handles sensitive data, financial transactions, or administrative actions.
|
|
266
|
+
|
|
267
|
+
**Implementation options:**
|
|
268
|
+
- TOTP (Time-based One-Time Password) via authenticator apps (Google Authenticator, Authy)
|
|
269
|
+
- WebAuthn / FIDO2 hardware keys (strongest, best UX)
|
|
270
|
+
- SMS codes (weakest — vulnerable to SIM swapping, but better than nothing)
|
|
271
|
+
- Email codes (moderate — depends on email security)
|
|
272
|
+
|
|
273
|
+
**Recovery:** Always provide recovery codes (one-time use) in case the user loses their MFA device.
|
|
274
|
+
|
|
275
|
+
## Authorization Patterns
|
|
276
|
+
|
|
277
|
+
### Role-Based Access Control (RBAC)
|
|
278
|
+
|
|
279
|
+
Users are assigned roles. Roles have permissions. Authorization checks whether the user's role has the required permission.
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
User: alice@example.com
|
|
283
|
+
Role: admin
|
|
284
|
+
Permissions: users:read, users:write, users:delete, orders:read, orders:write
|
|
285
|
+
|
|
286
|
+
User: bob@example.com
|
|
287
|
+
Role: member
|
|
288
|
+
Permissions: orders:read, orders:write (own orders only)
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Best for:** Most applications. Simple to implement, easy to understand, covers 80% of authorization needs.
|
|
292
|
+
|
|
293
|
+
### Attribute-Based Access Control (ABAC)
|
|
294
|
+
|
|
295
|
+
Authorization decisions based on attributes of the user, the resource, and the context.
|
|
296
|
+
|
|
297
|
+
**Example policy:**
|
|
298
|
+
- User can read a document if: user.department == document.department AND document.classification <= user.clearanceLevel
|
|
299
|
+
- User can modify a resource if: user.id == resource.ownerId OR user.role == 'admin'
|
|
300
|
+
|
|
301
|
+
**Best for:** Complex authorization requirements that RBAC can't express cleanly (multi-tenancy, data classification, time-based access).
|
|
302
|
+
|
|
303
|
+
### Resource-Level Permissions
|
|
304
|
+
|
|
305
|
+
Authorization checks that verify the user can access a specific resource instance, not just the resource type.
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
// Type-level: "Can this user access orders?" — Role check
|
|
309
|
+
// Instance-level: "Can this user access THIS order?" — Ownership check
|
|
310
|
+
|
|
311
|
+
async function authorizeOrderAccess(userId: string, orderId: string): boolean {
|
|
312
|
+
const order = await db.orders.findById(orderId);
|
|
313
|
+
return order && (order.userId === userId || await isAdmin(userId));
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Always implement instance-level checks for user-owned resources. Type-level checks alone allow users to access each other's data.
|
|
318
|
+
|
|
319
|
+
## Data Protection
|
|
320
|
+
|
|
321
|
+
### Encryption at Rest
|
|
322
|
+
|
|
323
|
+
Sensitive data stored in databases, files, or backups should be encrypted:
|
|
324
|
+
|
|
325
|
+
- **Database-level encryption:** Transparent Data Encryption (TDE) encrypts the entire database. No application changes needed. Protects against physical storage theft.
|
|
326
|
+
- **Column-level encryption:** Encrypt specific sensitive columns (SSN, credit card). Application decrypts as needed. More granular control.
|
|
327
|
+
- **Backup encryption:** All database backups and file exports must be encrypted. An unencrypted backup negates database encryption.
|
|
328
|
+
|
|
329
|
+
### Encryption in Transit
|
|
330
|
+
|
|
331
|
+
All network communication should use TLS:
|
|
332
|
+
|
|
333
|
+
- **HTTPS everywhere:** No HTTP endpoints, no mixed content
|
|
334
|
+
- **TLS version:** 1.2 minimum, 1.3 preferred
|
|
335
|
+
- **HSTS header:** Force HTTPS for all future requests: `Strict-Transport-Security: max-age=31536000; includeSubDomains`
|
|
336
|
+
- **Internal services:** Use TLS for service-to-service communication too, not just client-facing
|
|
337
|
+
|
|
338
|
+
### PII Handling
|
|
339
|
+
|
|
340
|
+
Personally Identifiable Information requires special handling:
|
|
341
|
+
|
|
342
|
+
- **Inventory:** Know what PII you store and where (data mapping exercise)
|
|
343
|
+
- **Minimization:** Don't collect PII you don't need
|
|
344
|
+
- **Retention:** Define how long you keep PII and what triggers deletion
|
|
345
|
+
- **Access logging:** Log who accessed PII and when
|
|
346
|
+
- **Right to deletion:** Implement user data deletion (GDPR Article 17, CCPA)
|
|
347
|
+
- **Pseudonymization:** Replace identifying data with pseudonyms where full PII isn't needed
|
|
348
|
+
|
|
349
|
+
### Data Classification
|
|
350
|
+
|
|
351
|
+
Classify all data by sensitivity:
|
|
352
|
+
|
|
353
|
+
| Level | Examples | Controls |
|
|
354
|
+
|-------|---------|----------|
|
|
355
|
+
| Public | Marketing content, public API docs | No restrictions |
|
|
356
|
+
| Internal | Internal metrics, non-PII user data | Authentication required |
|
|
357
|
+
| Confidential | PII, financial data, health data | Encryption, access logging, retention policy |
|
|
358
|
+
| Restricted | Passwords, encryption keys, API secrets | Encryption, strict access control, rotation |
|
|
359
|
+
|
|
360
|
+
## Secrets Management
|
|
361
|
+
|
|
362
|
+
### Environment Variables
|
|
363
|
+
|
|
364
|
+
The simplest secrets management: store secrets in environment variables, never in code.
|
|
365
|
+
|
|
366
|
+
**Rules:**
|
|
367
|
+
- Never commit secrets to git (use `.gitignore` for `.env` files)
|
|
368
|
+
- Never log secrets (redact in logging middleware)
|
|
369
|
+
- Never pass secrets in URLs (URLs appear in logs, browser history, Referer headers)
|
|
370
|
+
- Use `.env.example` with placeholder values as a template
|
|
371
|
+
|
|
372
|
+
### Vault Systems
|
|
373
|
+
|
|
374
|
+
For production environments, use a dedicated secrets manager:
|
|
375
|
+
|
|
376
|
+
- **Cloud-native:** AWS Secrets Manager, Google Secret Manager, Azure Key Vault
|
|
377
|
+
- **Self-hosted:** HashiCorp Vault, Infisical, Doppler
|
|
378
|
+
|
|
379
|
+
**Benefits over environment variables:**
|
|
380
|
+
- Access control and audit logging
|
|
381
|
+
- Automatic rotation
|
|
382
|
+
- Dynamic secrets (database credentials generated on demand)
|
|
383
|
+
- Encryption at rest and in transit
|
|
384
|
+
|
|
385
|
+
### Key Rotation
|
|
386
|
+
|
|
387
|
+
Secrets should be rotatable without downtime:
|
|
388
|
+
|
|
389
|
+
- **JWT signing keys:** Support multiple active keys. Add new key, start signing with it, keep old key for validation during transition, remove old key after all tokens expire.
|
|
390
|
+
- **API keys:** Issue new key, update consumers, revoke old key.
|
|
391
|
+
- **Database passwords:** Update the secret store, restart application (zero-downtime if using connection pool draining).
|
|
392
|
+
- **Encryption keys:** Re-encrypt data with new key during a migration. Support decrypting with both old and new keys during transition.
|
|
393
|
+
|
|
394
|
+
### Never Commit Secrets
|
|
395
|
+
|
|
396
|
+
Prevent accidental secret commits:
|
|
397
|
+
|
|
398
|
+
- Add `.env`, `*.pem`, `*.key` to `.gitignore`
|
|
399
|
+
- Use pre-commit hooks to scan for secrets (git-secrets, detect-secrets, gitleaks)
|
|
400
|
+
- Run secret scanning in CI (GitHub secret scanning, TruffleHog)
|
|
401
|
+
- If a secret is committed: rotate it immediately (assume it's compromised), remove from history with `git filter-branch` or BFG Repo Cleaner
|
|
402
|
+
|
|
403
|
+
## Threat Modeling
|
|
404
|
+
|
|
405
|
+
### STRIDE Model
|
|
406
|
+
|
|
407
|
+
Analyze threats using the STRIDE categories:
|
|
408
|
+
|
|
409
|
+
| Category | Threat | Example | Mitigation |
|
|
410
|
+
|----------|--------|---------|------------|
|
|
411
|
+
| **S**poofing | Attacker impersonates a user | Stolen credentials | MFA, strong password policy |
|
|
412
|
+
| **T**ampering | Attacker modifies data | Man-in-the-middle attack | TLS, input validation, integrity checks |
|
|
413
|
+
| **R**epudiation | User denies performing an action | "I didn't delete that" | Audit logging, non-repudiation |
|
|
414
|
+
| **I**nformation Disclosure | Sensitive data exposed | Database dump leaked | Encryption, access control, data classification |
|
|
415
|
+
| **D**enial of Service | Service made unavailable | DDoS attack | Rate limiting, CDN, auto-scaling |
|
|
416
|
+
| **E**levation of Privilege | User gains unauthorized access | SQL injection to admin | Input validation, principle of least privilege |
|
|
417
|
+
|
|
418
|
+
### Attack Surface Analysis
|
|
419
|
+
|
|
420
|
+
Enumerate all entry points where attackers can interact with the system:
|
|
421
|
+
|
|
422
|
+
- **Network:** HTTP endpoints, WebSocket connections, database ports
|
|
423
|
+
- **Data inputs:** Form fields, URL parameters, headers, file uploads, API request bodies
|
|
424
|
+
- **Authentication:** Login page, password reset, API key endpoints, OAuth callbacks
|
|
425
|
+
- **Infrastructure:** Admin panels, monitoring endpoints, health checks, CI/CD webhooks
|
|
426
|
+
|
|
427
|
+
For each entry point, assess: what could an attacker do? What data could they access? What operations could they trigger?
|
|
428
|
+
|
|
429
|
+
### Trust Boundaries
|
|
430
|
+
|
|
431
|
+
Identify where trust levels change:
|
|
432
|
+
|
|
433
|
+
- **Browser to server:** User input is untrusted. Validate everything.
|
|
434
|
+
- **Server to database:** Application code is trusted. Database constraints are the last line of defense.
|
|
435
|
+
- **Server to external API:** External API responses are partially trusted. Validate response shapes.
|
|
436
|
+
- **Internal service to internal service:** Trust level depends on network isolation. In a shared network, verify identity.
|
|
437
|
+
|
|
438
|
+
### Data Flow Analysis for Threats
|
|
439
|
+
|
|
440
|
+
Trace sensitive data through the system and identify exposure points:
|
|
441
|
+
|
|
442
|
+
```
|
|
443
|
+
User enters password
|
|
444
|
+
-> HTTPS to API server (encrypted in transit: OK)
|
|
445
|
+
-> Validation middleware (password in memory: OK, brief)
|
|
446
|
+
-> Auth service (hashed with bcrypt: OK)
|
|
447
|
+
-> Database (stored as hash: OK)
|
|
448
|
+
-> Backup system (encrypted backup: OK)
|
|
449
|
+
-> Log system (THREAT: is password logged? Must not be!)
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
For each sensitive data flow, verify:
|
|
453
|
+
- Is it encrypted in transit?
|
|
454
|
+
- Is it encrypted at rest?
|
|
455
|
+
- Who can access it? (Users, admins, services, backup systems, log systems)
|
|
456
|
+
- How long is it retained?
|
|
457
|
+
- How is it deleted?
|
|
458
|
+
|
|
459
|
+
## Dependency Auditing
|
|
460
|
+
|
|
461
|
+
### Known Vulnerability Scanning
|
|
462
|
+
|
|
463
|
+
Run automated vulnerability scanning on every CI build:
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
# Node.js
|
|
467
|
+
npm audit --audit-level=high
|
|
468
|
+
|
|
469
|
+
# Python
|
|
470
|
+
pip audit
|
|
471
|
+
|
|
472
|
+
# Go
|
|
473
|
+
govulncheck ./...
|
|
474
|
+
|
|
475
|
+
# Rust
|
|
476
|
+
cargo audit
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**Policy:**
|
|
480
|
+
- **Critical vulnerabilities:** Block merge. Fix immediately.
|
|
481
|
+
- **High vulnerabilities:** Block merge. Fix within 24 hours.
|
|
482
|
+
- **Medium vulnerabilities:** Warning. Fix within one sprint.
|
|
483
|
+
- **Low vulnerabilities:** Track. Fix when convenient.
|
|
484
|
+
|
|
485
|
+
### License Compliance
|
|
486
|
+
|
|
487
|
+
Verify that dependency licenses permit your intended use:
|
|
488
|
+
|
|
489
|
+
**Generally safe:** MIT, Apache 2.0, BSD, ISC
|
|
490
|
+
|
|
491
|
+
**Requires attention:** LGPL (linking restrictions), MPL (file-level copyleft)
|
|
492
|
+
|
|
493
|
+
**Potentially problematic:** GPL (copyleft — entire project must be GPL), AGPL (network use triggers copyleft), SSPL (commercial use restrictions)
|
|
494
|
+
|
|
495
|
+
**No license:** Treat as all rights reserved — do not use without explicit permission.
|
|
496
|
+
|
|
497
|
+
### Supply Chain Security
|
|
498
|
+
|
|
499
|
+
Protect against compromised dependencies:
|
|
500
|
+
|
|
501
|
+
- **Lockfiles:** Always commit lockfiles. They pin exact versions and include integrity hashes.
|
|
502
|
+
- **Verify checksums:** `npm ci` (not `npm install`) verifies against lockfile checksums.
|
|
503
|
+
- **Review dependency changes:** When updating, check the changelog and diff for unexpected changes.
|
|
504
|
+
- **Minimize dependencies:** Fewer dependencies mean less attack surface. Consider whether you really need that utility library.
|
|
505
|
+
- **Monitor for compromised packages:** Subscribe to security advisories for critical dependencies. Watch for maintainer account takeovers.
|
|
506
|
+
|
|
507
|
+
## Common Pitfalls
|
|
508
|
+
|
|
509
|
+
**Authentication as afterthought.** Building all endpoints without auth, then adding it at the end. This leaves forgotten endpoints unprotected and creates inconsistent auth patterns. Fix: design auth requirements for every endpoint during API design. Implement auth middleware before any endpoint handlers.
|
|
510
|
+
|
|
511
|
+
**Overly permissive defaults.** Default user role has admin access, default CORS allows all origins, default rate limits are too generous. Fix: deny by default. Each permission must be explicitly granted. CORS allows specific origins only. Rate limits start conservative and are relaxed based on monitoring.
|
|
512
|
+
|
|
513
|
+
**Missing input validation at boundaries.** Trusting that the frontend validates input, so the backend skips validation. Fix: validate at every trust boundary. Frontend validation is a UX convenience; backend validation is a security requirement.
|
|
514
|
+
|
|
515
|
+
**Logging sensitive data.** Request logging that includes passwords, tokens, or PII in the log files. Fix: implement a logging middleware that redacts sensitive fields before logging. Test that redaction works.
|
|
516
|
+
|
|
517
|
+
**Storing secrets in git.** An API key committed in the first commit, now buried in git history. Fix: use git-secrets or gitleaks in pre-commit hooks. If a secret is committed, rotate it immediately — removing it from git history is not sufficient because it may have been cloned.
|
|
518
|
+
|
|
519
|
+
**Relying on security through obscurity.** "Nobody will find the admin endpoint at /api/sekrit-admin." Fix: assume attackers will find every endpoint. Every endpoint must have proper authentication and authorization regardless of its discoverability.
|
|
520
|
+
|
|
521
|
+
**No rate limiting.** Login endpoints with unlimited attempts allow brute-force password attacks. API endpoints with no rate limits allow denial of service. Fix: implement rate limiting on all public endpoints. Start with conservative limits. Use exponential backoff for authentication failures.
|
|
522
|
+
|
|
523
|
+
**Ignoring dependency vulnerabilities.** Running `npm audit` shows 47 vulnerabilities but nobody addresses them because "they're all low severity." Fix: set a policy and enforce it in CI. Critical and high vulnerabilities block deployment. Medium vulnerabilities have a SLA for resolution.
|