@wazir-dev/cli 1.0.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/AGENTS.md +111 -0
- package/CHANGELOG.md +14 -0
- package/CONTRIBUTING.md +101 -0
- package/LICENSE +21 -0
- package/README.md +314 -0
- package/assets/composition-engine.mmd +34 -0
- package/assets/demo-script.sh +17 -0
- package/assets/logo-dark.svg +14 -0
- package/assets/logo.svg +14 -0
- package/assets/pipeline.mmd +39 -0
- package/assets/record-demo.sh +51 -0
- package/docs/README.md +51 -0
- package/docs/adapters/context-mode.md +60 -0
- package/docs/concepts/architecture.md +87 -0
- package/docs/concepts/artifact-model.md +60 -0
- package/docs/concepts/composition-engine.md +36 -0
- package/docs/concepts/indexing-and-recall.md +160 -0
- package/docs/concepts/observability.md +41 -0
- package/docs/concepts/roles-and-workflows.md +59 -0
- package/docs/concepts/terminology-policy.md +27 -0
- package/docs/getting-started/01-installation.md +78 -0
- package/docs/getting-started/02-first-run.md +102 -0
- package/docs/getting-started/03-adding-to-project.md +15 -0
- package/docs/getting-started/04-host-setup.md +15 -0
- package/docs/guides/ci-integration.md +15 -0
- package/docs/guides/creating-skills.md +15 -0
- package/docs/guides/expertise-module-authoring.md +15 -0
- package/docs/guides/hook-development.md +15 -0
- package/docs/guides/memory-and-learnings.md +34 -0
- package/docs/guides/multi-host-export.md +15 -0
- package/docs/guides/troubleshooting.md +101 -0
- package/docs/guides/writing-custom-roles.md +15 -0
- package/docs/plans/2026-03-15-cli-pipeline-integration-design.md +592 -0
- package/docs/plans/2026-03-15-cli-pipeline-integration-plan.md +598 -0
- package/docs/plans/2026-03-15-docs-enforcement-plan.md +238 -0
- package/docs/readmes/INDEX.md +99 -0
- package/docs/readmes/features/expertise/README.md +171 -0
- package/docs/readmes/features/exports/README.md +222 -0
- package/docs/readmes/features/hooks/README.md +103 -0
- package/docs/readmes/features/hooks/loop-cap-guard.md +133 -0
- package/docs/readmes/features/hooks/post-tool-capture.md +121 -0
- package/docs/readmes/features/hooks/post-tool-lint.md +130 -0
- package/docs/readmes/features/hooks/pre-compact-summary.md +122 -0
- package/docs/readmes/features/hooks/pre-tool-capture-route.md +100 -0
- package/docs/readmes/features/hooks/protected-path-write-guard.md +128 -0
- package/docs/readmes/features/hooks/session-start.md +119 -0
- package/docs/readmes/features/hooks/stop-handoff-harvest.md +125 -0
- package/docs/readmes/features/roles/README.md +157 -0
- package/docs/readmes/features/roles/clarifier.md +152 -0
- package/docs/readmes/features/roles/content-author.md +190 -0
- package/docs/readmes/features/roles/designer.md +193 -0
- package/docs/readmes/features/roles/executor.md +184 -0
- package/docs/readmes/features/roles/learner.md +210 -0
- package/docs/readmes/features/roles/planner.md +182 -0
- package/docs/readmes/features/roles/researcher.md +164 -0
- package/docs/readmes/features/roles/reviewer.md +184 -0
- package/docs/readmes/features/roles/specifier.md +162 -0
- package/docs/readmes/features/roles/verifier.md +215 -0
- package/docs/readmes/features/schemas/README.md +178 -0
- package/docs/readmes/features/skills/README.md +63 -0
- package/docs/readmes/features/skills/brainstorming.md +96 -0
- package/docs/readmes/features/skills/debugging.md +148 -0
- package/docs/readmes/features/skills/design.md +120 -0
- package/docs/readmes/features/skills/prepare-next.md +109 -0
- package/docs/readmes/features/skills/run-audit.md +159 -0
- package/docs/readmes/features/skills/scan-project.md +109 -0
- package/docs/readmes/features/skills/self-audit.md +176 -0
- package/docs/readmes/features/skills/tdd.md +137 -0
- package/docs/readmes/features/skills/using-skills.md +92 -0
- package/docs/readmes/features/skills/verification.md +120 -0
- package/docs/readmes/features/skills/writing-plans.md +104 -0
- package/docs/readmes/features/tooling/README.md +320 -0
- package/docs/readmes/features/workflows/README.md +186 -0
- package/docs/readmes/features/workflows/author.md +181 -0
- package/docs/readmes/features/workflows/clarify.md +154 -0
- package/docs/readmes/features/workflows/design-review.md +171 -0
- package/docs/readmes/features/workflows/design.md +169 -0
- package/docs/readmes/features/workflows/discover.md +162 -0
- package/docs/readmes/features/workflows/execute.md +173 -0
- package/docs/readmes/features/workflows/learn.md +167 -0
- package/docs/readmes/features/workflows/plan-review.md +165 -0
- package/docs/readmes/features/workflows/plan.md +170 -0
- package/docs/readmes/features/workflows/prepare-next.md +167 -0
- package/docs/readmes/features/workflows/review.md +169 -0
- package/docs/readmes/features/workflows/run-audit.md +191 -0
- package/docs/readmes/features/workflows/spec-challenge.md +159 -0
- package/docs/readmes/features/workflows/specify.md +160 -0
- package/docs/readmes/features/workflows/verify.md +177 -0
- package/docs/readmes/packages/README.md +50 -0
- package/docs/readmes/packages/ajv.md +117 -0
- package/docs/readmes/packages/context-mode.md +118 -0
- package/docs/readmes/packages/gray-matter.md +116 -0
- package/docs/readmes/packages/node-test.md +137 -0
- package/docs/readmes/packages/yaml.md +112 -0
- package/docs/reference/configuration-reference.md +159 -0
- package/docs/reference/expertise-index.md +52 -0
- package/docs/reference/git-flow.md +43 -0
- package/docs/reference/hooks.md +87 -0
- package/docs/reference/host-exports.md +50 -0
- package/docs/reference/launch-checklist.md +172 -0
- package/docs/reference/marketplace-listings.md +76 -0
- package/docs/reference/release-process.md +34 -0
- package/docs/reference/roles-reference.md +77 -0
- package/docs/reference/skills.md +33 -0
- package/docs/reference/templates.md +29 -0
- package/docs/reference/tooling-cli.md +94 -0
- package/docs/truth-claims.yaml +222 -0
- package/expertise/PROGRESS.md +63 -0
- package/expertise/README.md +18 -0
- package/expertise/antipatterns/PROGRESS.md +56 -0
- package/expertise/antipatterns/backend/api-design-antipatterns.md +1271 -0
- package/expertise/antipatterns/backend/auth-antipatterns.md +1195 -0
- package/expertise/antipatterns/backend/caching-antipatterns.md +622 -0
- package/expertise/antipatterns/backend/database-antipatterns.md +1038 -0
- package/expertise/antipatterns/backend/index.md +24 -0
- package/expertise/antipatterns/backend/microservices-antipatterns.md +850 -0
- package/expertise/antipatterns/code/architecture-antipatterns.md +919 -0
- package/expertise/antipatterns/code/async-antipatterns.md +622 -0
- package/expertise/antipatterns/code/code-smells.md +1186 -0
- package/expertise/antipatterns/code/dependency-antipatterns.md +1209 -0
- package/expertise/antipatterns/code/error-handling-antipatterns.md +1360 -0
- package/expertise/antipatterns/code/index.md +27 -0
- package/expertise/antipatterns/code/naming-and-abstraction.md +1118 -0
- package/expertise/antipatterns/code/state-management-antipatterns.md +1076 -0
- package/expertise/antipatterns/code/testing-antipatterns.md +1053 -0
- package/expertise/antipatterns/design/accessibility-antipatterns.md +1136 -0
- package/expertise/antipatterns/design/dark-patterns.md +1121 -0
- package/expertise/antipatterns/design/index.md +22 -0
- package/expertise/antipatterns/design/ui-antipatterns.md +1202 -0
- package/expertise/antipatterns/design/ux-antipatterns.md +680 -0
- package/expertise/antipatterns/frontend/css-layout-antipatterns.md +691 -0
- package/expertise/antipatterns/frontend/flutter-antipatterns.md +1827 -0
- package/expertise/antipatterns/frontend/index.md +23 -0
- package/expertise/antipatterns/frontend/mobile-antipatterns.md +573 -0
- package/expertise/antipatterns/frontend/react-antipatterns.md +1128 -0
- package/expertise/antipatterns/frontend/spa-antipatterns.md +1235 -0
- package/expertise/antipatterns/index.md +31 -0
- package/expertise/antipatterns/performance/index.md +20 -0
- package/expertise/antipatterns/performance/performance-antipatterns.md +1013 -0
- package/expertise/antipatterns/performance/premature-optimization.md +623 -0
- package/expertise/antipatterns/performance/scaling-antipatterns.md +785 -0
- package/expertise/antipatterns/process/ai-coding-antipatterns.md +853 -0
- package/expertise/antipatterns/process/code-review-antipatterns.md +656 -0
- package/expertise/antipatterns/process/deployment-antipatterns.md +920 -0
- package/expertise/antipatterns/process/index.md +23 -0
- package/expertise/antipatterns/process/technical-debt-antipatterns.md +647 -0
- package/expertise/antipatterns/security/index.md +20 -0
- package/expertise/antipatterns/security/secrets-antipatterns.md +849 -0
- package/expertise/antipatterns/security/security-theater.md +843 -0
- package/expertise/antipatterns/security/vulnerability-patterns.md +801 -0
- package/expertise/architecture/PROGRESS.md +70 -0
- package/expertise/architecture/data/caching-architecture.md +671 -0
- package/expertise/architecture/data/data-consistency.md +574 -0
- package/expertise/architecture/data/data-modeling.md +536 -0
- package/expertise/architecture/data/event-streams-and-queues.md +634 -0
- package/expertise/architecture/data/index.md +25 -0
- package/expertise/architecture/data/search-architecture.md +663 -0
- package/expertise/architecture/data/sql-vs-nosql.md +708 -0
- package/expertise/architecture/decisions/architecture-decision-records.md +640 -0
- package/expertise/architecture/decisions/build-vs-buy.md +616 -0
- package/expertise/architecture/decisions/index.md +23 -0
- package/expertise/architecture/decisions/monolith-to-microservices.md +790 -0
- package/expertise/architecture/decisions/technology-selection.md +616 -0
- package/expertise/architecture/distributed/cap-theorem-and-tradeoffs.md +800 -0
- package/expertise/architecture/distributed/circuit-breaker-bulkhead.md +741 -0
- package/expertise/architecture/distributed/consensus-and-coordination.md +796 -0
- package/expertise/architecture/distributed/distributed-systems-fundamentals.md +564 -0
- package/expertise/architecture/distributed/idempotency-and-retry.md +796 -0
- package/expertise/architecture/distributed/index.md +25 -0
- package/expertise/architecture/distributed/saga-pattern.md +797 -0
- package/expertise/architecture/foundations/architectural-thinking.md +460 -0
- package/expertise/architecture/foundations/coupling-and-cohesion.md +770 -0
- package/expertise/architecture/foundations/design-principles-solid.md +649 -0
- package/expertise/architecture/foundations/domain-driven-design.md +719 -0
- package/expertise/architecture/foundations/index.md +25 -0
- package/expertise/architecture/foundations/separation-of-concerns.md +472 -0
- package/expertise/architecture/foundations/twelve-factor-app.md +797 -0
- package/expertise/architecture/index.md +34 -0
- package/expertise/architecture/integration/api-design-graphql.md +638 -0
- package/expertise/architecture/integration/api-design-grpc.md +804 -0
- package/expertise/architecture/integration/api-design-rest.md +892 -0
- package/expertise/architecture/integration/index.md +25 -0
- package/expertise/architecture/integration/third-party-integration.md +795 -0
- package/expertise/architecture/integration/webhooks-and-callbacks.md +1152 -0
- package/expertise/architecture/integration/websockets-realtime.md +791 -0
- package/expertise/architecture/mobile-architecture/index.md +22 -0
- package/expertise/architecture/mobile-architecture/mobile-app-architecture.md +780 -0
- package/expertise/architecture/mobile-architecture/mobile-backend-for-frontend.md +670 -0
- package/expertise/architecture/mobile-architecture/offline-first.md +719 -0
- package/expertise/architecture/mobile-architecture/push-and-sync.md +782 -0
- package/expertise/architecture/patterns/cqrs-event-sourcing.md +717 -0
- package/expertise/architecture/patterns/event-driven.md +797 -0
- package/expertise/architecture/patterns/hexagonal-clean-architecture.md +870 -0
- package/expertise/architecture/patterns/index.md +27 -0
- package/expertise/architecture/patterns/layered-architecture.md +736 -0
- package/expertise/architecture/patterns/microservices.md +753 -0
- package/expertise/architecture/patterns/modular-monolith.md +692 -0
- package/expertise/architecture/patterns/monolith.md +626 -0
- package/expertise/architecture/patterns/plugin-architecture.md +735 -0
- package/expertise/architecture/patterns/serverless.md +780 -0
- package/expertise/architecture/scaling/database-scaling.md +615 -0
- package/expertise/architecture/scaling/feature-flags-and-rollouts.md +757 -0
- package/expertise/architecture/scaling/horizontal-vs-vertical.md +606 -0
- package/expertise/architecture/scaling/index.md +24 -0
- package/expertise/architecture/scaling/multi-tenancy.md +800 -0
- package/expertise/architecture/scaling/stateless-design.md +787 -0
- package/expertise/backend/embedded-firmware.md +625 -0
- package/expertise/backend/go.md +853 -0
- package/expertise/backend/index.md +24 -0
- package/expertise/backend/java-spring.md +448 -0
- package/expertise/backend/node-typescript.md +625 -0
- package/expertise/backend/python-fastapi.md +724 -0
- package/expertise/backend/rust.md +458 -0
- package/expertise/backend/solidity.md +711 -0
- package/expertise/composition-map.yaml +443 -0
- package/expertise/content/foundations/content-modeling.md +395 -0
- package/expertise/content/foundations/editorial-standards.md +449 -0
- package/expertise/content/foundations/index.md +24 -0
- package/expertise/content/foundations/microcopy.md +455 -0
- package/expertise/content/foundations/terminology-governance.md +509 -0
- package/expertise/content/index.md +34 -0
- package/expertise/content/patterns/accessibility-copy.md +518 -0
- package/expertise/content/patterns/index.md +24 -0
- package/expertise/content/patterns/notification-content.md +433 -0
- package/expertise/content/patterns/sample-content.md +486 -0
- package/expertise/content/patterns/state-copy.md +439 -0
- package/expertise/design/PROGRESS.md +58 -0
- package/expertise/design/disciplines/dark-mode-theming.md +577 -0
- package/expertise/design/disciplines/design-systems.md +595 -0
- package/expertise/design/disciplines/index.md +25 -0
- package/expertise/design/disciplines/information-architecture.md +800 -0
- package/expertise/design/disciplines/interaction-design.md +788 -0
- package/expertise/design/disciplines/responsive-design.md +552 -0
- package/expertise/design/disciplines/usability-testing.md +516 -0
- package/expertise/design/disciplines/user-research.md +792 -0
- package/expertise/design/foundations/accessibility-design.md +796 -0
- package/expertise/design/foundations/color-theory.md +797 -0
- package/expertise/design/foundations/iconography.md +795 -0
- package/expertise/design/foundations/index.md +26 -0
- package/expertise/design/foundations/motion-and-animation.md +653 -0
- package/expertise/design/foundations/rtl-design.md +585 -0
- package/expertise/design/foundations/spacing-and-layout.md +607 -0
- package/expertise/design/foundations/typography.md +800 -0
- package/expertise/design/foundations/visual-hierarchy.md +761 -0
- package/expertise/design/index.md +32 -0
- package/expertise/design/patterns/authentication-flows.md +474 -0
- package/expertise/design/patterns/content-consumption.md +789 -0
- package/expertise/design/patterns/data-display.md +618 -0
- package/expertise/design/patterns/e-commerce.md +1494 -0
- package/expertise/design/patterns/feedback-and-states.md +642 -0
- package/expertise/design/patterns/forms-and-input.md +819 -0
- package/expertise/design/patterns/gamification.md +801 -0
- package/expertise/design/patterns/index.md +31 -0
- package/expertise/design/patterns/microinteractions.md +449 -0
- package/expertise/design/patterns/navigation.md +800 -0
- package/expertise/design/patterns/notifications.md +705 -0
- package/expertise/design/patterns/onboarding.md +700 -0
- package/expertise/design/patterns/search-and-filter.md +601 -0
- package/expertise/design/patterns/settings-and-preferences.md +768 -0
- package/expertise/design/patterns/social-and-community.md +748 -0
- package/expertise/design/platforms/desktop-native.md +612 -0
- package/expertise/design/platforms/index.md +25 -0
- package/expertise/design/platforms/mobile-android.md +825 -0
- package/expertise/design/platforms/mobile-cross-platform.md +983 -0
- package/expertise/design/platforms/mobile-ios.md +699 -0
- package/expertise/design/platforms/tablet.md +794 -0
- package/expertise/design/platforms/web-dashboard.md +790 -0
- package/expertise/design/platforms/web-responsive.md +550 -0
- package/expertise/design/psychology/behavioral-nudges.md +449 -0
- package/expertise/design/psychology/cognitive-load.md +1191 -0
- package/expertise/design/psychology/error-psychology.md +778 -0
- package/expertise/design/psychology/index.md +22 -0
- package/expertise/design/psychology/persuasive-design.md +736 -0
- package/expertise/design/psychology/user-mental-models.md +623 -0
- package/expertise/design/tooling/open-pencil.md +266 -0
- package/expertise/frontend/angular.md +1073 -0
- package/expertise/frontend/desktop-electron.md +546 -0
- package/expertise/frontend/flutter.md +782 -0
- package/expertise/frontend/index.md +27 -0
- package/expertise/frontend/native-android.md +409 -0
- package/expertise/frontend/native-ios.md +490 -0
- package/expertise/frontend/react-native.md +1160 -0
- package/expertise/frontend/react.md +808 -0
- package/expertise/frontend/vue.md +1089 -0
- package/expertise/humanize/domain-rules-code.md +79 -0
- package/expertise/humanize/domain-rules-content.md +67 -0
- package/expertise/humanize/domain-rules-technical-docs.md +56 -0
- package/expertise/humanize/index.md +35 -0
- package/expertise/humanize/self-audit-checklist.md +87 -0
- package/expertise/humanize/sentence-patterns.md +218 -0
- package/expertise/humanize/vocabulary-blacklist.md +105 -0
- package/expertise/i18n/PROGRESS.md +65 -0
- package/expertise/i18n/advanced/accessibility-and-i18n.md +28 -0
- package/expertise/i18n/advanced/bidirectional-text-algorithm.md +38 -0
- package/expertise/i18n/advanced/complex-scripts.md +30 -0
- package/expertise/i18n/advanced/performance-and-i18n.md +27 -0
- package/expertise/i18n/advanced/testing-i18n.md +28 -0
- package/expertise/i18n/content/content-adaptation.md +23 -0
- package/expertise/i18n/content/locale-specific-formatting.md +23 -0
- package/expertise/i18n/content/machine-translation-integration.md +28 -0
- package/expertise/i18n/content/translation-management.md +29 -0
- package/expertise/i18n/foundations/date-time-calendars.md +67 -0
- package/expertise/i18n/foundations/i18n-architecture.md +272 -0
- package/expertise/i18n/foundations/locale-and-language-tags.md +79 -0
- package/expertise/i18n/foundations/numbers-currency-units.md +61 -0
- package/expertise/i18n/foundations/pluralization-and-gender.md +109 -0
- package/expertise/i18n/foundations/string-externalization.md +236 -0
- package/expertise/i18n/foundations/text-direction-bidi.md +241 -0
- package/expertise/i18n/foundations/unicode-and-encoding.md +86 -0
- package/expertise/i18n/index.md +38 -0
- package/expertise/i18n/platform/backend-i18n.md +31 -0
- package/expertise/i18n/platform/flutter-i18n.md +148 -0
- package/expertise/i18n/platform/native-android-i18n.md +36 -0
- package/expertise/i18n/platform/native-ios-i18n.md +36 -0
- package/expertise/i18n/platform/react-i18n.md +103 -0
- package/expertise/i18n/platform/web-css-i18n.md +81 -0
- package/expertise/i18n/rtl/arabic-specific.md +175 -0
- package/expertise/i18n/rtl/hebrew-specific.md +149 -0
- package/expertise/i18n/rtl/rtl-animations-and-transitions.md +111 -0
- package/expertise/i18n/rtl/rtl-forms-and-input.md +161 -0
- package/expertise/i18n/rtl/rtl-fundamentals.md +211 -0
- package/expertise/i18n/rtl/rtl-icons-and-images.md +181 -0
- package/expertise/i18n/rtl/rtl-layout-mirroring.md +252 -0
- package/expertise/i18n/rtl/rtl-navigation-and-gestures.md +107 -0
- package/expertise/i18n/rtl/rtl-testing-and-qa.md +147 -0
- package/expertise/i18n/rtl/rtl-typography.md +160 -0
- package/expertise/index.md +113 -0
- package/expertise/index.yaml +216 -0
- package/expertise/infrastructure/cloud-aws.md +597 -0
- package/expertise/infrastructure/cloud-gcp.md +599 -0
- package/expertise/infrastructure/cybersecurity.md +816 -0
- package/expertise/infrastructure/database-mongodb.md +447 -0
- package/expertise/infrastructure/database-postgres.md +400 -0
- package/expertise/infrastructure/devops-cicd.md +787 -0
- package/expertise/infrastructure/index.md +27 -0
- package/expertise/performance/PROGRESS.md +50 -0
- package/expertise/performance/backend/api-latency.md +1204 -0
- package/expertise/performance/backend/background-jobs.md +506 -0
- package/expertise/performance/backend/connection-pooling.md +1209 -0
- package/expertise/performance/backend/database-query-optimization.md +515 -0
- package/expertise/performance/backend/index.md +23 -0
- package/expertise/performance/backend/rate-limiting-and-throttling.md +971 -0
- package/expertise/performance/foundations/algorithmic-complexity.md +954 -0
- package/expertise/performance/foundations/caching-strategies.md +489 -0
- package/expertise/performance/foundations/concurrency-and-parallelism.md +847 -0
- package/expertise/performance/foundations/index.md +24 -0
- package/expertise/performance/foundations/measuring-and-profiling.md +440 -0
- package/expertise/performance/foundations/memory-management.md +964 -0
- package/expertise/performance/foundations/performance-budgets.md +1314 -0
- package/expertise/performance/index.md +31 -0
- package/expertise/performance/infrastructure/auto-scaling.md +1059 -0
- package/expertise/performance/infrastructure/cdn-and-edge.md +1081 -0
- package/expertise/performance/infrastructure/index.md +22 -0
- package/expertise/performance/infrastructure/load-balancing.md +1081 -0
- package/expertise/performance/infrastructure/observability.md +1079 -0
- package/expertise/performance/mobile/index.md +23 -0
- package/expertise/performance/mobile/mobile-animations.md +544 -0
- package/expertise/performance/mobile/mobile-memory-battery.md +416 -0
- package/expertise/performance/mobile/mobile-network.md +452 -0
- package/expertise/performance/mobile/mobile-rendering.md +599 -0
- package/expertise/performance/mobile/mobile-startup-time.md +505 -0
- package/expertise/performance/platform-specific/flutter-performance.md +647 -0
- package/expertise/performance/platform-specific/index.md +22 -0
- package/expertise/performance/platform-specific/node-performance.md +1307 -0
- package/expertise/performance/platform-specific/postgres-performance.md +1366 -0
- package/expertise/performance/platform-specific/react-performance.md +1403 -0
- package/expertise/performance/web/bundle-optimization.md +1239 -0
- package/expertise/performance/web/image-and-media.md +636 -0
- package/expertise/performance/web/index.md +24 -0
- package/expertise/performance/web/network-optimization.md +1133 -0
- package/expertise/performance/web/rendering-performance.md +1098 -0
- package/expertise/performance/web/ssr-and-hydration.md +918 -0
- package/expertise/performance/web/web-vitals.md +1374 -0
- package/expertise/quality/accessibility.md +985 -0
- package/expertise/quality/evidence-based-verification.md +499 -0
- package/expertise/quality/index.md +24 -0
- package/expertise/quality/ml-model-audit.md +614 -0
- package/expertise/quality/performance.md +600 -0
- package/expertise/quality/testing-api.md +891 -0
- package/expertise/quality/testing-mobile.md +496 -0
- package/expertise/quality/testing-web.md +849 -0
- package/expertise/security/PROGRESS.md +54 -0
- package/expertise/security/agentic-identity.md +540 -0
- package/expertise/security/compliance-frameworks.md +601 -0
- package/expertise/security/data/data-encryption.md +364 -0
- package/expertise/security/data/data-privacy-gdpr.md +692 -0
- package/expertise/security/data/database-security.md +1171 -0
- package/expertise/security/data/index.md +22 -0
- package/expertise/security/data/pii-handling.md +531 -0
- package/expertise/security/foundations/authentication.md +1041 -0
- package/expertise/security/foundations/authorization.md +603 -0
- package/expertise/security/foundations/cryptography.md +1001 -0
- package/expertise/security/foundations/index.md +25 -0
- package/expertise/security/foundations/owasp-top-10.md +1354 -0
- package/expertise/security/foundations/secrets-management.md +1217 -0
- package/expertise/security/foundations/secure-sdlc.md +700 -0
- package/expertise/security/foundations/supply-chain-security.md +698 -0
- package/expertise/security/index.md +31 -0
- package/expertise/security/infrastructure/cloud-security-aws.md +1296 -0
- package/expertise/security/infrastructure/cloud-security-gcp.md +1376 -0
- package/expertise/security/infrastructure/container-security.md +721 -0
- package/expertise/security/infrastructure/incident-response.md +1295 -0
- package/expertise/security/infrastructure/index.md +24 -0
- package/expertise/security/infrastructure/logging-and-monitoring.md +1618 -0
- package/expertise/security/infrastructure/network-security.md +1337 -0
- package/expertise/security/mobile/index.md +23 -0
- package/expertise/security/mobile/mobile-android-security.md +1218 -0
- package/expertise/security/mobile/mobile-binary-protection.md +1229 -0
- package/expertise/security/mobile/mobile-data-storage.md +1265 -0
- package/expertise/security/mobile/mobile-ios-security.md +1401 -0
- package/expertise/security/mobile/mobile-network-security.md +1520 -0
- package/expertise/security/smart-contract-security.md +594 -0
- package/expertise/security/testing/index.md +22 -0
- package/expertise/security/testing/penetration-testing.md +1258 -0
- package/expertise/security/testing/security-code-review.md +1765 -0
- package/expertise/security/testing/threat-modeling.md +1074 -0
- package/expertise/security/testing/vulnerability-scanning.md +1062 -0
- package/expertise/security/web/api-security.md +586 -0
- package/expertise/security/web/cors-and-headers.md +433 -0
- package/expertise/security/web/csrf.md +562 -0
- package/expertise/security/web/file-upload.md +1477 -0
- package/expertise/security/web/index.md +25 -0
- package/expertise/security/web/injection.md +1375 -0
- package/expertise/security/web/session-management.md +1101 -0
- package/expertise/security/web/xss.md +1158 -0
- package/exports/README.md +17 -0
- package/exports/hosts/claude/.claude/agents/clarifier.md +42 -0
- package/exports/hosts/claude/.claude/agents/content-author.md +63 -0
- package/exports/hosts/claude/.claude/agents/designer.md +55 -0
- package/exports/hosts/claude/.claude/agents/executor.md +55 -0
- package/exports/hosts/claude/.claude/agents/learner.md +51 -0
- package/exports/hosts/claude/.claude/agents/planner.md +53 -0
- package/exports/hosts/claude/.claude/agents/researcher.md +43 -0
- package/exports/hosts/claude/.claude/agents/reviewer.md +54 -0
- package/exports/hosts/claude/.claude/agents/specifier.md +47 -0
- package/exports/hosts/claude/.claude/agents/verifier.md +71 -0
- package/exports/hosts/claude/.claude/commands/author.md +42 -0
- package/exports/hosts/claude/.claude/commands/clarify.md +38 -0
- package/exports/hosts/claude/.claude/commands/design-review.md +46 -0
- package/exports/hosts/claude/.claude/commands/design.md +44 -0
- package/exports/hosts/claude/.claude/commands/discover.md +37 -0
- package/exports/hosts/claude/.claude/commands/execute.md +48 -0
- package/exports/hosts/claude/.claude/commands/learn.md +38 -0
- package/exports/hosts/claude/.claude/commands/plan-review.md +42 -0
- package/exports/hosts/claude/.claude/commands/plan.md +39 -0
- package/exports/hosts/claude/.claude/commands/prepare-next.md +37 -0
- package/exports/hosts/claude/.claude/commands/review.md +40 -0
- package/exports/hosts/claude/.claude/commands/run-audit.md +41 -0
- package/exports/hosts/claude/.claude/commands/spec-challenge.md +41 -0
- package/exports/hosts/claude/.claude/commands/specify.md +38 -0
- package/exports/hosts/claude/.claude/commands/verify.md +37 -0
- package/exports/hosts/claude/.claude/settings.json +34 -0
- package/exports/hosts/claude/CLAUDE.md +19 -0
- package/exports/hosts/claude/export.manifest.json +38 -0
- package/exports/hosts/claude/host-package.json +67 -0
- package/exports/hosts/codex/AGENTS.md +19 -0
- package/exports/hosts/codex/export.manifest.json +38 -0
- package/exports/hosts/codex/host-package.json +41 -0
- package/exports/hosts/cursor/.cursor/hooks.json +16 -0
- package/exports/hosts/cursor/.cursor/rules/wazir-core.mdc +19 -0
- package/exports/hosts/cursor/export.manifest.json +38 -0
- package/exports/hosts/cursor/host-package.json +42 -0
- package/exports/hosts/gemini/GEMINI.md +19 -0
- package/exports/hosts/gemini/export.manifest.json +38 -0
- package/exports/hosts/gemini/host-package.json +41 -0
- package/hooks/README.md +18 -0
- package/hooks/definitions/loop_cap_guard.yaml +21 -0
- package/hooks/definitions/post_tool_capture.yaml +24 -0
- package/hooks/definitions/pre_compact_summary.yaml +19 -0
- package/hooks/definitions/pre_tool_capture_route.yaml +19 -0
- package/hooks/definitions/protected_path_write_guard.yaml +19 -0
- package/hooks/definitions/session_start.yaml +19 -0
- package/hooks/definitions/stop_handoff_harvest.yaml +20 -0
- package/hooks/loop-cap-guard +17 -0
- package/hooks/post-tool-lint +36 -0
- package/hooks/protected-path-write-guard +17 -0
- package/hooks/session-start +41 -0
- package/llms-full.txt +2355 -0
- package/llms.txt +43 -0
- package/package.json +79 -0
- package/roles/README.md +20 -0
- package/roles/clarifier.md +42 -0
- package/roles/content-author.md +63 -0
- package/roles/designer.md +55 -0
- package/roles/executor.md +55 -0
- package/roles/learner.md +51 -0
- package/roles/planner.md +53 -0
- package/roles/researcher.md +43 -0
- package/roles/reviewer.md +54 -0
- package/roles/specifier.md +47 -0
- package/roles/verifier.md +71 -0
- package/schemas/README.md +24 -0
- package/schemas/accepted-learning.schema.json +20 -0
- package/schemas/author-artifact.schema.json +156 -0
- package/schemas/clarification.schema.json +19 -0
- package/schemas/design-artifact.schema.json +80 -0
- package/schemas/docs-claim.schema.json +18 -0
- package/schemas/export-manifest.schema.json +20 -0
- package/schemas/hook.schema.json +67 -0
- package/schemas/host-export-package.schema.json +18 -0
- package/schemas/implementation-plan.schema.json +19 -0
- package/schemas/proposed-learning.schema.json +19 -0
- package/schemas/research.schema.json +18 -0
- package/schemas/review.schema.json +29 -0
- package/schemas/run-manifest.schema.json +18 -0
- package/schemas/spec-challenge.schema.json +18 -0
- package/schemas/spec.schema.json +20 -0
- package/schemas/usage.schema.json +102 -0
- package/schemas/verification-proof.schema.json +29 -0
- package/schemas/wazir-manifest.schema.json +173 -0
- package/skills/README.md +40 -0
- package/skills/brainstorming/SKILL.md +77 -0
- package/skills/debugging/SKILL.md +50 -0
- package/skills/design/SKILL.md +61 -0
- package/skills/dispatching-parallel-agents/SKILL.md +128 -0
- package/skills/executing-plans/SKILL.md +70 -0
- package/skills/finishing-a-development-branch/SKILL.md +169 -0
- package/skills/humanize/SKILL.md +123 -0
- package/skills/init-pipeline/SKILL.md +124 -0
- package/skills/prepare-next/SKILL.md +20 -0
- package/skills/receiving-code-review/SKILL.md +123 -0
- package/skills/requesting-code-review/SKILL.md +105 -0
- package/skills/requesting-code-review/code-reviewer.md +108 -0
- package/skills/run-audit/SKILL.md +197 -0
- package/skills/scan-project/SKILL.md +41 -0
- package/skills/self-audit/SKILL.md +153 -0
- package/skills/subagent-driven-development/SKILL.md +154 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/skills/subagent-driven-development/implementer-prompt.md +102 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/tdd/SKILL.md +23 -0
- package/skills/using-git-worktrees/SKILL.md +163 -0
- package/skills/using-skills/SKILL.md +95 -0
- package/skills/verification/SKILL.md +22 -0
- package/skills/wazir/SKILL.md +463 -0
- package/skills/writing-plans/SKILL.md +30 -0
- package/skills/writing-skills/SKILL.md +157 -0
- package/skills/writing-skills/anthropic-best-practices.md +122 -0
- package/skills/writing-skills/persuasion-principles.md +50 -0
- package/templates/README.md +20 -0
- package/templates/artifacts/README.md +10 -0
- package/templates/artifacts/accepted-learning.md +19 -0
- package/templates/artifacts/accepted-learning.template.json +12 -0
- package/templates/artifacts/author.md +74 -0
- package/templates/artifacts/author.template.json +19 -0
- package/templates/artifacts/clarification.md +21 -0
- package/templates/artifacts/clarification.template.json +12 -0
- package/templates/artifacts/execute-notes.md +19 -0
- package/templates/artifacts/implementation-plan.md +21 -0
- package/templates/artifacts/implementation-plan.template.json +11 -0
- package/templates/artifacts/learning-proposal.md +19 -0
- package/templates/artifacts/next-run-handoff.md +21 -0
- package/templates/artifacts/plan-review.md +19 -0
- package/templates/artifacts/proposed-learning.template.json +12 -0
- package/templates/artifacts/research.md +21 -0
- package/templates/artifacts/research.template.json +12 -0
- package/templates/artifacts/review-findings.md +19 -0
- package/templates/artifacts/review.template.json +11 -0
- package/templates/artifacts/run-manifest.template.json +8 -0
- package/templates/artifacts/spec-challenge.md +19 -0
- package/templates/artifacts/spec-challenge.template.json +11 -0
- package/templates/artifacts/spec.md +21 -0
- package/templates/artifacts/spec.template.json +12 -0
- package/templates/artifacts/verification-proof.md +19 -0
- package/templates/artifacts/verification-proof.template.json +11 -0
- package/templates/examples/accepted-learning.example.json +14 -0
- package/templates/examples/author.example.json +152 -0
- package/templates/examples/clarification.example.json +15 -0
- package/templates/examples/docs-claim.example.json +8 -0
- package/templates/examples/export-manifest.example.json +7 -0
- package/templates/examples/host-export-package.example.json +11 -0
- package/templates/examples/implementation-plan.example.json +17 -0
- package/templates/examples/proposed-learning.example.json +13 -0
- package/templates/examples/research.example.json +15 -0
- package/templates/examples/research.example.md +6 -0
- package/templates/examples/review.example.json +17 -0
- package/templates/examples/run-manifest.example.json +9 -0
- package/templates/examples/spec-challenge.example.json +14 -0
- package/templates/examples/spec.example.json +21 -0
- package/templates/examples/verification-proof.example.json +21 -0
- package/templates/examples/wazir-manifest.example.yaml +65 -0
- package/templates/task-definition-schema.md +99 -0
- package/tooling/README.md +20 -0
- package/tooling/src/adapters/context-mode.js +50 -0
- package/tooling/src/capture/command.js +376 -0
- package/tooling/src/capture/store.js +99 -0
- package/tooling/src/capture/usage.js +270 -0
- package/tooling/src/checks/branches.js +50 -0
- package/tooling/src/checks/brand-truth.js +110 -0
- package/tooling/src/checks/changelog.js +231 -0
- package/tooling/src/checks/command-registry.js +36 -0
- package/tooling/src/checks/commits.js +102 -0
- package/tooling/src/checks/docs-drift.js +103 -0
- package/tooling/src/checks/docs-truth.js +201 -0
- package/tooling/src/checks/runtime-surface.js +156 -0
- package/tooling/src/cli.js +116 -0
- package/tooling/src/command-options.js +56 -0
- package/tooling/src/commands/validate.js +320 -0
- package/tooling/src/doctor/command.js +91 -0
- package/tooling/src/export/command.js +77 -0
- package/tooling/src/export/compiler.js +498 -0
- package/tooling/src/guards/loop-cap-guard.js +52 -0
- package/tooling/src/guards/protected-path-write-guard.js +67 -0
- package/tooling/src/index/command.js +152 -0
- package/tooling/src/index/storage.js +1061 -0
- package/tooling/src/index/summarizers.js +261 -0
- package/tooling/src/loaders.js +18 -0
- package/tooling/src/project-root.js +22 -0
- package/tooling/src/recall/command.js +225 -0
- package/tooling/src/schema-validator.js +30 -0
- package/tooling/src/state-root.js +40 -0
- package/tooling/src/status/command.js +71 -0
- package/wazir.manifest.yaml +135 -0
- package/workflows/README.md +19 -0
- package/workflows/author.md +42 -0
- package/workflows/clarify.md +38 -0
- package/workflows/design-review.md +46 -0
- package/workflows/design.md +44 -0
- package/workflows/discover.md +37 -0
- package/workflows/execute.md +48 -0
- package/workflows/learn.md +38 -0
- package/workflows/plan-review.md +42 -0
- package/workflows/plan.md +39 -0
- package/workflows/prepare-next.md +37 -0
- package/workflows/review.md +40 -0
- package/workflows/run-audit.md +41 -0
- package/workflows/spec-challenge.md +41 -0
- package/workflows/specify.md +38 -0
- package/workflows/verify.md +37 -0
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
# Software Supply Chain Security
|
|
2
|
+
|
|
3
|
+
> Threat landscape, defensive strategies, tooling, compliance, and incident response
|
|
4
|
+
> for software supply chain attacks. For teams depending on third-party packages,
|
|
5
|
+
> open-source libraries, and CI/CD pipelines.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Threat Landscape
|
|
10
|
+
|
|
11
|
+
### 1.1 Attack Vectors
|
|
12
|
+
|
|
13
|
+
**Dependency Confusion / Namespace Hijacking** — Attackers register a public
|
|
14
|
+
package with the same name as an internal private package but with a higher
|
|
15
|
+
version number. Package managers pull the malicious public package instead.
|
|
16
|
+
Alex Birsan (2021) demonstrated this against Apple, Microsoft, and PayPal.
|
|
17
|
+
49% of organizations remain vulnerable (Orca Security, 2024).
|
|
18
|
+
|
|
19
|
+
**Typosquatting** — Packages with names similar to popular libraries (e.g.,
|
|
20
|
+
`lodahs` instead of `lodash`). Over 500,000 malicious packages detected in
|
|
21
|
+
public registries in 2024 (Sonatype).
|
|
22
|
+
|
|
23
|
+
**Compromised Maintainer Accounts** — Credential stuffing, phishing, or social
|
|
24
|
+
engineering to take over maintainer accounts. See ua-parser-js (2021) and
|
|
25
|
+
event-stream (2018).
|
|
26
|
+
|
|
27
|
+
**Backdoored Packages via Long-Term Social Engineering** — Attackers spend
|
|
28
|
+
months or years building trust, eventually gaining commit access. XZ Utils
|
|
29
|
+
(CVE-2024-3094): attacker "Jia Tan" spent ~3 years building credibility.
|
|
30
|
+
|
|
31
|
+
**Compromised Build Infrastructure** — Targeting CI/CD systems or build servers
|
|
32
|
+
to inject malicious code during the build process. SolarWinds (2020) and
|
|
33
|
+
Codecov (2021) used this approach.
|
|
34
|
+
|
|
35
|
+
**Malicious Post-Install Scripts** — Package managers like npm execute lifecycle
|
|
36
|
+
scripts automatically. Attackers use these hooks for arbitrary code execution
|
|
37
|
+
on developer machines and CI/CD systems.
|
|
38
|
+
|
|
39
|
+
### 1.2 Major Supply Chain Attacks — Timeline
|
|
40
|
+
|
|
41
|
+
**event-stream / flatmap-stream (November 2018)**
|
|
42
|
+
- A new maintainer (@right9ctrl) took over the event-stream npm package
|
|
43
|
+
(~2 million weekly downloads) from the original author
|
|
44
|
+
- Added a dependency on `flatmap-stream` containing obfuscated code targeting
|
|
45
|
+
the Copay Bitcoin wallet, designed to steal cryptocurrency
|
|
46
|
+
- The malicious dependency was present for approximately 3 days before removal
|
|
47
|
+
- Impact: Unknown financial losses; demonstrated the risk of maintainer handover
|
|
48
|
+
- CWE-506 (Embedded Malicious Code)
|
|
49
|
+
- Source: GitHub issue #116 on dominictarr/event-stream
|
|
50
|
+
|
|
51
|
+
**SolarWinds / SUNBURST (December 2020)**
|
|
52
|
+
- Threat actor UNC2452 (attributed to Russian SVR) compromised SolarWinds'
|
|
53
|
+
build infrastructure and injected the SUNBURST backdoor into Orion platform
|
|
54
|
+
updates (versions 2019.4 HF5 through 2020.2.1)
|
|
55
|
+
- 18,000 customers downloaded trojanized updates; ~100 organizations actively
|
|
56
|
+
exploited including US Treasury, Commerce, DHS, and FireEye
|
|
57
|
+
- Attack persisted undetected for approximately 14 months
|
|
58
|
+
- Impact: Estimated $100+ billion in damages across government and enterprise
|
|
59
|
+
- Source: CISA Alert AA20-352A; Mandiant/FireEye disclosure
|
|
60
|
+
|
|
61
|
+
**Codecov Bash Uploader (April 2021)**
|
|
62
|
+
- Attackers modified Codecov's Bash Uploader script via a Docker image
|
|
63
|
+
creation flaw, exfiltrating environment variables (tokens, keys, credentials)
|
|
64
|
+
from CI/CD environments
|
|
65
|
+
- The compromise went undetected for over 2 months (January 31 to April 1, 2021)
|
|
66
|
+
- Impact: Credentials leaked from thousands of CI pipelines
|
|
67
|
+
- Source: Codecov Security Notice, April 2021
|
|
68
|
+
|
|
69
|
+
**ua-parser-js (October 2021)**
|
|
70
|
+
- The npm package ua-parser-js (~7 million weekly downloads) was hijacked;
|
|
71
|
+
malicious versions (0.7.29, 0.8.0, 1.0.0) were published containing
|
|
72
|
+
cryptominer and credential-stealing malware
|
|
73
|
+
- Subsequently, similar attacks hit npm packages `coa` and `rc` in November 2021
|
|
74
|
+
- Impact: Millions of downstream projects exposed
|
|
75
|
+
- Source: GitHub Advisory GHSA-pjwm-rvh2-c87w
|
|
76
|
+
|
|
77
|
+
**Log4Shell / CVE-2021-44228 (December 2021)**
|
|
78
|
+
- Critical RCE vulnerability in Apache Log4j2, a ubiquitous Java logging library
|
|
79
|
+
- Not a supply chain *attack* per se, but demonstrated how a single transitive
|
|
80
|
+
dependency vulnerability can cascade across millions of applications
|
|
81
|
+
- CVSS 10.0; affected an estimated 35,000+ Java packages (8% of Maven Central)
|
|
82
|
+
- Impact: Exploitation began within hours of disclosure; remediation ongoing
|
|
83
|
+
for years due to transitive dependency depth
|
|
84
|
+
- Source: NIST NVD CVE-2021-44228
|
|
85
|
+
|
|
86
|
+
**XZ Utils / CVE-2024-3094 (March 2024)**
|
|
87
|
+
- A pseudonymous contributor "Jia Tan" spent ~3 years gaining co-maintainer
|
|
88
|
+
trust on the xz-utils project, a compression library used by virtually all
|
|
89
|
+
Linux distributions
|
|
90
|
+
- Injected a sophisticated backdoor into liblzma (versions 5.6.0 and 5.6.1)
|
|
91
|
+
that subverted OpenSSH authentication, enabling remote code execution
|
|
92
|
+
- Discovered on March 29, 2024 by Andres Freund (Microsoft/PostgreSQL) who
|
|
93
|
+
noticed anomalous SSH CPU usage and valgrind errors
|
|
94
|
+
- CVSS 10.0; affected Fedora 40 beta, Debian unstable, Kali Linux, Arch Linux
|
|
95
|
+
- Widely assessed as a state-sponsored operation
|
|
96
|
+
- Impact: Averted catastrophe due to early detection before reaching stable distros
|
|
97
|
+
- Source: NIST NVD CVE-2024-3094; Datadog Security Labs analysis
|
|
98
|
+
|
|
99
|
+
**npm Ecosystem Compromise / "Shai-Hulud" (September 2025)**
|
|
100
|
+
- Self-propagating malware compromised 500+ npm packages via credential theft
|
|
101
|
+
and automated malicious package publishing
|
|
102
|
+
- Used TruffleHog to harvest CI/CD secrets and environment variables
|
|
103
|
+
- CISA issued advisory on September 23, 2025
|
|
104
|
+
- Socket.dev identified and tracked the campaign in real time
|
|
105
|
+
- Source: CISA Alert; Socket.dev advisory; Trend Micro analysis
|
|
106
|
+
|
|
107
|
+
### 1.3 Scale of the Problem (2024-2025)
|
|
108
|
+
|
|
109
|
+
- 512,847 malicious packages detected in 2024 (156% year-over-year increase) —
|
|
110
|
+
Sonatype
|
|
111
|
+
- 30% of breaches involve a third party (doubled from 15%) — Verizon DBIR 2025
|
|
112
|
+
- 75% of organizations experienced a supply chain attack in 2024 — BlackBerry
|
|
113
|
+
- Supply chain attacks projected to cost $60 billion globally by 2025 —
|
|
114
|
+
Cybersecurity Ventures
|
|
115
|
+
- October 2025 set a new record with 41 supply chain attacks in a single month,
|
|
116
|
+
30% above the previous peak — Cyble
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 2. Core Security Principles
|
|
121
|
+
|
|
122
|
+
### 2.1 Verify Before You Trust
|
|
123
|
+
|
|
124
|
+
- **Provenance verification**: Verify build provenance via SLSA attestations or Sigstore
|
|
125
|
+
- **Integrity checking**: Validate checksums/hashes of all downloaded artifacts
|
|
126
|
+
- **Author verification**: Assess maintainer identity and track record before adopting
|
|
127
|
+
- **Reproducible builds**: Building from source produces identical artifacts
|
|
128
|
+
|
|
129
|
+
### 2.2 Pin Versions and Lock Dependencies
|
|
130
|
+
|
|
131
|
+
- Use exact version pins (`1.2.3`) not ranges (`^1.2.3` or `~1.2.3`) in production
|
|
132
|
+
- Commit lock files (`package-lock.json`, `yarn.lock`, `pubspec.lock`, etc.) to VCS
|
|
133
|
+
- Review lock file changes in code review — they represent real code changes
|
|
134
|
+
|
|
135
|
+
### 2.3 Audit Regularly and Continuously
|
|
136
|
+
|
|
137
|
+
- Run `npm audit`, `pip-audit`, `bundler-audit` as part of CI/CD
|
|
138
|
+
- Subscribe to security advisories for critical dependencies
|
|
139
|
+
- Periodically review dependency trees, especially transitive dependencies
|
|
140
|
+
|
|
141
|
+
### 2.4 Generate and Maintain SBOMs
|
|
142
|
+
|
|
143
|
+
- Generate SBOMs in CycloneDX or SPDX format during every build
|
|
144
|
+
- Store SBOMs alongside release artifacts
|
|
145
|
+
- Use SBOMs for vulnerability impact analysis — when a CVE drops, query SBOMs
|
|
146
|
+
to determine exposure within minutes, not days
|
|
147
|
+
|
|
148
|
+
### 2.5 Minimize the Dependency Surface
|
|
149
|
+
|
|
150
|
+
- Evaluate whether a dependency is truly needed before adding it
|
|
151
|
+
- Prefer well-maintained libraries with active security response teams
|
|
152
|
+
- Remove unused dependencies regularly (`depcheck`, `deptry`)
|
|
153
|
+
- Audit transitive trees — one direct dep can pull hundreds of transitive ones
|
|
154
|
+
|
|
155
|
+
### 2.6 SLSA Framework Levels
|
|
156
|
+
|
|
157
|
+
SLSA (pronounced "salsa") defines progressive build integrity levels:
|
|
158
|
+
|
|
159
|
+
| Level | Requirements | Guarantees |
|
|
160
|
+
|-------|-------------|------------|
|
|
161
|
+
| L0 | None | No provenance |
|
|
162
|
+
| L1 | Build process generates provenance automatically | Provenance exists and is distributable |
|
|
163
|
+
| L2 | Hosted build service; signed provenance | Tamper-evident provenance |
|
|
164
|
+
| L3 | Hardened build platform; isolated builds | Tamper-resistant provenance; prevents insider threats |
|
|
165
|
+
|
|
166
|
+
Target SLSA L2 minimum; L3 for critical software. Latest spec: v1.2 (2025).
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 3. Implementation Patterns
|
|
171
|
+
|
|
172
|
+
### 3.1 Lock Files and Deterministic Installs
|
|
173
|
+
|
|
174
|
+
| Ecosystem | Lock File | Deterministic Install |
|
|
175
|
+
|-----------|-----------|----------------------|
|
|
176
|
+
| npm | `package-lock.json` | `npm ci` |
|
|
177
|
+
| Yarn | `yarn.lock` | `yarn install --frozen-lockfile` |
|
|
178
|
+
| pnpm | `pnpm-lock.yaml` | `pnpm install --frozen-lockfile` |
|
|
179
|
+
| Python/pip | `requirements.txt` (pinned) | `pip install -r requirements.txt --require-hashes` |
|
|
180
|
+
| Python/Poetry | `poetry.lock` | `poetry install --no-update` |
|
|
181
|
+
| Dart/Flutter | `pubspec.lock` | `dart pub get` (respects lock) |
|
|
182
|
+
| Ruby | `Gemfile.lock` | `bundle install --frozen` |
|
|
183
|
+
| Go | `go.sum` | `go mod verify` |
|
|
184
|
+
| Maven | (use enforcer plugin) | `mvn dependency:resolve` |
|
|
185
|
+
|
|
186
|
+
### 3.2 Dependency Update Automation
|
|
187
|
+
|
|
188
|
+
- **Dependabot** (GitHub native): broad ecosystem support, low config
|
|
189
|
+
- **Renovate** (Mend): flexible config, monorepo support, auto-merge policies
|
|
190
|
+
- **Snyk**: combined vulnerability scanning + update PRs
|
|
191
|
+
|
|
192
|
+
Best practice: auto-merge patch updates with passing CI; require human review
|
|
193
|
+
for minor/major version bumps.
|
|
194
|
+
|
|
195
|
+
### 3.3 SBOM Generation
|
|
196
|
+
|
|
197
|
+
| Standard | Maintainer | Strength | Formats | Tooling |
|
|
198
|
+
|----------|-----------|----------|---------|---------|
|
|
199
|
+
| CycloneDX | OWASP | Security use cases, VEX | JSON, XML | `cdxgen`, `syft`, `trivy` |
|
|
200
|
+
| SPDX | Linux Foundation | License compliance, ISO standard | JSON, RDF, YAML | `syft`, `spdx-sbom-generator` |
|
|
201
|
+
|
|
202
|
+
### 3.4 Artifact Signing with Sigstore
|
|
203
|
+
|
|
204
|
+
- **cosign**: Signs/verifies container images, blobs, and SBOMs
|
|
205
|
+
- **Rekor**: Immutable transparency log for signatures
|
|
206
|
+
- **Fulcio**: Short-lived certificates tied to OIDC identity (keyless signing)
|
|
207
|
+
|
|
208
|
+
### 3.5 Dependency Confusion Prevention
|
|
209
|
+
|
|
210
|
+
1. **Scope packages**: Use npm scopes (`@yourorg/package-name`)
|
|
211
|
+
2. **Configure registry priority**: Route scoped packages to private registry in `.npmrc`
|
|
212
|
+
3. **Claim names**: Register internal names on public registries as placeholders (PyPI)
|
|
213
|
+
4. **Use registry proxies**: Artifactory or Nexus as single package entry point
|
|
214
|
+
|
|
215
|
+
### 3.6 CI/CD Pipeline Hardening
|
|
216
|
+
|
|
217
|
+
- Pin CI action versions by full SHA, not tags (tags are mutable)
|
|
218
|
+
- Use read-only tokens and ephemeral build containers
|
|
219
|
+
- Verify artifact signatures before deployment
|
|
220
|
+
- Use OIDC-based cloud auth instead of long-lived keys
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 4. Vulnerability Catalog
|
|
225
|
+
|
|
226
|
+
### 4.1 Dependency Management Vulnerabilities
|
|
227
|
+
|
|
228
|
+
| # | Vulnerability | CWE | Risk | Mitigation |
|
|
229
|
+
|---|--------------|-----|------|------------|
|
|
230
|
+
| 1 | No lock file committed | CWE-1104 | Non-deterministic builds install arbitrary versions | Commit lock files; use `npm ci` / `--frozen-lockfile` |
|
|
231
|
+
| 2 | Unpinned dependency versions | CWE-1104 | Automatic upgrades may pull compromised versions | Pin exact versions in production manifests |
|
|
232
|
+
| 3 | Typosquatting packages installed | CWE-506 | Malicious code executed via misspelled package name | Use `socket.dev`, lockfile review, allowlists |
|
|
233
|
+
| 4 | Dependency confusion | CWE-427 | Public package overrides private package of same name | Scope packages, configure `.npmrc`, claim public names |
|
|
234
|
+
| 5 | Unreviewed lock file changes | CWE-829 | Malicious transitive dependency added silently | Require lock file diff review in PRs |
|
|
235
|
+
|
|
236
|
+
### 4.2 Build and Distribution Vulnerabilities
|
|
237
|
+
|
|
238
|
+
| # | Vulnerability | CWE | Risk | Mitigation |
|
|
239
|
+
|---|--------------|-----|------|------------|
|
|
240
|
+
| 6 | Compromised post-install scripts | CWE-506 | Arbitrary code runs on `npm install` | Use `--ignore-scripts`, audit scripts before install |
|
|
241
|
+
| 7 | Mutable CI action tags | CWE-829 | Attacker replaces action content behind same tag | Pin GitHub Actions by full commit SHA |
|
|
242
|
+
| 8 | Unsigned build artifacts | CWE-345 | Cannot verify artifact integrity or provenance | Sign with cosign/Sigstore; verify before deploy |
|
|
243
|
+
| 9 | Build secrets leaked in logs | CWE-532 | Credentials exposed in CI output | Mask secrets; use short-lived OIDC tokens |
|
|
244
|
+
|
|
245
|
+
### 4.3 Maintenance and Governance Vulnerabilities
|
|
246
|
+
|
|
247
|
+
| # | Vulnerability | CWE | Risk | Mitigation |
|
|
248
|
+
|---|--------------|-----|------|------------|
|
|
249
|
+
| 10 | Abandoned/unmaintained packages | CWE-1104 | No security patches; potential maintainer takeover | Monitor OpenSSF Scorecard; set maintenance thresholds |
|
|
250
|
+
| 11 | Excessive transitive dependencies | CWE-1104 | Deep trees increase attack surface exponentially | Audit with `npm ls --all`; prefer minimal libraries |
|
|
251
|
+
| 12 | No SBOM generated | CWE-1059 | Cannot assess impact of new CVEs on your software | Generate CycloneDX/SPDX SBOMs in CI |
|
|
252
|
+
| 13 | Missing vulnerability scanning | CWE-1104 | Known CVEs persist in deployed software | Integrate Snyk/Trivy/Grype in CI pipeline |
|
|
253
|
+
| 14 | Unverified third-party CI actions | CWE-829 | Malicious actions exfiltrate secrets or modify builds | Fork and vendor critical actions; pin by SHA |
|
|
254
|
+
| 15 | No provenance attestation | CWE-345 | Cannot verify where/how artifact was built | Implement SLSA L2+; use SLSA GitHub generator |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 5. Security Checklist
|
|
259
|
+
|
|
260
|
+
### Dependency Management
|
|
261
|
+
- [ ] All lock files (`package-lock.json`, `yarn.lock`, etc.) committed to VCS
|
|
262
|
+
- [ ] Production dependencies pinned to exact versions
|
|
263
|
+
- [ ] Lock file diffs reviewed as part of code review process
|
|
264
|
+
- [ ] `npm ci` or `--frozen-lockfile` used in CI/CD (never `npm install`)
|
|
265
|
+
- [ ] Transitive dependency tree audited quarterly for depth and risk
|
|
266
|
+
- [ ] Unused dependencies removed (verified with `depcheck` or equivalent)
|
|
267
|
+
|
|
268
|
+
### Vulnerability Scanning
|
|
269
|
+
- [ ] `npm audit` / `pip-audit` / equivalent runs in every CI build
|
|
270
|
+
- [ ] Snyk, Socket.dev, or Trivy integrated for continuous monitoring
|
|
271
|
+
- [ ] Critical/high vulnerabilities block deployment (CI gate)
|
|
272
|
+
- [ ] Security advisories subscribed for top 20 dependencies
|
|
273
|
+
- [ ] Known-vulnerable packages prevented from installation
|
|
274
|
+
|
|
275
|
+
### SBOM and Provenance
|
|
276
|
+
- [ ] SBOM generated in CycloneDX or SPDX format on every release build
|
|
277
|
+
- [ ] SBOMs stored alongside release artifacts and accessible to consumers
|
|
278
|
+
- [ ] Build provenance attestations generated (SLSA L1 minimum)
|
|
279
|
+
- [ ] Artifact signatures verified before deployment (cosign verify)
|
|
280
|
+
|
|
281
|
+
### Build Pipeline
|
|
282
|
+
- [ ] GitHub Actions (or equivalent) pinned by full commit SHA
|
|
283
|
+
- [ ] Post-install scripts disabled by default (`--ignore-scripts`)
|
|
284
|
+
- [ ] CI environment uses ephemeral, isolated build containers
|
|
285
|
+
- [ ] Secrets injected via CI secret management (never hardcoded)
|
|
286
|
+
- [ ] OIDC used for cloud authentication (no long-lived keys in CI)
|
|
287
|
+
|
|
288
|
+
### Registry and Namespace
|
|
289
|
+
- [ ] Private packages use scoped names (`@org/pkg`)
|
|
290
|
+
- [ ] `.npmrc` configured to route scoped packages to private registry
|
|
291
|
+
- [ ] Internal package names claimed on public registries (PyPI, npm)
|
|
292
|
+
- [ ] Registry proxy (Artifactory/Nexus) used as single package source
|
|
293
|
+
- [ ] Package publication requires MFA and is restricted to authorized accounts
|
|
294
|
+
|
|
295
|
+
### Governance
|
|
296
|
+
- [ ] OpenSSF Scorecard evaluated for critical open-source dependencies
|
|
297
|
+
- [ ] New dependency adoption requires security review
|
|
298
|
+
- [ ] Dependency update automation configured (Dependabot/Renovate)
|
|
299
|
+
- [ ] Incident response plan covers supply chain compromise scenarios
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 6. Tools and Automation
|
|
304
|
+
|
|
305
|
+
### 6.1 Vulnerability Scanning
|
|
306
|
+
|
|
307
|
+
| Tool | Type | Ecosystems | Key Features |
|
|
308
|
+
|------|------|-----------|--------------|
|
|
309
|
+
| `npm audit` | Built-in | npm | Free; integrated into npm CLI; checks GitHub Advisory DB |
|
|
310
|
+
| Snyk | SCA | npm, PyPI, Maven, Go, Ruby, .NET | Fix PRs, license compliance, container scanning |
|
|
311
|
+
| Socket.dev | Behavioral | npm, PyPI | Detects suspicious behavior (network, filesystem, eval); not just CVEs |
|
|
312
|
+
| Trivy | Scanner | OS packages, language deps, containers, IaC | Open source (Aqua); broad coverage; SBOM generation |
|
|
313
|
+
| Grype | Scanner | OS packages, language deps, containers | Open source (Anchore); pairs with Syft for SBOM |
|
|
314
|
+
| OSV-Scanner | Scanner | npm, PyPI, Go, Maven, Rust, Ruby | Open source (Google); uses OSV.dev database |
|
|
315
|
+
|
|
316
|
+
### 6.2 SBOM Generation
|
|
317
|
+
|
|
318
|
+
| Tool | Formats | Ecosystems | Notes |
|
|
319
|
+
|------|---------|-----------|-------|
|
|
320
|
+
| Syft (Anchore) | CycloneDX, SPDX, Syft JSON | All major | De facto standard; pairs with Grype |
|
|
321
|
+
| `cdxgen` | CycloneDX | npm, Python, Java, Go, .NET | OWASP project; CycloneDX-native |
|
|
322
|
+
| Trivy | CycloneDX, SPDX | All major | SBOM + vulnerability scan in one tool |
|
|
323
|
+
| `spdx-sbom-generator` | SPDX | Go, Java, Node, Python, Ruby | Linux Foundation project |
|
|
324
|
+
|
|
325
|
+
### 6.3 Dependency Update Automation
|
|
326
|
+
|
|
327
|
+
| Tool | Provider | Strengths |
|
|
328
|
+
|------|----------|-----------|
|
|
329
|
+
| Dependabot | GitHub | Native GitHub integration; low config; broad ecosystem support |
|
|
330
|
+
| Renovate | Mend (open source) | Highly configurable; monorepo support; auto-merge policies; custom managers |
|
|
331
|
+
| Snyk | Snyk | Combined vuln scan + update PRs; prioritized by exploitability |
|
|
332
|
+
|
|
333
|
+
### 6.4 Signing and Verification
|
|
334
|
+
|
|
335
|
+
| Tool | Purpose | Notes |
|
|
336
|
+
|------|---------|-------|
|
|
337
|
+
| cosign (Sigstore) | Sign/verify images, blobs, SBOMs | Keyless OIDC-based signing; transparency log |
|
|
338
|
+
| Notation (Notary v2) | Sign/verify OCI artifacts | CNCF project; cloud-provider-neutral |
|
|
339
|
+
| GPG | Sign commits, tags, artifacts | Traditional; requires key management |
|
|
340
|
+
|
|
341
|
+
### 6.5 Policy and Compliance
|
|
342
|
+
|
|
343
|
+
| Tool | Purpose | Notes |
|
|
344
|
+
|------|---------|-------|
|
|
345
|
+
| OpenSSF Scorecard | Assess open-source project health | 19 automated checks; GitHub Action available |
|
|
346
|
+
| StepSecurity Harden-Runner | CI/CD runtime security | Detects anomalous network/process activity in CI |
|
|
347
|
+
| OPA/Gatekeeper | Policy enforcement | Block deployments missing signatures or SBOMs |
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## 7. Platform-Specific Guidance
|
|
352
|
+
|
|
353
|
+
### 7.1 npm / Node.js
|
|
354
|
+
|
|
355
|
+
**Key risks**: Post-install scripts, typosquatting, dependency confusion, massive
|
|
356
|
+
transitive dependency trees (average npm project pulls ~700 transitive deps).
|
|
357
|
+
|
|
358
|
+
**Hardening measures**:
|
|
359
|
+
- Use `npm ci` in CI (deterministic, respects lock file exactly)
|
|
360
|
+
- Set `ignore-scripts=true` in `.npmrc`; explicitly allow trusted scripts
|
|
361
|
+
- Scope all internal packages under `@yourorg/`
|
|
362
|
+
- Enable npm provenance (`--provenance` flag on `npm publish`)
|
|
363
|
+
- Use `npm audit signatures` to verify registry-signed packages
|
|
364
|
+
- Consider Socket.dev for behavioral analysis beyond CVE matching
|
|
365
|
+
|
|
366
|
+
### 7.2 PyPI / Python
|
|
367
|
+
|
|
368
|
+
**Key risks**: No native namespace scoping; typosquatting is rampant;
|
|
369
|
+
`setup.py` execution during install enables arbitrary code execution.
|
|
370
|
+
|
|
371
|
+
**Hardening measures**:
|
|
372
|
+
- Use `pip install --require-hashes` with pinned `requirements.txt`
|
|
373
|
+
- Migrate to `pyproject.toml` and `pip-compile` (pip-tools) for lock files
|
|
374
|
+
- Claim internal package names on PyPI as empty placeholders
|
|
375
|
+
- Use `pip-audit` for vulnerability scanning
|
|
376
|
+
- Consider Trusted Publishers for PyPI (OIDC-based publishing)
|
|
377
|
+
- Migrate from `setup.py` to declarative `pyproject.toml` where possible
|
|
378
|
+
|
|
379
|
+
### 7.3 Maven / Java
|
|
380
|
+
|
|
381
|
+
**Key risks**: Transitive dependency resolution via "nearest wins"; Log4Shell
|
|
382
|
+
demonstrated how deeply embedded a single transitive dependency can be;
|
|
383
|
+
dependency mediation can silently downgrade secure versions.
|
|
384
|
+
|
|
385
|
+
**Hardening measures**:
|
|
386
|
+
- Use Maven Enforcer Plugin to ban known-bad dependencies
|
|
387
|
+
- Enable `<dependencyManagement>` to control transitive versions
|
|
388
|
+
- Use `mvn dependency:tree` regularly to audit the full tree
|
|
389
|
+
- Sign artifacts with GPG; verify signatures on consumption
|
|
390
|
+
- Use OSSRH (Sonatype) staging rules and release policies
|
|
391
|
+
- Scan with `mvn org.owasp:dependency-check-maven:check`
|
|
392
|
+
|
|
393
|
+
### 7.4 pub / Dart (Flutter)
|
|
394
|
+
|
|
395
|
+
**Key risks**: Smaller ecosystem means less security tooling; `pubspec.lock`
|
|
396
|
+
is sometimes .gitignored in library packages (by convention).
|
|
397
|
+
|
|
398
|
+
**Hardening measures**:
|
|
399
|
+
- Always commit `pubspec.lock` for applications
|
|
400
|
+
- Use `dart pub outdated` to track dependency freshness
|
|
401
|
+
- Pin versions in `pubspec.yaml` for production applications
|
|
402
|
+
- Audit transitive dependencies with `dart pub deps`
|
|
403
|
+
- Use `pana` (pub.dev analysis) scores to evaluate package health
|
|
404
|
+
- Monitor pub.dev verified publisher badges
|
|
405
|
+
|
|
406
|
+
### 7.5 CocoaPods / iOS
|
|
407
|
+
|
|
408
|
+
**Key risks**: Centralized Specs repository; trunk account compromise can
|
|
409
|
+
replace any pod version; post-install hooks in Podfiles.
|
|
410
|
+
|
|
411
|
+
**Hardening measures**:
|
|
412
|
+
- Commit `Podfile.lock` to version control
|
|
413
|
+
- Use `pod install` (never `pod update`) in CI
|
|
414
|
+
- Audit `Podfile` for `post_install` hooks performing network access
|
|
415
|
+
- Consider Swift Package Manager (SPM) as an alternative with better
|
|
416
|
+
integrity checking
|
|
417
|
+
- Use private Spec repos for internal pods
|
|
418
|
+
- Verify pod checksums in `Podfile.lock`
|
|
419
|
+
|
|
420
|
+
### 7.6 GitHub Actions
|
|
421
|
+
|
|
422
|
+
**Key risks**: Actions are code that runs with access to your repository
|
|
423
|
+
secrets, GITHUB_TOKEN, and OIDC tokens. A compromised action can exfiltrate
|
|
424
|
+
secrets, modify code, or publish malicious artifacts.
|
|
425
|
+
|
|
426
|
+
**Hardening measures**:
|
|
427
|
+
- Pin all actions by full commit SHA (not `@v4`, which is a mutable tag)
|
|
428
|
+
- Fork critical third-party actions into your organization
|
|
429
|
+
- Use `permissions:` to apply least-privilege to GITHUB_TOKEN
|
|
430
|
+
- Enable Dependabot for GitHub Actions version updates
|
|
431
|
+
- Use StepSecurity Harden-Runner to monitor network egress
|
|
432
|
+
- Prefer GitHub's official actions (`actions/checkout`, `actions/setup-node`)
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## 8. Incident Patterns
|
|
437
|
+
|
|
438
|
+
### 8.1 Malicious Package Detection
|
|
439
|
+
|
|
440
|
+
**Indicators of compromise**: obfuscated/minified code in non-build packages,
|
|
441
|
+
network calls in install scripts, env var enumeration, binary downloads during
|
|
442
|
+
install, sudden maintainer changes, version jumps with minimal changelog.
|
|
443
|
+
|
|
444
|
+
**Detection**: Run Socket.dev behavioral analysis on new deps, monitor
|
|
445
|
+
`npm audit` in CI, alert on maintainer changes, review lock file diffs in PRs.
|
|
446
|
+
|
|
447
|
+
### 8.2 Compromised Dependency Response
|
|
448
|
+
|
|
449
|
+
1. **Identify scope**: Query SBOMs for affected package/version across all environments
|
|
450
|
+
2. **Contain**: Pin to last known-good version; block compromised version in registry proxy
|
|
451
|
+
3. **Assess impact**: Determine if malicious code executed in build/staging/production
|
|
452
|
+
4. **Rotate credentials**: Assume all secrets accessible to affected builds are compromised
|
|
453
|
+
5. **Notify downstream**: Alert consumers if you publish artifacts including the compromised dep
|
|
454
|
+
6. **Post-incident**: Update allowlists; review whether the dependency is still needed
|
|
455
|
+
|
|
456
|
+
### 8.3 SBOM-Based Impact Analysis
|
|
457
|
+
|
|
458
|
+
When a critical CVE drops: query SBOM repository across all products, generate
|
|
459
|
+
exposure report in minutes, prioritize by deployment context (internet-facing
|
|
460
|
+
first), track remediation via SBOM diffs, produce compliance evidence.
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
## 9. Compliance and Standards
|
|
465
|
+
|
|
466
|
+
### 9.1 NIST SSDF (SP 800-218)
|
|
467
|
+
|
|
468
|
+
Four practice groups: Prepare the Organization (PO), Protect the Software (PS),
|
|
469
|
+
Produce Well-Secured Software (PW), Respond to Vulnerabilities (RV). Federal
|
|
470
|
+
software vendors must submit signed self-attestation of SSDF compliance (2024).
|
|
471
|
+
|
|
472
|
+
### 9.2 Executive Order 14028 (May 2021)
|
|
473
|
+
|
|
474
|
+
- Software vendors must provide SBOMs to federal agency customers
|
|
475
|
+
- Led to SSDF v1.1, CISA SBOM guidance, SLSA framework adoption
|
|
476
|
+
- Defines SBOM as "formal record containing details and supply chain
|
|
477
|
+
relationships of components used in building software"
|
|
478
|
+
|
|
479
|
+
### 9.3 CISA SBOM Minimum Elements (2025 Update)
|
|
480
|
+
|
|
481
|
+
Required metadata: component name/version/supplier, unique identifiers (CPE,
|
|
482
|
+
PURL), dependency relationships, provenance/authenticity fields, timestamps.
|
|
483
|
+
|
|
484
|
+
### 9.4 SLSA
|
|
485
|
+
|
|
486
|
+
OpenSSF project defining progressive build integrity levels (see Section 2.6).
|
|
487
|
+
Hosted build requirement (L2+), hardened platforms (L3). Spec v1.2 (2025).
|
|
488
|
+
|
|
489
|
+
### 9.5 OpenSSF Scorecard
|
|
490
|
+
|
|
491
|
+
19 automated checks: branch protection, code review, CI tests, fuzzing,
|
|
492
|
+
dependency updates, SAST, signed releases, SBOM, dangerous workflows.
|
|
493
|
+
Score 0-10 per check. Below 5 on critical checks warrants evaluation.
|
|
494
|
+
|
|
495
|
+
### 9.6 EU Cyber Resilience Act (CRA)
|
|
496
|
+
|
|
497
|
+
Adopted 2024. Requires SBOM generation, vulnerability handling, security updates
|
|
498
|
+
for product lifetime. Compliance deadline: 2027.
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
## 10. Code Examples
|
|
503
|
+
|
|
504
|
+
### 10.1 .npmrc Configuration (Dependency Confusion Prevention)
|
|
505
|
+
|
|
506
|
+
```ini
|
|
507
|
+
# .npmrc — prevent dependency confusion and harden npm behavior
|
|
508
|
+
|
|
509
|
+
# Route scoped packages to private registry
|
|
510
|
+
@yourorg:registry=https://npm.yourorg.com/
|
|
511
|
+
|
|
512
|
+
# Always use exact versions when saving
|
|
513
|
+
save-exact=true
|
|
514
|
+
|
|
515
|
+
# Disable post-install scripts by default (enable per-package as needed)
|
|
516
|
+
ignore-scripts=true
|
|
517
|
+
|
|
518
|
+
# Require lock file for installs (fail if lock file is missing or outdated)
|
|
519
|
+
package-lock=true
|
|
520
|
+
|
|
521
|
+
# Enforce strict SSL for registry connections
|
|
522
|
+
strict-ssl=true
|
|
523
|
+
|
|
524
|
+
# Set audit level to fail on moderate+ vulnerabilities
|
|
525
|
+
audit-level=moderate
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### 10.2 Dependabot Configuration
|
|
529
|
+
|
|
530
|
+
```yaml
|
|
531
|
+
# .github/dependabot.yml
|
|
532
|
+
version: 2
|
|
533
|
+
updates:
|
|
534
|
+
- package-ecosystem: "npm"
|
|
535
|
+
directory: "/"
|
|
536
|
+
schedule: { interval: "weekly", day: "monday" }
|
|
537
|
+
open-pull-requests-limit: 10
|
|
538
|
+
reviewers: ["security-team"]
|
|
539
|
+
labels: ["dependencies", "security"]
|
|
540
|
+
groups:
|
|
541
|
+
production-deps:
|
|
542
|
+
patterns: ["*"]
|
|
543
|
+
update-types: ["minor", "patch"]
|
|
544
|
+
|
|
545
|
+
- package-ecosystem: "github-actions" # Pin actions by SHA
|
|
546
|
+
directory: "/"
|
|
547
|
+
schedule: { interval: "weekly" }
|
|
548
|
+
labels: ["ci", "dependencies"]
|
|
549
|
+
|
|
550
|
+
- package-ecosystem: "docker"
|
|
551
|
+
directory: "/"
|
|
552
|
+
schedule: { interval: "weekly" }
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### 10.3 GitHub Actions with Pinned SHAs
|
|
556
|
+
|
|
557
|
+
```yaml
|
|
558
|
+
# .github/workflows/ci.yml
|
|
559
|
+
name: CI
|
|
560
|
+
on: [push, pull_request]
|
|
561
|
+
|
|
562
|
+
permissions:
|
|
563
|
+
contents: read # Least-privilege GITHUB_TOKEN
|
|
564
|
+
|
|
565
|
+
jobs:
|
|
566
|
+
build:
|
|
567
|
+
runs-on: ubuntu-latest
|
|
568
|
+
steps:
|
|
569
|
+
# Pin actions by full commit SHA — never use @v4 (mutable tag)
|
|
570
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
571
|
+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
572
|
+
with:
|
|
573
|
+
node-version: "20"
|
|
574
|
+
cache: "npm"
|
|
575
|
+
|
|
576
|
+
# Deterministic install from lock file
|
|
577
|
+
- run: npm ci --ignore-scripts
|
|
578
|
+
|
|
579
|
+
# Audit for known vulnerabilities
|
|
580
|
+
- run: npm audit --audit-level=moderate
|
|
581
|
+
|
|
582
|
+
# Verify npm package provenance signatures
|
|
583
|
+
- run: npm audit signatures
|
|
584
|
+
|
|
585
|
+
# Run tests
|
|
586
|
+
- run: npm test
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
### 10.4 SBOM Generation in CI
|
|
590
|
+
|
|
591
|
+
```yaml
|
|
592
|
+
# .github/workflows/sbom.yml
|
|
593
|
+
name: SBOM Generation
|
|
594
|
+
on:
|
|
595
|
+
push:
|
|
596
|
+
tags: ["v*"]
|
|
597
|
+
|
|
598
|
+
permissions:
|
|
599
|
+
contents: write
|
|
600
|
+
id-token: write # Required for Sigstore keyless signing
|
|
601
|
+
|
|
602
|
+
jobs:
|
|
603
|
+
sbom:
|
|
604
|
+
runs-on: ubuntu-latest
|
|
605
|
+
steps:
|
|
606
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
607
|
+
|
|
608
|
+
# Install Syft for SBOM generation
|
|
609
|
+
- uses: anchore/sbom-action@fc46e51e3555f3b6b3318a1461a89fc1add9170b # v0.18.0
|
|
610
|
+
with:
|
|
611
|
+
format: cyclonedx-json
|
|
612
|
+
output-file: sbom.cyclonedx.json
|
|
613
|
+
|
|
614
|
+
# Install cosign for signing
|
|
615
|
+
- uses: sigstore/cosign-installer@3454372be43a5bdb07b09b3c0c3c6e38233e1aa9 # v3.8.2
|
|
616
|
+
|
|
617
|
+
# Sign the SBOM with keyless Sigstore
|
|
618
|
+
- run: cosign sign-blob --yes sbom.cyclonedx.json --bundle sbom.cyclonedx.json.bundle
|
|
619
|
+
|
|
620
|
+
# Upload SBOM as release artifact
|
|
621
|
+
- uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
|
|
622
|
+
with:
|
|
623
|
+
files: |
|
|
624
|
+
sbom.cyclonedx.json
|
|
625
|
+
sbom.cyclonedx.json.bundle
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
### 10.5 Cosign Verification
|
|
629
|
+
|
|
630
|
+
```bash
|
|
631
|
+
#!/usr/bin/env bash
|
|
632
|
+
# verify-artifact.sh — Verify a signed container image or blob
|
|
633
|
+
|
|
634
|
+
set -euo pipefail
|
|
635
|
+
|
|
636
|
+
IMAGE="ghcr.io/yourorg/yourapp:latest"
|
|
637
|
+
|
|
638
|
+
# Verify container image signature (keyless / OIDC identity)
|
|
639
|
+
cosign verify "$IMAGE" \
|
|
640
|
+
--certificate-identity="https://github.com/yourorg/yourapp/.github/workflows/release.yml@refs/heads/main" \
|
|
641
|
+
--certificate-oidc-issuer="https://token.actions.githubusercontent.com"
|
|
642
|
+
|
|
643
|
+
# Verify an SBOM blob signature
|
|
644
|
+
cosign verify-blob sbom.cyclonedx.json \
|
|
645
|
+
--bundle sbom.cyclonedx.json.bundle \
|
|
646
|
+
--certificate-identity="https://github.com/yourorg/yourapp/.github/workflows/sbom.yml@refs/tags/v1.0.0" \
|
|
647
|
+
--certificate-oidc-issuer="https://token.actions.githubusercontent.com"
|
|
648
|
+
|
|
649
|
+
echo "Verification successful — artifact provenance confirmed."
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
### 10.6 Renovate Configuration (Supply Chain Hardening)
|
|
653
|
+
|
|
654
|
+
```json5
|
|
655
|
+
// renovate.json5
|
|
656
|
+
{
|
|
657
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
658
|
+
"extends": ["config:recommended", "helpers:pinGitHubActionDigests", ":pinVersions"],
|
|
659
|
+
"vulnerabilityAlerts": { "enabled": true, "labels": ["security"] },
|
|
660
|
+
"packageRules": [
|
|
661
|
+
{ "matchUpdateTypes": ["patch"], "matchCurrentVersion": "!/^0/",
|
|
662
|
+
"automerge": true, "platformAutomerge": true },
|
|
663
|
+
{ "matchUpdateTypes": ["major"], "reviewers": ["team:security"],
|
|
664
|
+
"labels": ["major-update", "needs-review"] },
|
|
665
|
+
{ "matchManagers": ["github-actions"], "groupName": "GitHub Actions" }
|
|
666
|
+
]
|
|
667
|
+
}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
### 10.7 Python Requirements with Hash Verification
|
|
671
|
+
|
|
672
|
+
```text
|
|
673
|
+
# requirements.txt — Install with: pip install -r requirements.txt --require-hashes
|
|
674
|
+
# Generated with: pip-compile --generate-hashes requirements.in
|
|
675
|
+
requests==2.32.3 \
|
|
676
|
+
--hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6
|
|
677
|
+
certifi==2024.8.30 \
|
|
678
|
+
--hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
## References
|
|
684
|
+
|
|
685
|
+
- [XZ Utils Backdoor (CVE-2024-3094) — Datadog](https://securitylabs.datadoghq.com/articles/xz-backdoor-cve-2024-3094/)
|
|
686
|
+
- [CVE-2024-3094 — CrowdStrike](https://www.crowdstrike.com/en-us/blog/cve-2024-3094-xz-upstream-supply-chain-attack/)
|
|
687
|
+
- [event-stream Incident Analysis](https://es-incident.github.io/paper.html)
|
|
688
|
+
- [NPM Supply Chain Compromise — CISA](https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem)
|
|
689
|
+
- [Codecov Breach — Sonatype](https://www.sonatype.com/blog/what-you-need-to-know-about-the-codecov-incident-a-supply-chain-attack-gone-undetected-for-2-months)
|
|
690
|
+
- [SLSA Framework](https://slsa.dev/) | [Spec v1.2](https://slsa.dev/spec/v1.2/)
|
|
691
|
+
- [NIST SP 800-218 — SSDF](https://www.nist.gov/itl/executive-order-14028-improving-nations-cybersecurity/software-security-supply-chains-software-1)
|
|
692
|
+
- [CISA 2025 SBOM Minimum Elements](https://www.cisa.gov/resources-tools/resources/2025-minimum-elements-software-bill-materials-sbom)
|
|
693
|
+
- [OpenSSF Scorecard](https://scorecard.dev/) | [Checks](https://github.com/ossf/scorecard/blob/main/docs/checks.md)
|
|
694
|
+
- [Sonatype State of the Software Supply Chain 2024](https://www.sonatype.com/state-of-the-software-supply-chain/2024/10-year-look)
|
|
695
|
+
- [Supply Chain Attack Statistics 2025 — DeepStrike](https://deepstrike.io/blog/supply-chain-attack-statistics-2025)
|
|
696
|
+
- [Sigstore Cosign — SBOM Signing](https://edu.chainguard.dev/open-source/sigstore/cosign/how-to-sign-an-sbom-with-cosign/)
|
|
697
|
+
- [Dependency Confusion Prevention — Snyk](https://snyk.io/blog/detect-prevent-dependency-confusion-attacks-npm-supply-chain-security/)
|
|
698
|
+
- [EO 14028 and Supply Chain Transparency — NetRise](https://www.netrise.io/xiot-security-blog/what-eo-14028-eu-cra-and-nist-csf-2.0-mean-for-software-supply-chain-transparency)
|