sinapse-ai 5.0.8 → 6.0.1
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/.claude/CLAUDE.md +1 -1
- package/.claude/rules/agent-authority.md +10 -10
- package/.claude/rules/agent-memory-imports.md +4 -4
- package/.claude/rules/coderabbit-integration.md +4 -4
- package/.claude/rules/ids-principles.md +5 -5
- package/.claude/rules/story-lifecycle.md +15 -15
- package/.claude/rules/workflow-execution.md +11 -11
- package/.sinapse-ai/constitution.md +3 -3
- package/.sinapse-ai/core/code-intel/helpers/dev-helper.js +1 -1
- package/.sinapse-ai/core/code-intel/helpers/qa-helper.js +1 -1
- package/.sinapse-ai/core/code-intel/helpers/story-helper.js +7 -7
- package/.sinapse-ai/core/config/config-loader.js +1 -1
- package/.sinapse-ai/core/docs/session-update-pattern.md +1 -1
- package/.sinapse-ai/core/ids/framework-governor.js +4 -4
- package/.sinapse-ai/core/ids/index.js +1 -1
- package/.sinapse-ai/core/memory/gotchas-memory.js +1 -1
- package/.sinapse-ai/core/orchestration/agent-invoker.js +1 -1
- package/.sinapse-ai/core/orchestration/bob-surface-criteria.yaml +2 -2
- package/.sinapse-ai/core/orchestration/executor-assignment.js +1 -1
- package/.sinapse-ai/core/orchestration/executors/epic-6-executor.js +1 -1
- package/.sinapse-ai/core/orchestration/executors/epic-executor.js +1 -1
- package/.sinapse-ai/core/orchestration/greenfield-handler.js +4 -4
- package/.sinapse-ai/core/orchestration/master-orchestrator.js +1 -1
- package/.sinapse-ai/core/orchestration/skill-dispatcher.js +3 -3
- package/.sinapse-ai/core/orchestration/workflow-executor.js +1 -1
- package/.sinapse-ai/core/quality-gates/layer2-pr-automation.js +3 -3
- package/.sinapse-ai/core/quality-gates/layer3-human-review.js +1 -1
- package/.sinapse-ai/core/quality-gates/quality-gate-config.yaml +1 -1
- package/.sinapse-ai/core/session/context-loader.js +1 -1
- package/.sinapse-ai/data/agent-config-requirements.yaml +3 -3
- package/.sinapse-ai/data/entity-registry.yaml +2154 -2337
- package/.sinapse-ai/data/registry-update-log.jsonl +316 -0
- package/.sinapse-ai/data/sinapse-kb.md +13 -13
- package/.sinapse-ai/data/tech-presets/csharp.md +2 -2
- package/.sinapse-ai/data/tech-presets/go.md +2 -2
- package/.sinapse-ai/data/tech-presets/java.md +2 -2
- package/.sinapse-ai/data/tech-presets/nextjs-react.md +1 -1
- package/.sinapse-ai/data/tech-presets/php.md +2 -2
- package/.sinapse-ai/data/tech-presets/rust.md +2 -2
- package/.sinapse-ai/data/technical-preferences.md +1 -1
- package/.sinapse-ai/data/workflow-chains.yaml +15 -15
- package/.sinapse-ai/development/README.md +1 -1
- package/.sinapse-ai/development/agent-teams/team-qa-focused.yaml +7 -7
- package/.sinapse-ai/development/agents/analyst.md +6 -6
- package/.sinapse-ai/development/agents/architect.md +4 -4
- package/.sinapse-ai/development/agents/data-engineer.md +2 -2
- package/.sinapse-ai/development/agents/{dev.md → developer.md} +7 -7
- package/.sinapse-ai/development/agents/devops.md +4 -4
- package/.sinapse-ai/development/agents/{po → product-lead}/MEMORY.md +3 -3
- package/.sinapse-ai/development/agents/{po.md → product-lead.md} +25 -25
- package/.sinapse-ai/development/agents/{pm → project-lead}/MEMORY.md +2 -2
- package/.sinapse-ai/development/agents/{pm.md → project-lead.md} +15 -15
- package/.sinapse-ai/development/agents/{qa.md → quality-gate.md} +8 -8
- package/.sinapse-ai/development/agents/{sinapse-master.md → sinapse-orqx.md} +12 -12
- package/.sinapse-ai/development/agents/{sm.md → sprint-lead.md} +18 -18
- package/.sinapse-ai/development/agents/squad-creator.md +4 -4
- package/.sinapse-ai/development/agents/ux-design-expert.md +2 -2
- package/.sinapse-ai/development/checklists/brownfield-compatibility-checklist.md +1 -1
- package/.sinapse-ai/development/checklists/memory-audit-checklist.md +1 -1
- package/.sinapse-ai/development/scripts/agent-config-loader.js +1 -1
- package/.sinapse-ai/development/scripts/apply-inline-greeting-all-agents.js +1 -1
- package/.sinapse-ai/development/scripts/audit-agent-config.js +2 -2
- package/.sinapse-ai/development/scripts/batch-update-agents-session-context.js +1 -1
- package/.sinapse-ai/development/scripts/dev-context-loader.js +1 -1
- package/.sinapse-ai/development/scripts/populate-entity-registry.js +2 -2
- package/.sinapse-ai/development/scripts/test-greeting-system.js +4 -4
- package/.sinapse-ai/development/scripts/unified-activation-pipeline.js +2 -2
- package/.sinapse-ai/development/scripts/verify-workflow-gaps.js +9 -9
- package/.sinapse-ai/development/tasks/analyze-cross-artifact.md +1 -1
- package/.sinapse-ai/development/tasks/analyze-project-structure.md +4 -4
- package/.sinapse-ai/development/tasks/apply-qa-fixes.md +1 -1
- package/.sinapse-ai/development/tasks/architect-analyze-impact.md +1 -1
- package/.sinapse-ai/development/tasks/brownfield-create-epic.md +10 -10
- package/.sinapse-ai/development/tasks/brownfield-create-story.md +1 -1
- package/.sinapse-ai/development/tasks/build-autonomous.md +1 -1
- package/.sinapse-ai/development/tasks/cleanup-utilities.md +6 -6
- package/.sinapse-ai/development/tasks/create-agent.md +1 -1
- package/.sinapse-ai/development/tasks/create-brownfield-story.md +4 -4
- package/.sinapse-ai/development/tasks/create-next-story.md +12 -12
- package/.sinapse-ai/development/tasks/create-service.md +2 -2
- package/.sinapse-ai/development/tasks/create-suite.md +1 -1
- package/.sinapse-ai/development/tasks/dev-backlog-debt.md +3 -3
- package/.sinapse-ai/development/tasks/dev-develop-story.md +5 -5
- package/.sinapse-ai/development/tasks/environment-bootstrap.md +2 -2
- package/.sinapse-ai/development/tasks/execute-checklist.md +1 -1
- package/.sinapse-ai/development/tasks/execute-epic-plan.md +11 -11
- package/.sinapse-ai/development/tasks/extract-patterns.md +2 -2
- package/.sinapse-ai/development/tasks/facilitate-brainstorming-session.md +2 -2
- package/.sinapse-ai/development/tasks/github-devops-github-pr-automation.md +1 -1
- package/.sinapse-ai/development/tasks/github-devops-pre-push-quality-gate.md +1 -1
- package/.sinapse-ai/development/tasks/ids-governor.md +3 -3
- package/.sinapse-ai/development/tasks/next.md +2 -2
- package/.sinapse-ai/development/tasks/orchestrate-resume.md +1 -1
- package/.sinapse-ai/development/tasks/orchestrate-status.md +1 -1
- package/.sinapse-ai/development/tasks/orchestrate-stop.md +1 -1
- package/.sinapse-ai/development/tasks/orchestrate.md +1 -1
- package/.sinapse-ai/development/tasks/patterns.md +2 -2
- package/.sinapse-ai/development/tasks/plan-create-context.md +2 -2
- package/.sinapse-ai/development/tasks/plan-execute-subtask.md +3 -3
- package/.sinapse-ai/development/tasks/po-close-story.md +3 -3
- package/.sinapse-ai/development/tasks/project-status.md +2 -2
- package/.sinapse-ai/development/tasks/qa-after-creation.md +2 -2
- package/.sinapse-ai/development/tasks/qa-backlog-add-followup.md +3 -3
- package/.sinapse-ai/development/tasks/qa-create-fix-request.md +8 -8
- package/.sinapse-ai/development/tasks/qa-evidence-requirements.md +1 -1
- package/.sinapse-ai/development/tasks/qa-false-positive-detection.md +1 -1
- package/.sinapse-ai/development/tasks/qa-fix-issues.md +10 -10
- package/.sinapse-ai/development/tasks/qa-gate.md +3 -3
- package/.sinapse-ai/development/tasks/qa-review-build.md +3 -3
- package/.sinapse-ai/development/tasks/qa-review-story.md +2 -2
- package/.sinapse-ai/development/tasks/qa-run-tests.md +1 -1
- package/.sinapse-ai/development/tasks/run-workflow-engine.md +1 -1
- package/.sinapse-ai/development/tasks/run-workflow.md +1 -1
- package/.sinapse-ai/development/tasks/security-scan.md +2 -2
- package/.sinapse-ai/development/tasks/setup-llm-routing.md +1 -1
- package/.sinapse-ai/development/tasks/spec-critique.md +4 -4
- package/.sinapse-ai/development/tasks/spec-gather-requirements.md +4 -4
- package/.sinapse-ai/development/tasks/spec-write-spec.md +2 -2
- package/.sinapse-ai/development/tasks/story-checkpoint.md +3 -3
- package/.sinapse-ai/development/tasks/sync-registry-intel.md +1 -1
- package/.sinapse-ai/development/tasks/validate-agents.md +1 -1
- package/.sinapse-ai/development/tasks/validate-next-story.md +10 -10
- package/.sinapse-ai/development/tasks/validate-workflow.md +1 -1
- package/.sinapse-ai/development/tasks/verify-subtask.md +2 -2
- package/.sinapse-ai/development/templates/code-intel-integration-pattern.md +3 -3
- package/.sinapse-ai/development/templates/subagent-step-prompt.md +2 -2
- package/.sinapse-ai/development/workflows/README.md +2 -2
- package/.sinapse-ai/development/workflows/auto-worktree.yaml +5 -5
- package/.sinapse-ai/development/workflows/brownfield-discovery.yaml +11 -11
- package/.sinapse-ai/development/workflows/brownfield-fullstack.yaml +6 -6
- package/.sinapse-ai/development/workflows/brownfield-service.yaml +5 -5
- package/.sinapse-ai/development/workflows/brownfield-ui.yaml +5 -5
- package/.sinapse-ai/development/workflows/development-cycle.yaml +10 -10
- package/.sinapse-ai/development/workflows/epic-orchestration.yaml +6 -6
- package/.sinapse-ai/development/workflows/greenfield-fullstack.yaml +7 -7
- package/.sinapse-ai/development/workflows/greenfield-service.yaml +5 -5
- package/.sinapse-ai/development/workflows/greenfield-ui.yaml +5 -5
- package/.sinapse-ai/development/workflows/qa-loop.yaml +1 -1
- package/.sinapse-ai/development/workflows/spec-pipeline.yaml +2 -2
- package/.sinapse-ai/development/workflows/story-development-cycle.yaml +1 -1
- package/.sinapse-ai/docs/standards/AGENT-PERSONALIZATION-STANDARD-V1.md +2 -2
- package/.sinapse-ai/docs/standards/OPEN-SOURCE-VS-SERVICE-DIFFERENCES.md +1 -1
- package/.sinapse-ai/docs/standards/QUALITY-GATES-SPECIFICATION.md +1 -1
- package/.sinapse-ai/docs/standards/SINAPSE-LIVRO-DE-OURO-V2.1-COMPLETE.md +6 -6
- package/.sinapse-ai/docs/standards/STANDARDS-INDEX.md +2 -2
- package/.sinapse-ai/docs/standards/STORY-TEMPLATE-V2-SPECIFICATION.md +6 -6
- package/.sinapse-ai/infrastructure/scripts/config-loader.js +2 -2
- package/.sinapse-ai/infrastructure/scripts/gotchas-documenter.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/ide-sync/README.md +3 -3
- package/.sinapse-ai/infrastructure/scripts/ide-sync/gemini-commands.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/ide-sync/index.js +2 -2
- package/.sinapse-ai/infrastructure/scripts/ide-sync/redirect-generator.js +2 -2
- package/.sinapse-ai/infrastructure/scripts/migrate-agent.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/performance-tracker.js +2 -2
- package/.sinapse-ai/infrastructure/scripts/qa-report-generator.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/recovery-tracker.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/rollback-manager.js +1 -1
- package/.sinapse-ai/infrastructure/templates/core-config/core-config-brownfield.tmpl.yaml +1 -1
- package/.sinapse-ai/infrastructure/templates/core-config/core-config-greenfield.tmpl.yaml +1 -1
- package/.sinapse-ai/infrastructure/templates/sinapse-sync.yaml.template +1 -1
- package/.sinapse-ai/install-manifest.yaml +344 -344
- package/.sinapse-ai/monitor/hooks/lib/enrich.py +1 -1
- package/.sinapse-ai/product/checklists/self-critique-checklist.md +1 -1
- package/.sinapse-ai/product/checklists/story-draft-checklist.md +3 -3
- package/.sinapse-ai/product/templates/command-rationalization-matrix.md +3 -3
- package/.sinapse-ai/product/templates/design-story-tmpl.yaml +4 -4
- package/.sinapse-ai/product/templates/ide-rules/antigravity-rules.md +1 -1
- package/.sinapse-ai/product/templates/ide-rules/claude-rules.md +2 -2
- package/.sinapse-ai/product/templates/ide-rules/codex-rules.md +6 -6
- package/.sinapse-ai/product/templates/ide-rules/cursor-rules.md +1 -1
- package/.sinapse-ai/product/templates/personalized-agent-template.md +1 -1
- package/.sinapse-ai/product/templates/personalized-task-template.md +1 -1
- package/.sinapse-ai/product/templates/personalized-template-file.yaml +1 -1
- package/.sinapse-ai/product/templates/personalized-workflow-template.yaml +3 -3
- package/.sinapse-ai/product/templates/story-tmpl.yaml +8 -8
- package/.sinapse-ai/schemas/README.md +15 -15
- package/.sinapse-ai/scripts/diagnostics/health-dashboard/package-lock.json +2 -2
- package/.sinapse-ai/user-guide.md +4 -4
- package/.sinapse-ai/working-in-the-brownfield.md +3 -3
- package/LICENSE +4 -4
- package/README.en.md +6 -6
- package/README.md +8 -8
- package/bin/cli.js +13 -11
- package/bin/sinapse.js +17 -0
- package/docs/00-shared-activation-pipeline.md +16 -16
- package/docs/FEATURE_PROCESS.md +1 -1
- package/docs/ORQX-PLAN.md +264 -0
- package/docs/core-architecture.md +2 -2
- package/docs/en/sinapse-agent-flows/README.md +2 -2
- package/docs/en/sinapse-agent-flows/dev-system.md +2 -2
- package/docs/en/sinapse-agent-flows/pm-system.md +2 -2
- package/docs/en/sinapse-agent-flows/qa-system.md +2 -2
- package/docs/en/sinapse-agent-flows/{sinapse-master-system.md → sinapse-orqx-system.md} +5 -5
- package/docs/en/sinapse-agent-flows/sm-system.md +2 -2
- package/docs/framework/entity-layer-classification.md +2 -2
- package/docs/framework/source-tree.md +17 -17
- package/docs/getting-started.md +13 -13
- package/docs/guides/IDS-CONCEITOS-EXPLICADOS.md +17 -17
- package/docs/guides/MEMORY-INTEGRATION.md +3 -3
- package/docs/guides/MEMORY-INTELLIGENCE-SYSTEM.md +4 -4
- package/docs/guides/ade-guide.md +25 -25
- package/docs/guides/agent-selection-guide.md +36 -36
- package/docs/guides/agents/ANALYST-SYSTEM.md +5 -5
- package/docs/guides/agents/ARCHITECT-SYSTEM.md +9 -9
- package/docs/guides/agents/DATA-ENGINEER-SYSTEM.md +8 -8
- package/docs/guides/agents/DEV-SYSTEM.md +27 -27
- package/docs/guides/agents/DEVOPS-SYSTEM.md +5 -5
- package/docs/guides/agents/PM-SYSTEM.md +24 -24
- package/docs/guides/agents/QA-SYSTEM.md +24 -24
- package/docs/guides/agents/SINAPSE-MASTER-SYSTEM.md +26 -26
- package/docs/guides/agents/SM-SYSTEM.md +31 -31
- package/docs/guides/agents/SQUAD-CREATOR-SYSTEM.md +2 -2
- package/docs/guides/agents/UX-DESIGN-EXPERT-SYSTEM.md +10 -10
- package/docs/guides/agents/traces/00-shared-activation-pipeline.md +16 -16
- package/docs/guides/agents/traces/00-shared-activation-pipeline.v1-act8.md +16 -16
- package/docs/guides/agents/traces/README.md +20 -20
- package/docs/guides/agents/traces/analyst-execution-trace.md +6 -6
- package/docs/guides/agents/traces/architect-execution-trace.md +3 -3
- package/docs/guides/agents/traces/data-engineer-execution-trace.md +4 -4
- package/docs/guides/agents/traces/dev-execution-trace.md +12 -12
- package/docs/guides/agents/traces/devops-execution-trace.md +6 -6
- package/docs/guides/agents/traces/pm-execution-trace.md +14 -14
- package/docs/guides/agents/traces/po-execution-trace.md +17 -17
- package/docs/guides/agents/traces/qa-execution-trace.md +15 -15
- package/docs/guides/agents/traces/{sinapse-master-execution-trace.md → sinapse-orqx-execution-trace.md} +22 -22
- package/docs/guides/agents/traces/sm-execution-trace.md +15 -15
- package/docs/guides/agents/traces/squad-creation-execution-trace.md +9 -9
- package/docs/guides/agents/traces/ux-design-expert-execution-trace.md +4 -4
- package/docs/guides/api-reference.md +27 -27
- package/docs/guides/coderabbit/README.md +9 -9
- package/docs/guides/contextual-greeting-system-guide.md +5 -5
- package/docs/guides/development-setup.md +1 -1
- package/docs/guides/project-status-feature.md +2 -2
- package/docs/guides/quality-dashboard.md +2 -2
- package/docs/guides/quality-gates.md +6 -6
- package/docs/guides/template-engine-v2.md +2 -2
- package/docs/guides/user-guide.md +13 -13
- package/docs/guides/workflows/AUTO-WORKTREE-WORKFLOW.md +3 -3
- package/docs/guides/workflows/BROWNFIELD-DISCOVERY-WORKFLOW.md +6 -6
- package/docs/guides/workflows/BROWNFIELD-FULLSTACK-WORKFLOW.md +30 -30
- package/docs/guides/workflows/BROWNFIELD-SERVICE-WORKFLOW.md +38 -38
- package/docs/guides/workflows/BROWNFIELD-UI-WORKFLOW.md +25 -25
- package/docs/guides/workflows/GREENFIELD-FULLSTACK-WORKFLOW.md +37 -37
- package/docs/guides/workflows/GREENFIELD-SERVICE-WORKFLOW.md +5 -5
- package/docs/guides/workflows/GREENFIELD-UI-WORKFLOW.md +19 -19
- package/docs/guides/workflows/QA-LOOP-WORKFLOW.md +13 -13
- package/docs/guides/workflows/SINAPSE-COMPLETE-CROSS-REFERENCE-ANALYSIS.md +19 -19
- package/docs/guides/workflows/SPEC-PIPELINE-WORKFLOW.md +25 -25
- package/docs/guides/workflows/STORY-DEVELOPMENT-CYCLE-WORKFLOW.md +28 -28
- package/docs/guides/workflows/WORKFLOW-TASK-AGENT-ANALYSIS.md +94 -94
- package/docs/guides/workflows/xref-phase2-templates.md +29 -29
- package/docs/guides/workflows/xref-phase3-scripts.md +33 -33
- package/docs/guides/workflows/xref-phase4-infra.md +2 -2
- package/docs/guides/workflows/xref-phase6-supporting.md +1 -1
- package/docs/guides/workflows-guide.md +2 -2
- package/docs/installation/faq.md +1 -1
- package/docs/installation/troubleshooting.md +2 -2
- package/docs/installation/v4-quick-start.md +2 -2
- package/docs/prd-cli-graph-dashboard.md +1 -1
- package/docs/pt/DOCUMENTATION-ROADMAP.md +1 -1
- package/docs/pt/FEATURE_PROCESS.md +1 -1
- package/docs/pt/README.md +2 -2
- package/docs/pt/agents/archetype-rationale.md +4 -4
- package/docs/pt/agents/persona-definitions.md +9 -9
- package/docs/pt/architecture/ADE-ARCHITECT-HANDOFF.md +15 -15
- package/docs/pt/architecture/ADE-EPIC1-HANDOFF.md +2 -2
- package/docs/pt/architecture/ADE-EPIC2-HANDOFF.md +2 -2
- package/docs/pt/architecture/ADE-EPIC3-HANDOFF.md +8 -8
- package/docs/pt/architecture/ade-architecture.md +4 -4
- package/docs/pt/architecture/adr/adr-hcs-health-check-system.md +3 -3
- package/docs/pt/architecture/agent-config-audit.md +4 -4
- package/docs/pt/architecture/agent-responsibility-matrix.md +20 -20
- package/docs/pt/architecture/agent-tool-integration-guide.md +8 -8
- package/docs/pt/architecture/contribution-workflow-research.md +1 -1
- package/docs/pt/architecture/dashboard-architecture.md +1 -1
- package/docs/pt/architecture/hcs-check-specifications.md +1 -1
- package/docs/pt/architecture/hcs-execution-modes.md +1 -1
- package/docs/pt/architecture/hcs-self-healing-spec.md +1 -1
- package/docs/pt/architecture/high-level-architecture.md +1 -1
- package/docs/pt/architecture/module-system.md +1 -1
- package/docs/pt/architecture/source-tree.md +1 -1
- package/docs/pt/architecture/squad-improvement-recommended-approach.md +2 -2
- package/docs/pt/architecture/utility-integration-guide.md +2 -2
- package/docs/pt/contributing.md +1 -1
- package/docs/pt/core-architecture.md +2 -2
- package/docs/pt/framework/source-tree.md +1 -1
- package/docs/pt/guides/ade-guide.md +25 -25
- package/docs/pt/guides/agent-selection-guide.md +36 -36
- package/docs/pt/guides/api-reference.md +25 -25
- package/docs/pt/guides/contextual-greeting-system-guide.md +5 -5
- package/docs/pt/guides/development-setup.md +1 -1
- package/docs/pt/guides/project-status-feature.md +2 -2
- package/docs/pt/guides/quality-dashboard.md +2 -2
- package/docs/pt/guides/quality-gates.md +6 -6
- package/docs/pt/guides/template-engine-v2.md +2 -2
- package/docs/pt/guides/user-guide.md +8 -8
- package/docs/pt/guides/workflows-guide.md +2 -2
- package/docs/pt/installation/faq.md +1 -1
- package/docs/pt/installation/troubleshooting.md +2 -2
- package/docs/pt/installation/v4-quick-start.md +2 -2
- package/docs/pt/platforms/antigravity.md +9 -9
- package/docs/pt/platforms/cursor.md +15 -15
- package/docs/pt/platforms/gemini-cli.md +3 -3
- package/docs/pt/roadmap.md +1 -1
- package/docs/pt/sinapse-nomenclature-specification.md +15 -15
- package/docs/pt/specifications/docs-agent-technical-specification.md +11 -11
- package/docs/roadmap.md +1 -1
- package/docs/sinapse-agent-flows/README.md +2 -2
- package/docs/sinapse-agent-flows/analyst-system.md +5 -5
- package/docs/sinapse-agent-flows/architect-system.md +9 -9
- package/docs/sinapse-agent-flows/data-engineer-system.md +8 -8
- package/docs/sinapse-agent-flows/dev-system.md +27 -27
- package/docs/sinapse-agent-flows/devops-system.md +5 -5
- package/docs/sinapse-agent-flows/pm-system.md +24 -24
- package/docs/sinapse-agent-flows/qa-system.md +24 -24
- package/docs/sinapse-agent-flows/{sinapse-master-system.md → sinapse-orqx-system.md} +26 -26
- package/docs/sinapse-agent-flows/sm-system.md +31 -31
- package/docs/sinapse-agent-flows/squad-creator-system.md +2 -2
- package/docs/sinapse-agent-flows/ux-design-expert-system.md +10 -10
- package/docs/sinapse-workflows/auto-worktree-workflow.md +3 -3
- package/docs/sinapse-workflows/brownfield-discovery-workflow.md +6 -6
- package/docs/sinapse-workflows/brownfield-fullstack-workflow.md +30 -30
- package/docs/sinapse-workflows/brownfield-service-workflow.md +38 -38
- package/docs/sinapse-workflows/brownfield-ui-workflow.md +25 -25
- package/docs/sinapse-workflows/greenfield-fullstack-workflow.md +37 -37
- package/docs/sinapse-workflows/greenfield-service-workflow.md +5 -5
- package/docs/sinapse-workflows/greenfield-ui-workflow.md +19 -19
- package/docs/sinapse-workflows/qa-loop-workflow.md +13 -13
- package/docs/sinapse-workflows/spec-pipeline-workflow.md +25 -25
- package/docs/sinapse-workflows/story-development-cycle-workflow.md +28 -28
- package/package.json +1 -1
- package/packages/gemini-sinapse-extension/README.md +1 -1
- package/packages/gemini-sinapse-extension/commands/lib/agent-launcher.js +1 -1
- package/packages/gemini-sinapse-extension/commands/{sinapse-master.js → sinapse-orqx.js} +1 -1
- package/packages/gemini-sinapse-extension/extension.json +3 -3
- package/packages/gemini-sinapse-extension/gemini-extension.json +3 -3
- package/packages/installer/src/config/configure-environment.js +2 -2
- package/packages/installer/src/updater/index.js +105 -0
- package/packages/installer/src/wizard/feedback.js +38 -30
- package/packages/installer/src/wizard/i18n.js +25 -182
- package/packages/installer/src/wizard/ide-config-generator.js +1 -1
- package/packages/installer/src/wizard/index.js +253 -69
- package/packages/installer/src/wizard/questions.js +35 -7
- package/packages/installer/tests/unit/artifact-copy-pipeline/artifact-copy-pipeline.test.js +1 -1
- package/packages/sinapse-install/README.md +1 -1
- package/packages/sinapse-install/src/installer.js +1 -1
- package/scripts/package-synapse.js +1 -1
- package/sinapse/agents/{sinapse-master.md → sinapse-orqx.md} +18 -18
- package/sinapse/knowledge-base/cross-squad-patterns.md +1 -1
- package/sinapse/knowledge-base/routing-catalog.md +1 -1
- package/sinapse/squad.yaml +1 -1
- package/sinapse/tasks/compose-multi-squad-plan.md +2 -2
- package/sinapse/tasks/coordinate-cross-squad.md +2 -2
- package/sinapse/tasks/diagnose-and-route.md +2 -2
- package/sinapse/tasks/onboard-user.md +2 -2
- package/sinapse/tasks/resolve-conflict.md +2 -2
- package/sinapse/tasks/squad-status-report.md +2 -2
- package/sinapse/tasks/strategic-brief.md +3 -3
- package/squads/squad-animations/agents/animations-orqx.md +2 -2
- package/squads/squad-brand/agents/brand-creative-engineer.md +1 -1
- package/squads/squad-brand/agents/brand-motion-vfx.md +1 -1
- package/squads/squad-brand/agents/brand-orqx.md +2 -2
- package/squads/squad-brand/agents/brand-sonic-designer.md +1 -1
- package/squads/squad-brand/agents/brand-system-architect.md +1 -1
- package/squads/squad-claude/agents/claude-orqx.md +2 -2
- package/squads/squad-cloning/agents/cloning-orqx.md +3 -3
- package/squads/squad-commercial/agents/commercial-orqx.md +1 -1
- package/squads/squad-commercial/agents/cs-business-auditor.md +1 -1
- package/squads/squad-commercial/agents/cs-client-success.md +1 -1
- package/squads/squad-commercial/agents/cs-crm-specialist.md +1 -1
- package/squads/squad-commercial/agents/cs-funnel-architect.md +1 -1
- package/squads/squad-commercial/agents/cs-lead-generation-strategist.md +1 -1
- package/squads/squad-commercial/agents/cs-offer-designer.md +1 -1
- package/squads/squad-commercial/agents/cs-revops-analyst.md +1 -1
- package/squads/squad-commercial/agents/cs-sales-closer.md +1 -1
- package/squads/squad-commercial/agents/cs-sales-enablement.md +1 -1
- package/squads/squad-commercial/knowledge-base/ai-as-competitive-infrastructure.md +1 -1
- package/squads/squad-content/agents/content-orqx.md +2 -2
- package/squads/squad-content/knowledge-base/ai-leverage-content-framework.md +1 -1
- package/squads/squad-copy/agents/copy-strategist.md +3 -3
- package/squads/squad-copy/knowledge-base/consequence-headline-patterns.md +1 -1
- package/squads/squad-council/agents/council-orqx.md +1 -1
- package/squads/squad-courses/agents/courses-orqx.md +1 -1
- package/squads/squad-cybersecurity/agents/cyber-orqx.md +2 -2
- package/squads/squad-design/agents/design-orqx.md +2 -2
- package/squads/squad-finance/agents/finance-orqx.md +2 -2
- package/squads/squad-growth/agents/growth-orqx.md +2 -2
- package/squads/squad-paidmedia/agents/paidmedia-orqx.md +2 -2
- package/squads/squad-product/agents/product-orqx.md +2 -2
- package/squads/squad-research/agents/research-orqx.md +2 -2
- package/squads/squad-research/tasks/create-executive-briefing.md +1 -1
- package/squads/squad-research/tasks/create-insight-deck.md +1 -1
- package/squads/squad-research/tasks/forecast-industry-trends.md +1 -1
- package/squads/squad-research/tasks/generate-actionable-recommendations.md +2 -2
- package/squads/squad-research/tasks/run-scenario-planning.md +2 -2
- package/squads/squad-research/tasks/synthesize-research-report.md +2 -2
- package/squads/squad-research/tasks/track-emerging-technologies.md +1 -1
- package/squads/squad-storytelling/agents/storytelling-orqx.md +2 -2
- package/docs/es/CHANGELOG.md +0 -117
- package/docs/es/DOCUMENTATION-ROADMAP.md +0 -216
- package/docs/es/ENVIRONMENT.md +0 -140
- package/docs/es/FEATURE_PROCESS.md +0 -99
- package/docs/es/GUIDING-PRINCIPLES.md +0 -101
- package/docs/es/README.md +0 -134
- package/docs/es/agent-reference-guide.md +0 -570
- package/docs/es/agents/archetype-rationale.md +0 -566
- package/docs/es/agents/persona-definitions.md +0 -501
- package/docs/es/api/squads-api.md +0 -753
- package/docs/es/architecture/ADE-AGENT-CHANGES.md +0 -469
- package/docs/es/architecture/ADE-ARCHITECT-HANDOFF.md +0 -338
- package/docs/es/architecture/ADE-EPIC1-HANDOFF.md +0 -85
- package/docs/es/architecture/ADE-EPIC2-HANDOFF.md +0 -106
- package/docs/es/architecture/ADE-EPIC3-HANDOFF.md +0 -327
- package/docs/es/architecture/ARCHITECTURE-INDEX.md +0 -188
- package/docs/es/architecture/ade-architecture.md +0 -586
- package/docs/es/architecture/adr/ADR-COLLAB-1-current-state-audit.md +0 -259
- package/docs/es/architecture/adr/ADR-COLLAB-2-proposed-configuration.md +0 -518
- package/docs/es/architecture/adr/adr-hcs-health-check-system.md +0 -489
- package/docs/es/architecture/adr/adr-isolated-vm-decision.md +0 -70
- package/docs/es/architecture/agent-config-audit.md +0 -222
- package/docs/es/architecture/agent-responsibility-matrix.md +0 -444
- package/docs/es/architecture/agent-tool-integration-guide.md +0 -334
- package/docs/es/architecture/ci-cd.md +0 -151
- package/docs/es/architecture/coding-standards.md +0 -896
- package/docs/es/architecture/contribution-workflow-research.md +0 -376
- package/docs/es/architecture/dashboard-architecture.md +0 -926
- package/docs/es/architecture/dashboard-realtime.md +0 -1253
- package/docs/es/architecture/hcs-check-specifications.md +0 -897
- package/docs/es/architecture/hcs-execution-modes.md +0 -519
- package/docs/es/architecture/hcs-self-healing-spec.md +0 -695
- package/docs/es/architecture/high-level-architecture.md +0 -357
- package/docs/es/architecture/introduction.md +0 -21
- package/docs/es/architecture/mcp-api-keys-management.md +0 -246
- package/docs/es/architecture/mcp-system-diagrams.md +0 -113
- package/docs/es/architecture/module-system.md +0 -382
- package/docs/es/architecture/multi-repo-strategy.md +0 -390
- package/docs/es/architecture/source-tree.md +0 -708
- package/docs/es/architecture/squad-improvement-analysis.md +0 -204
- package/docs/es/architecture/squad-improvement-recommended-approach.md +0 -390
- package/docs/es/architecture/tech-stack.md +0 -806
- package/docs/es/architecture/utility-integration-guide.md +0 -358
- package/docs/es/community/README-community-snippet-core.md +0 -57
- package/docs/es/community/README-community-snippet-mcp.md +0 -49
- package/docs/es/community/README-community-snippet-squads.md +0 -40
- package/docs/es/community.md +0 -227
- package/docs/es/core-architecture.md +0 -229
- package/docs/es/docker-mcp-setup.md +0 -426
- package/docs/es/framework/README.md +0 -99
- package/docs/es/framework/coding-standards.md +0 -892
- package/docs/es/framework/source-tree.md +0 -725
- package/docs/es/framework/tech-stack.md +0 -802
- package/docs/es/getting-started.md +0 -572
- package/docs/es/git-workflow-guide.md +0 -995
- package/docs/es/guides/README.md +0 -133
- package/docs/es/guides/ade-guide.md +0 -452
- package/docs/es/guides/agent-selection-guide.md +0 -295
- package/docs/es/guides/api-reference.md +0 -899
- package/docs/es/guides/build-recovery-guide.md +0 -270
- package/docs/es/guides/contextual-greeting-system-guide.md +0 -387
- package/docs/es/guides/contributing-squads.md +0 -256
- package/docs/es/guides/development-setup.md +0 -1111
- package/docs/es/guides/ide-sync-guide.md +0 -194
- package/docs/es/guides/installation-troubleshooting.md +0 -327
- package/docs/es/guides/llm-routing.md +0 -312
- package/docs/es/guides/mcp/desktop-commander.md +0 -368
- package/docs/es/guides/mcp/docker-gateway-tutorial.md +0 -336
- package/docs/es/guides/mcp-global-setup.md +0 -663
- package/docs/es/guides/permission-modes.md +0 -313
- package/docs/es/guides/project-status-feature.md +0 -473
- package/docs/es/guides/quality-dashboard.md +0 -367
- package/docs/es/guides/quality-gates.md +0 -614
- package/docs/es/guides/security-hardening.md +0 -1359
- package/docs/es/guides/service-discovery.md +0 -524
- package/docs/es/guides/squad-examples/README.md +0 -64
- package/docs/es/guides/squad-migration.md +0 -356
- package/docs/es/guides/squads-guide.md +0 -836
- package/docs/es/guides/squads-overview.md +0 -332
- package/docs/es/guides/template-engine-v2.md +0 -484
- package/docs/es/guides/testing-guide.md +0 -1215
- package/docs/es/guides/user-guide.md +0 -452
- package/docs/es/guides/workflows-guide.md +0 -400
- package/docs/es/how-to-contribute-with-pull-requests.md +0 -160
- package/docs/es/ide-integration.md +0 -425
- package/docs/es/installation/README.md +0 -108
- package/docs/es/installation/faq.md +0 -616
- package/docs/es/installation/linux.md +0 -311
- package/docs/es/installation/macos.md +0 -189
- package/docs/es/installation/troubleshooting.md +0 -735
- package/docs/es/installation/v4-quick-start.md +0 -269
- package/docs/es/installation/windows.md +0 -342
- package/docs/es/meta-agent-commands.md +0 -990
- package/docs/es/migration-guide.md +0 -310
- package/docs/es/npx-install.md +0 -193
- package/docs/es/performance-tuning-guide.md +0 -707
- package/docs/es/platforms/README.md +0 -283
- package/docs/es/platforms/antigravity.md +0 -510
- package/docs/es/platforms/claude-code.md +0 -650
- package/docs/es/platforms/cursor.md +0 -635
- package/docs/es/platforms/gemini-cli.md +0 -483
- package/docs/es/platforms/github-copilot.md +0 -480
- package/docs/es/roadmap.md +0 -119
- package/docs/es/security-best-practices.md +0 -613
- package/docs/es/security.md +0 -124
- package/docs/es/sinapse-agent-flows/README.md +0 -190
- package/docs/es/sinapse-agent-flows/analyst-system.md +0 -36
- package/docs/es/sinapse-agent-flows/architect-system.md +0 -36
- package/docs/es/sinapse-agent-flows/data-engineer-system.md +0 -36
- package/docs/es/sinapse-agent-flows/dev-system.md +0 -36
- package/docs/es/sinapse-agent-flows/devops-system.md +0 -36
- package/docs/es/sinapse-agent-flows/pm-system.md +0 -36
- package/docs/es/sinapse-agent-flows/qa-system.md +0 -36
- package/docs/es/sinapse-agent-flows/sinapse-master-system.md +0 -36
- package/docs/es/sinapse-agent-flows/sm-system.md +0 -36
- package/docs/es/sinapse-agent-flows/squad-creator-system.md +0 -36
- package/docs/es/sinapse-agent-flows/ux-design-expert-system.md +0 -36
- package/docs/es/sinapse-nomenclature-specification.md +0 -673
- package/docs/es/sinapse-workflows/README.md +0 -247
- package/docs/es/sinapse-workflows/auto-worktree-workflow.md +0 -39
- package/docs/es/sinapse-workflows/brownfield-discovery-workflow.md +0 -41
- package/docs/es/sinapse-workflows/brownfield-fullstack-workflow.md +0 -42
- package/docs/es/sinapse-workflows/brownfield-service-workflow.md +0 -43
- package/docs/es/sinapse-workflows/brownfield-ui-workflow.md +0 -42
- package/docs/es/sinapse-workflows/design-system-build-quality-workflow.md +0 -40
- package/docs/es/sinapse-workflows/greenfield-fullstack-workflow.md +0 -44
- package/docs/es/sinapse-workflows/greenfield-service-workflow.md +0 -43
- package/docs/es/sinapse-workflows/greenfield-ui-workflow.md +0 -43
- package/docs/es/sinapse-workflows/qa-loop-workflow.md +0 -39
- package/docs/es/sinapse-workflows/spec-pipeline-workflow.md +0 -40
- package/docs/es/sinapse-workflows/story-development-cycle-workflow.md +0 -42
- package/docs/es/specifications/docs-agent-technical-specification.md +0 -2161
- package/docs/es/troubleshooting.md +0 -887
- package/docs/es/uninstallation.md +0 -556
- package/docs/es/versioning-and-releases.md +0 -146
- package/docs/zh/CHANGELOG.md +0 -191
- package/docs/zh/ENVIRONMENT.md +0 -136
- package/docs/zh/FEATURE_PROCESS.md +0 -92
- package/docs/zh/GLOSSARY.md +0 -179
- package/docs/zh/GUIDING-PRINCIPLES.md +0 -97
- package/docs/zh/README.md +0 -133
- package/docs/zh/TRANSLATION-PLAN.md +0 -508
- package/docs/zh/agent-reference-guide.md +0 -566
- package/docs/zh/agents/archetype-rationale.md +0 -631
- package/docs/zh/agents/persona-definitions.md +0 -560
- package/docs/zh/api/squads-api.md +0 -753
- package/docs/zh/architecture/ADE-ARCHITECT-HANDOFF.md +0 -338
- package/docs/zh/architecture/ADE-EPIC1-HANDOFF.md +0 -85
- package/docs/zh/architecture/ADE-EPIC2-HANDOFF.md +0 -106
- package/docs/zh/architecture/ADE-EPIC3-HANDOFF.md +0 -327
- package/docs/zh/architecture/ARCHITECTURE-INDEX.md +0 -190
- package/docs/zh/architecture/SINAPSE-VISUAL-OVERVIEW.md +0 -595
- package/docs/zh/architecture/ade-architecture.md +0 -474
- package/docs/zh/architecture/adr/ADR-COLLAB-1-current-state-audit.md +0 -259
- package/docs/zh/architecture/adr/ADR-COLLAB-2-proposed-configuration.md +0 -518
- package/docs/zh/architecture/adr/adr-hcs-health-check-system.md +0 -489
- package/docs/zh/architecture/adr/adr-isolated-vm-decision.md +0 -70
- package/docs/zh/architecture/agent-config-audit.md +0 -220
- package/docs/zh/architecture/agent-responsibility-matrix.md +0 -444
- package/docs/zh/architecture/agent-tool-integration-guide.md +0 -336
- package/docs/zh/architecture/ci-cd.md +0 -151
- package/docs/zh/architecture/coding-standards.md +0 -898
- package/docs/zh/architecture/command-authority-matrix.md +0 -18
- package/docs/zh/architecture/contribution-workflow-research.md +0 -376
- package/docs/zh/architecture/dashboard-architecture.md +0 -569
- package/docs/zh/architecture/dashboard-realtime.md +0 -415
- package/docs/zh/architecture/hcs-check-specifications.md +0 -102
- package/docs/zh/architecture/hcs-execution-modes.md +0 -114
- package/docs/zh/architecture/hcs-self-healing-spec.md +0 -148
- package/docs/zh/architecture/high-level-architecture.md +0 -355
- package/docs/zh/architecture/introduction.md +0 -21
- package/docs/zh/architecture/mcp-api-keys-management.md +0 -248
- package/docs/zh/architecture/mcp-system-diagrams.md +0 -113
- package/docs/zh/architecture/module-system.md +0 -382
- package/docs/zh/architecture/multi-repo-strategy.md +0 -237
- package/docs/zh/architecture/source-tree.md +0 -710
- package/docs/zh/architecture/squad-improvement-analysis.md +0 -204
- package/docs/zh/architecture/squad-improvement-recommended-approach.md +0 -390
- package/docs/zh/architecture/tech-stack.md +0 -808
- package/docs/zh/architecture/utility-integration-guide.md +0 -358
- package/docs/zh/code-of-conduct.md +0 -113
- package/docs/zh/community/README-community-snippet-core.md +0 -57
- package/docs/zh/community/README-community-snippet-mcp.md +0 -49
- package/docs/zh/community/README-community-snippet-squads.md +0 -40
- package/docs/zh/community.md +0 -227
- package/docs/zh/contributing.md +0 -581
- package/docs/zh/core-architecture.md +0 -229
- package/docs/zh/docker-mcp-setup.md +0 -226
- package/docs/zh/framework/README.md +0 -97
- package/docs/zh/framework/coding-standards.md +0 -886
- package/docs/zh/framework/source-tree.md +0 -888
- package/docs/zh/framework/tech-stack.md +0 -796
- package/docs/zh/getting-started.md +0 -317
- package/docs/zh/git-workflow-guide.md +0 -988
- package/docs/zh/guides/MEMORY-INTEGRATION.md +0 -497
- package/docs/zh/guides/MEMORY-INTELLIGENCE-SYSTEM.md +0 -1083
- package/docs/zh/guides/MEMORY-SYSTEM.md +0 -1003
- package/docs/zh/guides/README.md +0 -127
- package/docs/zh/guides/ade-guide.md +0 -446
- package/docs/zh/guides/agent-selection-guide.md +0 -289
- package/docs/zh/guides/api-reference.md +0 -427
- package/docs/zh/guides/build-recovery-guide.md +0 -266
- package/docs/zh/guides/contextual-greeting-system-guide.md +0 -381
- package/docs/zh/guides/contributing-squads.md +0 -250
- package/docs/zh/guides/development-setup.md +0 -384
- package/docs/zh/guides/ide-sync-guide.md +0 -193
- package/docs/zh/guides/installation-troubleshooting.md +0 -321
- package/docs/zh/guides/llm-routing.md +0 -306
- package/docs/zh/guides/mcp/desktop-commander.md +0 -368
- package/docs/zh/guides/mcp/docker-gateway-tutorial.md +0 -336
- package/docs/zh/guides/mcp-global-setup.md +0 -696
- package/docs/zh/guides/permission-modes.md +0 -307
- package/docs/zh/guides/project-status-feature.md +0 -467
- package/docs/zh/guides/quality-dashboard.md +0 -361
- package/docs/zh/guides/quality-gates.md +0 -462
- package/docs/zh/guides/security-hardening.md +0 -1055
- package/docs/zh/guides/service-discovery.md +0 -518
- package/docs/zh/guides/squad-examples/README.md +0 -63
- package/docs/zh/guides/squad-migration.md +0 -336
- package/docs/zh/guides/template-engine-v2.md +0 -478
- package/docs/zh/guides/workflows-guide.md +0 -408
- package/docs/zh/how-to-contribute-with-pull-requests.md +0 -158
- package/docs/zh/installation/README.md +0 -106
- package/docs/zh/installation/faq.md +0 -611
- package/docs/zh/installation/linux.md +0 -447
- package/docs/zh/installation/macos.md +0 -187
- package/docs/zh/installation/troubleshooting.md +0 -729
- package/docs/zh/installation/windows.md +0 -475
- package/docs/zh/meta-agent-commands.md +0 -990
- package/docs/zh/security-best-practices.md +0 -610
- package/docs/zh/security.md +0 -124
- package/docs/zh/sinapse-agent-flows/README.md +0 -196
- package/docs/zh/sinapse-agent-flows/analyst-system.md +0 -679
- package/docs/zh/sinapse-agent-flows/architect-system.md +0 -246
- package/docs/zh/sinapse-agent-flows/data-engineer-system.md +0 -418
- package/docs/zh/sinapse-agent-flows/dev-system.md +0 -209
- package/docs/zh/sinapse-agent-flows/devops-system.md +0 -643
- package/docs/zh/sinapse-agent-flows/pm-system.md +0 -733
- package/docs/zh/sinapse-agent-flows/qa-system.md +0 -268
- package/docs/zh/sinapse-agent-flows/sinapse-master-system.md +0 -81
- package/docs/zh/sinapse-agent-flows/sm-system.md +0 -501
- package/docs/zh/sinapse-agent-flows/squad-creator-system.md +0 -704
- package/docs/zh/sinapse-agent-flows/ux-design-expert-system.md +0 -160
- package/docs/zh/sinapse-workflows/README.md +0 -247
- package/docs/zh/sinapse-workflows/auto-worktree-workflow.md +0 -793
- package/docs/zh/sinapse-workflows/brownfield-discovery-workflow.md +0 -915
- package/docs/zh/sinapse-workflows/brownfield-fullstack-workflow.md +0 -764
- package/docs/zh/sinapse-workflows/brownfield-service-workflow.md +0 -812
- package/docs/zh/sinapse-workflows/brownfield-ui-workflow.md +0 -891
- package/docs/zh/sinapse-workflows/design-system-build-quality-workflow.md +0 -845
- package/docs/zh/sinapse-workflows/greenfield-fullstack-workflow.md +0 -796
- package/docs/zh/sinapse-workflows/greenfield-service-workflow.md +0 -786
- package/docs/zh/sinapse-workflows/greenfield-ui-workflow.md +0 -922
- package/docs/zh/sinapse-workflows/qa-loop-workflow.md +0 -1111
- package/docs/zh/sinapse-workflows/spec-pipeline-workflow.md +0 -1031
- package/docs/zh/sinapse-workflows/story-development-cycle-workflow.md +0 -843
- package/docs/zh/troubleshooting.md +0 -883
- package/docs/zh/uninstallation.md +0 -348
- package/docs/zh/versioning-and-releases.md +0 -140
- /package/.sinapse-ai/development/agents/{dev → developer}/MEMORY.md +0 -0
- /package/.sinapse-ai/development/agents/{qa → quality-gate}/MEMORY.md +0 -0
- /package/.sinapse-ai/development/agents/{sm → sprint-lead}/MEMORY.md +0 -0
|
@@ -1,1359 +0,0 @@
|
|
|
1
|
-
# Guía de Hardening de Seguridad de SINAPSE
|
|
2
|
-
|
|
3
|
-
> [EN](../../guides/security-hardening.md) | [PT](../../pt/guides/security-hardening.md) | **ES**
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
> Guía completa para fortalecer la seguridad en despliegues de SINAPSE - desde desarrollo hasta producción.
|
|
8
|
-
|
|
9
|
-
**Versión:** 2.1.0
|
|
10
|
-
**Última Actualización:** 2026-01-29
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Tabla de Contenidos
|
|
15
|
-
|
|
16
|
-
1. [Visión General de Seguridad](#visión-general-de-seguridad)
|
|
17
|
-
2. [Gestión de Claves API](#gestión-de-claves-api)
|
|
18
|
-
3. [Variables de Entorno y Secretos](#variables-de-entorno-y-secretos)
|
|
19
|
-
4. [Permisos de Archivos y Directorios](#permisos-de-archivos-y-directorios)
|
|
20
|
-
5. [Sandboxing y Aislamiento](#sandboxing-y-aislamiento)
|
|
21
|
-
6. [Validación de Entrada](#validación-de-entrada)
|
|
22
|
-
7. [Protección contra Inyección](#protección-contra-inyección)
|
|
23
|
-
8. [Logging y Auditoría](#logging-y-auditoría)
|
|
24
|
-
9. [Configuración de Producción vs Desarrollo](#configuración-de-producción-vs-desarrollo)
|
|
25
|
-
10. [Lista de Verificación de Seguridad](#lista-de-verificación-de-seguridad)
|
|
26
|
-
11. [Reporte de Vulnerabilidades](#reporte-de-vulnerabilidades)
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Visión General de Seguridad
|
|
31
|
-
|
|
32
|
-
SINAPSE opera en una capa privilegiada entre los modelos de IA y tu sistema. Esta guía cubre estrategias de hardening específicas para entornos de desarrollo orquestados por IA.
|
|
33
|
-
|
|
34
|
-
### Arquitectura de Seguridad
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
38
|
-
│ CAPA EXTERNA │
|
|
39
|
-
│ Network Firewall | WAF | TLS Termination | Rate Limiting │
|
|
40
|
-
├─────────────────────────────────────────────────────────────────┤
|
|
41
|
-
│ CAPA DE APLICACIÓN │
|
|
42
|
-
│ Permission Modes | Input Validation | Command Sanitization │
|
|
43
|
-
├─────────────────────────────────────────────────────────────────┤
|
|
44
|
-
│ CAPA DE EJECUCIÓN │
|
|
45
|
-
│ Sandboxing | Process Isolation | Resource Limits | Hooks │
|
|
46
|
-
├─────────────────────────────────────────────────────────────────┤
|
|
47
|
-
│ CAPA DE DATOS │
|
|
48
|
-
│ Encryption at Rest | Secure Storage | Audit Logging │
|
|
49
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Preocupaciones de Seguridad Específicas de SINAPSE
|
|
53
|
-
|
|
54
|
-
| Preocupación | Nivel de Riesgo | Mitigación |
|
|
55
|
-
| ------------------------------ | --------------- | --------------------------------- |
|
|
56
|
-
| Ejecución de código de agentes | CRÍTICO | Permission Modes, Sandboxing |
|
|
57
|
-
| Exposición de claves API | CRÍTICO | Aislamiento de entorno, cifrado |
|
|
58
|
-
| Inyección de comandos vía IA | ALTO | Sanitización de entrada, hooks |
|
|
59
|
-
| Acceso no autorizado a archivos| ALTO | Restricciones de directorio |
|
|
60
|
-
| Secuestro de sesión | MEDIO | Rotación de tokens, almacenamiento seguro |
|
|
61
|
-
| Divulgación de información | MEDIO | Audit logging, controles de acceso|
|
|
62
|
-
|
|
63
|
-
### Defensa en Profundidad
|
|
64
|
-
|
|
65
|
-
SINAPSE implementa múltiples capas de protección:
|
|
66
|
-
|
|
67
|
-
1. **Permission Modes** - Controlan la autonomía del agente (Explore/Ask/Auto)
|
|
68
|
-
2. **Claude Hooks** - Validación previa a la ejecución (read-protection, sql-governance)
|
|
69
|
-
3. **Sanitización de Entrada** - Toda entrada de usuario/IA es validada
|
|
70
|
-
4. **Aislamiento de Procesos** - Los servidores MCP se ejecutan en contenedores
|
|
71
|
-
5. **Audit Logging** - Todas las operaciones son registradas
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Gestión de Claves API
|
|
76
|
-
|
|
77
|
-
Las claves API son los secretos más críticos en SINAPSE. Las claves comprometidas pueden llevar a uso no autorizado, brechas de datos e impacto financiero significativo.
|
|
78
|
-
|
|
79
|
-
### Jerarquía de Almacenamiento
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
┌────────────────────────────────────────────────────────────────┐
|
|
83
|
-
│ NUNCA │
|
|
84
|
-
│ ❌ Código fuente │
|
|
85
|
-
│ ❌ Repositorios Git │
|
|
86
|
-
│ ❌ Archivos de configuración (commiteados) │
|
|
87
|
-
│ ❌ Archivos de log │
|
|
88
|
-
│ ❌ Mensajes de error │
|
|
89
|
-
├────────────────────────────────────────────────────────────────┤
|
|
90
|
-
│ ACEPTABLE (Desarrollo) │
|
|
91
|
-
│ ⚠️ Archivos .env (gitignored) │
|
|
92
|
-
│ ⚠️ Variables de entorno locales │
|
|
93
|
-
├────────────────────────────────────────────────────────────────┤
|
|
94
|
-
│ RECOMENDADO (Producción) │
|
|
95
|
-
│ ✅ Secret managers (Vault, AWS Secrets, etc.) │
|
|
96
|
-
│ ✅ Inyección de secretos en CI/CD │
|
|
97
|
-
│ ✅ Kubernetes secrets │
|
|
98
|
-
│ ✅ Almacenes de credenciales cifrados │
|
|
99
|
-
└────────────────────────────────────────────────────────────────┘
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Configuración Segura de Claves API
|
|
103
|
-
|
|
104
|
-
**Desarrollo (archivo .env - nunca commitear)**
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# .env - Agregar a .gitignore INMEDIATAMENTE
|
|
108
|
-
# Claves de Proveedores de API
|
|
109
|
-
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
110
|
-
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
111
|
-
|
|
112
|
-
# Claves de Servidores MCP
|
|
113
|
-
EXA_API_KEY=exa-xxxxxxxxxxxxxxxxxxxxxxxx
|
|
114
|
-
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
115
|
-
APIFY_TOKEN=apify_api_xxxxxxxxxxxxxxxxxxxxx
|
|
116
|
-
|
|
117
|
-
# Nunca usar valores predeterminados o débiles
|
|
118
|
-
JWT_SECRET=your-256-bit-cryptographically-secure-random-key
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
**Producción (usando secret manager)**
|
|
122
|
-
|
|
123
|
-
```javascript
|
|
124
|
-
// Cargar secretos desde vault seguro
|
|
125
|
-
const secrets = await SecretManager.loadSecrets({
|
|
126
|
-
provider: 'aws-secrets-manager', // o 'hashicorp-vault', 'gcp-secrets'
|
|
127
|
-
secretName: 'sinapse/production/api-keys',
|
|
128
|
-
region: process.env.AWS_REGION,
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
process.env.ANTHROPIC_API_KEY = secrets.ANTHROPIC_API_KEY;
|
|
132
|
-
process.env.OPENAI_API_KEY = secrets.OPENAI_API_KEY;
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Política de Rotación de Claves
|
|
136
|
-
|
|
137
|
-
| Tipo de Clave | Frecuencia de Rotación | En Caso de Compromiso |
|
|
138
|
-
| ------------------ | ---------------------- | --------------------- |
|
|
139
|
-
| Claves de Proveedores AI | 90 días | Inmediato |
|
|
140
|
-
| JWT Secrets | 30 días | Inmediato |
|
|
141
|
-
| Claves de Servidores MCP | 90 días | Inmediato |
|
|
142
|
-
| Tokens de Servicio | 7 días | Inmediato |
|
|
143
|
-
| Claves de Desarrollo | Nunca reutilizar | Revocar inmediatamente|
|
|
144
|
-
|
|
145
|
-
### Validación de Claves al Iniciar
|
|
146
|
-
|
|
147
|
-
```javascript
|
|
148
|
-
// .sinapse-ai/core/security/key-validator.js
|
|
149
|
-
const requiredKeys = [
|
|
150
|
-
{ name: 'ANTHROPIC_API_KEY', pattern: /^sk-ant-[a-zA-Z0-9_-]+$/ },
|
|
151
|
-
{ name: 'JWT_SECRET', minLength: 32 },
|
|
152
|
-
];
|
|
153
|
-
|
|
154
|
-
function validateApiKeys() {
|
|
155
|
-
const errors = [];
|
|
156
|
-
|
|
157
|
-
for (const key of requiredKeys) {
|
|
158
|
-
const value = process.env[key.name];
|
|
159
|
-
|
|
160
|
-
if (!value) {
|
|
161
|
-
errors.push(`Clave requerida faltante: ${key.name}`);
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (key.pattern && !key.pattern.test(value)) {
|
|
166
|
-
errors.push(`Formato inválido para ${key.name}`);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (key.minLength && value.length < key.minLength) {
|
|
170
|
-
errors.push(`${key.name} debe tener al menos ${key.minLength} caracteres`);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (errors.length > 0) {
|
|
175
|
-
throw new Error(`Validación de Clave API Fallida:\n${errors.join('\n')}`);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Variables de Entorno y Secretos
|
|
183
|
-
|
|
184
|
-
### Plantilla de Archivo .env Seguro
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# ============================================================
|
|
188
|
-
# CONFIGURACIÓN DE ENTORNO SINAPSE
|
|
189
|
-
# ============================================================
|
|
190
|
-
# SEGURIDAD: Este archivo NUNCA debe ser commiteado a control de versiones
|
|
191
|
-
# Agregar a .gitignore: .env, .env.local, .env.*.local
|
|
192
|
-
# ============================================================
|
|
193
|
-
|
|
194
|
-
# ------------------------------------------------------------
|
|
195
|
-
# ENTORNO
|
|
196
|
-
# ------------------------------------------------------------
|
|
197
|
-
NODE_ENV=development
|
|
198
|
-
SINAPSE_DEBUG=false
|
|
199
|
-
LOG_LEVEL=info
|
|
200
|
-
|
|
201
|
-
# ------------------------------------------------------------
|
|
202
|
-
# CONFIGURACIÓN DE PROVEEDOR AI
|
|
203
|
-
# ------------------------------------------------------------
|
|
204
|
-
# Proveedor principal
|
|
205
|
-
AI_PROVIDER=anthropic
|
|
206
|
-
ANTHROPIC_API_KEY=
|
|
207
|
-
|
|
208
|
-
# Proveedor de respaldo (opcional)
|
|
209
|
-
OPENAI_API_KEY=
|
|
210
|
-
|
|
211
|
-
# ------------------------------------------------------------
|
|
212
|
-
# AUTENTICACIÓN Y SESIÓN
|
|
213
|
-
# ------------------------------------------------------------
|
|
214
|
-
# Generar con: openssl rand -hex 32
|
|
215
|
-
JWT_SECRET=
|
|
216
|
-
JWT_EXPIRY=1h
|
|
217
|
-
REFRESH_TOKEN_EXPIRY=7d
|
|
218
|
-
|
|
219
|
-
# Configuración de sesión
|
|
220
|
-
SESSION_SECRET=
|
|
221
|
-
SESSION_TIMEOUT=3600000
|
|
222
|
-
|
|
223
|
-
# ------------------------------------------------------------
|
|
224
|
-
# CIFRADO
|
|
225
|
-
# ------------------------------------------------------------
|
|
226
|
-
# Generar con: openssl rand -hex 32
|
|
227
|
-
DATABASE_ENCRYPTION_KEY=
|
|
228
|
-
FILE_ENCRYPTION_KEY=
|
|
229
|
-
|
|
230
|
-
# ------------------------------------------------------------
|
|
231
|
-
# SERVIDORES MCP
|
|
232
|
-
# ------------------------------------------------------------
|
|
233
|
-
# EXA Web Search
|
|
234
|
-
EXA_API_KEY=
|
|
235
|
-
|
|
236
|
-
# Integración GitHub
|
|
237
|
-
GITHUB_TOKEN=
|
|
238
|
-
|
|
239
|
-
# Apify Web Scraping
|
|
240
|
-
APIFY_TOKEN=
|
|
241
|
-
|
|
242
|
-
# ------------------------------------------------------------
|
|
243
|
-
# CONFIGURACIÓN DE SEGURIDAD
|
|
244
|
-
# ------------------------------------------------------------
|
|
245
|
-
# Rate limiting
|
|
246
|
-
RATE_LIMIT_WINDOW=900000
|
|
247
|
-
RATE_LIMIT_MAX_REQUESTS=1000
|
|
248
|
-
|
|
249
|
-
# CORS (solo producción)
|
|
250
|
-
CORS_ORIGIN=https://your-domain.com
|
|
251
|
-
|
|
252
|
-
# Content Security Policy
|
|
253
|
-
CSP_ENABLED=true
|
|
254
|
-
|
|
255
|
-
# ------------------------------------------------------------
|
|
256
|
-
# AUDITORÍA Y LOGGING
|
|
257
|
-
# ------------------------------------------------------------
|
|
258
|
-
AUDIT_LOG_ENABLED=true
|
|
259
|
-
AUDIT_LOG_PATH=/var/log/sinapse/audit.log
|
|
260
|
-
AUDIT_LOG_RETENTION_DAYS=90
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### Protección de Archivos de Secretos
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
# Crear directorio seguro para secretos
|
|
267
|
-
mkdir -p ~/.sinapse/secrets
|
|
268
|
-
chmod 700 ~/.sinapse/secrets
|
|
269
|
-
|
|
270
|
-
# Crear archivo de secretos cifrado
|
|
271
|
-
# Nunca almacenar secretos en texto plano
|
|
272
|
-
openssl enc -aes-256-cbc -salt -pbkdf2 \
|
|
273
|
-
-in secrets.txt \
|
|
274
|
-
-out ~/.sinapse/secrets/encrypted.dat
|
|
275
|
-
|
|
276
|
-
# Establecer permisos apropiados
|
|
277
|
-
chmod 600 ~/.sinapse/secrets/*
|
|
278
|
-
|
|
279
|
-
# Verificar que no hay secretos en el historial de git
|
|
280
|
-
git log -p --all -S "API_KEY" -- .
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
### Aislamiento de Entorno
|
|
284
|
-
|
|
285
|
-
```javascript
|
|
286
|
-
// Validar aislamiento de entorno
|
|
287
|
-
function validateEnvironment() {
|
|
288
|
-
// Asegurar que los secretos de producción no se usen en desarrollo
|
|
289
|
-
if (process.env.NODE_ENV === 'development') {
|
|
290
|
-
if (process.env.ANTHROPIC_API_KEY?.includes('prod')) {
|
|
291
|
-
throw new Error('Clave API de producción detectada en entorno de desarrollo');
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// Asegurar que el modo debug esté desactivado en producción
|
|
296
|
-
if (process.env.NODE_ENV === 'production') {
|
|
297
|
-
if (process.env.SINAPSE_DEBUG === 'true') {
|
|
298
|
-
console.warn('ADVERTENCIA: Modo debug habilitado en producción');
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
## Permisos de Archivos y Directorios
|
|
307
|
-
|
|
308
|
-
### Permisos de Estructura de Directorios SINAPSE
|
|
309
|
-
|
|
310
|
-
```bash
|
|
311
|
-
# ============================================================
|
|
312
|
-
# PERMISOS RECOMENDADOS
|
|
313
|
-
# ============================================================
|
|
314
|
-
|
|
315
|
-
# Raíz del proyecto (estándar)
|
|
316
|
-
chmod 755 /path/to/project
|
|
317
|
-
|
|
318
|
-
# Directorios de configuración SINAPSE
|
|
319
|
-
chmod 700 .sinapse/ # Solo el propietario puede acceder
|
|
320
|
-
chmod 700 .sinapse-ai/ # Fuente del framework
|
|
321
|
-
chmod 700 .claude/ # Configuración de Claude
|
|
322
|
-
|
|
323
|
-
# Archivos de configuración sensibles
|
|
324
|
-
chmod 600 .env # Variables de entorno
|
|
325
|
-
chmod 600 .sinapse/config.yaml # Configuración principal
|
|
326
|
-
chmod 600 .sinapse/users.json # Base de datos de usuarios
|
|
327
|
-
chmod 600 .sinapse/sessions.json # Sesiones activas
|
|
328
|
-
|
|
329
|
-
# Directorio de secretos
|
|
330
|
-
chmod 700 ~/.sinapse/secrets/
|
|
331
|
-
chmod 600 ~/.sinapse/secrets/*
|
|
332
|
-
|
|
333
|
-
# Archivos de log
|
|
334
|
-
chmod 640 logs/*.log # Propietario lectura/escritura, grupo lectura
|
|
335
|
-
chmod 750 logs/ # Propietario completo, grupo lectura/ejecución
|
|
336
|
-
|
|
337
|
-
# Archivos temporales
|
|
338
|
-
chmod 700 .sinapse/temp/
|
|
339
|
-
chmod 600 .sinapse/temp/*
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
### Control de Acceso a Directorios
|
|
343
|
-
|
|
344
|
-
```yaml
|
|
345
|
-
# .sinapse/config.yaml - Configuración de directorios permitidos
|
|
346
|
-
security:
|
|
347
|
-
allowedDirectories:
|
|
348
|
-
read:
|
|
349
|
-
- '${PROJECT_ROOT}'
|
|
350
|
-
- '${HOME}/.sinapse'
|
|
351
|
-
write:
|
|
352
|
-
- '${PROJECT_ROOT}/src'
|
|
353
|
-
- '${PROJECT_ROOT}/docs'
|
|
354
|
-
- '${PROJECT_ROOT}/tests'
|
|
355
|
-
execute:
|
|
356
|
-
- '${PROJECT_ROOT}/scripts'
|
|
357
|
-
- '${PROJECT_ROOT}/node_modules/.bin'
|
|
358
|
-
|
|
359
|
-
blockedPaths:
|
|
360
|
-
- '/etc'
|
|
361
|
-
- '/var'
|
|
362
|
-
- '/usr'
|
|
363
|
-
- '${HOME}/.ssh'
|
|
364
|
-
- '${HOME}/.gnupg'
|
|
365
|
-
- '${HOME}/.aws'
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### Script de Validación de Permisos
|
|
369
|
-
|
|
370
|
-
```bash
|
|
371
|
-
#!/bin/bash
|
|
372
|
-
# scripts/check-permissions.sh
|
|
373
|
-
|
|
374
|
-
echo "Verificación de Permisos de Seguridad SINAPSE"
|
|
375
|
-
echo "==========================================="
|
|
376
|
-
|
|
377
|
-
# Verificar archivos críticos
|
|
378
|
-
check_permission() {
|
|
379
|
-
local file=$1
|
|
380
|
-
local expected=$2
|
|
381
|
-
local actual=$(stat -f "%Lp" "$file" 2>/dev/null || stat -c "%a" "$file" 2>/dev/null)
|
|
382
|
-
|
|
383
|
-
if [ "$actual" != "$expected" ]; then
|
|
384
|
-
echo "ADVERTENCIA: $file tiene permisos $actual, se esperaba $expected"
|
|
385
|
-
return 1
|
|
386
|
-
else
|
|
387
|
-
echo "OK: $file ($actual)"
|
|
388
|
-
return 0
|
|
389
|
-
fi
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
# Verificar archivos críticos
|
|
393
|
-
check_permission ".env" "600"
|
|
394
|
-
check_permission ".sinapse" "700"
|
|
395
|
-
check_permission ".sinapse/config.yaml" "600"
|
|
396
|
-
|
|
397
|
-
# Verificar archivos sensibles legibles por todos
|
|
398
|
-
find . -name "*.key" -o -name "*.pem" -o -name "*.env*" | while read f; do
|
|
399
|
-
perms=$(stat -f "%Lp" "$f" 2>/dev/null || stat -c "%a" "$f" 2>/dev/null)
|
|
400
|
-
if [ "${perms: -1}" != "0" ]; then
|
|
401
|
-
echo "CRÍTICO: ¡$f es legible por todos!"
|
|
402
|
-
fi
|
|
403
|
-
done
|
|
404
|
-
|
|
405
|
-
echo ""
|
|
406
|
-
echo "Verificación de permisos completada."
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
---
|
|
410
|
-
|
|
411
|
-
## Sandboxing y Aislamiento
|
|
412
|
-
|
|
413
|
-
### Aislamiento de MCP con Docker
|
|
414
|
-
|
|
415
|
-
SINAPSE usa contenedores Docker para aislar los servidores MCP del sistema host:
|
|
416
|
-
|
|
417
|
-
```
|
|
418
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
419
|
-
│ SISTEMA HOST │
|
|
420
|
-
│ │
|
|
421
|
-
│ ┌────────────────┐ ┌────────────────────────────────┐ │
|
|
422
|
-
│ │ Claude Code │ │ Contenedor Docker │ │
|
|
423
|
-
│ │ │ │ ┌──────────────────────────┐ │ │
|
|
424
|
-
│ │ ┌──────────┐ │ │ │ docker-gateway │ │ │
|
|
425
|
-
│ │ │ Native │ │◄──►│ │ ┌─────┐ ┌─────────┐ │ │ │
|
|
426
|
-
│ │ │ Tools │ │ │ │ │ EXA │ │Context7 │ │ │ │
|
|
427
|
-
│ │ └──────────┘ │ │ │ └─────┘ └─────────┘ │ │ │
|
|
428
|
-
│ │ │ │ │ ┌─────────┐ │ │ │
|
|
429
|
-
│ │ ┌──────────┐ │ │ │ │ Apify │ │ │ │
|
|
430
|
-
│ │ │Playwright│ │ │ │ └─────────┘ │ │ │
|
|
431
|
-
│ │ └──────────┘ │ │ └──────────────────────────┘ │ │
|
|
432
|
-
│ └────────────────┘ └────────────────────────────────┘ │
|
|
433
|
-
│ │
|
|
434
|
-
└─────────────────────────────────────────────────────────────┘
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
### Configuración de Seguridad de Contenedores
|
|
438
|
-
|
|
439
|
-
```yaml
|
|
440
|
-
# docker-compose.security.yml
|
|
441
|
-
version: '3.8'
|
|
442
|
-
|
|
443
|
-
services:
|
|
444
|
-
mcp-gateway:
|
|
445
|
-
image: docker-mcp-gateway:latest
|
|
446
|
-
security_opt:
|
|
447
|
-
- no-new-privileges:true
|
|
448
|
-
- seccomp:./seccomp-profile.json
|
|
449
|
-
cap_drop:
|
|
450
|
-
- ALL
|
|
451
|
-
cap_add:
|
|
452
|
-
- NET_BIND_SERVICE
|
|
453
|
-
read_only: true
|
|
454
|
-
tmpfs:
|
|
455
|
-
- /tmp:noexec,nosuid,nodev
|
|
456
|
-
networks:
|
|
457
|
-
- mcp-isolated
|
|
458
|
-
deploy:
|
|
459
|
-
resources:
|
|
460
|
-
limits:
|
|
461
|
-
cpus: '1.0'
|
|
462
|
-
memory: 512M
|
|
463
|
-
reservations:
|
|
464
|
-
cpus: '0.25'
|
|
465
|
-
memory: 128M
|
|
466
|
-
|
|
467
|
-
networks:
|
|
468
|
-
mcp-isolated:
|
|
469
|
-
driver: bridge
|
|
470
|
-
internal: true # Sin acceso externo
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
### Aislamiento de Procesos con Permission Modes
|
|
474
|
-
|
|
475
|
-
```javascript
|
|
476
|
-
// Aplicación de Permission Mode
|
|
477
|
-
const { OperationGuard } = require('./.sinapse-ai/core/permissions');
|
|
478
|
-
|
|
479
|
-
async function executeWithIsolation(operation, context) {
|
|
480
|
-
const guard = new OperationGuard();
|
|
481
|
-
|
|
482
|
-
// Verificar si la operación está permitida en el modo actual
|
|
483
|
-
const permission = await guard.guard(operation.tool, {
|
|
484
|
-
command: operation.command,
|
|
485
|
-
args: operation.args,
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
if (!permission.proceed) {
|
|
489
|
-
if (permission.needsConfirmation) {
|
|
490
|
-
// Solicitar confirmación del usuario
|
|
491
|
-
const confirmed = await requestUserConfirmation(operation);
|
|
492
|
-
if (!confirmed) {
|
|
493
|
-
throw new Error('Operación denegada por el usuario');
|
|
494
|
-
}
|
|
495
|
-
} else {
|
|
496
|
-
throw new Error(`Operación bloqueada: ${permission.reason}`);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
// Ejecutar en contexto aislado
|
|
501
|
-
return await isolatedExecutor.run(operation, {
|
|
502
|
-
timeout: 30000,
|
|
503
|
-
maxMemory: '256M',
|
|
504
|
-
networkAccess: false,
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
### Límites de Recursos
|
|
510
|
-
|
|
511
|
-
```javascript
|
|
512
|
-
// Configuración de límites de recursos
|
|
513
|
-
const resourceLimits = {
|
|
514
|
-
cpu: {
|
|
515
|
-
maxPercent: 50,
|
|
516
|
-
throttleAt: 80,
|
|
517
|
-
},
|
|
518
|
-
memory: {
|
|
519
|
-
maxMB: 512,
|
|
520
|
-
warnAt: 400,
|
|
521
|
-
},
|
|
522
|
-
disk: {
|
|
523
|
-
maxWriteMB: 100,
|
|
524
|
-
tempDirMaxMB: 50,
|
|
525
|
-
},
|
|
526
|
-
network: {
|
|
527
|
-
maxRequestsPerMinute: 100,
|
|
528
|
-
maxBandwidthMBps: 10,
|
|
529
|
-
},
|
|
530
|
-
process: {
|
|
531
|
-
maxConcurrent: 5,
|
|
532
|
-
maxRuntime: 300000, // 5 minutos
|
|
533
|
-
},
|
|
534
|
-
};
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
---
|
|
538
|
-
|
|
539
|
-
## Validación de Entrada
|
|
540
|
-
|
|
541
|
-
### Reglas de Validación por Tipo de Entrada
|
|
542
|
-
|
|
543
|
-
| Tipo de Entrada | Reglas de Validación | Ejemplo |
|
|
544
|
-
| ------------------- | --------------------------------------- | ------------------------- |
|
|
545
|
-
| **Rutas de archivo**| Sin traversal, whitelist dirs, normalizar | `/project/src/file.ts` |
|
|
546
|
-
| **Comandos** | Whitelist comandos, sanitizar args | `npm run build` |
|
|
547
|
-
| **Nombres de proyecto** | Alfanumérico, guiones, guiones bajos| `my-project-01` |
|
|
548
|
-
| **URLs** | Whitelist de protocolos, validación de dominio | `https://api.example.com` |
|
|
549
|
-
| **Entrada de usuario** | Límites de longitud, filtrado de caracteres | `Comentario del usuario` |
|
|
550
|
-
| **Configuración** | Verificación de tipos, validación de enums | `{ mode: "ask" }` |
|
|
551
|
-
|
|
552
|
-
### Implementación de Sanitizador de Entrada
|
|
553
|
-
|
|
554
|
-
```javascript
|
|
555
|
-
// .sinapse-ai/core/security/input-sanitizer.js
|
|
556
|
-
|
|
557
|
-
class InputSanitizer {
|
|
558
|
-
/**
|
|
559
|
-
* Sanitizar ruta de archivo para prevenir directory traversal
|
|
560
|
-
*/
|
|
561
|
-
static sanitizePath(inputPath, basePath) {
|
|
562
|
-
// Remover null bytes
|
|
563
|
-
let sanitized = inputPath.replace(/\0/g, '');
|
|
564
|
-
|
|
565
|
-
// Normalizar separadores de ruta
|
|
566
|
-
sanitized = sanitized.replace(/\\/g, '/');
|
|
567
|
-
|
|
568
|
-
// Remover intentos de directory traversal
|
|
569
|
-
sanitized = sanitized.replace(/\.\.+\//g, '');
|
|
570
|
-
sanitized = sanitized.replace(/\/\.\.+/g, '');
|
|
571
|
-
|
|
572
|
-
// Resolver a ruta absoluta
|
|
573
|
-
const resolved = path.resolve(basePath, sanitized);
|
|
574
|
-
|
|
575
|
-
// Verificar que la ruta está dentro del directorio permitido
|
|
576
|
-
if (!resolved.startsWith(path.resolve(basePath))) {
|
|
577
|
-
throw new SecurityError('Intento de directory traversal detectado');
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
return resolved;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Sanitizar comando para ejecución segura
|
|
585
|
-
*/
|
|
586
|
-
static sanitizeCommand(command) {
|
|
587
|
-
// Bloquear patrones peligrosos
|
|
588
|
-
const dangerousPatterns = [
|
|
589
|
-
/;/g, // Encadenamiento de comandos
|
|
590
|
-
/\|/g, // Pipes
|
|
591
|
-
/&/g, // Background/AND
|
|
592
|
-
/`/g, // Sustitución de comandos
|
|
593
|
-
/\$\(/g, // Sustitución de comandos
|
|
594
|
-
/>/g, // Redirección
|
|
595
|
-
/</g, // Redirección
|
|
596
|
-
/\n/g, // Nuevas líneas
|
|
597
|
-
/\r/g, // Retornos de carro
|
|
598
|
-
];
|
|
599
|
-
|
|
600
|
-
let sanitized = command;
|
|
601
|
-
for (const pattern of dangerousPatterns) {
|
|
602
|
-
sanitized = sanitized.replace(pattern, '');
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// Limitar longitud
|
|
606
|
-
if (sanitized.length > 1000) {
|
|
607
|
-
throw new SecurityError('Comando demasiado largo');
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
return sanitized;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* Validar y sanitizar nombre de proyecto
|
|
615
|
-
*/
|
|
616
|
-
static sanitizeProjectName(name) {
|
|
617
|
-
// Solo permitir alfanumérico, guiones y guiones bajos
|
|
618
|
-
const sanitized = name.replace(/[^a-zA-Z0-9-_]/g, '');
|
|
619
|
-
|
|
620
|
-
if (sanitized.length === 0) {
|
|
621
|
-
throw new SecurityError('Nombre de proyecto inválido');
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
if (sanitized.length > 64) {
|
|
625
|
-
throw new SecurityError('Nombre de proyecto demasiado largo');
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
return sanitized;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* Validar URL
|
|
633
|
-
*/
|
|
634
|
-
static validateUrl(url) {
|
|
635
|
-
const allowedProtocols = ['https:', 'http:'];
|
|
636
|
-
|
|
637
|
-
try {
|
|
638
|
-
const parsed = new URL(url);
|
|
639
|
-
|
|
640
|
-
if (!allowedProtocols.includes(parsed.protocol)) {
|
|
641
|
-
throw new SecurityError('Protocolo de URL inválido');
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
// Bloquear localhost en producción
|
|
645
|
-
if (process.env.NODE_ENV === 'production') {
|
|
646
|
-
if (parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1') {
|
|
647
|
-
throw new SecurityError('URLs de localhost no permitidas en producción');
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
return parsed.toString();
|
|
652
|
-
} catch (error) {
|
|
653
|
-
throw new SecurityError(`URL inválida: ${error.message}`);
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
```
|
|
658
|
-
|
|
659
|
-
### Validación de Esquema
|
|
660
|
-
|
|
661
|
-
```javascript
|
|
662
|
-
// Usar JSON Schema para validación de configuración
|
|
663
|
-
const Ajv = require('ajv');
|
|
664
|
-
const ajv = new Ajv({ allErrors: true });
|
|
665
|
-
|
|
666
|
-
const configSchema = {
|
|
667
|
-
type: 'object',
|
|
668
|
-
required: ['version', 'permissions'],
|
|
669
|
-
properties: {
|
|
670
|
-
version: { type: 'string', pattern: '^\\d+\\.\\d+\\.\\d+$' },
|
|
671
|
-
permissions: {
|
|
672
|
-
type: 'object',
|
|
673
|
-
properties: {
|
|
674
|
-
mode: { type: 'string', enum: ['explore', 'ask', 'auto'] },
|
|
675
|
-
},
|
|
676
|
-
required: ['mode'],
|
|
677
|
-
},
|
|
678
|
-
security: {
|
|
679
|
-
type: 'object',
|
|
680
|
-
properties: {
|
|
681
|
-
allowedDirectories: {
|
|
682
|
-
type: 'array',
|
|
683
|
-
items: { type: 'string' },
|
|
684
|
-
},
|
|
685
|
-
},
|
|
686
|
-
},
|
|
687
|
-
},
|
|
688
|
-
additionalProperties: false,
|
|
689
|
-
};
|
|
690
|
-
|
|
691
|
-
function validateConfig(config) {
|
|
692
|
-
const validate = ajv.compile(configSchema);
|
|
693
|
-
const valid = validate(config);
|
|
694
|
-
|
|
695
|
-
if (!valid) {
|
|
696
|
-
throw new SecurityError(`Validación de configuración fallida: ${JSON.stringify(validate.errors)}`);
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
return config;
|
|
700
|
-
}
|
|
701
|
-
```
|
|
702
|
-
|
|
703
|
-
---
|
|
704
|
-
|
|
705
|
-
## Protección contra Inyección
|
|
706
|
-
|
|
707
|
-
### Prevención de Inyección de Comandos
|
|
708
|
-
|
|
709
|
-
```javascript
|
|
710
|
-
// PELIGROSO - Nunca hacer esto
|
|
711
|
-
const userInput = req.query.file;
|
|
712
|
-
exec(`cat ${userInput}`); // ¡Vulnerabilidad de inyección de comandos!
|
|
713
|
-
|
|
714
|
-
// SEGURO - Usar ejecución parametrizada
|
|
715
|
-
const { execFile } = require('child_process');
|
|
716
|
-
const userInput = sanitizePath(req.query.file, PROJECT_ROOT);
|
|
717
|
-
execFile('cat', [userInput], (error, stdout) => {
|
|
718
|
-
// Ejecución segura
|
|
719
|
-
});
|
|
720
|
-
|
|
721
|
-
// MÁS SEGURO - Usar operaciones de archivo integradas
|
|
722
|
-
const fs = require('fs').promises;
|
|
723
|
-
const safePath = sanitizePath(req.query.file, PROJECT_ROOT);
|
|
724
|
-
const content = await fs.readFile(safePath, 'utf8');
|
|
725
|
-
```
|
|
726
|
-
|
|
727
|
-
### Prevención de Inyección SQL (Hook de SQL Governance)
|
|
728
|
-
|
|
729
|
-
```python
|
|
730
|
-
# .claude/hooks/sql-governance.py
|
|
731
|
-
# Este hook se aplica automáticamente
|
|
732
|
-
|
|
733
|
-
BLOCKED_PATTERNS = [
|
|
734
|
-
r'CREATE\s+TABLE',
|
|
735
|
-
r'DROP\s+TABLE',
|
|
736
|
-
r'ALTER\s+TABLE',
|
|
737
|
-
r'TRUNCATE',
|
|
738
|
-
r'DELETE\s+FROM',
|
|
739
|
-
r'UPDATE\s+.*\s+SET',
|
|
740
|
-
r'INSERT\s+INTO',
|
|
741
|
-
]
|
|
742
|
-
|
|
743
|
-
def validate_sql(query: str) -> bool:
|
|
744
|
-
"""Bloquear operaciones SQL peligrosas sin aprobación explícita"""
|
|
745
|
-
for pattern in BLOCKED_PATTERNS:
|
|
746
|
-
if re.search(pattern, query, re.IGNORECASE):
|
|
747
|
-
raise SecurityError(f"Patrón SQL bloqueado detectado: {pattern}")
|
|
748
|
-
return True
|
|
749
|
-
```
|
|
750
|
-
|
|
751
|
-
### Prevención de Inyección de Plantillas
|
|
752
|
-
|
|
753
|
-
```javascript
|
|
754
|
-
// PELIGROSO - Interpolación directa de plantillas
|
|
755
|
-
const template = `Hello ${userInput}!`; // ¡Vulnerabilidad XSS!
|
|
756
|
-
|
|
757
|
-
// SEGURO - Codificación HTML
|
|
758
|
-
const { escape } = require('html-escaper');
|
|
759
|
-
const template = `Hello ${escape(userInput)}!`;
|
|
760
|
-
|
|
761
|
-
// Para plantillas Markdown
|
|
762
|
-
function safeMarkdownInterpolation(template, data) {
|
|
763
|
-
return template.replace(/\{\{(\w+)\}\}/g, (match, key) => {
|
|
764
|
-
const value = data[key];
|
|
765
|
-
if (value === undefined) return match;
|
|
766
|
-
|
|
767
|
-
// Escapar caracteres especiales de Markdown
|
|
768
|
-
return String(value).replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&');
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
```
|
|
772
|
-
|
|
773
|
-
### Prevención de Path Traversal
|
|
774
|
-
|
|
775
|
-
```javascript
|
|
776
|
-
// Aplicación de hook para archivos protegidos
|
|
777
|
-
// .claude/hooks/read-protection.py
|
|
778
|
-
|
|
779
|
-
PROTECTED_FILES = [
|
|
780
|
-
'.claude/CLAUDE.md',
|
|
781
|
-
'.claude/rules/*.md',
|
|
782
|
-
'.sinapse-ai/development/agents/*.md',
|
|
783
|
-
'package.json',
|
|
784
|
-
'tsconfig.json'
|
|
785
|
-
]
|
|
786
|
-
|
|
787
|
-
def validate_read(file_path: str, params: dict) -> bool:
|
|
788
|
-
"""Bloquear lecturas parciales en archivos protegidos"""
|
|
789
|
-
for pattern in PROTECTED_FILES:
|
|
790
|
-
if fnmatch.fnmatch(file_path, pattern):
|
|
791
|
-
if params.get('limit') or params.get('offset'):
|
|
792
|
-
raise SecurityError(
|
|
793
|
-
f"Lectura parcial bloqueada en archivo protegido: {file_path}\n"
|
|
794
|
-
"Debe leer el archivo completo."
|
|
795
|
-
)
|
|
796
|
-
return True
|
|
797
|
-
```
|
|
798
|
-
|
|
799
|
-
### Prevención de Prototype Pollution
|
|
800
|
-
|
|
801
|
-
```javascript
|
|
802
|
-
// Prevenir ataques de prototype pollution
|
|
803
|
-
function safeObjectMerge(target, source) {
|
|
804
|
-
const blockedKeys = ['__proto__', 'constructor', 'prototype'];
|
|
805
|
-
|
|
806
|
-
function merge(t, s, depth = 0) {
|
|
807
|
-
if (depth > 10) {
|
|
808
|
-
throw new SecurityError('Profundidad de merge de objeto excedida');
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
for (const key of Object.keys(s)) {
|
|
812
|
-
if (blockedKeys.includes(key)) {
|
|
813
|
-
throw new SecurityError(`Propiedad bloqueada: ${key}`);
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
if (typeof s[key] === 'object' && s[key] !== null) {
|
|
817
|
-
t[key] = t[key] || {};
|
|
818
|
-
merge(t[key], s[key], depth + 1);
|
|
819
|
-
} else {
|
|
820
|
-
t[key] = s[key];
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
return t;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
return merge(target, source);
|
|
828
|
-
}
|
|
829
|
-
```
|
|
830
|
-
|
|
831
|
-
---
|
|
832
|
-
|
|
833
|
-
## Logging y Auditoría
|
|
834
|
-
|
|
835
|
-
### Configuración de Audit Log
|
|
836
|
-
|
|
837
|
-
```yaml
|
|
838
|
-
# .sinapse/config.yaml - Configuración de auditoría
|
|
839
|
-
audit:
|
|
840
|
-
enabled: true
|
|
841
|
-
level: info # debug, info, warn, error
|
|
842
|
-
|
|
843
|
-
# Qué registrar
|
|
844
|
-
events:
|
|
845
|
-
- authentication
|
|
846
|
-
- authorization
|
|
847
|
-
- fileAccess
|
|
848
|
-
- commandExecution
|
|
849
|
-
- configChange
|
|
850
|
-
- agentActivation
|
|
851
|
-
- modeChange
|
|
852
|
-
- error
|
|
853
|
-
|
|
854
|
-
# Configuración de salida
|
|
855
|
-
output:
|
|
856
|
-
file:
|
|
857
|
-
enabled: true
|
|
858
|
-
path: .sinapse/logs/audit.log
|
|
859
|
-
maxSize: 10M
|
|
860
|
-
maxFiles: 10
|
|
861
|
-
compress: true
|
|
862
|
-
console:
|
|
863
|
-
enabled: false
|
|
864
|
-
remote:
|
|
865
|
-
enabled: false
|
|
866
|
-
endpoint: https://logs.example.com/audit
|
|
867
|
-
|
|
868
|
-
# Retención
|
|
869
|
-
retention:
|
|
870
|
-
days: 90
|
|
871
|
-
archivePath: .sinapse/logs/archive
|
|
872
|
-
```
|
|
873
|
-
|
|
874
|
-
### Formato de Audit Log
|
|
875
|
-
|
|
876
|
-
```json
|
|
877
|
-
{
|
|
878
|
-
"timestamp": "2026-01-29T14:30:00.000Z",
|
|
879
|
-
"level": "info",
|
|
880
|
-
"event": "commandExecution",
|
|
881
|
-
"actor": {
|
|
882
|
-
"type": "agent",
|
|
883
|
-
"id": "dev",
|
|
884
|
-
"name": "Dex"
|
|
885
|
-
},
|
|
886
|
-
"action": {
|
|
887
|
-
"type": "execute",
|
|
888
|
-
"tool": "Bash",
|
|
889
|
-
"command": "npm run build"
|
|
890
|
-
},
|
|
891
|
-
"context": {
|
|
892
|
-
"mode": "ask",
|
|
893
|
-
"project": "my-project",
|
|
894
|
-
"story": "1.1"
|
|
895
|
-
},
|
|
896
|
-
"result": {
|
|
897
|
-
"status": "success",
|
|
898
|
-
"duration": 12500
|
|
899
|
-
},
|
|
900
|
-
"security": {
|
|
901
|
-
"approved": true,
|
|
902
|
-
"approvedBy": "user",
|
|
903
|
-
"riskLevel": "low"
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
```
|
|
907
|
-
|
|
908
|
-
### Implementación de Audit Logger
|
|
909
|
-
|
|
910
|
-
```javascript
|
|
911
|
-
// .sinapse-ai/core/security/audit-logger.js
|
|
912
|
-
|
|
913
|
-
const winston = require('winston');
|
|
914
|
-
const { format } = winston;
|
|
915
|
-
|
|
916
|
-
class AuditLogger {
|
|
917
|
-
constructor(config) {
|
|
918
|
-
this.config = config;
|
|
919
|
-
this.logger = this.createLogger();
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
createLogger() {
|
|
923
|
-
const transports = [];
|
|
924
|
-
|
|
925
|
-
if (this.config.output.file.enabled) {
|
|
926
|
-
transports.push(
|
|
927
|
-
new winston.transports.File({
|
|
928
|
-
filename: this.config.output.file.path,
|
|
929
|
-
maxsize: this.parseSize(this.config.output.file.maxSize),
|
|
930
|
-
maxFiles: this.config.output.file.maxFiles,
|
|
931
|
-
tailable: true,
|
|
932
|
-
})
|
|
933
|
-
);
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
return winston.createLogger({
|
|
937
|
-
level: this.config.level,
|
|
938
|
-
format: format.combine(format.timestamp(), format.json()),
|
|
939
|
-
transports,
|
|
940
|
-
});
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
log(event, data) {
|
|
944
|
-
if (!this.config.events.includes(event)) {
|
|
945
|
-
return;
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
const entry = {
|
|
949
|
-
timestamp: new Date().toISOString(),
|
|
950
|
-
event,
|
|
951
|
-
...this.sanitizeData(data),
|
|
952
|
-
};
|
|
953
|
-
|
|
954
|
-
this.logger.info(entry);
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
sanitizeData(data) {
|
|
958
|
-
// Remover información sensible antes de registrar
|
|
959
|
-
const sensitivePatterns = [/api[_-]?key/i, /password/i, /secret/i, /token/i, /auth/i];
|
|
960
|
-
|
|
961
|
-
const sanitized = JSON.parse(JSON.stringify(data));
|
|
962
|
-
|
|
963
|
-
function redact(obj) {
|
|
964
|
-
for (const key of Object.keys(obj)) {
|
|
965
|
-
if (sensitivePatterns.some((p) => p.test(key))) {
|
|
966
|
-
obj[key] = '[REDACTADO]';
|
|
967
|
-
} else if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
968
|
-
redact(obj[key]);
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
redact(sanitized);
|
|
974
|
-
return sanitized;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
// Métodos de logging específicos
|
|
978
|
-
logAuthentication(result, context) {
|
|
979
|
-
this.log('authentication', {
|
|
980
|
-
action: { type: 'authenticate', result: result.success ? 'success' : 'failure' },
|
|
981
|
-
context,
|
|
982
|
-
security: { failureReason: result.reason },
|
|
983
|
-
});
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
logCommandExecution(command, result, context) {
|
|
987
|
-
this.log('commandExecution', {
|
|
988
|
-
action: { type: 'execute', command },
|
|
989
|
-
result: { status: result.success ? 'success' : 'failure', duration: result.duration },
|
|
990
|
-
context,
|
|
991
|
-
});
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
logFileAccess(path, operation, context) {
|
|
995
|
-
this.log('fileAccess', {
|
|
996
|
-
action: { type: operation, path },
|
|
997
|
-
context,
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
logSecurityEvent(event, severity, details) {
|
|
1002
|
-
this.log('security', {
|
|
1003
|
-
action: { type: event },
|
|
1004
|
-
security: { severity, ...details },
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
module.exports = AuditLogger;
|
|
1010
|
-
```
|
|
1011
|
-
|
|
1012
|
-
### Consultas de Análisis de Logs
|
|
1013
|
-
|
|
1014
|
-
```bash
|
|
1015
|
-
# Encontrar todas las autenticaciones fallidas
|
|
1016
|
-
jq 'select(.event == "authentication" and .result.status == "failure")' audit.log
|
|
1017
|
-
|
|
1018
|
-
# Encontrar todas las ejecuciones de comandos por agente
|
|
1019
|
-
jq 'select(.event == "commandExecution" and .actor.type == "agent")' audit.log
|
|
1020
|
-
|
|
1021
|
-
# Encontrar todos los eventos de seguridad en las últimas 24 horas
|
|
1022
|
-
jq 'select(.event == "security" and (.timestamp | fromdateiso8601) > (now - 86400))' audit.log
|
|
1023
|
-
|
|
1024
|
-
# Contar eventos por tipo
|
|
1025
|
-
jq -s 'group_by(.event) | map({event: .[0].event, count: length})' audit.log
|
|
1026
|
-
```
|
|
1027
|
-
|
|
1028
|
-
---
|
|
1029
|
-
|
|
1030
|
-
## Configuración de Producción vs Desarrollo
|
|
1031
|
-
|
|
1032
|
-
### Detección de Entorno
|
|
1033
|
-
|
|
1034
|
-
```javascript
|
|
1035
|
-
// Carga de configuración consciente del entorno
|
|
1036
|
-
function loadSecurityConfig() {
|
|
1037
|
-
const env = process.env.NODE_ENV || 'development';
|
|
1038
|
-
|
|
1039
|
-
const baseConfig = require('./security-config.base.json');
|
|
1040
|
-
const envConfig = require(`./security-config.${env}.json`);
|
|
1041
|
-
|
|
1042
|
-
return deepMerge(baseConfig, envConfig);
|
|
1043
|
-
}
|
|
1044
|
-
```
|
|
1045
|
-
|
|
1046
|
-
### Comparación de Configuración
|
|
1047
|
-
|
|
1048
|
-
| Configuración | Desarrollo | Producción |
|
|
1049
|
-
| ---------------------- | ----------------- | ---------------- |
|
|
1050
|
-
| **SINAPSE_DEBUG** | `true` | `false` |
|
|
1051
|
-
| **LOG_LEVEL** | `debug` | `info` |
|
|
1052
|
-
| **Permission Mode** | `auto` | `ask` |
|
|
1053
|
-
| **Rate Limiting** | Relajado | Estricto |
|
|
1054
|
-
| **CORS** | `*` | Orígenes específicos |
|
|
1055
|
-
| **Detalles de Error** | Stack traces completos | Mensajes genéricos |
|
|
1056
|
-
| **Validación de API Key** | Solo advertencia | Bloquear si inválida |
|
|
1057
|
-
| **SSL/TLS** | Opcional | Requerido |
|
|
1058
|
-
| **Audit Logging** | Opcional | Requerido |
|
|
1059
|
-
| **Timeout de Sesión** | 24 horas | 1 hora |
|
|
1060
|
-
|
|
1061
|
-
### Configuración de Desarrollo
|
|
1062
|
-
|
|
1063
|
-
```yaml
|
|
1064
|
-
# .sinapse/config.development.yaml
|
|
1065
|
-
security:
|
|
1066
|
-
debug: true
|
|
1067
|
-
|
|
1068
|
-
validation:
|
|
1069
|
-
strict: false
|
|
1070
|
-
warnOnly: true
|
|
1071
|
-
|
|
1072
|
-
rateLimiting:
|
|
1073
|
-
enabled: false
|
|
1074
|
-
|
|
1075
|
-
cors:
|
|
1076
|
-
origin: '*'
|
|
1077
|
-
credentials: true
|
|
1078
|
-
|
|
1079
|
-
session:
|
|
1080
|
-
timeout: 86400000 # 24 horas
|
|
1081
|
-
secure: false
|
|
1082
|
-
|
|
1083
|
-
audit:
|
|
1084
|
-
enabled: true
|
|
1085
|
-
level: debug
|
|
1086
|
-
console: true
|
|
1087
|
-
|
|
1088
|
-
permissions:
|
|
1089
|
-
mode: auto
|
|
1090
|
-
```
|
|
1091
|
-
|
|
1092
|
-
### Configuración de Producción
|
|
1093
|
-
|
|
1094
|
-
```yaml
|
|
1095
|
-
# .sinapse/config.production.yaml
|
|
1096
|
-
security:
|
|
1097
|
-
debug: false
|
|
1098
|
-
|
|
1099
|
-
validation:
|
|
1100
|
-
strict: true
|
|
1101
|
-
warnOnly: false
|
|
1102
|
-
|
|
1103
|
-
rateLimiting:
|
|
1104
|
-
enabled: true
|
|
1105
|
-
windowMs: 900000 # 15 minutos
|
|
1106
|
-
maxRequests: 1000
|
|
1107
|
-
|
|
1108
|
-
cors:
|
|
1109
|
-
origin:
|
|
1110
|
-
- https://app.example.com
|
|
1111
|
-
- https://admin.example.com
|
|
1112
|
-
credentials: true
|
|
1113
|
-
|
|
1114
|
-
session:
|
|
1115
|
-
timeout: 3600000 # 1 hora
|
|
1116
|
-
secure: true
|
|
1117
|
-
sameSite: strict
|
|
1118
|
-
|
|
1119
|
-
tls:
|
|
1120
|
-
enabled: true
|
|
1121
|
-
minVersion: TLSv1.2
|
|
1122
|
-
ciphers: ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384
|
|
1123
|
-
|
|
1124
|
-
headers:
|
|
1125
|
-
hsts: true
|
|
1126
|
-
hstsMaxAge: 31536000
|
|
1127
|
-
xssProtection: true
|
|
1128
|
-
noSniff: true
|
|
1129
|
-
frameOptions: DENY
|
|
1130
|
-
|
|
1131
|
-
audit:
|
|
1132
|
-
enabled: true
|
|
1133
|
-
level: info
|
|
1134
|
-
console: false
|
|
1135
|
-
remote:
|
|
1136
|
-
enabled: true
|
|
1137
|
-
endpoint: https://logs.example.com/audit
|
|
1138
|
-
|
|
1139
|
-
permissions:
|
|
1140
|
-
mode: ask
|
|
1141
|
-
requireApprovalFor:
|
|
1142
|
-
- delete
|
|
1143
|
-
- execute
|
|
1144
|
-
```
|
|
1145
|
-
|
|
1146
|
-
### Script de Validación de Entorno
|
|
1147
|
-
|
|
1148
|
-
```javascript
|
|
1149
|
-
// Validar requisitos de seguridad de producción
|
|
1150
|
-
function validateProductionSecurity() {
|
|
1151
|
-
const errors = [];
|
|
1152
|
-
|
|
1153
|
-
// Variables de entorno requeridas
|
|
1154
|
-
const required = ['JWT_SECRET', 'DATABASE_ENCRYPTION_KEY', 'SESSION_SECRET'];
|
|
1155
|
-
for (const key of required) {
|
|
1156
|
-
if (!process.env[key]) {
|
|
1157
|
-
errors.push(`Variable de entorno requerida faltante: ${key}`);
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
// Debug debe estar desactivado
|
|
1162
|
-
if (process.env.SINAPSE_DEBUG === 'true') {
|
|
1163
|
-
errors.push('SINAPSE_DEBUG debe ser false en producción');
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
// TLS debe estar habilitado (verificar archivos de certificado)
|
|
1167
|
-
if (!fs.existsSync(process.env.TLS_CERT_PATH)) {
|
|
1168
|
-
errors.push('Certificado TLS no encontrado');
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
// Fortaleza de secretos
|
|
1172
|
-
if (process.env.JWT_SECRET?.length < 32) {
|
|
1173
|
-
errors.push('JWT_SECRET debe tener al menos 32 caracteres');
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
if (errors.length > 0) {
|
|
1177
|
-
throw new Error(`Validación de seguridad de producción fallida:\n${errors.join('\n')}`);
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
console.log('Validación de seguridad de producción aprobada');
|
|
1181
|
-
}
|
|
1182
|
-
```
|
|
1183
|
-
|
|
1184
|
-
---
|
|
1185
|
-
|
|
1186
|
-
## Lista de Verificación de Seguridad
|
|
1187
|
-
|
|
1188
|
-
### Lista de Verificación Pre-Despliegue
|
|
1189
|
-
|
|
1190
|
-
```markdown
|
|
1191
|
-
## Lista de Verificación de Seguridad Pre-Despliegue
|
|
1192
|
-
|
|
1193
|
-
### Gestión de Secretos
|
|
1194
|
-
|
|
1195
|
-
- [ ] Todas las claves API almacenadas en variables de entorno o secret manager
|
|
1196
|
-
- [ ] Sin secretos en código fuente o historial de git
|
|
1197
|
-
- [ ] Archivo .env agregado a .gitignore
|
|
1198
|
-
- [ ] Secretos de producción usan claves separadas de desarrollo
|
|
1199
|
-
- [ ] Cronograma de rotación de secretos establecido
|
|
1200
|
-
|
|
1201
|
-
### Configuración
|
|
1202
|
-
|
|
1203
|
-
- [ ] NODE_ENV establecido a 'production'
|
|
1204
|
-
- [ ] Modo debug deshabilitado
|
|
1205
|
-
- [ ] Mensajes de error no exponen detalles internos
|
|
1206
|
-
- [ ] Rate limiting configurado y probado
|
|
1207
|
-
- [ ] CORS configurado correctamente para dominios de producción
|
|
1208
|
-
|
|
1209
|
-
### Autenticación y Autorización
|
|
1210
|
-
|
|
1211
|
-
- [ ] Política de contraseñas fuertes aplicada
|
|
1212
|
-
- [ ] JWT secrets son criptográficamente fuertes (32+ caracteres)
|
|
1213
|
-
- [ ] Expiración de tokens configurada apropiadamente
|
|
1214
|
-
- [ ] Gestión de sesiones implementada
|
|
1215
|
-
- [ ] Permission modes configurados (predeterminado: ask)
|
|
1216
|
-
|
|
1217
|
-
### Validación de Entrada
|
|
1218
|
-
|
|
1219
|
-
- [ ] Toda entrada de usuario sanitizada
|
|
1220
|
-
- [ ] Validación de rutas de archivo habilitada
|
|
1221
|
-
- [ ] Protección contra inyección de comandos activa
|
|
1222
|
-
- [ ] Hooks de SQL governance instalados
|
|
1223
|
-
- [ ] Validación de esquema para configuración
|
|
1224
|
-
|
|
1225
|
-
### Seguridad de Red
|
|
1226
|
-
|
|
1227
|
-
- [ ] TLS 1.2+ requerido
|
|
1228
|
-
- [ ] Headers de seguridad configurados (HSTS, CSP, etc.)
|
|
1229
|
-
- [ ] Puertos innecesarios cerrados
|
|
1230
|
-
- [ ] Reglas de firewall implementadas
|
|
1231
|
-
|
|
1232
|
-
### Logging y Monitoreo
|
|
1233
|
-
|
|
1234
|
-
- [ ] Audit logging habilitado
|
|
1235
|
-
- [ ] Archivos de log asegurados (permisos 640)
|
|
1236
|
-
- [ ] Datos sensibles redactados de los logs
|
|
1237
|
-
- [ ] Alertas configuradas para eventos de seguridad
|
|
1238
|
-
- [ ] Política de retención de logs establecida
|
|
1239
|
-
|
|
1240
|
-
### Seguridad de Dependencias
|
|
1241
|
-
|
|
1242
|
-
- [ ] npm audit no muestra vulnerabilidades críticas
|
|
1243
|
-
- [ ] Dependabot o similar habilitado
|
|
1244
|
-
- [ ] Lockfile commiteado y verificado
|
|
1245
|
-
```
|
|
1246
|
-
|
|
1247
|
-
### Lista de Verificación de Seguridad Continua
|
|
1248
|
-
|
|
1249
|
-
```markdown
|
|
1250
|
-
## Mantenimiento de Seguridad Continuo
|
|
1251
|
-
|
|
1252
|
-
### Semanal
|
|
1253
|
-
|
|
1254
|
-
- [ ] Revisar alertas de seguridad del monitoreo
|
|
1255
|
-
- [ ] Verificar nuevas vulnerabilidades de dependencias
|
|
1256
|
-
- [ ] Revisar logs de acceso en busca de anomalías
|
|
1257
|
-
|
|
1258
|
-
### Mensual
|
|
1259
|
-
|
|
1260
|
-
- [ ] Ejecutar escaneo de seguridad completo (npm audit, snyk)
|
|
1261
|
-
- [ ] Actualizar dependencias con parches de seguridad
|
|
1262
|
-
- [ ] Revisar y rotar tokens de servicio
|
|
1263
|
-
- [ ] Auditar acceso y permisos de usuarios
|
|
1264
|
-
|
|
1265
|
-
### Trimestral
|
|
1266
|
-
|
|
1267
|
-
- [ ] Pruebas de penetración completas
|
|
1268
|
-
- [ ] Revisar y actualizar políticas de seguridad
|
|
1269
|
-
- [ ] Rotar secretos de larga duración (claves API, JWT secrets)
|
|
1270
|
-
- [ ] Actualización de capacitación en seguridad
|
|
1271
|
-
|
|
1272
|
-
### Anual
|
|
1273
|
-
|
|
1274
|
-
- [ ] Auditoría de seguridad por terceros
|
|
1275
|
-
- [ ] Pruebas de recuperación ante desastres
|
|
1276
|
-
- [ ] Rotación completa de secretos
|
|
1277
|
-
- [ ] Revisión de arquitectura de seguridad
|
|
1278
|
-
```
|
|
1279
|
-
|
|
1280
|
-
---
|
|
1281
|
-
|
|
1282
|
-
## Reporte de Vulnerabilidades
|
|
1283
|
-
|
|
1284
|
-
### Política de Divulgación Responsable
|
|
1285
|
-
|
|
1286
|
-
Si descubres una vulnerabilidad de seguridad en SINAPSE, por favor sigue las prácticas de divulgación responsable:
|
|
1287
|
-
|
|
1288
|
-
### Proceso de Reporte
|
|
1289
|
-
|
|
1290
|
-
1. **NO** crees un issue público en GitHub para vulnerabilidades de seguridad
|
|
1291
|
-
2. Reporta preocupaciones de seguridad via [GitHub Security Advisories](https://github.com/SinapseAI/sinapse-ai/security/advisories)
|
|
1292
|
-
3. Incluye lo siguiente en tu reporte:
|
|
1293
|
-
- Descripción de la vulnerabilidad
|
|
1294
|
-
- Pasos para reproducir
|
|
1295
|
-
- Evaluación del impacto potencial
|
|
1296
|
-
- Cualquier corrección sugerida (opcional)
|
|
1297
|
-
|
|
1298
|
-
### Qué Incluir
|
|
1299
|
-
|
|
1300
|
-
```markdown
|
|
1301
|
-
## Plantilla de Reporte de Vulnerabilidad
|
|
1302
|
-
|
|
1303
|
-
**Tipo de Vulnerabilidad:** [ej., Command Injection, XSS, Auth Bypass]
|
|
1304
|
-
|
|
1305
|
-
**Severidad:** [Crítica / Alta / Media / Baja]
|
|
1306
|
-
|
|
1307
|
-
**Componente Afectado:** [ej., InputSanitizer, AuthSystem, MCP Gateway]
|
|
1308
|
-
|
|
1309
|
-
**Versión de SINAPSE:** [ej., 2.1.0]
|
|
1310
|
-
|
|
1311
|
-
**Descripción:**
|
|
1312
|
-
[Descripción detallada de la vulnerabilidad]
|
|
1313
|
-
|
|
1314
|
-
**Pasos para Reproducir:**
|
|
1315
|
-
|
|
1316
|
-
1. [Paso 1]
|
|
1317
|
-
2. [Paso 2]
|
|
1318
|
-
3. [Paso 3]
|
|
1319
|
-
|
|
1320
|
-
**Prueba de Concepto:**
|
|
1321
|
-
[Código o comandos para demostrar la vulnerabilidad]
|
|
1322
|
-
|
|
1323
|
-
**Impacto:**
|
|
1324
|
-
[Qué podría lograr un atacante con esta vulnerabilidad]
|
|
1325
|
-
|
|
1326
|
-
**Corrección Sugerida:**
|
|
1327
|
-
[Opcional: Tu recomendación para corregir el problema]
|
|
1328
|
-
```
|
|
1329
|
-
|
|
1330
|
-
### Cronograma de Respuesta
|
|
1331
|
-
|
|
1332
|
-
| Etapa | Plazo |
|
|
1333
|
-
| ------------------------ | ---------------------- |
|
|
1334
|
-
| Acuse de recibo inicial | 24 horas |
|
|
1335
|
-
| Evaluación preliminar | 72 horas |
|
|
1336
|
-
| Desarrollo de corrección | 7-14 días |
|
|
1337
|
-
| Lanzamiento del parche | 14-30 días |
|
|
1338
|
-
| Divulgación pública | 90 días (o después del fix) |
|
|
1339
|
-
|
|
1340
|
-
### Salón de la Fama de Seguridad
|
|
1341
|
-
|
|
1342
|
-
Los contribuyentes que divulguen vulnerabilidades de manera responsable son reconocidos en nuestro Salón de la Fama de Seguridad (con permiso).
|
|
1343
|
-
|
|
1344
|
-
### Programa de Bug Bounty
|
|
1345
|
-
|
|
1346
|
-
Actualmente, SINAPSE no tiene un programa formal de bug bounty. Sin embargo, las contribuciones significativas de seguridad son reconocidas y pueden recibir licencias de SINAPSE Pro u otro reconocimiento.
|
|
1347
|
-
|
|
1348
|
-
---
|
|
1349
|
-
|
|
1350
|
-
## Documentación Relacionada
|
|
1351
|
-
|
|
1352
|
-
- [Mejores Prácticas de Seguridad](../security-best-practices.md) - Directrices generales de seguridad
|
|
1353
|
-
- [Guía de Permission Modes](./permission-modes.md) - Control de autonomía de agentes
|
|
1354
|
-
- [Configuración Global de MCP](./mcp-global-setup.md) - Configuración segura de MCP
|
|
1355
|
-
- [Quality Gates](./quality-gates.md) - Verificaciones de seguridad en CI/CD
|
|
1356
|
-
|
|
1357
|
-
---
|
|
1358
|
-
|
|
1359
|
-
_Guía de Hardening de Seguridad de SINAPSE v4.0_
|