@shepai/cli 1.170.0 → 1.171.0-pr527.e2ee839
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/apis/json-schema/ActionDispositionEntry.yaml +14 -0
- package/apis/json-schema/DependencyFinding.yaml +28 -0
- package/apis/json-schema/DependencyRiskType.yaml +11 -0
- package/apis/json-schema/DependencyRules.yaml +38 -0
- package/apis/json-schema/EffectivePolicySnapshot.yaml +24 -0
- package/apis/json-schema/ReleaseIntegrityCheck.yaml +22 -0
- package/apis/json-schema/ReleaseIntegrityCheckType.yaml +9 -0
- package/apis/json-schema/ReleaseIntegrityResult.yaml +16 -0
- package/apis/json-schema/ReleaseRules.yaml +21 -0
- package/apis/json-schema/SecurityActionCategory.yaml +10 -0
- package/apis/json-schema/SecurityActionDisposition.yaml +8 -0
- package/apis/json-schema/SecurityConfig.yaml +17 -0
- package/apis/json-schema/SecurityEvent.yaml +36 -0
- package/apis/json-schema/SecurityMode.yaml +8 -0
- package/apis/json-schema/SecurityPolicy.yaml +24 -0
- package/apis/json-schema/SecuritySeverity.yaml +9 -0
- package/apis/json-schema/Settings.yaml +3 -0
- package/dist/packages/core/src/application/ports/output/agents/agent-executor.interface.d.ts +15 -1
- package/dist/packages/core/src/application/ports/output/agents/agent-executor.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts +3 -1
- package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/repositories/security-event.repository.interface.d.ts +76 -0
- package/dist/packages/core/src/application/ports/output/repositories/security-event.repository.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/repositories/security-event.repository.interface.js +11 -0
- package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts +38 -0
- package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.js +9 -0
- package/dist/packages/core/src/application/ports/output/services/security-policy-service.interface.d.ts +77 -0
- package/dist/packages/core/src/application/ports/output/services/security-policy-service.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/security-policy-service.interface.js +13 -0
- package/dist/packages/core/src/application/ports/output/services/spec-initializer.interface.d.ts +11 -0
- package/dist/packages/core/src/application/ports/output/services/spec-initializer.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.js +2 -0
- package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.js +2 -0
- package/dist/packages/core/src/application/use-cases/features/check-and-unblock-features.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/check-and-unblock-features.use-case.js +2 -0
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.js +1 -0
- package/dist/packages/core/src/application/use-cases/features/resume-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/resume-feature.use-case.js +2 -0
- package/dist/packages/core/src/application/use-cases/features/start-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/start-feature.use-case.js +2 -0
- package/dist/packages/core/src/application/use-cases/security/enforce-security.use-case.d.ts +71 -0
- package/dist/packages/core/src/application/use-cases/security/enforce-security.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/security/enforce-security.use-case.js +215 -0
- package/dist/packages/core/src/application/use-cases/security/evaluate-security-policy.use-case.d.ts +24 -0
- package/dist/packages/core/src/application/use-cases/security/evaluate-security-policy.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/security/evaluate-security-policy.use-case.js +56 -0
- package/dist/packages/core/src/application/use-cases/security/get-security-state.use-case.d.ts +36 -0
- package/dist/packages/core/src/application/use-cases/security/get-security-state.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/security/get-security-state.use-case.js +76 -0
- package/dist/packages/core/src/application/use-cases/security/record-security-event.use-case.d.ts +14 -0
- package/dist/packages/core/src/application/use-cases/security/record-security-event.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/security/record-security-event.use-case.js +46 -0
- package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.d.ts +1 -0
- package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.js +59 -2
- package/dist/packages/core/src/domain/errors/security-violation.error.d.ts +15 -0
- package/dist/packages/core/src/domain/errors/security-violation.error.d.ts.map +1 -0
- package/dist/packages/core/src/domain/errors/security-violation.error.js +20 -0
- package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
- package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +5 -1
- package/dist/packages/core/src/domain/generated/output.d.ts +259 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +43 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +57 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/security-event.mapper.d.ts +44 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/security-event.mapper.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/security-event.mapper.js +55 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +3 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +14 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-security-settings-columns.d.ts +18 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-security-settings-columns.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-security-settings-columns.js +31 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-create-security-events-table.d.ts +29 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-create-security-events-table.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-create-security-events-table.js +53 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-security-event.repository.d.ts +24 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-security-event.repository.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-security-event.repository.js +96 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +12 -3
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts +2 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.js +12 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/security-constraint-validator.d.ts +22 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/security-constraint-validator.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/security-constraint-validator.js +30 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/fast-feature-agent-graph.d.ts +10 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/fast-feature-agent-graph.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +34 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +3 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +7 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +3 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +32 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +19 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/security-pre-check.d.ts +45 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/security-pre-check.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/security-pre-check.js +70 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts +4 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.js +10 -0
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts +10 -1
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.js +101 -1
- package/dist/packages/core/src/infrastructure/services/security/dependency-risk-evaluator.d.ts +53 -0
- package/dist/packages/core/src/infrastructure/services/security/dependency-risk-evaluator.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/security/dependency-risk-evaluator.js +241 -0
- package/dist/packages/core/src/infrastructure/services/security/release-integrity-evaluator.d.ts +44 -0
- package/dist/packages/core/src/infrastructure/services/security/release-integrity-evaluator.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/security/release-integrity-evaluator.js +194 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy-file-reader.d.ts +28 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy-file-reader.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy-file-reader.js +50 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy-validator.d.ts +26 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy-validator.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy-validator.js +147 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy.service.d.ts +44 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/security/security-policy.service.js +174 -0
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.js +61 -0
- package/dist/src/presentation/cli/commands/security.command.d.ts +16 -0
- package/dist/src/presentation/cli/commands/security.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/security.command.js +118 -0
- package/dist/src/presentation/cli/commands/upgrade.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/upgrade.command.js +68 -3
- package/dist/src/presentation/cli/index.js +2 -0
- package/dist/src/presentation/web/app/actions/security.d.ts +28 -0
- package/dist/src/presentation/web/app/actions/security.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/security.js +59 -0
- package/dist/src/presentation/web/app/build-graph-nodes.d.ts +3 -1
- package/dist/src/presentation/web/app/build-graph-nodes.d.ts.map +1 -1
- package/dist/src/presentation/web/app/build-graph-nodes.js +2 -0
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +3 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-node.js +2 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.d.ts +3 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.js +3 -2
- package/dist/src/presentation/web/components/common/repository-node/security-panel.d.ts +6 -0
- package/dist/src/presentation/web/components/common/repository-node/security-panel.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/repository-node/security-panel.js +29 -0
- package/dist/src/presentation/web/components/common/repository-node/security-panel.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/common/repository-node/security-panel.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/repository-node/security-panel.stories.js +53 -0
- package/dist/src/presentation/web/components/common/security-badge.d.ts +7 -0
- package/dist/src/presentation/web/components/common/security-badge.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/security-badge.js +30 -0
- package/dist/src/presentation/web/components/common/security-badge.stories.d.ts +12 -0
- package/dist/src/presentation/web/components/common/security-badge.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/security-badge.stories.js +20 -0
- package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.js +16 -3
- package/dist/src/presentation/web/components/features/settings/supply-chain-security-settings-section.d.ts +6 -0
- package/dist/src/presentation/web/components/features/settings/supply-chain-security-settings-section.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/supply-chain-security-settings-section.js +60 -0
- package/dist/src/presentation/web/components/features/settings/supply-chain-security-settings-section.stories.d.ts +14 -0
- package/dist/src/presentation/web/components/features/settings/supply-chain-security-settings-section.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/supply-chain-security-settings-section.stories.js +116 -0
- package/dist/translations/ar/cli.json +22 -0
- package/dist/translations/ar/web.json +43 -1
- package/dist/translations/de/cli.json +22 -0
- package/dist/translations/de/web.json +43 -1
- package/dist/translations/en/cli.json +22 -0
- package/dist/translations/en/web.json +43 -1
- package/dist/translations/es/cli.json +22 -0
- package/dist/translations/es/web.json +43 -1
- package/dist/translations/fr/cli.json +22 -0
- package/dist/translations/fr/web.json +43 -1
- package/dist/translations/he/cli.json +22 -0
- package/dist/translations/he/web.json +43 -1
- package/dist/translations/pt/cli.json +22 -0
- package/dist/translations/pt/web.json +43 -1
- package/dist/translations/ru/cli.json +22 -0
- package/dist/translations/ru/web.json +43 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +2 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +2 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +2 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +2 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/chat/page.js +2 -1
- package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/create/page.js +2 -1
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +2 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +2 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/page.js +2 -1
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +2 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
- package/web/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/web/.next/server/app/api/sessions-batch/route.js.nft.json +1 -1
- package/web/.next/server/app/features/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/features/page.js.nft.json +1 -1
- package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +33 -18
- package/web/.next/server/app/settings/page.js +1 -1
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +13 -13
- package/web/.next/server/app/skills/page.js +2 -1
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/tools/page.js +2 -1
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_ad0071c9.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_ad0071c9.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_90d98b2b.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_90d98b2b.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_d3828105.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_d3828105.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__51ec77a8._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__51ec77a8._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__540c615f._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__540c615f._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__66047a1b._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__66047a1b._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9a9cb046._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9a9cb046._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a2d6c0ac._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a2d6c0ac._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a932cd3a._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a932cd3a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aa72e794._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aa72e794._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_02580450._.js +3 -0
- package/web/.next/server/chunks/ssr/_02580450._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1594e369._.js +9 -0
- package/web/.next/server/chunks/ssr/_1594e369._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_21d37090._.js +3 -0
- package/web/.next/server/chunks/ssr/_21d37090._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_45496654._.js +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js +1 -1
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_5119a3df._.js +1 -1
- package/web/.next/server/chunks/ssr/_5119a3df._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_0d7dd23b._.js → _767748d2._.js} +2 -2
- package/web/.next/server/chunks/ssr/_767748d2._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_df737cce._.js +1 -1
- package/web/.next/server/chunks/ssr/{_77ae079a._.js → _ee42a212._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_77ae079a._.js.map → _ee42a212._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_f8c55130._.js +4 -0
- package/web/.next/server/chunks/ssr/_f8c55130._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_ff04802c._.js +3 -0
- package/web/.next/server/chunks/ssr/_ff04802c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_17d39233._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_17d39233._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_54b02639._.js +5 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_54b02639._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_7b7b9e3b._.js +5 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_7b7b9e3b._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_807cba76._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_807cba76._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_90b5e66e.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_90b5e66e.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_e1cd1869._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_e1cd1869._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_e3a30e30._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_e3a30e30._.js.map +1 -0
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js +1 -1
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +74 -59
- package/web/.next/static/chunks/051873309d87fb45.css +1 -0
- package/web/.next/static/chunks/{8e12deeabf6624e9.js → 16fa4d3877c28fe2.js} +1 -1
- package/web/.next/static/chunks/23d80bb760e7dc4c.js +1 -0
- package/web/.next/static/chunks/30a0ba9015f94405.js +7 -0
- package/web/.next/static/chunks/{7a6854bb07182777.js → 39f6ad3f9005703a.js} +1 -1
- package/web/.next/static/chunks/3aba9d2242420cb5.js +1 -0
- package/web/.next/static/chunks/7a6f56f37aaa17ea.js +1 -0
- package/web/.next/static/chunks/{b0a6fce5425f8d3a.js → 7e05e7e25220ee9a.js} +1 -1
- package/web/.next/static/chunks/{f9da308b3033c57a.js → 89dd90bf14488ec0.js} +1 -1
- package/web/.next/static/chunks/{2b2f3a70ebd6ac1c.js → 9374d251360e808b.js} +1 -1
- package/web/.next/static/chunks/{f29814a72404ea2b.js → 9423dc2310202fda.js} +1 -1
- package/web/.next/static/chunks/a794cf7a1a5648dd.js +1 -0
- package/web/.next/static/chunks/{3d1df5c349d855eb.js → a8edb9423086e83f.js} +1 -1
- package/web/.next/static/chunks/ae81796726a9bba3.js +1 -0
- package/web/.next/static/chunks/{a3802d6f8677cd04.js → b9c62932ed987239.js} +2 -2
- package/web/.next/static/chunks/{c5a0b452afc8fe47.js → d1c3e0ee8e788c87.js} +1 -1
- package/web/.next/static/chunks/{ca23a8642f750548.js → e8c3c12f92e9a521.js} +2 -2
- package/web/.next/static/chunks/f3d5e0ae13def35a.js +1 -0
- package/web/.next/static/chunks/{d5366257d6b9f855.js → fb8dadb64c0ffc6b.js} +1 -1
- package/web/.next/static/chunks/fd232b88b5b50b2e.js +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fa525872._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fa525872._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_02e01240._.js +0 -4
- package/web/.next/server/chunks/ssr/_02e01240._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0d7dd23b._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_18886033._.js +0 -4
- package/web/.next/server/chunks/ssr/_18886033._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js +0 -4
- package/web/.next/server/chunks/ssr/_22e00a14._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_43ba79e7._.js +0 -3
- package/web/.next/server/chunks/ssr/_43ba79e7._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js +0 -4
- package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_a963dd3c._.js +0 -3
- package/web/.next/server/chunks/ssr/_a963dd3c._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_ad09f271._.js +0 -4
- package/web/.next/server/chunks/ssr/_ad09f271._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js +0 -4
- package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_deabc145._.js +0 -3
- package/web/.next/server/chunks/ssr/_deabc145._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_e3f14907._.js +0 -9
- package/web/.next/server/chunks/ssr/_e3f14907._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_ea9e1556._.js +0 -4
- package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js +0 -6
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f33cd07e._.js +0 -6
- package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js +0 -4
- package/web/.next/server/chunks/ssr/_f8b45233._.js.map +0 -1
- package/web/.next/static/chunks/06a86173379e6c51.js +0 -1
- package/web/.next/static/chunks/16ed73f9880b7d63.js +0 -1
- package/web/.next/static/chunks/4559a403ee40dd19.js +0 -7
- package/web/.next/static/chunks/74e5b5c7950efbc1.js +0 -1
- package/web/.next/static/chunks/8b0a9cb5109fe899.js +0 -1
- package/web/.next/static/chunks/9c6f8f49799efd3a.js +0 -1
- package/web/.next/static/chunks/b14085e99b88e7f7.css +0 -1
- package/web/.next/static/chunks/b65e555419a0c664.js +0 -1
- package/web/.next/static/chunks/f51250616da82bd2.js +0 -1
- /package/web/.next/static/{0KDwNT3AGQmFGIwjHx99r → t6SUt71jyk_PYf152Imog}/_buildManifest.js +0 -0
- /package/web/.next/static/{0KDwNT3AGQmFGIwjHx99r → t6SUt71jyk_PYf152Imog}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{0KDwNT3AGQmFGIwjHx99r → t6SUt71jyk_PYf152Imog}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency Risk Evaluator
|
|
3
|
+
*
|
|
4
|
+
* Evaluates repository-local dependency risk signals without
|
|
5
|
+
* external services. Checks:
|
|
6
|
+
* - Manifest-lockfile consistency (package.json vs lockfile)
|
|
7
|
+
* - Dependency source types (registry vs git vs file)
|
|
8
|
+
* - Risky lifecycle scripts (preinstall, postinstall, prepare)
|
|
9
|
+
* - Allowlist/denylist enforcement
|
|
10
|
+
* - Version-range strictness
|
|
11
|
+
*
|
|
12
|
+
* Returns an array of DependencyFinding objects with severity and remediation.
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
15
|
+
import { join } from 'node:path';
|
|
16
|
+
import { DependencyRiskType, SecuritySeverity } from '../../../domain/generated/output.js';
|
|
17
|
+
/**
|
|
18
|
+
* Lockfile names in priority order.
|
|
19
|
+
*/
|
|
20
|
+
const LOCKFILE_NAMES = ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock'];
|
|
21
|
+
/**
|
|
22
|
+
* Lifecycle script names that execute arbitrary code during install.
|
|
23
|
+
*/
|
|
24
|
+
const RISKY_LIFECYCLE_SCRIPTS = ['preinstall', 'install', 'postinstall', 'prepare'];
|
|
25
|
+
/**
|
|
26
|
+
* Patterns indicating a non-registry dependency source.
|
|
27
|
+
*/
|
|
28
|
+
const NON_REGISTRY_PREFIXES = ['git+', 'git:', 'github:', 'file:', 'link:', 'http:', 'https:'];
|
|
29
|
+
/**
|
|
30
|
+
* Patterns indicating loose version ranges.
|
|
31
|
+
*/
|
|
32
|
+
const LOOSE_RANGE_PATTERNS = [/^\*$/, /^\^/, /^~/, /^>=/, /^>(?!=)/];
|
|
33
|
+
export class DependencyRiskEvaluator {
|
|
34
|
+
/**
|
|
35
|
+
* Evaluate dependency risk for a repository.
|
|
36
|
+
*
|
|
37
|
+
* @param repositoryPath - Absolute path to the repository root
|
|
38
|
+
* @param rules - Dependency risk policy rules
|
|
39
|
+
* @returns Array of dependency findings
|
|
40
|
+
*/
|
|
41
|
+
evaluate(repositoryPath, rules) {
|
|
42
|
+
const packageJsonPath = join(repositoryPath, 'package.json');
|
|
43
|
+
if (!existsSync(packageJsonPath)) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
let packageJson;
|
|
47
|
+
try {
|
|
48
|
+
packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
const findings = [];
|
|
54
|
+
// Collect all dependencies
|
|
55
|
+
const allDeps = this.collectDependencies(packageJson);
|
|
56
|
+
// Check lockfile consistency
|
|
57
|
+
if (rules.checkLockfileConsistency) {
|
|
58
|
+
findings.push(...this.checkLockfileConsistency(repositoryPath, allDeps));
|
|
59
|
+
}
|
|
60
|
+
// Check non-registry sources
|
|
61
|
+
if (rules.checkNonRegistrySource) {
|
|
62
|
+
findings.push(...this.checkNonRegistrySources(allDeps));
|
|
63
|
+
}
|
|
64
|
+
// Check lifecycle scripts
|
|
65
|
+
if (rules.checkLifecycleScripts) {
|
|
66
|
+
findings.push(...this.checkLifecycleScripts(repositoryPath, allDeps));
|
|
67
|
+
}
|
|
68
|
+
// Check denylist
|
|
69
|
+
if (rules.denylist.length > 0) {
|
|
70
|
+
findings.push(...this.checkDenylist(allDeps, rules.denylist));
|
|
71
|
+
}
|
|
72
|
+
// Check allowlist
|
|
73
|
+
if (rules.allowlist.length > 0) {
|
|
74
|
+
findings.push(...this.checkAllowlist(allDeps, rules.allowlist));
|
|
75
|
+
}
|
|
76
|
+
// Check version-range strictness
|
|
77
|
+
if (rules.enforceStrictVersionRanges) {
|
|
78
|
+
findings.push(...this.checkVersionRangeStrictness(allDeps));
|
|
79
|
+
}
|
|
80
|
+
return findings;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Collect all dependencies from package.json (dependencies + devDependencies).
|
|
84
|
+
*/
|
|
85
|
+
collectDependencies(packageJson) {
|
|
86
|
+
const deps = new Map();
|
|
87
|
+
const depSections = ['dependencies', 'devDependencies'];
|
|
88
|
+
for (const section of depSections) {
|
|
89
|
+
const sectionDeps = packageJson[section];
|
|
90
|
+
if (sectionDeps && typeof sectionDeps === 'object') {
|
|
91
|
+
for (const [name, version] of Object.entries(sectionDeps)) {
|
|
92
|
+
deps.set(name, version);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return deps;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Check that a lockfile exists when there are dependencies.
|
|
100
|
+
*/
|
|
101
|
+
checkLockfileConsistency(repositoryPath, deps) {
|
|
102
|
+
if (deps.size === 0) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
const hasLockfile = LOCKFILE_NAMES.some((name) => existsSync(join(repositoryPath, name)));
|
|
106
|
+
if (!hasLockfile) {
|
|
107
|
+
return [
|
|
108
|
+
{
|
|
109
|
+
packageName: '*',
|
|
110
|
+
severity: SecuritySeverity.High,
|
|
111
|
+
riskType: DependencyRiskType.LockfileInconsistency,
|
|
112
|
+
message: 'No lockfile found. Dependencies are not pinned to specific versions.',
|
|
113
|
+
remediation: 'Run your package manager install command to generate a lockfile (e.g., pnpm install).',
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Check for dependencies installed from non-registry sources.
|
|
121
|
+
*/
|
|
122
|
+
checkNonRegistrySources(deps) {
|
|
123
|
+
const findings = [];
|
|
124
|
+
for (const [name, version] of deps) {
|
|
125
|
+
const isNonRegistry = NON_REGISTRY_PREFIXES.some((prefix) => version.startsWith(prefix));
|
|
126
|
+
if (isNonRegistry) {
|
|
127
|
+
findings.push({
|
|
128
|
+
packageName: name,
|
|
129
|
+
version,
|
|
130
|
+
severity: SecuritySeverity.Medium,
|
|
131
|
+
riskType: DependencyRiskType.NonRegistrySource,
|
|
132
|
+
message: `Package "${name}" is installed from a non-registry source: ${version}`,
|
|
133
|
+
remediation: `Consider using a registry-published version of "${name}" instead of a direct source reference.`,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return findings;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Check installed packages for risky lifecycle scripts.
|
|
141
|
+
*/
|
|
142
|
+
checkLifecycleScripts(repositoryPath, deps) {
|
|
143
|
+
const findings = [];
|
|
144
|
+
const nodeModules = join(repositoryPath, 'node_modules');
|
|
145
|
+
if (!existsSync(nodeModules)) {
|
|
146
|
+
return [];
|
|
147
|
+
}
|
|
148
|
+
for (const [name] of deps) {
|
|
149
|
+
const pkgJsonPath = join(nodeModules, name, 'package.json');
|
|
150
|
+
if (!existsSync(pkgJsonPath)) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));
|
|
155
|
+
const scripts = pkgJson.scripts;
|
|
156
|
+
if (!scripts || typeof scripts !== 'object') {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const riskyScripts = RISKY_LIFECYCLE_SCRIPTS.filter((s) => typeof scripts[s] === 'string' && scripts[s].length > 0);
|
|
160
|
+
if (riskyScripts.length > 0) {
|
|
161
|
+
findings.push({
|
|
162
|
+
packageName: name,
|
|
163
|
+
version: pkgJson.version,
|
|
164
|
+
severity: SecuritySeverity.Medium,
|
|
165
|
+
riskType: DependencyRiskType.LifecycleScript,
|
|
166
|
+
message: `Package "${name}" has lifecycle scripts that execute during install: ${riskyScripts.join(', ')}`,
|
|
167
|
+
remediation: `Review the lifecycle scripts in "${name}" or add it to the allowlist if trusted. Consider using --ignore-scripts during install.`,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
// Skip packages with unreadable package.json
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return findings;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Check dependencies against the denylist.
|
|
179
|
+
*/
|
|
180
|
+
checkDenylist(deps, denylist) {
|
|
181
|
+
const findings = [];
|
|
182
|
+
const denySet = new Set(denylist);
|
|
183
|
+
for (const [name, version] of deps) {
|
|
184
|
+
if (denySet.has(name)) {
|
|
185
|
+
findings.push({
|
|
186
|
+
packageName: name,
|
|
187
|
+
version,
|
|
188
|
+
severity: SecuritySeverity.Critical,
|
|
189
|
+
riskType: DependencyRiskType.DenylistViolation,
|
|
190
|
+
message: `Package "${name}" is on the denylist and must be removed.`,
|
|
191
|
+
remediation: `Remove "${name}" from your dependencies. It has been explicitly denied by security policy.`,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return findings;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Check dependencies against the allowlist (non-empty allowlist = only listed packages allowed).
|
|
199
|
+
*/
|
|
200
|
+
checkAllowlist(deps, allowlist) {
|
|
201
|
+
const findings = [];
|
|
202
|
+
const allowSet = new Set(allowlist);
|
|
203
|
+
for (const [name, version] of deps) {
|
|
204
|
+
if (!allowSet.has(name)) {
|
|
205
|
+
findings.push({
|
|
206
|
+
packageName: name,
|
|
207
|
+
version,
|
|
208
|
+
severity: SecuritySeverity.High,
|
|
209
|
+
riskType: DependencyRiskType.AllowlistViolation,
|
|
210
|
+
message: `Package "${name}" is not on the allowlist.`,
|
|
211
|
+
remediation: `Add "${name}" to the allowlist in shep.security.yaml if it is a trusted dependency, or remove it.`,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return findings;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Check version ranges for strictness (no ^, ~, *, >= patterns).
|
|
219
|
+
*/
|
|
220
|
+
checkVersionRangeStrictness(deps) {
|
|
221
|
+
const findings = [];
|
|
222
|
+
for (const [name, version] of deps) {
|
|
223
|
+
// Skip non-registry sources (already flagged separately)
|
|
224
|
+
if (NON_REGISTRY_PREFIXES.some((prefix) => version.startsWith(prefix))) {
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
const isLoose = LOOSE_RANGE_PATTERNS.some((pattern) => pattern.test(version));
|
|
228
|
+
if (isLoose) {
|
|
229
|
+
findings.push({
|
|
230
|
+
packageName: name,
|
|
231
|
+
version,
|
|
232
|
+
severity: SecuritySeverity.Medium,
|
|
233
|
+
riskType: DependencyRiskType.VersionRangePolicy,
|
|
234
|
+
message: `Package "${name}" uses a loose version range "${version}". Strict version pinning is required by policy.`,
|
|
235
|
+
remediation: `Pin "${name}" to an exact version (e.g., "4.17.21" instead of "${version}").`,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return findings;
|
|
240
|
+
}
|
|
241
|
+
}
|
package/dist/packages/core/src/infrastructure/services/security/release-integrity-evaluator.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release Integrity Evaluator
|
|
3
|
+
*
|
|
4
|
+
* Checks release pipeline integrity for a repository:
|
|
5
|
+
* - CI workflow exists and publishes from CI (not local)
|
|
6
|
+
* - NPM_TOKEN and RELEASE_TOKEN referenced as secrets (not hardcoded)
|
|
7
|
+
* - npm provenance flags (--provenance) present in publish steps
|
|
8
|
+
* - Release workflow integrity (semantic-release configured)
|
|
9
|
+
*
|
|
10
|
+
* Returns a ReleaseIntegrityResult with individual check results and overall pass/fail.
|
|
11
|
+
*/
|
|
12
|
+
import type { ReleaseIntegrityResult, ReleaseRules } from '../../../domain/generated/output.js';
|
|
13
|
+
export declare class ReleaseIntegrityEvaluator {
|
|
14
|
+
/**
|
|
15
|
+
* Evaluate release pipeline integrity.
|
|
16
|
+
*
|
|
17
|
+
* @param repositoryPath - Absolute path to the repository root
|
|
18
|
+
* @param rules - Release integrity policy rules
|
|
19
|
+
* @returns Aggregated result with individual check details
|
|
20
|
+
*/
|
|
21
|
+
evaluate(repositoryPath: string, rules: ReleaseRules): ReleaseIntegrityResult;
|
|
22
|
+
/**
|
|
23
|
+
* Read all YAML workflow files from .github/workflows/.
|
|
24
|
+
*/
|
|
25
|
+
private readWorkflowFiles;
|
|
26
|
+
/**
|
|
27
|
+
* Check that CI workflow files exist (publishing happens in CI, not locally).
|
|
28
|
+
*/
|
|
29
|
+
private checkCiOnlyPublishing;
|
|
30
|
+
/**
|
|
31
|
+
* Check that tokens are referenced as secrets, not hardcoded.
|
|
32
|
+
* Scans for known token env var names and verifies they use ${{ secrets.* }}.
|
|
33
|
+
*/
|
|
34
|
+
private checkSecretConfiguration;
|
|
35
|
+
/**
|
|
36
|
+
* Check that npm publish commands include --provenance flag.
|
|
37
|
+
*/
|
|
38
|
+
private checkProvenanceConfiguration;
|
|
39
|
+
/**
|
|
40
|
+
* Check workflow integrity (semantic-release is configured).
|
|
41
|
+
*/
|
|
42
|
+
private checkWorkflowIntegrity;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=release-integrity-evaluator.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/security/release-integrity-evaluator.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-integrity-evaluator.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/security/release-integrity-evaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAEV,sBAAsB,EACtB,YAAY,EACb,MAAM,qCAAqC,CAAC;AA2B7C,qBAAa,yBAAyB;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,sBAAsB;IAiC7E;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAgBzB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAsB7B;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAkChC;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAyCpC;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAoB/B"}
|
package/dist/packages/core/src/infrastructure/services/security/release-integrity-evaluator.js
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release Integrity Evaluator
|
|
3
|
+
*
|
|
4
|
+
* Checks release pipeline integrity for a repository:
|
|
5
|
+
* - CI workflow exists and publishes from CI (not local)
|
|
6
|
+
* - NPM_TOKEN and RELEASE_TOKEN referenced as secrets (not hardcoded)
|
|
7
|
+
* - npm provenance flags (--provenance) present in publish steps
|
|
8
|
+
* - Release workflow integrity (semantic-release configured)
|
|
9
|
+
*
|
|
10
|
+
* Returns a ReleaseIntegrityResult with individual check results and overall pass/fail.
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { ReleaseIntegrityCheckType, SecuritySeverity } from '../../../domain/generated/output.js';
|
|
15
|
+
/**
|
|
16
|
+
* Token env var names that should use secrets.* references.
|
|
17
|
+
*/
|
|
18
|
+
const TOKEN_ENV_NAMES = ['GITHUB_TOKEN', 'RELEASE_TOKEN', 'NPM_TOKEN', 'NODE_AUTH_TOKEN'];
|
|
19
|
+
/**
|
|
20
|
+
* Pattern for a secrets.* reference in a YAML value.
|
|
21
|
+
*/
|
|
22
|
+
const SECRETS_REF_PATTERN = /\$\{\{\s*secrets\./;
|
|
23
|
+
/**
|
|
24
|
+
* Pattern for detecting npm publish commands.
|
|
25
|
+
*/
|
|
26
|
+
const NPM_PUBLISH_PATTERN = /npm\s+publish/;
|
|
27
|
+
/**
|
|
28
|
+
* Pattern for detecting --provenance flag.
|
|
29
|
+
*/
|
|
30
|
+
const PROVENANCE_FLAG_PATTERN = /--provenance/;
|
|
31
|
+
/**
|
|
32
|
+
* Pattern for detecting semantic-release.
|
|
33
|
+
*/
|
|
34
|
+
const SEMANTIC_RELEASE_PATTERN = /semantic-release/;
|
|
35
|
+
export class ReleaseIntegrityEvaluator {
|
|
36
|
+
/**
|
|
37
|
+
* Evaluate release pipeline integrity.
|
|
38
|
+
*
|
|
39
|
+
* @param repositoryPath - Absolute path to the repository root
|
|
40
|
+
* @param rules - Release integrity policy rules
|
|
41
|
+
* @returns Aggregated result with individual check details
|
|
42
|
+
*/
|
|
43
|
+
evaluate(repositoryPath, rules) {
|
|
44
|
+
const checks = [];
|
|
45
|
+
const workflowDir = join(repositoryPath, '.github', 'workflows');
|
|
46
|
+
// Read all workflow files
|
|
47
|
+
const workflowContents = this.readWorkflowFiles(workflowDir);
|
|
48
|
+
// Check CI-only publishing
|
|
49
|
+
if (rules.requireCiOnlyPublishing) {
|
|
50
|
+
checks.push(this.checkCiOnlyPublishing(workflowDir, workflowContents));
|
|
51
|
+
}
|
|
52
|
+
// Check secret configuration (no hardcoded tokens)
|
|
53
|
+
if (rules.requireCiOnlyPublishing) {
|
|
54
|
+
checks.push(this.checkSecretConfiguration(workflowContents));
|
|
55
|
+
}
|
|
56
|
+
// Check provenance configuration
|
|
57
|
+
if (rules.requireProvenance) {
|
|
58
|
+
checks.push(...this.checkProvenanceConfiguration(workflowContents));
|
|
59
|
+
}
|
|
60
|
+
// Check workflow integrity
|
|
61
|
+
if (rules.checkWorkflowIntegrity) {
|
|
62
|
+
checks.push(this.checkWorkflowIntegrity(workflowContents));
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
checks,
|
|
66
|
+
passed: checks.length === 0 || checks.every((c) => c.passed),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Read all YAML workflow files from .github/workflows/.
|
|
71
|
+
*/
|
|
72
|
+
readWorkflowFiles(workflowDir) {
|
|
73
|
+
if (!existsSync(workflowDir)) {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const files = readdirSync(workflowDir).filter((f) => f.endsWith('.yml') || f.endsWith('.yaml'));
|
|
78
|
+
return files.map((f) => readFileSync(join(workflowDir, f), 'utf-8'));
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Check that CI workflow files exist (publishing happens in CI, not locally).
|
|
86
|
+
*/
|
|
87
|
+
checkCiOnlyPublishing(workflowDir, workflowContents) {
|
|
88
|
+
if (workflowContents.length === 0) {
|
|
89
|
+
return {
|
|
90
|
+
checkType: ReleaseIntegrityCheckType.CiOnlyPublishing,
|
|
91
|
+
passed: false,
|
|
92
|
+
message: 'No CI workflow files found in .github/workflows/. Publishing must happen in CI, not locally.',
|
|
93
|
+
severity: SecuritySeverity.Critical,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
checkType: ReleaseIntegrityCheckType.CiOnlyPublishing,
|
|
98
|
+
passed: true,
|
|
99
|
+
message: 'CI workflow files found. Publishing is configured for CI execution.',
|
|
100
|
+
severity: SecuritySeverity.Critical,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Check that tokens are referenced as secrets, not hardcoded.
|
|
105
|
+
* Scans for known token env var names and verifies they use ${{ secrets.* }}.
|
|
106
|
+
*/
|
|
107
|
+
checkSecretConfiguration(workflowContents) {
|
|
108
|
+
const allContent = workflowContents.join('\n');
|
|
109
|
+
const lines = allContent.split('\n');
|
|
110
|
+
for (const line of lines) {
|
|
111
|
+
const trimmed = line.trim();
|
|
112
|
+
for (const tokenName of TOKEN_ENV_NAMES) {
|
|
113
|
+
// Match lines like "NPM_TOKEN: value" or "NPM_TOKEN: 'value'"
|
|
114
|
+
const pattern = new RegExp(`^${tokenName}\\s*:\\s*(.+)$`);
|
|
115
|
+
const match = pattern.exec(trimmed);
|
|
116
|
+
if (match) {
|
|
117
|
+
const value = match[1].trim();
|
|
118
|
+
// Value must contain a secrets.* reference to be safe
|
|
119
|
+
if (!SECRETS_REF_PATTERN.test(value)) {
|
|
120
|
+
return {
|
|
121
|
+
checkType: ReleaseIntegrityCheckType.SecretConfiguration,
|
|
122
|
+
passed: false,
|
|
123
|
+
message: 'Hardcoded token detected in workflow files. Tokens must use ${{ secrets.* }} references.',
|
|
124
|
+
severity: SecuritySeverity.Critical,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
checkType: ReleaseIntegrityCheckType.SecretConfiguration,
|
|
132
|
+
passed: true,
|
|
133
|
+
message: 'Tokens are properly referenced using ${{ secrets.* }} expressions.',
|
|
134
|
+
severity: SecuritySeverity.Critical,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Check that npm publish commands include --provenance flag.
|
|
139
|
+
*/
|
|
140
|
+
checkProvenanceConfiguration(workflowContents) {
|
|
141
|
+
const allContent = workflowContents.join('\n');
|
|
142
|
+
// If no npm publish commands found, provenance is not applicable
|
|
143
|
+
if (!NPM_PUBLISH_PATTERN.test(allContent)) {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
// Check if all npm publish commands have --provenance
|
|
147
|
+
const lines = allContent.split('\n');
|
|
148
|
+
let hasPublishWithoutProvenance = false;
|
|
149
|
+
for (const line of lines) {
|
|
150
|
+
if (NPM_PUBLISH_PATTERN.test(line) && !PROVENANCE_FLAG_PATTERN.test(line)) {
|
|
151
|
+
hasPublishWithoutProvenance = true;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (hasPublishWithoutProvenance) {
|
|
156
|
+
return [
|
|
157
|
+
{
|
|
158
|
+
checkType: ReleaseIntegrityCheckType.ProvenanceConfiguration,
|
|
159
|
+
passed: false,
|
|
160
|
+
message: 'npm publish command found without --provenance flag. Add --provenance to generate SLSA provenance attestations.',
|
|
161
|
+
severity: SecuritySeverity.Medium,
|
|
162
|
+
},
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
return [
|
|
166
|
+
{
|
|
167
|
+
checkType: ReleaseIntegrityCheckType.ProvenanceConfiguration,
|
|
168
|
+
passed: true,
|
|
169
|
+
message: 'npm publish commands include --provenance flag for SLSA provenance.',
|
|
170
|
+
severity: SecuritySeverity.Medium,
|
|
171
|
+
},
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Check workflow integrity (semantic-release is configured).
|
|
176
|
+
*/
|
|
177
|
+
checkWorkflowIntegrity(workflowContents) {
|
|
178
|
+
const allContent = workflowContents.join('\n');
|
|
179
|
+
if (!SEMANTIC_RELEASE_PATTERN.test(allContent)) {
|
|
180
|
+
return {
|
|
181
|
+
checkType: ReleaseIntegrityCheckType.WorkflowIntegrity,
|
|
182
|
+
passed: false,
|
|
183
|
+
message: 'semantic-release not found in CI workflows. Automated release management is recommended.',
|
|
184
|
+
severity: SecuritySeverity.Medium,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
checkType: ReleaseIntegrityCheckType.WorkflowIntegrity,
|
|
189
|
+
passed: true,
|
|
190
|
+
message: 'semantic-release is configured in CI workflows.',
|
|
191
|
+
severity: SecuritySeverity.Medium,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
package/dist/packages/core/src/infrastructure/services/security/security-policy-file-reader.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Policy File Reader
|
|
3
|
+
*
|
|
4
|
+
* Reads and parses shep.security.yaml from a repository root using js-yaml.
|
|
5
|
+
* Returns the parsed object or null if the file does not exist.
|
|
6
|
+
* Throws with actionable messages on YAML syntax errors.
|
|
7
|
+
*
|
|
8
|
+
* Uses DEFAULT_SCHEMA to prevent arbitrary code execution from YAML tags.
|
|
9
|
+
*/
|
|
10
|
+
import type { SecurityPolicy } from '../../../domain/generated/output.js';
|
|
11
|
+
/**
|
|
12
|
+
* The filename for the security policy file at the repository root.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SECURITY_POLICY_FILENAME = "shep.security.yaml";
|
|
15
|
+
/**
|
|
16
|
+
* Reads and parses the security policy YAML file from a repository.
|
|
17
|
+
*/
|
|
18
|
+
export declare class SecurityPolicyFileReader {
|
|
19
|
+
/**
|
|
20
|
+
* Read and parse the security policy file from the given repository path.
|
|
21
|
+
*
|
|
22
|
+
* @param repositoryPath - Absolute path to the repository root
|
|
23
|
+
* @returns Parsed policy object, or null if file does not exist or is empty
|
|
24
|
+
* @throws Error with actionable message if YAML is malformed
|
|
25
|
+
*/
|
|
26
|
+
read(repositoryPath: string): Promise<Partial<SecurityPolicy> | null>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=security-policy-file-reader.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/security/security-policy-file-reader.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-policy-file-reader.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/security/security-policy-file-reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D;;GAEG;AACH,qBAAa,wBAAwB;IACnC;;;;;;OAMG;IACG,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;CA0B5E"}
|
package/dist/packages/core/src/infrastructure/services/security/security-policy-file-reader.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Policy File Reader
|
|
3
|
+
*
|
|
4
|
+
* Reads and parses shep.security.yaml from a repository root using js-yaml.
|
|
5
|
+
* Returns the parsed object or null if the file does not exist.
|
|
6
|
+
* Throws with actionable messages on YAML syntax errors.
|
|
7
|
+
*
|
|
8
|
+
* Uses DEFAULT_SCHEMA to prevent arbitrary code execution from YAML tags.
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import yaml from 'js-yaml';
|
|
13
|
+
/**
|
|
14
|
+
* The filename for the security policy file at the repository root.
|
|
15
|
+
*/
|
|
16
|
+
export const SECURITY_POLICY_FILENAME = 'shep.security.yaml';
|
|
17
|
+
/**
|
|
18
|
+
* Reads and parses the security policy YAML file from a repository.
|
|
19
|
+
*/
|
|
20
|
+
export class SecurityPolicyFileReader {
|
|
21
|
+
/**
|
|
22
|
+
* Read and parse the security policy file from the given repository path.
|
|
23
|
+
*
|
|
24
|
+
* @param repositoryPath - Absolute path to the repository root
|
|
25
|
+
* @returns Parsed policy object, or null if file does not exist or is empty
|
|
26
|
+
* @throws Error with actionable message if YAML is malformed
|
|
27
|
+
*/
|
|
28
|
+
async read(repositoryPath) {
|
|
29
|
+
const filePath = join(repositoryPath, SECURITY_POLICY_FILENAME);
|
|
30
|
+
if (!existsSync(filePath)) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
34
|
+
try {
|
|
35
|
+
const parsed = yaml.load(content, {
|
|
36
|
+
schema: yaml.DEFAULT_SCHEMA,
|
|
37
|
+
filename: SECURITY_POLICY_FILENAME,
|
|
38
|
+
});
|
|
39
|
+
// Empty file or comment-only file yields null/undefined
|
|
40
|
+
if (parsed == null || typeof parsed !== 'object') {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return parsed;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
47
|
+
throw new Error(`Failed to parse ${SECURITY_POLICY_FILENAME}: ${message}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist/packages/core/src/infrastructure/services/security/security-policy-validator.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Policy Validator
|
|
3
|
+
*
|
|
4
|
+
* Validates a parsed security policy object against the expected schema.
|
|
5
|
+
* Checks required fields, valid enum values, contradictory rules,
|
|
6
|
+
* and reasonable input limits. Returns structured validation results
|
|
7
|
+
* with per-field error messages.
|
|
8
|
+
*/
|
|
9
|
+
import type { PolicyValidationResult } from '../../../application/ports/output/services/security-policy-service.interface.js';
|
|
10
|
+
/**
|
|
11
|
+
* Validates parsed security policy objects against the expected schema.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SecurityPolicyValidator {
|
|
14
|
+
/**
|
|
15
|
+
* Validate a parsed policy object.
|
|
16
|
+
*
|
|
17
|
+
* @param policy - The parsed policy object (from YAML)
|
|
18
|
+
* @returns Validation result with errors array
|
|
19
|
+
*/
|
|
20
|
+
validate(policy: Record<string, unknown>): PolicyValidationResult;
|
|
21
|
+
private validateActionDispositions;
|
|
22
|
+
private validateDependencyRules;
|
|
23
|
+
private validateReleaseRules;
|
|
24
|
+
private validateStringList;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=security-policy-validator.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/security/security-policy-validator.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-policy-validator.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/security/security-policy-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iFAAiF,CAAC;AAY9H;;GAEG;AACH,qBAAa,uBAAuB;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,sBAAsB;IAiCjE,OAAO,CAAC,0BAA0B;IAwDlC,OAAO,CAAC,uBAAuB;IAgC/B,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,kBAAkB;CAgB3B"}
|