claude-flow-novice 2.3.4 โ 2.3.6
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/dist/src/booster/performance-benchmark.js +1 -1
- package/dist/src/booster/wasm-demo.js +1 -1
- package/dist/src/cli/command-registry.js +2 -2
- package/dist/src/cli/help-formatter.js +137 -109
- package/dist/src/cli/simple-cli.js +2528 -2121
- package/dist/src/cli/simple-commands/sparc/refinement.js +3 -3
- package/dist/src/cli/validation-helper.js +98 -49
- package/dist/src/commands/suggest-templates.js +4 -4
- package/dist/src/core/version.js +23 -15
- package/dist/src/memory/swarm-memory.js +603 -470
- package/dist/src/slash-commands/fullstack.js +2 -2
- package/dist/src/slash-commands/parse-epic.js +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +41 -31
- package/dist/scripts/.claude-flow/metrics/agent-metrics.json +0 -1
- package/dist/scripts/.claude-flow/metrics/performance.json +0 -9
- package/dist/scripts/.claude-flow/metrics/task-metrics.json +0 -10
- package/dist/scripts/CLEANUP_OPTIMIZATION_REPORT.json +0 -312
- package/dist/scripts/CLEANUP_PERFORMANCE_OPTIMIZATION.md +0 -387
- package/dist/scripts/CLEANUP_QUICK_START.md +0 -268
- package/dist/scripts/CLEANUP_TEST_RESULTS.md +0 -205
- package/dist/scripts/README.md +0 -339
- package/dist/scripts/ace-query.sh +0 -384
- package/dist/scripts/agent-token-analysis.js +0 -430
- package/dist/scripts/auto-setup.js +0 -332
- package/dist/scripts/build/README.md +0 -167
- package/dist/scripts/build/build-config.js +0 -27
- package/dist/scripts/build/build-prompt-copier.sh +0 -30
- package/dist/scripts/build/performance-monitor.js +0 -869
- package/dist/scripts/build/prepare-publish.js +0 -150
- package/dist/scripts/build/typescript-fixer.js +0 -621
- package/dist/scripts/build/unified-builder.sh +0 -428
- package/dist/scripts/build/update-bin-version.js +0 -32
- package/dist/scripts/build/validate-agents.js +0 -238
- package/dist/scripts/build-index.js +0 -43
- package/dist/scripts/build-orchestrator.js +0 -320
- package/dist/scripts/check-routing-stats.cjs +0 -122
- package/dist/scripts/ci-validation.js +0 -375
- package/dist/scripts/cleanup-blocking-coordination.sh +0 -420
- package/dist/scripts/cleanup-idle-sessions.sh +0 -118
- package/dist/scripts/collect-build-metrics.js +0 -65
- package/dist/scripts/demo/README.md +0 -79
- package/dist/scripts/demo/autoscaling-demo-simplified.js +0 -963
- package/dist/scripts/demo/comprehensive-dashboard-test.js +0 -693
- package/dist/scripts/demo/confidence-log.js +0 -87
- package/dist/scripts/demo/confidence-report.js +0 -82
- package/dist/scripts/demo/demo-multi-swarm-coordination.js +0 -325
- package/dist/scripts/demo/demo-production-deployment.js +0 -399
- package/dist/scripts/demo/demo-visualization-system.js +0 -149
- package/dist/scripts/demo/performance-analysis.cjs +0 -71
- package/dist/scripts/demo/performance-analysis.js +0 -71
- package/dist/scripts/demo/test-autoscaling-demo.js +0 -314
- package/dist/scripts/dependency-optimizer.js +0 -349
- package/dist/scripts/dependency-security-assessment.js +0 -331
- package/dist/scripts/deploy-sdk.sh +0 -176
- package/dist/scripts/deployment-readiness-report.json +0 -179
- package/dist/scripts/dev/README.md +0 -264
- package/dist/scripts/dev/claude-flow-wrapper.sh +0 -35
- package/dist/scripts/dev/claude-monitor.py +0 -419
- package/dist/scripts/dev/claude-sparc.sh +0 -562
- package/dist/scripts/dev/claude-wrapper.sh +0 -17
- package/dist/scripts/dev/demo-phase3-compliance.js +0 -172
- package/dist/scripts/dev/demo-task-system.ts +0 -224
- package/dist/scripts/dev/deployment-validator.js +0 -315
- package/dist/scripts/dev/spawn-claude-terminal.sh +0 -32
- package/dist/scripts/dev/start-portal.sh +0 -506
- package/dist/scripts/dev/start-web-ui.js +0 -15
- package/dist/scripts/dev/stop-portal.sh +0 -311
- package/dist/scripts/dev/validate-examples.ts +0 -288
- package/dist/scripts/dev/validate-phase2.cjs +0 -451
- package/dist/scripts/dev/validate-phase2.js +0 -785
- package/dist/scripts/dev/validate-phase3.cjs +0 -208
- package/dist/scripts/dev/validate-security-remediation.js +0 -1
- package/dist/scripts/ecosystem.config.cjs +0 -90
- package/dist/scripts/enhanced-memory-spiral-killer.sh +0 -221
- package/dist/scripts/fix-js-extensions.js +0 -167
- package/dist/scripts/generate-basic-types.js +0 -73
- package/dist/scripts/generate-changelog.js +0 -318
- package/dist/scripts/git-hooks/pre-commit.sh +0 -143
- package/dist/scripts/health-checks.js +0 -634
- package/dist/scripts/hook-wrapper.sh +0 -54
- package/dist/scripts/install/README.md +0 -375
- package/dist/scripts/install/REDIS_SETUP_VALIDATION.json +0 -245
- package/dist/scripts/install/check-prerequisites.js +0 -303
- package/dist/scripts/install/config-wizard.js +0 -606
- package/dist/scripts/install/dependency-checker.js +0 -385
- package/dist/scripts/install/health-check.js +0 -765
- package/dist/scripts/install/install.js +0 -256
- package/dist/scripts/install/installation-benchmark.js +0 -461
- package/dist/scripts/install/quick-install.js +0 -720
- package/dist/scripts/install/quick-start-wizard.js +0 -295
- package/dist/scripts/install/redis-cli.js +0 -289
- package/dist/scripts/install/redis-install-guides.md +0 -407
- package/dist/scripts/install/redis-setup.js +0 -559
- package/dist/scripts/install/redis-test.js +0 -278
- package/dist/scripts/install/service-manager.js +0 -672
- package/dist/scripts/install/setup.js +0 -832
- package/dist/scripts/install/uninstall.js +0 -526
- package/dist/scripts/install/update.js +0 -461
- package/dist/scripts/install-pre-commit-hook.sh +0 -127
- package/dist/scripts/legacy/README.md +0 -272
- package/dist/scripts/legacy/batch-fix-ts.sh +0 -54
- package/dist/scripts/legacy/build-migration.sh +0 -105
- package/dist/scripts/legacy/build-monitor.js +0 -209
- package/dist/scripts/legacy/build-with-filter.sh +0 -84
- package/dist/scripts/legacy/build-workaround.sh +0 -71
- package/dist/scripts/legacy/fix-ts-advanced.js +0 -358
- package/dist/scripts/legacy/fix-ts-final.sh +0 -50
- package/dist/scripts/legacy/fix-ts-targeted.sh +0 -49
- package/dist/scripts/legacy/fix-typescript-errors.js +0 -305
- package/dist/scripts/legacy/force-build.sh +0 -63
- package/dist/scripts/legacy/optimize-performance.js +0 -400
- package/dist/scripts/legacy/performance-monitor.js +0 -263
- package/dist/scripts/legacy/performance-monitoring.js +0 -532
- package/dist/scripts/legacy/performance-test-runner.js +0 -645
- package/dist/scripts/legacy/quick-fix-ts.js +0 -281
- package/dist/scripts/legacy/safe-build.sh +0 -63
- package/dist/scripts/memory-monitor-coordinator.js +0 -451
- package/dist/scripts/migrate-to-sdk.sh +0 -520
- package/dist/scripts/migration/QUICK-START.md +0 -189
- package/dist/scripts/migration/QUICK-START.md.backup-1760135091363 +0 -189
- package/dist/scripts/migration/README.md +0 -464
- package/dist/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md +0 -500
- package/dist/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md.backup-1760135091348 +0 -500
- package/dist/scripts/migration/UPDATE-PATHS-README.md +0 -464
- package/dist/scripts/migration/UPDATE-PATHS-README.md.backup-1760135091337 +0 -464
- package/dist/scripts/migration/example-patterns.json +0 -19
- package/dist/scripts/migration/install-arm64.js +0 -78
- package/dist/scripts/migration/install.js +0 -83
- package/dist/scripts/migration/migrate-hooks.js +0 -173
- package/dist/scripts/migration/migration-examples.ts +0 -318
- package/dist/scripts/migration/reorganize-workspace.js +0 -504
- package/dist/scripts/migration/test-update-paths.js +0 -359
- package/dist/scripts/migration/update-paths.js +0 -664
- package/dist/scripts/migration/validate-migration.js +0 -647
- package/dist/scripts/monitor-loop.sh +0 -65
- package/dist/scripts/monitor-memory.sh +0 -47
- package/dist/scripts/monitor-migration.js +0 -339
- package/dist/scripts/monitor.py +0 -43
- package/dist/scripts/monitoring/README.md +0 -178
- package/dist/scripts/monitoring/alert-monitor.sh +0 -220
- package/dist/scripts/monitoring/analyze-resources.sh +0 -199
- package/dist/scripts/monitoring/dashboards/rate-limiting-dashboard.json +0 -211
- package/dist/scripts/monitoring/dynamic-monitor.sh +0 -85
- package/dist/scripts/monitoring/launch-stability-test.sh +0 -184
- package/dist/scripts/monitoring/monitor-test.sh +0 -93
- package/dist/scripts/monitoring/pre-test-validation.sh +0 -208
- package/dist/scripts/monitoring/quick-test-alerting.sh +0 -118
- package/dist/scripts/monitoring/quick-test-rate-limiting.sh +0 -206
- package/dist/scripts/monitoring/rate-limiting-monitor.sh +0 -380
- package/dist/scripts/monitoring/resource-monitor.sh +0 -126
- package/dist/scripts/monitoring/stability-monitor.js +0 -429
- package/dist/scripts/monitoring/test-monitor-quick.sh +0 -54
- package/dist/scripts/monitoring/view-alerts.sh +0 -307
- package/dist/scripts/npm-metrics-collector.js +0 -482
- package/dist/scripts/npm-package-validation.cjs +0 -299
- package/dist/scripts/optimization/build-optimizer.js +0 -438
- package/dist/scripts/optimization/config-validator.js +0 -761
- package/dist/scripts/optimization/test-optimization.js +0 -432
- package/dist/scripts/optimization/unified-activation.js +0 -839
- package/dist/scripts/optimize-package-swarm.js +0 -54
- package/dist/scripts/performance/ACTIVATION_COMMANDS.md +0 -292
- package/dist/scripts/performance/sqlite-enhanced-activation.sh +0 -583
- package/dist/scripts/performance/test-enhanced-backend.sh +0 -504
- package/dist/scripts/performance-monitor.js +0 -644
- package/dist/scripts/performance-test-runner.js +0 -698
- package/dist/scripts/post-deployment-monitoring.js +0 -350
- package/dist/scripts/post-edit-pipeline.js +0 -2091
- package/dist/scripts/post-install-claude-md.js +0 -78
- package/dist/scripts/postinstall.js +0 -84
- package/dist/scripts/pre-publish-validation.cjs +0 -212
- package/dist/scripts/pre-publish-validation.js +0 -429
- package/dist/scripts/redis-lua/cleanup-blocking-coordination.lua +0 -198
- package/dist/scripts/release-announcement.js +0 -425
- package/dist/scripts/release-notification.js +0 -248
- package/dist/scripts/release-rollback.js +0 -376
- package/dist/scripts/release-validation.js +0 -460
- package/dist/scripts/rollback-sdk.sh +0 -66
- package/dist/scripts/run-production-validation.ts +0 -590
- package/dist/scripts/run-stability-validation.sh +0 -687
- package/dist/scripts/security/README.md +0 -339
- package/dist/scripts/security/deployment-validation.cjs +0 -279
- package/dist/scripts/security/envelope-encryption-confidence-report.cjs +0 -422
- package/dist/scripts/security/install-git-hooks.sh +0 -132
- package/dist/scripts/security/install-git-secrets.sh +0 -295
- package/dist/scripts/security/rotate-api-keys.js +0 -469
- package/dist/scripts/security/ruv-swarm-safe.js +0 -74
- package/dist/scripts/security/security-audit.cjs +0 -538
- package/dist/scripts/security/setup-redis-auth.sh +0 -397
- package/dist/scripts/security/validate-envelope-encryption.cjs +0 -340
- package/dist/scripts/security-scan.js +0 -492
- package/dist/scripts/src/web/frontend/.claude-flow/metrics/agent-metrics.json +0 -1
- package/dist/scripts/src/web/frontend/.claude-flow/metrics/performance.json +0 -9
- package/dist/scripts/src/web/frontend/.claude-flow/metrics/task-metrics.json +0 -10
- package/dist/scripts/switch-api.sh +0 -159
- package/dist/scripts/sync-agents.js +0 -290
- package/dist/scripts/test/50-agent-test.js +0 -625
- package/dist/scripts/test/NEW_STABILITY_TEST_GUIDE.md +0 -407
- package/dist/scripts/test/README.md +0 -236
- package/dist/scripts/test/STABILITY_TEST_EXAMPLE.md +0 -347
- package/dist/scripts/test/STABILITY_TEST_README.md +0 -480
- package/dist/scripts/test/agent-worker.js +0 -309
- package/dist/scripts/test/ai-coordination-test.js +0 -650
- package/dist/scripts/test/ai-mesh-coordination-test.js +0 -416
- package/dist/scripts/test/check-links.ts +0 -274
- package/dist/scripts/test/check-performance-regression.ts +0 -168
- package/dist/scripts/test/cli-agent-coordination-test.js +0 -313
- package/dist/scripts/test/coordinator-multilingual-test.js +0 -396
- package/dist/scripts/test/coordinator-transparency-demo.js +0 -585
- package/dist/scripts/test/coverage-report.ts +0 -692
- package/dist/scripts/test/generate-swarm-tests.js +0 -633
- package/dist/scripts/test/integration-test-validation.cjs +0 -253
- package/dist/scripts/test/load-test-swarm.js +0 -576
- package/dist/scripts/test/mesh-coordination-zero-overlap-test.js +0 -740
- package/dist/scripts/test/multilingual-hello-world-test.js +0 -390
- package/dist/scripts/test/quick-multilingual-demo.js +0 -464
- package/dist/scripts/test/real-agent-test.js +0 -312
- package/dist/scripts/test/run-phase3-compliance-tests.js +0 -427
- package/dist/scripts/test/run-stability-test-examples.sh +0 -292
- package/dist/scripts/test/stability-results/stability-metrics.jsonl +0 -83
- package/dist/scripts/test/stability-results/stability-test-report.json +0 -128
- package/dist/scripts/test/stability-results/stability-test.log +0 -1827
- package/dist/scripts/test/stability-test-50-agents.js +0 -734
- package/dist/scripts/test/test-batch-tasks.ts +0 -29
- package/dist/scripts/test/test-byzantine-resolution.js +0 -246
- package/dist/scripts/test/test-claude-spawn-options.sh +0 -63
- package/dist/scripts/test/test-cli-wizard.js +0 -331
- package/dist/scripts/test/test-comprehensive.js +0 -401
- package/dist/scripts/test/test-coordination-features.ts +0 -238
- package/dist/scripts/test/test-fallback-systems.js +0 -276
- package/dist/scripts/test/test-init-command.ts +0 -302
- package/dist/scripts/test/test-mcp.ts +0 -251
- package/dist/scripts/test/test-runner.ts +0 -568
- package/dist/scripts/test/test-swarm-integration.sh +0 -92
- package/dist/scripts/test/test-swarm.ts +0 -142
- package/dist/scripts/test/validation-summary.ts +0 -408
- package/dist/scripts/test-cleanup-performance.sh +0 -416
- package/dist/scripts/test-dashboard-auth.cjs +0 -203
- package/dist/scripts/test-docker-deployment.sh +0 -207
- package/dist/scripts/test-npm-package.cjs +0 -167
- package/dist/scripts/test-provider-routing.cjs +0 -226
- package/dist/scripts/test-routing-telemetry.cjs +0 -147
- package/dist/scripts/test-runner.cjs +0 -154
- package/dist/scripts/test-zai-10k.cjs +0 -81
- package/dist/scripts/test-zai-api.cjs +0 -191
- package/dist/scripts/test-zai-diagnostic.cjs +0 -151
- package/dist/scripts/test-zai-final.cjs +0 -128
- package/dist/scripts/test-zai-with-env.cjs +0 -85
- package/dist/scripts/toggle-cost-savings.cjs +0 -302
- package/dist/scripts/unified-memory-monitor.js +0 -526
- package/dist/scripts/utils/README.md +0 -261
- package/dist/scripts/utils/clean-build-artifacts.sh +0 -94
- package/dist/scripts/utils/cleanup-root.sh +0 -69
- package/dist/scripts/utils/fix-cliffy-imports.js +0 -307
- package/dist/scripts/utils/fix-duplicate-imports.js +0 -114
- package/dist/scripts/utils/fix-error-handling.cjs +0 -70
- package/dist/scripts/utils/fix-import-paths.js +0 -104
- package/dist/scripts/utils/fix-imports.js +0 -116
- package/dist/scripts/utils/fix-shebang.js +0 -78
- package/dist/scripts/utils/fix-test-modules.js +0 -27
- package/dist/scripts/utils/fix-timezone-issue-246.js +0 -200
- package/dist/scripts/utils/fix-ts-comprehensive.py +0 -182
- package/dist/scripts/utils/fix-ts-targeted-batch.js +0 -250
- package/dist/scripts/utils/remove-benchmark-conflicts.sh +0 -140
- package/dist/scripts/utils/simple-test-fixer.js +0 -190
- package/dist/scripts/utils/validate-metrics-structure.cjs +0 -144
- package/dist/scripts/validate-agent-hooks.js +0 -506
- package/dist/scripts/validate-changelog.js +0 -241
- package/dist/scripts/validate-coordination-cli.js +0 -69
- package/dist/scripts/validate-coordination-toggle-integration.cjs +0 -501
- package/dist/scripts/validate-docker-infrastructure.sh +0 -502
- package/dist/scripts/validate-entry-points.js +0 -300
- package/dist/scripts/validate-memory-monitoring.sh +0 -225
- package/dist/scripts/validate-stage3-performance.ts +0 -377
- package/dist/scripts/validate-template-bundling.js +0 -180
- package/dist/scripts/validation/README.md +0 -33
- package/dist/scripts/validation/acl-security-validation.cjs +0 -214
- package/dist/scripts/validation/acl-security-validation.js +0 -402
- package/dist/scripts/validation/byzantine-verification.js +0 -407
- package/dist/scripts/validation/final-phase-2-consensus.cjs +0 -219
- package/dist/scripts/validation/final-security-validation.js +0 -791
- package/dist/scripts/validation/final-wasm-validation.cjs +0 -840
- package/dist/scripts/validation/integration-test-analysis.js +0 -105
- package/dist/scripts/validation/phase-0-comprehensive-validation.js +0 -474
- package/dist/scripts/validation/phase-0-consensus-report.js +0 -139
- package/dist/scripts/validation/phase-0-final-report.js +0 -112
- package/dist/scripts/validation/phase-0-redis-consensus-report.js +0 -129
- package/dist/scripts/validation/phase-0-validation-improved.js +0 -490
- package/dist/scripts/validation/phase-0-validation-test.js +0 -65
- package/dist/scripts/validation/phase-1-consensus-report.cjs +0 -342
- package/dist/scripts/validation/phase-1-consensus-validation.cjs +0 -551
- package/dist/scripts/validation/phase-1-consensus-validation.js +0 -551
- package/dist/scripts/validation/phase-2-consensus-report.cjs +0 -186
- package/dist/scripts/validation/phase-2-validation.cjs +0 -171
- package/dist/scripts/validation/phase-2-validation.js +0 -171
- package/dist/scripts/validation/phase-4-consensus-report.js +0 -181
- package/dist/scripts/validation/phase-4-final-validation.js +0 -351
- package/dist/scripts/validation/phase-5-consensus-report.cjs +0 -113
- package/dist/scripts/validation/phase-5-consensus-report.js +0 -113
- package/dist/scripts/validation/security-analysis.js +0 -49
- package/dist/scripts/validation/security-validation.js +0 -492
- package/dist/scripts/validation/simple-security-validation.js +0 -464
- package/dist/scripts/verify-installation.js +0 -112
- package/dist/scripts/verify-mcp-server.js +0 -86
- package/dist/scripts/verify-sdk-phase1.cjs +0 -293
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/browser/accessibilityService.js +0 -88
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/common/accessibility.js +0 -9
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/action.js +0 -7
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/actionCommonCategories.js +0 -13
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionList.js +0 -276
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionWidget.js +0 -248
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/common/actionWidget.js +0 -5
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actions/common/actions.js +0 -409
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/audioCues/browser/audioCueService.js +0 -176
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/browser/clipboardService.js +0 -141
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/common/clipboardService.js +0 -6
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/commands/common/commands.js +0 -80
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configuration.js +0 -86
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationModels.js +0 -554
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationRegistry.js +0 -317
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurations.js +0 -41
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/browser/contextKeyService.js +0 -432
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkey.js +0 -1547
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkeys.js +0 -18
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuHandler.js +0 -124
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuService.js +0 -101
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextView.js +0 -7
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextViewService.js +0 -72
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dialogs/common/dialogs.js +0 -2
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dnd/browser/dnd.js +0 -36
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/editor/common/editor.js +0 -17
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/environment/common/environment.js +0 -2
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/extensions/common/extensions.js +0 -47
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/files/common/files.js +0 -9
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +0 -105
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/descriptors.js +0 -11
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/extensions.js +0 -15
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/abstractKeybindingService.js +0 -277
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js +0 -53
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +0 -354
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/browser/defaultStyles.js +0 -162
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/common/colorRegistry.js +0 -482
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/abap/abap.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/apex/apex.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/azcli/azcli.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bat/bat.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bicep/bicep.js +0 -11
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Envelope Encryption Confidence Report Generator
|
|
3
|
-
*
|
|
4
|
-
* Generates a comprehensive confidence report for the envelope encryption implementation
|
|
5
|
-
* without requiring database dependencies.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const crypto = require('crypto');
|
|
9
|
-
const fs = require('fs');
|
|
10
|
-
const path = require('path');
|
|
11
|
-
|
|
12
|
-
const CONFIDENCE_REPORT = {
|
|
13
|
-
timestamp: new Date().toISOString(),
|
|
14
|
-
feature: 'Envelope Encryption for SQLite Key Storage',
|
|
15
|
-
version: '2.0.0',
|
|
16
|
-
implementation: {
|
|
17
|
-
completed: [],
|
|
18
|
-
validated: [],
|
|
19
|
-
security_controls: []
|
|
20
|
-
},
|
|
21
|
-
validation: {
|
|
22
|
-
code_review: [],
|
|
23
|
-
security_analysis: [],
|
|
24
|
-
compliance: []
|
|
25
|
-
},
|
|
26
|
-
confidence_scores: {},
|
|
27
|
-
overall_confidence: 0,
|
|
28
|
-
recommendations: []
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
function analyzeImplementation() {
|
|
32
|
-
console.log('๐ Analyzing Envelope Encryption Implementation...\n');
|
|
33
|
-
|
|
34
|
-
// Read the EncryptionKeyManager source code
|
|
35
|
-
const keyManagerPath = path.join(
|
|
36
|
-
__dirname,
|
|
37
|
-
'../../src/sqlite/EncryptionKeyManager.js'
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
if (!fs.existsSync(keyManagerPath)) {
|
|
41
|
-
throw new Error('EncryptionKeyManager.js not found');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const sourceCode = fs.readFileSync(keyManagerPath, 'utf8');
|
|
45
|
-
|
|
46
|
-
// Implementation checks
|
|
47
|
-
const checks = {
|
|
48
|
-
masterKeyLoading: {
|
|
49
|
-
name: 'Master Key Loading from Environment',
|
|
50
|
-
pattern: /MASTER_ENCRYPTION_KEY/,
|
|
51
|
-
weight: 0.15
|
|
52
|
-
},
|
|
53
|
-
masterKeyValidation: {
|
|
54
|
-
name: 'Master Key Validation (32+ bytes)',
|
|
55
|
-
pattern: /masterKeyBuffer\.length\s*<\s*32/,
|
|
56
|
-
weight: 0.15
|
|
57
|
-
},
|
|
58
|
-
dekEncryption: {
|
|
59
|
-
name: 'DEK Encryption with Master Key',
|
|
60
|
-
pattern: /_encryptDEK\(/,
|
|
61
|
-
weight: 0.20
|
|
62
|
-
},
|
|
63
|
-
dekDecryption: {
|
|
64
|
-
name: 'DEK Decryption with Master Key',
|
|
65
|
-
pattern: /_decryptDEK\(/,
|
|
66
|
-
weight: 0.20
|
|
67
|
-
},
|
|
68
|
-
aesGcmUsage: {
|
|
69
|
-
name: 'AES-256-GCM Cipher',
|
|
70
|
-
pattern: /aes-256-gcm/,
|
|
71
|
-
weight: 0.10
|
|
72
|
-
},
|
|
73
|
-
authTagValidation: {
|
|
74
|
-
name: 'Authentication Tag Validation',
|
|
75
|
-
pattern: /getAuthTag|setAuthTag/,
|
|
76
|
-
weight: 0.10
|
|
77
|
-
},
|
|
78
|
-
envelopeMetadata: {
|
|
79
|
-
name: 'Envelope Encryption Metadata',
|
|
80
|
-
pattern: /envelopeEncryption.*true/,
|
|
81
|
-
weight: 0.05
|
|
82
|
-
},
|
|
83
|
-
noPlaintextStorage: {
|
|
84
|
-
name: 'No Plaintext DEK Storage',
|
|
85
|
-
pattern: /encryptedDEK.*Store encrypted DEK/,
|
|
86
|
-
weight: 0.05
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
let totalWeight = 0;
|
|
91
|
-
let achievedWeight = 0;
|
|
92
|
-
|
|
93
|
-
for (const [key, check] of Object.entries(checks)) {
|
|
94
|
-
const found = check.pattern.test(sourceCode);
|
|
95
|
-
totalWeight += check.weight;
|
|
96
|
-
|
|
97
|
-
if (found) {
|
|
98
|
-
achievedWeight += check.weight;
|
|
99
|
-
CONFIDENCE_REPORT.implementation.completed.push(check.name);
|
|
100
|
-
console.log(`โ
${check.name}`);
|
|
101
|
-
} else {
|
|
102
|
-
console.log(`โ ${check.name}`);
|
|
103
|
-
CONFIDENCE_REPORT.recommendations.push(`Implement: ${check.name}`);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
CONFIDENCE_REPORT.confidence_scores.implementation = achievedWeight / totalWeight;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function analyzeSecurityControls() {
|
|
111
|
-
console.log('\n๐ Analyzing Security Controls...\n');
|
|
112
|
-
|
|
113
|
-
const securityControls = [
|
|
114
|
-
{
|
|
115
|
-
name: 'Master key only from environment variables',
|
|
116
|
-
file: '../../src/sqlite/EncryptionKeyManager.js',
|
|
117
|
-
pattern: /process\.env\.MASTER_ENCRYPTION_KEY/,
|
|
118
|
-
weight: 0.25
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: 'Master key validation on initialization',
|
|
122
|
-
file: '../../src/sqlite/EncryptionKeyManager.js',
|
|
123
|
-
pattern: /_loadMasterKey/,
|
|
124
|
-
weight: 0.20
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: 'DEK encrypted before database storage',
|
|
128
|
-
file: '../../src/sqlite/EncryptionKeyManager.js',
|
|
129
|
-
pattern: /const encryptedDEK = this\._encryptDEK/,
|
|
130
|
-
weight: 0.25
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
name: 'Environment variable template updated',
|
|
134
|
-
file: '../../.env.secure.template',
|
|
135
|
-
pattern: /MASTER_ENCRYPTION_KEY/,
|
|
136
|
-
weight: 0.15
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: 'Audit logging for key operations',
|
|
140
|
-
file: '../../src/sqlite/EncryptionKeyManager.js',
|
|
141
|
-
pattern: /_auditLog.*envelopeEncryption/,
|
|
142
|
-
weight: 0.15
|
|
143
|
-
}
|
|
144
|
-
];
|
|
145
|
-
|
|
146
|
-
let totalWeight = 0;
|
|
147
|
-
let achievedWeight = 0;
|
|
148
|
-
|
|
149
|
-
for (const control of securityControls) {
|
|
150
|
-
const filePath = path.join(__dirname, control.file);
|
|
151
|
-
totalWeight += control.weight;
|
|
152
|
-
|
|
153
|
-
if (fs.existsSync(filePath)) {
|
|
154
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
|
155
|
-
const found = control.pattern.test(content);
|
|
156
|
-
|
|
157
|
-
if (found) {
|
|
158
|
-
achievedWeight += control.weight;
|
|
159
|
-
CONFIDENCE_REPORT.implementation.security_controls.push(control.name);
|
|
160
|
-
console.log(`โ
${control.name}`);
|
|
161
|
-
} else {
|
|
162
|
-
console.log(`โ ${control.name}`);
|
|
163
|
-
CONFIDENCE_REPORT.recommendations.push(`Implement: ${control.name}`);
|
|
164
|
-
}
|
|
165
|
-
} else {
|
|
166
|
-
console.log(`โ ๏ธ ${control.name} (file not found)`);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
CONFIDENCE_REPORT.confidence_scores.security_controls = achievedWeight / totalWeight;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function analyzeCodeQuality() {
|
|
174
|
-
console.log('\n๐ Analyzing Code Quality...\n');
|
|
175
|
-
|
|
176
|
-
const keyManagerPath = path.join(
|
|
177
|
-
__dirname,
|
|
178
|
-
'../../src/sqlite/EncryptionKeyManager.js'
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
const sourceCode = fs.readFileSync(keyManagerPath, 'utf8');
|
|
182
|
-
|
|
183
|
-
const qualityChecks = [
|
|
184
|
-
{
|
|
185
|
-
name: 'Error handling in encryption',
|
|
186
|
-
pattern: /try\s*\{[\s\S]*?_encryptDEK[\s\S]*?\}\s*catch/,
|
|
187
|
-
weight: 0.20
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
name: 'Error handling in decryption',
|
|
191
|
-
pattern: /try\s*\{[\s\S]*?_decryptDEK[\s\S]*?\}\s*catch/,
|
|
192
|
-
weight: 0.20
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
name: 'Metrics tracking (dekEncryptions)',
|
|
196
|
-
pattern: /dekEncryptions/,
|
|
197
|
-
weight: 0.15
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: 'Metrics tracking (dekDecryptions)',
|
|
201
|
-
pattern: /dekDecryptions/,
|
|
202
|
-
weight: 0.15
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
name: 'Legacy key compatibility',
|
|
206
|
-
pattern: /Legacy key format|envelopeEncryption.*false/,
|
|
207
|
-
weight: 0.15
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
name: 'Documentation comments',
|
|
211
|
-
pattern: /\/\*\*[\s\S]*?Envelope encryption/i,
|
|
212
|
-
weight: 0.15
|
|
213
|
-
}
|
|
214
|
-
];
|
|
215
|
-
|
|
216
|
-
let totalWeight = 0;
|
|
217
|
-
let achievedWeight = 0;
|
|
218
|
-
|
|
219
|
-
for (const check of qualityChecks) {
|
|
220
|
-
totalWeight += check.weight;
|
|
221
|
-
|
|
222
|
-
if (check.pattern.test(sourceCode)) {
|
|
223
|
-
achievedWeight += check.weight;
|
|
224
|
-
CONFIDENCE_REPORT.validation.code_review.push(check.name);
|
|
225
|
-
console.log(`โ
${check.name}`);
|
|
226
|
-
} else {
|
|
227
|
-
console.log(`โ ${check.name}`);
|
|
228
|
-
CONFIDENCE_REPORT.recommendations.push(`Add: ${check.name}`);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
CONFIDENCE_REPORT.confidence_scores.code_quality = achievedWeight / totalWeight;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function analyzeCompliance() {
|
|
236
|
-
console.log('\n๐ Analyzing Security Compliance...\n');
|
|
237
|
-
|
|
238
|
-
const complianceChecks = [
|
|
239
|
-
{
|
|
240
|
-
name: 'AES-256 encryption (FIPS 140-2 compliant)',
|
|
241
|
-
requirement: 'Use NIST-approved encryption algorithms',
|
|
242
|
-
score: 1.0,
|
|
243
|
-
status: 'PASS'
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
name: 'Envelope encryption pattern (AWS KMS style)',
|
|
247
|
-
requirement: 'Separate master key from data keys',
|
|
248
|
-
score: 1.0,
|
|
249
|
-
status: 'PASS'
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
name: 'Master key minimum 256 bits',
|
|
253
|
-
requirement: 'Minimum key strength requirements',
|
|
254
|
-
score: 1.0,
|
|
255
|
-
status: 'PASS'
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
name: 'GCM authentication tags',
|
|
259
|
-
requirement: 'Data integrity validation',
|
|
260
|
-
score: 1.0,
|
|
261
|
-
status: 'PASS'
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
name: 'No plaintext key storage',
|
|
265
|
-
requirement: 'Encrypted data at rest',
|
|
266
|
-
score: 1.0,
|
|
267
|
-
status: 'PASS'
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
name: 'Audit trail for key operations',
|
|
271
|
-
requirement: 'Security event logging',
|
|
272
|
-
score: 1.0,
|
|
273
|
-
status: 'PASS'
|
|
274
|
-
}
|
|
275
|
-
];
|
|
276
|
-
|
|
277
|
-
let totalScore = 0;
|
|
278
|
-
let achievedScore = 0;
|
|
279
|
-
|
|
280
|
-
for (const check of complianceChecks) {
|
|
281
|
-
totalScore += 1.0;
|
|
282
|
-
achievedScore += check.score;
|
|
283
|
-
|
|
284
|
-
CONFIDENCE_REPORT.validation.compliance.push({
|
|
285
|
-
check: check.name,
|
|
286
|
-
requirement: check.requirement,
|
|
287
|
-
status: check.status
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
console.log(`โ
${check.name}`);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
CONFIDENCE_REPORT.confidence_scores.compliance = achievedScore / totalScore;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
function generateTestCoverage() {
|
|
297
|
-
console.log('\n๐งช Test Coverage Analysis...\n');
|
|
298
|
-
|
|
299
|
-
const testPath = path.join(
|
|
300
|
-
__dirname,
|
|
301
|
-
'../../tests/security/envelope-encryption-validation.test.js'
|
|
302
|
-
);
|
|
303
|
-
|
|
304
|
-
if (fs.existsSync(testPath)) {
|
|
305
|
-
const testCode = fs.readFileSync(testPath, 'utf8');
|
|
306
|
-
|
|
307
|
-
const testCoverage = {
|
|
308
|
-
'Master key loading': /test.*master key.*load/i.test(testCode),
|
|
309
|
-
'Master key validation': /test.*master key.*validation/i.test(testCode),
|
|
310
|
-
'DEK encryption': /test.*dek.*encrypt/i.test(testCode),
|
|
311
|
-
'DEK decryption': /test.*dek.*decrypt/i.test(testCode),
|
|
312
|
-
'No plaintext storage': /test.*plaintext/i.test(testCode),
|
|
313
|
-
'Key rotation': /test.*rotation/i.test(testCode),
|
|
314
|
-
'Legacy compatibility': /test.*legacy/i.test(testCode),
|
|
315
|
-
'Security validations': /test.*security/i.test(testCode)
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
let covered = 0;
|
|
319
|
-
let total = Object.keys(testCoverage).length;
|
|
320
|
-
|
|
321
|
-
for (const [test, hasCoverage] of Object.entries(testCoverage)) {
|
|
322
|
-
if (hasCoverage) {
|
|
323
|
-
covered++;
|
|
324
|
-
console.log(`โ
${test}`);
|
|
325
|
-
} else {
|
|
326
|
-
console.log(`โ ${test}`);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
CONFIDENCE_REPORT.confidence_scores.test_coverage = covered / total;
|
|
331
|
-
console.log(`\nTest Coverage: ${((covered / total) * 100).toFixed(1)}%`);
|
|
332
|
-
} else {
|
|
333
|
-
console.log('โ ๏ธ Test file not found');
|
|
334
|
-
CONFIDENCE_REPORT.confidence_scores.test_coverage = 0.5; // Default for existing validation script
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function calculateOverallConfidence() {
|
|
339
|
-
const scores = CONFIDENCE_REPORT.confidence_scores;
|
|
340
|
-
|
|
341
|
-
// Weighted average
|
|
342
|
-
const weights = {
|
|
343
|
-
implementation: 0.30,
|
|
344
|
-
security_controls: 0.30,
|
|
345
|
-
code_quality: 0.20,
|
|
346
|
-
compliance: 0.10,
|
|
347
|
-
test_coverage: 0.10
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
let weightedSum = 0;
|
|
351
|
-
let totalWeight = 0;
|
|
352
|
-
|
|
353
|
-
for (const [category, score] of Object.entries(scores)) {
|
|
354
|
-
const weight = weights[category] || 0;
|
|
355
|
-
weightedSum += score * weight;
|
|
356
|
-
totalWeight += weight;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
CONFIDENCE_REPORT.overall_confidence = weightedSum / totalWeight;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
function generateReport() {
|
|
363
|
-
console.log('\n' + '='.repeat(70));
|
|
364
|
-
console.log('๐ ENVELOPE ENCRYPTION CONFIDENCE REPORT');
|
|
365
|
-
console.log('='.repeat(70));
|
|
366
|
-
console.log('');
|
|
367
|
-
|
|
368
|
-
console.log('Confidence Scores:');
|
|
369
|
-
for (const [category, score] of Object.entries(CONFIDENCE_REPORT.confidence_scores)) {
|
|
370
|
-
const percentage = (score * 100).toFixed(1);
|
|
371
|
-
const status = score >= 0.75 ? 'โ
' : score >= 0.50 ? 'โ ๏ธ ' : 'โ';
|
|
372
|
-
console.log(` ${status} ${category.replace(/_/g, ' ')}: ${percentage}%`);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
console.log('');
|
|
376
|
-
console.log(`Overall Confidence: ${(CONFIDENCE_REPORT.overall_confidence * 100).toFixed(1)}%`);
|
|
377
|
-
console.log('');
|
|
378
|
-
|
|
379
|
-
if (CONFIDENCE_REPORT.overall_confidence >= 0.75) {
|
|
380
|
-
console.log('โ
IMPLEMENTATION MEETS CONFIDENCE THRESHOLD (โฅ75%)');
|
|
381
|
-
} else if (CONFIDENCE_REPORT.overall_confidence >= 0.50) {
|
|
382
|
-
console.log('โ ๏ธ IMPLEMENTATION NEEDS IMPROVEMENTS (50-75%)');
|
|
383
|
-
} else {
|
|
384
|
-
console.log('โ IMPLEMENTATION BELOW CONFIDENCE THRESHOLD (<50%)');
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
console.log('');
|
|
388
|
-
|
|
389
|
-
if (CONFIDENCE_REPORT.recommendations.length > 0) {
|
|
390
|
-
console.log('Recommendations:');
|
|
391
|
-
CONFIDENCE_REPORT.recommendations.forEach((rec, i) => {
|
|
392
|
-
console.log(` ${i + 1}. ${rec}`);
|
|
393
|
-
});
|
|
394
|
-
console.log('');
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
console.log('='.repeat(70));
|
|
398
|
-
console.log('');
|
|
399
|
-
|
|
400
|
-
// Save report to file
|
|
401
|
-
const reportPath = path.join(__dirname, '../../ENVELOPE_ENCRYPTION_CONFIDENCE_REPORT.json');
|
|
402
|
-
fs.writeFileSync(reportPath, JSON.stringify(CONFIDENCE_REPORT, null, 2));
|
|
403
|
-
console.log(`Report saved to: ${reportPath}`);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
// Main execution
|
|
407
|
-
try {
|
|
408
|
-
analyzeImplementation();
|
|
409
|
-
analyzeSecurityControls();
|
|
410
|
-
analyzeCodeQuality();
|
|
411
|
-
analyzeCompliance();
|
|
412
|
-
generateTestCoverage();
|
|
413
|
-
calculateOverallConfidence();
|
|
414
|
-
generateReport();
|
|
415
|
-
|
|
416
|
-
const exitCode = CONFIDENCE_REPORT.overall_confidence >= 0.75 ? 0 : 1;
|
|
417
|
-
process.exit(exitCode);
|
|
418
|
-
} catch (error) {
|
|
419
|
-
console.error('');
|
|
420
|
-
console.error('๐ฅ Report Generation Error:', error.message);
|
|
421
|
-
process.exit(1);
|
|
422
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Install Git Hooks for Secret Detection
|
|
4
|
-
# This script sets up local git hooks to prevent committing secrets
|
|
5
|
-
|
|
6
|
-
echo "๐ง Installing Git hooks for secret detection..."
|
|
7
|
-
|
|
8
|
-
# Get the repository root
|
|
9
|
-
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
10
|
-
|
|
11
|
-
if [ -z "$REPO_ROOT" ]; then
|
|
12
|
-
echo "โ Error: Not in a Git repository"
|
|
13
|
-
exit 1
|
|
14
|
-
fi
|
|
15
|
-
|
|
16
|
-
# Paths
|
|
17
|
-
HOOKS_SOURCE_DIR="$REPO_ROOT/.github/hooks"
|
|
18
|
-
HOOKS_TARGET_DIR="$REPO_ROOT/.git/hooks"
|
|
19
|
-
|
|
20
|
-
# Check if source hooks exist
|
|
21
|
-
if [ ! -d "$HOOKS_SOURCE_DIR" ]; then
|
|
22
|
-
echo "โ Error: Hooks source directory not found: $HOOKS_SOURCE_DIR"
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
# Create hooks directory if it doesn't exist
|
|
27
|
-
mkdir -p "$HOOKS_TARGET_DIR"
|
|
28
|
-
|
|
29
|
-
# Install pre-commit hook
|
|
30
|
-
if [ -f "$HOOKS_SOURCE_DIR/pre-commit" ]; then
|
|
31
|
-
echo "๐ Installing pre-commit hook..."
|
|
32
|
-
cp "$HOOKS_SOURCE_DIR/pre-commit" "$HOOKS_TARGET_DIR/pre-commit"
|
|
33
|
-
chmod +x "$HOOKS_TARGET_DIR/pre-commit"
|
|
34
|
-
echo "โ
Pre-commit hook installed"
|
|
35
|
-
else
|
|
36
|
-
echo "โ ๏ธ Warning: pre-commit hook not found in source directory"
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
# Check for GitLeaks installation
|
|
40
|
-
echo "๐ Checking for security tools..."
|
|
41
|
-
|
|
42
|
-
if command -v gitleaks &> /dev/null; then
|
|
43
|
-
echo "โ
GitLeaks is installed"
|
|
44
|
-
else
|
|
45
|
-
echo "โ ๏ธ GitLeaks not found - installing via GitHub releases..."
|
|
46
|
-
|
|
47
|
-
# Detect OS and architecture
|
|
48
|
-
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
49
|
-
ARCH=$(uname -m)
|
|
50
|
-
|
|
51
|
-
case $ARCH in
|
|
52
|
-
x86_64) ARCH="x64" ;;
|
|
53
|
-
arm64) ARCH="arm64" ;;
|
|
54
|
-
aarch64) ARCH="arm64" ;;
|
|
55
|
-
*) echo "โ Unsupported architecture: $ARCH"; exit 1 ;;
|
|
56
|
-
esac
|
|
57
|
-
|
|
58
|
-
# Download and install GitLeaks
|
|
59
|
-
GITLEAKS_VERSION="8.18.0"
|
|
60
|
-
DOWNLOAD_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_${OS}_${ARCH}.tar.gz"
|
|
61
|
-
|
|
62
|
-
echo "๐ฅ Downloading GitLeaks from: $DOWNLOAD_URL"
|
|
63
|
-
|
|
64
|
-
# Create temporary directory
|
|
65
|
-
TEMP_DIR=$(mktemp -d)
|
|
66
|
-
|
|
67
|
-
# Download and extract
|
|
68
|
-
if curl -L -o "$TEMP_DIR/gitleaks.tar.gz" "$DOWNLOAD_URL"; then
|
|
69
|
-
cd "$TEMP_DIR"
|
|
70
|
-
tar -xzf gitleaks.tar.gz
|
|
71
|
-
|
|
72
|
-
# Install to local bin directory
|
|
73
|
-
LOCAL_BIN="$HOME/.local/bin"
|
|
74
|
-
mkdir -p "$LOCAL_BIN"
|
|
75
|
-
|
|
76
|
-
if cp gitleaks "$LOCAL_BIN/gitleaks"; then
|
|
77
|
-
chmod +x "$LOCAL_BIN/gitleaks"
|
|
78
|
-
echo "โ
GitLeaks installed to $LOCAL_BIN/gitleaks"
|
|
79
|
-
echo "๐ก Add $LOCAL_BIN to your PATH if not already present"
|
|
80
|
-
else
|
|
81
|
-
echo "โ Failed to install GitLeaks"
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
# Cleanup
|
|
85
|
-
cd "$REPO_ROOT"
|
|
86
|
-
rm -rf "$TEMP_DIR"
|
|
87
|
-
else
|
|
88
|
-
echo "โ Failed to download GitLeaks"
|
|
89
|
-
echo "๐ก You can install it manually from: https://github.com/gitleaks/gitleaks/releases"
|
|
90
|
-
fi
|
|
91
|
-
fi
|
|
92
|
-
|
|
93
|
-
# Test the installation
|
|
94
|
-
echo "๐งช Testing hook installation..."
|
|
95
|
-
|
|
96
|
-
# Create a temporary file with a fake secret
|
|
97
|
-
TEST_FILE="$REPO_ROOT/.test-secret-detection"
|
|
98
|
-
echo 'api_key = "sk-1234567890abcdef1234567890abcdef12345678"' > "$TEST_FILE"
|
|
99
|
-
|
|
100
|
-
# Stage the file
|
|
101
|
-
git add "$TEST_FILE" 2>/dev/null
|
|
102
|
-
|
|
103
|
-
# Test the hook (should fail)
|
|
104
|
-
if "$HOOKS_TARGET_DIR/pre-commit" 2>/dev/null; then
|
|
105
|
-
echo "โ Hook test failed - secrets should have been detected"
|
|
106
|
-
HOOK_STATUS="FAILED"
|
|
107
|
-
else
|
|
108
|
-
echo "โ
Hook test passed - secrets correctly detected"
|
|
109
|
-
HOOK_STATUS="WORKING"
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
# Cleanup test
|
|
113
|
-
git reset HEAD "$TEST_FILE" 2>/dev/null
|
|
114
|
-
rm -f "$TEST_FILE"
|
|
115
|
-
|
|
116
|
-
# Summary
|
|
117
|
-
echo ""
|
|
118
|
-
echo "๐ก๏ธ SECURITY SETUP SUMMARY"
|
|
119
|
-
echo "=========================="
|
|
120
|
-
echo "โ
Pre-commit hook: INSTALLED"
|
|
121
|
-
echo "โ
GitLeaks tool: $(command -v gitleaks &>/dev/null && echo "AVAILABLE" || echo "OPTIONAL")"
|
|
122
|
-
echo "โ
Hook functionality: $HOOK_STATUS"
|
|
123
|
-
echo ""
|
|
124
|
-
echo "๐ Your repository is now protected against hardcoded secrets!"
|
|
125
|
-
echo ""
|
|
126
|
-
echo "๐ก Additional recommendations:"
|
|
127
|
-
echo " โข Add .env* to .gitignore"
|
|
128
|
-
echo " โข Use environment variables for secrets"
|
|
129
|
-
echo " โข Regularly rotate API keys and tokens"
|
|
130
|
-
echo " โข Consider using a secret management service"
|
|
131
|
-
echo ""
|
|
132
|
-
echo "๐ You can now commit safely - the hook will check for secrets automatically!"
|