jarvis-ai-framework 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +416 -0
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/agents/AGENTS.md +234 -0
- package/agents/README.md +309 -0
- package/agents/engineering/data/eng.data-engineer.agent.md +309 -0
- package/agents/engineering/eng.agent.md +303 -0
- package/agents/engineering/eng.bug-hunter.md +386 -0
- package/agents/engineering/eng.cybersecurity.agent.md +503 -0
- package/agents/engineering/eng.dev-code-reviewer.md +148 -0
- package/agents/engineering/eng.docs-writer.md +152 -0
- package/agents/engineering/eng.frontend.agent.md +117 -0
- package/agents/engineering/eng.rpa.agent.md +215 -0
- package/agents/engineering/eng.tech-analyst.agent.md +102 -0
- package/agents/engineering/eng.ux-designer.agent.md +193 -0
- package/agents/engineering/qa/eng.qa.cypress-specialist.md +109 -0
- package/agents/engineering/qa/eng.qa.quality-champion-task-agent.md +85 -0
- package/agents/engineering/qa/eng.qa.quality-strategist.md +111 -0
- package/agents/engineering/qa/eng.qa.test-architect.md +400 -0
- package/agents/engineering/qa/eng.qa.test-planner.md +477 -0
- package/agents/engineering/qa/eng.qa.testing-engineer.md +339 -0
- package/agents/product/prod.pm-checker.md +52 -0
- package/bin/commands/docs-publish.js +184 -0
- package/bin/commands/docs-sync.js +139 -0
- package/bin/commands/info.js +87 -0
- package/bin/commands/init.js +237 -0
- package/bin/commands/install-rtk.js +90 -0
- package/bin/commands/list.js +48 -0
- package/bin/commands/qa-signoff.js +112 -0
- package/bin/commands/whoami.js +43 -0
- package/bin/jarvis.js +159 -0
- package/bin/lib/auth/session.js +56 -0
- package/bin/lib/config/constants.js +123 -0
- package/bin/lib/config/ide-config.js +233 -0
- package/bin/lib/core/scanner.js +124 -0
- package/bin/lib/core/sync-engine.js +551 -0
- package/bin/lib/docs/fetch-file.sh +41 -0
- package/bin/lib/docs/publish-file.sh +284 -0
- package/bin/lib/docs/validate-frontmatter.js +157 -0
- package/bin/lib/env-loader.js +198 -0
- package/bin/lib/tasks/comment.js +131 -0
- package/bin/lib/utils/git-parser.js +145 -0
- package/bin/lib/utils/logger.js +104 -0
- package/bin/lib/utils/npmrc-parser.js +106 -0
- package/bin/lib/utils/paths.js +55 -0
- package/bin/lib/utils/ui.js +59 -0
- package/bin/lib/vcs/api.js +312 -0
- package/bin/lib/vcs/create-issue.js +43 -0
- package/bin/lib/vcs/create-merge.js +43 -0
- package/bin/lib/vcs/fetch-raw.js +30 -0
- package/bin/postinstall.js +41 -0
- package/members.md +25 -0
- package/package.json +55 -0
- package/rules/AGENTS.md +205 -0
- package/rules/engineering/data/data-rules.md +200 -0
- package/rules/engineering/eng-rules.md +243 -0
- package/rules/engineering/eng-security-rules.md +186 -0
- package/rules/engineering/eng.breakdown-subtasks-rules.md +585 -0
- package/rules/engineering/eng.bump-rules.md +27 -0
- package/rules/engineering/eng.docs-scraping-rules.md +64 -0
- package/rules/engineering/eng.downstream-flow-rules.md +297 -0
- package/rules/engineering/eng.integrations-rules.md +73 -0
- package/rules/engineering/eng.plan-rules.md +333 -0
- package/rules/engineering/eng.pr-rules.md +359 -0
- package/rules/engineering/eng.pre-pr-rules.md +103 -0
- package/rules/engineering/eng.start-rules.md +246 -0
- package/rules/engineering/eng.tech-spec-rules.md +968 -0
- package/rules/engineering/eng.work-rules.md +312 -0
- package/rules/engineering/frontend/eng.frontend-rules.md +147 -0
- package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +259 -0
- package/rules/engineering/qa/eng.qa.exploratory-session-rules.md +137 -0
- package/rules/engineering/qa/eng.qa.quality-gate-scoring-rules.md +181 -0
- package/rules/engineering/qa/eng.qa.tech-spec-validation-criteria-rules.md +120 -0
- package/rules/engineering/rpa/eng.rpa-rules.md +230 -0
- package/rules/product/README.md +24 -0
- package/rules/product/prod-rules.md +151 -0
- package/rules/rtk-rules.md +68 -0
- package/skills/AGENTS.md +290 -0
- package/skills/SKILLS-ROADMAP.md +333 -0
- package/skills/churn-audit/SKILL.md +385 -0
- package/skills/context-detect/SKILL.md +399 -0
- package/skills/context-detect/assets/context-profile-template.md +127 -0
- package/skills/docs-central/README.md +310 -0
- package/skills/docs-central/SKILL.md +423 -0
- package/skills/docs-index/SKILL.md +377 -0
- package/skills/eng-ai-engineer/SKILL.md +296 -0
- package/skills/eng-arch-c4/SKILL.md +358 -0
- package/skills/eng-arch-c4/assets/example-code.md +189 -0
- package/skills/eng-arch-c4/assets/example-component.md +105 -0
- package/skills/eng-arch-c4/assets/example-container.md +104 -0
- package/skills/eng-arch-c4/assets/example-context.md +81 -0
- package/skills/eng-backend/SKILL.md +776 -0
- package/skills/eng-browser-extension-builder/SKILL.md +385 -0
- package/skills/eng-cybersecurity/SKILL.md +645 -0
- package/skills/eng-data-bi/SKILL.md +199 -0
- package/skills/eng-data-debug/SKILL.md +307 -0
- package/skills/eng-data-engineer/SKILL.md +256 -0
- package/skills/eng-data-onboard/SKILL.md +310 -0
- package/skills/eng-data-orchestrator/SKILL.md +426 -0
- package/skills/eng-design-system/SKILL.md +619 -0
- package/skills/eng-docs-write/SKILL.md +312 -0
- package/skills/eng-frontend/SKILL.md +913 -0
- package/skills/eng-jira-comment/SKILL.md +17 -0
- package/skills/eng-microfrontend/SKILL.md +602 -0
- package/skills/eng-ms-trace/SKILL.md +469 -0
- package/skills/eng-nestjs/SKILL.md +791 -0
- package/skills/eng-performance-engineer/SKILL.md +312 -0
- package/skills/eng-pr/SKILL.md +339 -0
- package/skills/eng-qa-a11y-audit/SKILL.md +269 -0
- package/skills/eng-qa-bug-report/SKILL.md +1088 -0
- package/skills/eng-qa-bug-report/TASK_MANAGERS.md +138 -0
- package/skills/eng-qa-cypress-e2e/SKILL.md +177 -0
- package/skills/eng-qa-dev-guide/SKILL.md +164 -0
- package/skills/eng-qa-e2e/SKILL.md +400 -0
- package/skills/eng-qa-e2e-spec-writer/SKILL.md +322 -0
- package/skills/eng-qa-exploratory/SKILL.md +188 -0
- package/skills/eng-qa-gate/SKILL.md +370 -0
- package/skills/eng-qa-gate/assets/checklist-validacao.md +291 -0
- package/skills/eng-qa-graphql-contract/SKILL.md +256 -0
- package/skills/eng-qa-quality-report/SKILL.md +412 -0
- package/skills/eng-qa-test-plan/SKILL.md +466 -0
- package/skills/eng-qa-test-plan/assets/test-coverage-template.md +92 -0
- package/skills/eng-qa-test-plan/assets/test-patterns.md +178 -0
- package/skills/eng-qa-testsprite/SKILL.md +325 -0
- package/skills/eng-qa-testsprite/references/testsprite-mcp.md +224 -0
- package/skills/eng-qa-unit-test/SKILL.md +471 -0
- package/skills/eng-rabbitmq/SKILL.md +661 -0
- package/skills/eng-scraper/SKILL.md +683 -0
- package/skills/eng-scraper-robot-builder/SKILL.md +370 -0
- package/skills/eng-security-patch/SKILL.md +378 -0
- package/skills/eng-security-triage/SKILL.md +266 -0
- package/skills/eng-task-comment/SKILL.md +60 -0
- package/skills/eng-tech-analyst/SKILL.md +529 -0
- package/skills/eng-threat-model/SKILL.md +161 -0
- package/skills/init-jarvis/SKILL.md +1304 -0
- package/skills/init-jarvis/assets/mcp-configs.md +389 -0
- package/skills/init-jarvis/assets/onboarding-checklist.md +104 -0
- package/skills/init-jarvis/assets/setup-guide.md +360 -0
- package/skills/lovable-prompt-generator/SKILL.md +304 -0
- package/skills/prod-roadmap-report/README.md +303 -0
- package/skills/prod-roadmap-report/SKILL.md +198 -0
- package/skills/prod-roadmap-report/commands/status.compiled.single.team.md +23 -0
- package/skills/prod-roadmap-report/commands/status.list.projects.md +17 -0
- package/skills/prod-roadmap-report/commands/status.memory.md +192 -0
- package/skills/prod-roadmap-report/commands/status.roadmap.preview.md +94 -0
- package/skills/prod-roadmap-report/references/detailed-guide.md +236 -0
- package/skills/prod-roadmap-report/rules/detailed-guide.md +237 -0
- package/skills/prod-roadmap-report/rules/status-report-rules.md +44 -0
- package/skills/prod-roadmap-report/templates/template-multiple-teams-compiled-status.md +53 -0
- package/skills/prod-roadmap-report/templates/template-projects-list.md +23 -0
- package/skills/prod-roadmap-report/templates/template-single-team-compiled-status.md +60 -0
- package/skills/prod-roadmap-report/templates/template-single-team-status.md +49 -0
- package/skills/prod-specs/SKILL.md +108 -0
- package/skills/prod-specs/references/prod.spec.clarify.md +176 -0
- package/skills/prod-specs/references/prod.spec.epic.md +107 -0
- package/skills/prod-specs/references/prod.spec.frd.md +135 -0
- package/skills/prod-specs/references/prod.spec.issue.md +145 -0
- package/skills/prod-specs/references/prod.spec.prd.md +118 -0
- package/skills/prod-specs/rules/prod-spec-rules.md +186 -0
- package/skills/prod-specs/templates/prod-breakdown-template.md +136 -0
- package/skills/prod-specs/templates/prod-epic-template.md +76 -0
- package/skills/prod-specs/templates/prod-frd-template.md +172 -0
- package/skills/prod-specs/templates/prod-issue-template.md +68 -0
- package/skills/prod-specs/templates/prod-prd-full-template.md +159 -0
- package/skills/prod-specs/templates/prod-prd-template.md +173 -0
- package/skills/prod-specs-update/SKILL.md +272 -0
- package/skills/report-issue/SKILL.md +156 -0
- package/taxonomy.md +270 -0
- package/templates/AGENTS.md +189 -0
- package/templates/CDD aplicado a Prompts.md +182 -0
- package/templates/ENV-template.md +187 -0
- package/templates/engineering/AGENTS-template.md +71 -0
- package/templates/engineering/ARD-template.md +193 -0
- package/templates/engineering/CONTACTS-template.md +135 -0
- package/templates/engineering/PR-template.md +40 -0
- package/templates/engineering/RFC-Playbook.md +325 -0
- package/templates/engineering/RFC-template.md +199 -0
- package/templates/engineering/architecture-template.md +277 -0
- package/templates/engineering/breakdown-subtasks-template.md +582 -0
- package/templates/engineering/c4-model-template.md +516 -0
- package/templates/engineering/data-contract-template.md +135 -0
- package/templates/engineering/data-pipeline-template.md +163 -0
- package/templates/engineering/plan-template.md +255 -0
- package/templates/engineering/qa/eng.qa.quality-gate-examples-template.md +311 -0
- package/templates/engineering/qa/eng.qa.quality-gate-report-template.md +249 -0
- package/templates/engineering/qa/qa.cypress-test-template.md +172 -0
- package/templates/engineering/qa/qa.exploratory-session-template.md +148 -0
- package/templates/engineering/qa/qa.quality-report-template.md +130 -0
- package/templates/engineering/qa/qa.release-signoff-template.md +54 -0
- package/templates/engineering/qa/qa.sprint-plan-template.md +49 -0
- package/templates/engineering/swagger-template.md +145 -0
- package/templates/engineering/tech-spec-template.md +497 -0
- package/templates/engineering/work-progress-template.md +155 -0
- package/workflows/AGENTS.md +240 -0
- package/workflows/README.md +160 -0
- package/workflows/all-tools.md +11 -0
- package/workflows/engineering/data/data.contract.md +202 -0
- package/workflows/engineering/data/data.new-pipeline.md +234 -0
- package/workflows/engineering/eng.breakdown-subtasks.md +420 -0
- package/workflows/engineering/eng.bug-audit.md +591 -0
- package/workflows/engineering/eng.build-tech-spec.md +1116 -0
- package/workflows/engineering/eng.create-ard-from-code.md +259 -0
- package/workflows/engineering/eng.create-ard.md +382 -0
- package/workflows/engineering/eng.create-rfc.md +245 -0
- package/workflows/engineering/eng.debug.md +479 -0
- package/workflows/engineering/eng.docs.md +40 -0
- package/workflows/engineering/eng.light-arch.md +84 -0
- package/workflows/engineering/eng.plan.md +213 -0
- package/workflows/engineering/eng.pr.md +466 -0
- package/workflows/engineering/eng.pre-pr.md +167 -0
- package/workflows/engineering/eng.review.md +185 -0
- package/workflows/engineering/eng.rpa.robot.md +342 -0
- package/workflows/engineering/eng.security-audit.md +312 -0
- package/workflows/engineering/eng.security-incident.md +275 -0
- package/workflows/engineering/eng.security-pipeline.md +210 -0
- package/workflows/engineering/eng.security-review.md +235 -0
- package/workflows/engineering/eng.start.md +494 -0
- package/workflows/engineering/eng.work.md +558 -0
- package/workflows/engineering/frontend/eng.frontend-component.md +190 -0
- package/workflows/engineering/frontend/eng.frontend-perf-audit.md +375 -0
- package/workflows/engineering/frontend/eng.frontend-review.md +185 -0
- package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +51 -0
- package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +51 -0
- package/workflows/engineering/qa/eng.qa-exploratory-session.md +60 -0
- package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +202 -0
- package/workflows/engineering/qa/eng.qa-quality-report.md +83 -0
- package/workflows/engineering/qa/eng.qa-refinement-entry.md +83 -0
- package/workflows/engineering/qa/eng.qa-release-signoff.md +170 -0
- package/workflows/engineering/qa/eng.qa-sprint-planning.md +100 -0
- package/workflows/engineering/ta/eng.ta.atendimento.md +93 -0
- package/workflows/product/prod.roadmap.preview.md +110 -0
- package/workflows/product/prod.spec.breakdown.md +163 -0
- package/workflows/product/prod.spec.clarify.md +178 -0
- package/workflows/product/prod.spec.epic.md +154 -0
- package/workflows/product/prod.spec.frd.md +96 -0
- package/workflows/product/prod.spec.issue.md +145 -0
- package/workflows/product/prod.spec.md +60 -0
- package/workflows/product/prod.spec.prd.md +100 -0
- package/workflows/taxonomy.md +92 -0
- package/workflows/warm-up.md +574 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Workflow de Engenharia para Auditoria de Seguranca (OWASP, secrets, supply chain)
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
recommended_model: claude-opus-4-6-20250529
|
|
6
|
+
model_tier: very_high
|
|
7
|
+
model_justification: Auditoria de seguranca requer analise profunda de codigo, identificacao de padroes de vulnerabilidade, classificacao CVSS e geracao de relatorios estruturados
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Workflow de Engenharia – Security Audit
|
|
11
|
+
|
|
12
|
+
## Objetivo
|
|
13
|
+
|
|
14
|
+
Guiar o SENTINEL (ENG) na auditoria proativa de seguranca de projetos — analisando codigo, configs, dependencias e arquitetura contra OWASP Top 10, supply chain e boas praticas de seguranca. Gera relatorio com severidade CVSS e cards no `$TASK_MANAGER`.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Quando Usar Este Workflow
|
|
19
|
+
|
|
20
|
+
- Auditoria periodica de seguranca (por sprint ou release)
|
|
21
|
+
- Onboarding em projeto sem historico de seguranca
|
|
22
|
+
- Pre-lancamento de feature com superficie de ataque significativa
|
|
23
|
+
- Pos-incidente para verificar outros vetores
|
|
24
|
+
- Avaliacao de compliance (LGPD, GDPR, PCI-DSS)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Pre-requisitos
|
|
29
|
+
|
|
30
|
+
### Validar ENV.md
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
if [ ! -f "$IDE/ENV.md" ]; then
|
|
34
|
+
echo "ENV.md nao encontrado. Execute /init-jarvis primeiro."
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
required_vars=("WORKSPACE" "IDE" "SQUAD" "HUB" "AREA" "POSITION")
|
|
39
|
+
for var in "${required_vars[@]}"; do
|
|
40
|
+
if ! grep -q "^$var=.\+" "$IDE/ENV.md"; then
|
|
41
|
+
echo "Variavel $var nao definida no ENV.md"
|
|
42
|
+
fi
|
|
43
|
+
done
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Definir Escopo (Argumento)
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
/eng.security-audit [escopo]
|
|
50
|
+
|
|
51
|
+
Onde [escopo] pode ser:
|
|
52
|
+
- Caminho de pasta/arquivo: ./src/auth/
|
|
53
|
+
- Modulo especifico: payment-service
|
|
54
|
+
- Projeto completo: --all
|
|
55
|
+
- Foco especifico: --focus=owasp|secrets|supply-chain|headers|compliance
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Fase 0 – Analise de Contexto (CDD)
|
|
61
|
+
|
|
62
|
+
> Skill: Use `/context-detect` se existir uma sessao ativa
|
|
63
|
+
> Configuravel: Controlada pela variavel `ENABLE_CDD` no ENV.md
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
grep "^ENABLE_CDD=" $IDE/ENV.md
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- Se `ENABLE_CDD=false` ou nao definida: pular esta fase
|
|
70
|
+
- Se `ENABLE_CDD=true`: herdar contexto
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Fase 0.5 — Threat Model Scoping
|
|
75
|
+
|
|
76
|
+
Se `THREAT_MODEL.md` existe no projeto (gerado por `/eng-threat-model`):
|
|
77
|
+
|
|
78
|
+
1. Ler secao 3 "Entry points & trust boundaries" → usar como lista base de focus areas para fan-out
|
|
79
|
+
2. Ler secao 4 "Threats" → filtrar por `status != mitigated` → priorizar areas com ameacas `almost_certain` ou `likely`
|
|
80
|
+
3. Registrar `threat_model_ref` para incluir no `security-findings.json` de output
|
|
81
|
+
|
|
82
|
+
Se nao existe: prosseguir para Fase 1 (recon manual de areas).
|
|
83
|
+
|
|
84
|
+
> Threat model transforma o scan de "busca geral" em "busca guiada" — reduz ruido e aumenta recall nas areas criticas.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Fase 1 – Scoping
|
|
89
|
+
|
|
90
|
+
### 1.1 Mapear superficie de ataque
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Endpoints publicos (controllers, rotas)
|
|
94
|
+
grep -rn --include="*.ts" --include="*.js" --include="*.py" \
|
|
95
|
+
-E "@(Get|Post|Put|Patch|Delete|Controller|app\.(get|post|put|delete)|router\.(get|post))" \
|
|
96
|
+
src/ 2>/dev/null | head -50
|
|
97
|
+
|
|
98
|
+
# Arquivos de auth
|
|
99
|
+
grep -rl --include="*.ts" --include="*.js" \
|
|
100
|
+
-E "(auth|guard|middleware|session|jwt|passport|oauth)" \
|
|
101
|
+
src/ 2>/dev/null
|
|
102
|
+
|
|
103
|
+
# Configs de seguranca existentes
|
|
104
|
+
find . -maxdepth 3 \( -name "helmet*" -o -name "cors*" -o -name "csp*" -o -name "*.security.*" \) 2>/dev/null
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 1.2 Priorizar areas
|
|
108
|
+
|
|
109
|
+
| Prioridade | Area | Motivo |
|
|
110
|
+
|------------|------|--------|
|
|
111
|
+
| P0 | Auth, sessions, tokens | Bypass = acesso total |
|
|
112
|
+
| P1 | Inputs (forms, APIs, uploads) | Injection, XSS |
|
|
113
|
+
| P2 | Dados sensiveis (PII, financeiro) | Exposicao, compliance |
|
|
114
|
+
| P3 | Dependencias e configs | Supply chain, misconfiguration |
|
|
115
|
+
| P4 | Logs e monitoramento | Deteccao de ataques |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Fase 2 – Reconnaissance
|
|
120
|
+
|
|
121
|
+
### 2.1 Mapear tecnologias e frameworks
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Stack detection
|
|
125
|
+
cat package.json 2>/dev/null | grep -E '"(nest|express|fastify|next|react|vue|prisma|typeorm|mongoose)"'
|
|
126
|
+
cat requirements.txt 2>/dev/null | head -20
|
|
127
|
+
cat go.mod 2>/dev/null | head -20
|
|
128
|
+
|
|
129
|
+
# Verificar se ha ferramentas de seguranca ja instaladas
|
|
130
|
+
cat package.json 2>/dev/null | grep -E '"(helmet|cors|csurf|express-rate-limit|bcrypt|argon2|zod|joi)"'
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 2.2 Mapear dados sensiveis
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Modelos com campos sensiveis
|
|
137
|
+
grep -rn --include="*.ts" --include="*.js" --include="*.py" \
|
|
138
|
+
-E "(password|cpf|cnpj|credit_card|card_number|ssn|phone|birth_date|salary)" \
|
|
139
|
+
src/ 2>/dev/null | head -30
|
|
140
|
+
|
|
141
|
+
# Verificar .gitignore para .env
|
|
142
|
+
grep -E "\.env" .gitignore 2>/dev/null
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Fase 3 – Analysis (OWASP Top 10)
|
|
148
|
+
|
|
149
|
+
### Fan-out por focus-area
|
|
150
|
+
|
|
151
|
+
Quando o projeto tem >15 arquivos de codigo-fonte, spawnar **1 subagente Task por focus-area** (max 10 concorrentes).
|
|
152
|
+
Em projetos pequenos (<15 arquivos): analise sequencial sem fan-out.
|
|
153
|
+
|
|
154
|
+
Cada subagente recebe:
|
|
155
|
+
- Focus area derivada da Fase 0.5 (threat model) ou Fase 1 (recon manual)
|
|
156
|
+
- Trust boundary do `THREAT_MODEL.md` secao 3, ou `"untrusted input → processo"` como fallback
|
|
157
|
+
- O brief OWASP abaixo como instrucao de analise
|
|
158
|
+
|
|
159
|
+
**Subagentes rodam sem MCP** — apenas Read/Grep para o codigo-alvo. Veredicto mais deterministico e barato.
|
|
160
|
+
|
|
161
|
+
Para cada vetor, verificar no codigo e classificar achados:
|
|
162
|
+
|
|
163
|
+
### A01 - Broken Access Control
|
|
164
|
+
```bash
|
|
165
|
+
# Endpoints sem guard/middleware de auth
|
|
166
|
+
grep -rn --include="*.ts" "@(Get|Post|Put|Delete)" src/ | grep -v -E "(Guard|Auth|Roles|Public)" | head -20
|
|
167
|
+
|
|
168
|
+
# IDOR patterns
|
|
169
|
+
grep -rn --include="*.ts" "req.params\.\(id\|userId\|orderId\)" src/ | head -20
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### A03 - Injection
|
|
173
|
+
```bash
|
|
174
|
+
# SQL injection patterns
|
|
175
|
+
grep -rn --include="*.ts" --include="*.js" -E "(\$queryRaw[^U]|query\(.*\+|query\(.*\$\{|exec\(.*\+)" src/ 2>/dev/null
|
|
176
|
+
|
|
177
|
+
# Command injection
|
|
178
|
+
grep -rn --include="*.ts" --include="*.js" -E "(exec\(|execSync\(|spawn\()" src/ 2>/dev/null | head -20
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### A05 - Security Misconfiguration
|
|
182
|
+
```bash
|
|
183
|
+
# CORS config
|
|
184
|
+
grep -rn --include="*.ts" --include="*.js" -E "(enableCors|cors\()" src/ 2>/dev/null
|
|
185
|
+
|
|
186
|
+
# Debug/dev configs em producao
|
|
187
|
+
grep -rn --include="*.ts" --include="*.js" -E "(debug:\s*true|DEBUG=true|stack.*trace)" src/ 2>/dev/null
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### A06 - Vulnerable Components
|
|
191
|
+
```bash
|
|
192
|
+
# Verificar vulnerabilidades
|
|
193
|
+
npm audit --audit-level=moderate 2>/dev/null || echo "npm audit nao disponivel"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
> Repetir para cada vetor relevante usando o skill `eng-cybersecurity` como referencia.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Fase 4 – Supply Chain
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Verificar lockfile commitado
|
|
204
|
+
git ls-files | grep -E "(package-lock|yarn.lock|pnpm-lock)" | head -5
|
|
205
|
+
|
|
206
|
+
# Verificar se .npmrc esta seguro (sem tokens hardcoded)
|
|
207
|
+
cat .npmrc 2>/dev/null | grep -v "^#" | grep -i "token\|auth" | head -5
|
|
208
|
+
|
|
209
|
+
# Licencas problematicas
|
|
210
|
+
npx license-checker --summary 2>/dev/null | head -20
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Fase 5 – Classification
|
|
216
|
+
|
|
217
|
+
Classificar cada achado no formato:
|
|
218
|
+
|
|
219
|
+
```markdown
|
|
220
|
+
### [SEV] Titulo da vulnerabilidade
|
|
221
|
+
|
|
222
|
+
- **Severidade**: CRITICAL | HIGH | MEDIUM | LOW | INFO
|
|
223
|
+
- **CVSS estimado**: X.X
|
|
224
|
+
- **Vetor OWASP**: A01-A10
|
|
225
|
+
- **Arquivo(s)**: `path/to/file.ts:line`
|
|
226
|
+
- **Evidencia**: {codigo ou config vulneravel}
|
|
227
|
+
- **Vetor de ataque**: {como um atacante exploraria}
|
|
228
|
+
- **Impacto**: {o que acontece se explorado}
|
|
229
|
+
- **Correcao**: {codigo ou config corrigido}
|
|
230
|
+
- **Status**: aberto | corrigido | mitigado
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Fase 6 – Reporting
|
|
236
|
+
|
|
237
|
+
### 6.1 Gerar relatorio
|
|
238
|
+
|
|
239
|
+
Criar arquivo `security-audit-report.md` na sessao:
|
|
240
|
+
|
|
241
|
+
```markdown
|
|
242
|
+
# Security Audit Report
|
|
243
|
+
|
|
244
|
+
**Workspace**: $WORKSPACE
|
|
245
|
+
**Squad**: $SQUAD
|
|
246
|
+
**Data**: {data ISO-8601}
|
|
247
|
+
**Auditor**: SENTINEL (AI-assisted)
|
|
248
|
+
**Escopo**: {escopo auditado}
|
|
249
|
+
|
|
250
|
+
## Resumo Executivo
|
|
251
|
+
|
|
252
|
+
| Severidade | Quantidade |
|
|
253
|
+
|------------|-----------|
|
|
254
|
+
| CRITICAL | {n} |
|
|
255
|
+
| HIGH | {n} |
|
|
256
|
+
| MEDIUM | {n} |
|
|
257
|
+
| LOW | {n} |
|
|
258
|
+
| INFO | {n} |
|
|
259
|
+
|
|
260
|
+
## Achados
|
|
261
|
+
|
|
262
|
+
{lista de achados classificados, do mais critico ao menos}
|
|
263
|
+
|
|
264
|
+
## Recomendacoes Prioritarias
|
|
265
|
+
|
|
266
|
+
1. {correcao mais urgente}
|
|
267
|
+
2. {segunda mais urgente}
|
|
268
|
+
...
|
|
269
|
+
|
|
270
|
+
## Proximos Passos
|
|
271
|
+
|
|
272
|
+
- [ ] Corrigir achados CRITICAL/HIGH
|
|
273
|
+
- [ ] Agendar correcao de MEDIUM para proxima sprint
|
|
274
|
+
- [ ] Documentar LOW/INFO como debt de seguranca
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### 6.2 Criar cards no $TASK_MANAGER
|
|
278
|
+
|
|
279
|
+
Para achados CRITICAL e HIGH, criar cards com:
|
|
280
|
+
- Titulo: `[SECURITY] {titulo da vulnerabilidade}`
|
|
281
|
+
- Label: `security`, `{severidade}`
|
|
282
|
+
- Descricao: evidencia + correcao sugerida
|
|
283
|
+
- Prioridade: maxima para CRITICAL, alta para HIGH
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Fase 6.3 — Output JSON (security-findings.json)
|
|
288
|
+
|
|
289
|
+
Alem do relatorio markdown, escrever `.security/outputs/security-findings.json` conforme `docs/SECURITY-ARTIFACTS-SCHEMA.md` secao 2. Criar `.security/outputs/` se nao existir.
|
|
290
|
+
|
|
291
|
+
Um arquivo por focus-area durante o fan-out (prefixar IDs: `AUTH-F001`, `DEPS-F002`).
|
|
292
|
+
Consolidar em arquivo unico ao final em `.security/outputs/security-findings.json`, reordenando por (impact, likelihood) decrescente.
|
|
293
|
+
|
|
294
|
+
Este arquivo e o input direto do skill `eng-security-triage`.
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Regras
|
|
299
|
+
|
|
300
|
+
### Nunca
|
|
301
|
+
- Ignorar um achado porque "provavelmente nao sera explorado"
|
|
302
|
+
- Executar exploits reais contra o sistema em producao
|
|
303
|
+
- Expor secrets encontrados no relatorio (mascarar com `***`)
|
|
304
|
+
- Minimizar severidade sem justificativa tecnica
|
|
305
|
+
- Pular a classificacao CVSS
|
|
306
|
+
|
|
307
|
+
### Sempre
|
|
308
|
+
- Usar o skill `eng-cybersecurity` como referencia de padroes
|
|
309
|
+
- Classificar TODOS os achados por severidade
|
|
310
|
+
- Incluir evidencia (codigo) e correcao para cada achado
|
|
311
|
+
- Mascarar secrets encontrados antes de reportar
|
|
312
|
+
- Comunicar achados CRITICAL imediatamente ao usuario (nao esperar o relatorio final)
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Workflow de Engenharia para Resposta a Incidentes de Seguranca (CVEs, vulnerabilidades, breaches)
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
recommended_model: claude-opus-4-6-20250529
|
|
6
|
+
model_tier: very_high
|
|
7
|
+
model_justification: Incident response requer analise rapida e precisa de vulnerabilidades, avaliacao de impacto e decisoes de contencao que afetam producao
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Workflow de Engenharia – Security Incident Response
|
|
11
|
+
|
|
12
|
+
## Objetivo
|
|
13
|
+
|
|
14
|
+
Guiar o SENTINEL (ENG) na resposta estruturada a incidentes de seguranca — desde CVEs criticas ate vulnerabilidades reportadas e breaches. Prioriza contencao rapida seguida de correcao definitiva e documentacao preventiva.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Quando Usar Este Workflow
|
|
19
|
+
|
|
20
|
+
- CVE critica publicada que pode afetar dependencias do projeto
|
|
21
|
+
- Vulnerabilidade reportada por ferramenta de scan (SAST/DAST)
|
|
22
|
+
- Secret vazado no repositorio ou em producao
|
|
23
|
+
- Incidente de seguranca reportado (acesso indevido, dados expostos)
|
|
24
|
+
- Alerta de dependencia comprometida (supply chain attack)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Pre-requisitos
|
|
29
|
+
|
|
30
|
+
### Validar ENV.md
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
if [ ! -f "$IDE/ENV.md" ]; then
|
|
34
|
+
echo "ENV.md nao encontrado. Execute /init-jarvis primeiro."
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Entrada do Incidente
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
/eng.security-incident [referencia]
|
|
43
|
+
|
|
44
|
+
Onde [referencia] pode ser:
|
|
45
|
+
- CVE ID: CVE-2024-XXXXX
|
|
46
|
+
- URL do advisory: https://github.com/advisories/GHSA-xxxx
|
|
47
|
+
- Descricao: "SQL injection no endpoint /api/users"
|
|
48
|
+
- Card do $TASK_MANAGER: TASK-1234
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Fase 1 – Triage
|
|
54
|
+
|
|
55
|
+
**Objetivo**: classificar rapidamente a severidade e impacto.
|
|
56
|
+
|
|
57
|
+
### 1.1 Coletar informacoes
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
## Triage
|
|
61
|
+
|
|
62
|
+
**Referencia**: {CVE, advisory URL ou descricao}
|
|
63
|
+
**Reportado por**: {ferramenta, pesquisador, equipe interna}
|
|
64
|
+
**Data do report**: {ISO-8601}
|
|
65
|
+
**Tipo**: {CVE em dependencia | vulnerabilidade no codigo | secret leak | breach | outro}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 1.2 Classificar severidade
|
|
69
|
+
|
|
70
|
+
| Criterio | CRITICAL | HIGH | MEDIUM | LOW |
|
|
71
|
+
|----------|----------|------|--------|-----|
|
|
72
|
+
| Explorabilidade | Remota, sem auth | Remota, com auth | Local ou com privilegio | Teorica |
|
|
73
|
+
| Impacto | RCE, data breach, auth bypass | Escalacao de privilegio, data leak parcial | DoS, info disclosure limitada | Baixo impacto |
|
|
74
|
+
| Dados afetados | PII, financeiro, credenciais | Dados internos sensiveis | Dados nao-sensiveis | Nenhum |
|
|
75
|
+
| Superficie | Endpoint publico | Endpoint autenticado | Funcao interna | Codigo morto |
|
|
76
|
+
|
|
77
|
+
### 1.3 Decisao de urgencia
|
|
78
|
+
|
|
79
|
+
| Severidade | SLA de resposta | Acao imediata |
|
|
80
|
+
|------------|-----------------|---------------|
|
|
81
|
+
| **CRITICAL** | Conter em 1h, corrigir em 24h | Notificar TL/CTO, iniciar contencao |
|
|
82
|
+
| **HIGH** | Corrigir em 48h | Notificar TL, planejar correcao |
|
|
83
|
+
| **MEDIUM** | Corrigir na proxima sprint | Criar card, documentar |
|
|
84
|
+
| **LOW** | Backlog | Documentar, corrigir quando conveniente |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Fase 2 – Assessment
|
|
89
|
+
|
|
90
|
+
**Objetivo**: determinar se e como o projeto e afetado.
|
|
91
|
+
|
|
92
|
+
### 2.1 Para CVEs em dependencias
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Verificar se a dependencia vulneravel esta instalada
|
|
96
|
+
grep "{pacote}" package.json package-lock.json 2>/dev/null
|
|
97
|
+
# ou
|
|
98
|
+
pip show {pacote} 2>/dev/null
|
|
99
|
+
|
|
100
|
+
# Verificar versao instalada vs. versao afetada
|
|
101
|
+
npm ls {pacote} 2>/dev/null
|
|
102
|
+
|
|
103
|
+
# Verificar se o codigo usa a funcao/modulo vulneravel
|
|
104
|
+
grep -rn --include="*.ts" --include="*.js" "{funcao_ou_import_afetado}" src/ 2>/dev/null
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 2.2 Para vulnerabilidades no codigo
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Localizar o codigo vulneravel
|
|
111
|
+
grep -rn --include="*.ts" --include="*.js" --include="*.py" "{pattern}" src/ 2>/dev/null
|
|
112
|
+
|
|
113
|
+
# Verificar se o endpoint e acessivel publicamente
|
|
114
|
+
# Verificar se ha guards/middleware protegendo
|
|
115
|
+
# Verificar se inputs sao validados antes de chegar ao ponto vulneravel
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 2.3 Para secrets vazados
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Verificar se o secret ainda esta ativo
|
|
122
|
+
# Verificar onde o secret e usado
|
|
123
|
+
grep -rn "{secret_parcial}" . --include="*.ts" --include="*.js" --include="*.env" --include="*.yml" 2>/dev/null
|
|
124
|
+
|
|
125
|
+
# Verificar historico git
|
|
126
|
+
git log --all --oneline -S "{secret_parcial}" 2>/dev/null | head -10
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 2.4 Documentar assessment
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
## Assessment
|
|
133
|
+
|
|
134
|
+
**Projeto afetado**: sim | nao | parcialmente
|
|
135
|
+
**Versao afetada**: {versao da dependencia ou do codigo}
|
|
136
|
+
**Superficie de ataque**: {endpoints, funcoes, configs afetadas}
|
|
137
|
+
**Dados em risco**: {tipo de dados que podem ser comprometidos}
|
|
138
|
+
**Exploracao confirmada**: sim | nao | nao verificavel
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Fase 3 – Containment
|
|
144
|
+
|
|
145
|
+
**Objetivo**: limitar o impacto imediato enquanto a correcao definitiva e preparada.
|
|
146
|
+
|
|
147
|
+
### Acoes de contencao por tipo
|
|
148
|
+
|
|
149
|
+
| Tipo | Acao de contencao |
|
|
150
|
+
|------|-------------------|
|
|
151
|
+
| Endpoint vulneravel | Desabilitar endpoint ou adicionar guard temporario |
|
|
152
|
+
| Secret vazado | Revogar/rotacionar o secret IMEDIATAMENTE |
|
|
153
|
+
| Dependencia com CVE | Avaliar se patch esta disponivel, aplicar se possivel |
|
|
154
|
+
| Auth bypass | Adicionar validacao extra, revogar sessions ativas se necessario |
|
|
155
|
+
| Data exposure | Verificar logs de acesso, avaliar notificacao (LGPD 72h) |
|
|
156
|
+
|
|
157
|
+
### Documentar contencao
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
## Containment
|
|
161
|
+
|
|
162
|
+
**Acao tomada**: {descricao da contencao}
|
|
163
|
+
**Timestamp**: {ISO-8601}
|
|
164
|
+
**Reversivel**: sim | nao
|
|
165
|
+
**Impacto da contencao**: {funcionalidades temporariamente afetadas}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
> **IMPORTANTE**: Contencao e temporaria. Sempre seguir com correcao definitiva.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Fase 4 – Remediation
|
|
173
|
+
|
|
174
|
+
**Objetivo**: implementar correcao definitiva e validar.
|
|
175
|
+
|
|
176
|
+
### 4.1 Implementar correcao
|
|
177
|
+
|
|
178
|
+
- Usar o skill `eng-cybersecurity` como referencia de padroes seguros
|
|
179
|
+
- Corrigir a causa raiz (nao apenas o sintoma)
|
|
180
|
+
- Adicionar validacao/sanitizacao onde necessario
|
|
181
|
+
- Atualizar dependencias afetadas
|
|
182
|
+
|
|
183
|
+
### 4.2 Validar correcao
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Rodar testes existentes
|
|
187
|
+
npm test 2>/dev/null
|
|
188
|
+
|
|
189
|
+
# Verificar que a vulnerabilidade foi corrigida
|
|
190
|
+
# (reproduzir o vetor de ataque e confirmar que falha)
|
|
191
|
+
|
|
192
|
+
# Rodar npm audit novamente (se CVE em dep)
|
|
193
|
+
npm audit 2>/dev/null
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### 4.3 Documentar correcao
|
|
197
|
+
|
|
198
|
+
```markdown
|
|
199
|
+
## Remediation
|
|
200
|
+
|
|
201
|
+
**Correcao aplicada**: {descricao tecnica}
|
|
202
|
+
**Arquivos alterados**: {lista}
|
|
203
|
+
**Testes adicionados**: {sim/nao — quais}
|
|
204
|
+
**Dependencias atualizadas**: {pacote@versao_antiga → pacote@versao_nova}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Fase 5 – Post-mortem
|
|
210
|
+
|
|
211
|
+
**Objetivo**: documentar o incidente para aprendizado e prevencao.
|
|
212
|
+
|
|
213
|
+
### Template de post-mortem
|
|
214
|
+
|
|
215
|
+
```markdown
|
|
216
|
+
# Security Post-mortem
|
|
217
|
+
|
|
218
|
+
**Incidente**: {titulo}
|
|
219
|
+
**Severidade**: {CRITICAL|HIGH|MEDIUM|LOW}
|
|
220
|
+
**Data de deteccao**: {ISO-8601}
|
|
221
|
+
**Data de resolucao**: {ISO-8601}
|
|
222
|
+
**Tempo de resolucao**: {duracao}
|
|
223
|
+
|
|
224
|
+
## Timeline
|
|
225
|
+
|
|
226
|
+
| Timestamp | Evento |
|
|
227
|
+
|-----------|--------|
|
|
228
|
+
| {t0} | Vulnerabilidade reportada/detectada |
|
|
229
|
+
| {t1} | Triage concluida — severidade {X} |
|
|
230
|
+
| {t2} | Contencao aplicada |
|
|
231
|
+
| {t3} | Correcao implementada e testada |
|
|
232
|
+
| {t4} | Deploy da correcao |
|
|
233
|
+
|
|
234
|
+
## Causa Raiz
|
|
235
|
+
|
|
236
|
+
{O que causou a vulnerabilidade? Quando foi introduzida?}
|
|
237
|
+
|
|
238
|
+
## Impacto
|
|
239
|
+
|
|
240
|
+
{Dados afetados, usuarios impactados, janela de exposicao}
|
|
241
|
+
|
|
242
|
+
## Correcao
|
|
243
|
+
|
|
244
|
+
{O que foi feito para resolver}
|
|
245
|
+
|
|
246
|
+
## Prevencao
|
|
247
|
+
|
|
248
|
+
{O que sera feito para evitar recorrencia}
|
|
249
|
+
|
|
250
|
+
- [ ] {acao preventiva 1}
|
|
251
|
+
- [ ] {acao preventiva 2}
|
|
252
|
+
- [ ] {acao preventiva 3}
|
|
253
|
+
|
|
254
|
+
## Licoes Aprendidas
|
|
255
|
+
|
|
256
|
+
{O que o time aprendeu com este incidente}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Regras
|
|
262
|
+
|
|
263
|
+
### Nunca
|
|
264
|
+
- Minimizar um incidente de seguranca ("provavelmente ninguem explorou")
|
|
265
|
+
- Deixar um secret vazado ativo enquanto investiga — revogar PRIMEIRO
|
|
266
|
+
- Aplicar correcao sem testes de validacao
|
|
267
|
+
- Pular o post-mortem ("ja foi resolvido, vamos seguir")
|
|
268
|
+
- Expor detalhes do incidente em canais publicos antes da correcao
|
|
269
|
+
|
|
270
|
+
### Sempre
|
|
271
|
+
- Comunicar achados CRITICAL ao TL/responsavel imediatamente
|
|
272
|
+
- Revogar secrets vazados antes de qualquer outra acao
|
|
273
|
+
- Documentar timeline completa do incidente
|
|
274
|
+
- Verificar se a vulnerabilidade afeta outros servicos do projeto
|
|
275
|
+
- Propor melhorias preventivas no post-mortem
|