@jetrabbits/agentic 0.0.3 → 0.0.4

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.
@@ -4,88 +4,80 @@ workflow: security-scan
4
4
 
5
5
  # Prompt: `/security-scan`
6
6
 
7
- Use when: running a full automated security sweep SAST, dependency audit, secrets detection, IaC checks before a release or after a major change.
7
+ Use when: running a security scan that must produce actionable release decisions (`exploitable-now`, `not-reachable`, `accepted-risk`) rather than only raw scanner output.
8
8
 
9
9
  ---
10
10
 
11
- ## Example 1 — Pre-release security gate
11
+ ## Example 1 — Release gate with reachability triage and VEX output
12
12
 
13
13
  **EN:**
14
14
  ```
15
15
  /security-scan
16
16
 
17
- Trigger: release candidate v2.5.0 ready for staging sign-off
18
- Scope: full — SAST + dependency CVEs + secrets + IaC (Terraform)
19
- Stack: Python 3.12 / FastAPI, PostgreSQL, Redis, Terraform (AWS)
20
- Tools available: bandit, ruff, safety, trufflehog, tfsec, semgrep
21
- Severity threshold: block release on any Critical or High; report Medium/Low
22
- Output: security-scan-report.md with findings, severity, remediation steps
23
- Branch: release/2.5.0
17
+ Trigger: release candidate v4.2.0
18
+ Scope: SAST + dependency + secrets + IaC
19
+ Stack: Node.js 22, Python 3.12, Terraform
20
+ Policy:
21
+ - Block release for any Critical finding classified as exploitable-now
22
+ - High findings require remediation plan <= 72h or time-bound exception
23
+ Required output sections:
24
+ 1) Findings summary by severity
25
+ 2) Reachability analysis for each High/Critical dependency CVE
26
+ 3) Classification table: exploitable-now / not-reachable / accepted-risk
27
+ 4) VEX-style statements for not-reachable items with evidence
28
+ 5) Exception register (owner, expiry, compensating controls)
24
29
  ```
25
30
 
26
31
  **RU:**
27
32
  ```
28
33
  /security-scan
29
34
 
30
- Триггер: release candidate v2.5.0 готов к sign-off на staging
31
- Скоуп: полный — SAST + CVE зависимостей + секреты + IaC (Terraform)
32
- Стек: Python 3.12 / FastAPI, PostgreSQL, Redis, Terraform (AWS)
33
- Доступные инструменты: bandit, ruff, safety, trufflehog, tfsec, semgrep
34
- Порог серьёзности: блокировать релиз на любом Critical или High; отчитываться о Medium/Low
35
- Результат: security-scan-report.md с находками, серьёзностью, шагами устранения
36
- Ветка: release/2.5.0
35
+ Триггер: release candidate v4.2.0
36
+ Скоуп: SAST + зависимости + секреты + IaC
37
+ Стек: Node.js 22, Python 3.12, Terraform
38
+ Политика:
39
+ - Блокировать релиз при любом Critical, классифицированном как exploitable-now
40
+ - Для High нужен план устранения <= 72ч или ограниченное по времени исключение
41
+ Обязательные разделы результата:
42
+ 1) Сводка находок по серьёзности
43
+ 2) Reachability-анализ для каждого High/Critical dependency CVE
44
+ 3) Таблица классификации: exploitable-now / not-reachable / accepted-risk
45
+ 4) VEX-подобные записи для not-reachable с доказательствами
46
+ 5) Реестр исключений (owner, expiry, compensating controls)
37
47
  ```
38
48
 
39
49
  ---
40
50
 
41
- ## Example 2 — Post-incident targeted scan
51
+ ## Example 2 — Fast incident-mode scan focused on exploitability
42
52
 
43
53
  **EN:**
44
54
  ```
45
55
  /security-scan
46
56
 
47
- Trigger: post-incident suspected SQL injection in orders module (INC-2024-088)
48
- Scope: targeted — SAST only on src/api/ and src/repositories/; dependency audit for SQLAlchemy
49
- Priority: SQL injection patterns, unsanitised inputs, ORM bypass risks
50
- Skip: IaC scan, secrets scan (already clean, saves time)
51
- Output: findings with code location + PoC query if reproducible
52
- Timeframe: results needed within 2 hours for incident postmortem
57
+ Context: actively exploited CVE announced in a transitive dependency
58
+ Timebox: 90 minutes
59
+ Scope:
60
+ - Dependency path tracing to affected services
61
+ - Runtime reachability confirmation
62
+ - Exposure check for internet-facing routes
63
+ Output:
64
+ - List of impacted services sorted by exploitability risk
65
+ - Immediate mitigations (feature flags, traffic isolation, WAF rules)
66
+ - Patch and rollback plan
53
67
  ```
54
68
 
55
69
  **RU:**
56
70
  ```
57
71
  /security-scan
58
72
 
59
- Триггер: после инцидента подозрение на SQL injection в модуле orders (INC-2024-088)
60
- Скоуп: целевой — только SAST на src/api/ и src/repositories/; аудит зависимостей для SQLAlchemy
61
- Приоритет: паттерны SQL injection, неэкранированные входные данные, риски обхода ORM
62
- Пропустить: IaC сканирование, проверку секретов (уже чисто, экономия времени)
63
- Результат: находки с расположением кода + PoC запрос если воспроизводимо
64
- Срок: результаты нужны в течение 2 часов для postmortem инцидента
65
- ```
66
-
67
- ---
68
-
69
- ## Example 3 — Dependency-only quick scan
70
-
71
- **EN:**
72
- ```
73
- /security-scan
74
-
75
- Scope: dependency CVE audit only
76
- Stack: Node.js 20 / Express, npm lockfile
77
- Command: npm audit --audit-level=high
78
- Auto-fix: apply non-breaking patches automatically (npm audit fix)
79
- Report: list packages with unresolved High/Critical CVEs that need manual review
80
- ```
81
-
82
- **RU:**
83
- ```
84
- /security-scan
85
-
86
- Скоуп: только аудит CVE зависимостей
87
- Стек: Node.js 20 / Express, npm lockfile
88
- Команда: npm audit --audit-level=high
89
- Авто-исправление: применить неломающие патчи автоматически (npm audit fix)
90
- Отчёт: список пакетов с неустранёнными High/Critical CVE которые требуют ручного ревью
73
+ Контекст: опубликован активно эксплуатируемый CVE в транзитивной зависимости
74
+ Таймбокс: 90 минут
75
+ Скоуп:
76
+ - Трассировка dependency path до затронутых сервисов
77
+ - Подтверждение runtime reachability
78
+ - Проверка экспозиции интернет-facing маршрутов
79
+ Результат:
80
+ - Список затронутых сервисов, отсортированный по риску exploitability
81
+ - Немедленные mitigation-шаги (feature flags, изоляция трафика, WAF rules)
82
+ - План патча и отката
91
83
  ```
@@ -1,12 +1,47 @@
1
1
  # Rule: Dependency Security Policy
2
2
 
3
- **Priority**: P1 — Critical CVEs block deploy; High CVEs require plan within 72 hours.
3
+ **Priority**: P1 — Critical exploitable dependency risk blocks release; all accepted risks require owner + expiry.
4
4
 
5
- ## Constraints
5
+ ## Policy Model: Risk-Based, Not CVSS-Only
6
6
 
7
- 1. **No direct use of packages with Critical CVEs**: Upgrade or replace immediately.
8
- 2. **High CVEs**: Remediation plan within 72 hours.
9
- 3. **Dependency audit in CI**: `npm audit`, `pip audit`, `trivy` run on every PR. Fail on severity ≥ HIGH.
10
- 4. **Pin transitive dependencies**: Lockfiles committed to Git (`package-lock.json`, `poetry.lock`, `go.sum`).
11
- 5. **No abandoned packages**: Packages without updates > 2 years require security review.
12
- 6. **License compliance**: No GPL in closed-source products without legal review. MIT, Apache 2.0, BSD pre-approved.
7
+ 1. Triage by **exploitability context**:
8
+ - severity (CVSS),
9
+ - reachability from runtime code path,
10
+ - exposure boundary (internet-facing vs internal),
11
+ - presence of compensating controls.
12
+ 2. A Critical CVE with confirmed reachable path is a deployment blocker.
13
+ 3. High CVEs require remediation plan within 72h or formal exception.
14
+
15
+ ## Mandatory CI Controls
16
+
17
+ 4. Run dependency scanning on every PR and main build.
18
+ 5. Enforce lockfiles and deterministic install modes.
19
+ 6. Verify checksums/signatures when ecosystem tooling supports it.
20
+ 7. Fail on prohibited licenses or policy-violating dependency sources.
21
+
22
+ ## Provenance and Registry Trust
23
+
24
+ 8. Prefer trusted publishers / verified maintainers where available.
25
+ 9. Restrict package sources to approved registries/proxies.
26
+ 10. Alert on maintainer transfer, suspicious install scripts, typosquatting indicators.
27
+
28
+ ## Reachability and VEX
29
+
30
+ 11. For each High/Critical finding, classify as:
31
+ - `exploitable-now`,
32
+ - `not-reachable`,
33
+ - `accepted-risk` (temporary).
34
+ 12. Use VEX-compatible status where possible to document non-exploitable findings.
35
+ 13. “Not reachable” claims require evidence (call graph, dependency path, runtime boundary).
36
+
37
+ ## Exception Handling
38
+
39
+ 14. Exceptions require: owner, justification, compensating controls, expiry date (max 30 days).
40
+ 15. Expired exceptions automatically re-block deployments.
41
+ 16. All exceptions reviewed in weekly security triage.
42
+
43
+ ## Language/Stack Constraints
44
+
45
+ 17. JavaScript/TypeScript: lockfile mandatory; block lifecycle scripts unless explicitly approved.
46
+ 18. Python: hashes for production requirements (`--require-hashes`) when feasible.
47
+ 19. Containers: base images pinned by digest; no floating tags in production images.
@@ -2,28 +2,49 @@
2
2
 
3
3
  ## When to load
4
4
 
5
- When adding new packages, reviewing a PR that adds dependencies, or performing security reviews.
6
-
7
- ## Pre-Add Checklist
8
-
9
- ```
10
- Before npm install [package]:
11
- 1. POPULARITY: > 100k weekly downloads?
12
- 2. MAINTENANCE: Last commit within 12 months? Open PRs reviewed?
13
- 3. OWNERSHIP: Well-known org/individual? History of incidents?
14
- 4. SCOPE: Does the package scope match its stated purpose?
15
- (A CSV parser with network dependencies is suspicious)
16
- 5. AUDIT: Run npm audit / snyk test immediately after adding
17
- 6. SIZE: Check bundlephobia.com
18
- 7. ALTERNATIVES: Is there a built-in API that does this?
19
- ```
20
-
21
- ## Supply Chain Attack Red Flags
22
-
23
- ```
24
- - Recently transferred ownership
25
- - Sudden version bump with no changelog
26
- - Minified/obfuscated code in source (not just dist)
27
- - postinstall / preinstall scripts making network requests
28
- - Name similar to popular package (typosquatting)
29
- ```
5
+ When adding/updating dependencies, handling security findings, preparing releases, or reviewing supply-chain risk in PRs.
6
+
7
+ ## Objective
8
+
9
+ Produce a dependency risk decision based on exploitability and business impact, not scanner output alone.
10
+
11
+ ## Audit Workflow
12
+
13
+ 1. **Inventory**
14
+ - Identify direct and transitive dependencies changed in PR/release.
15
+ - Record package source (registry), maintainer trust indicators, and version deltas.
16
+
17
+ 2. **Scan**
18
+ - Run ecosystem-native audit tools + repository policy checks.
19
+ - Capture High/Critical findings with package path and affected components.
20
+
21
+ 3. **Exploitability Triage**
22
+ - Determine runtime reachability (is vulnerable code path invoked?).
23
+ - Evaluate exposure (public endpoint, privileged process, internal-only).
24
+ - Assess mitigations (WAF, sandbox, feature flags, auth boundaries).
25
+
26
+ 4. **Classify each finding**
27
+ - `exploitable-now` block release, fix immediately.
28
+ - `not-reachable` document evidence and add VEX status.
29
+ - `accepted-risk` → temporary exception with owner + expiry.
30
+
31
+ 5. **Remediation Plan**
32
+ - Prefer upgrade to patched version.
33
+ - If upgrade is breaking: isolate vulnerability, add compensating controls, schedule upgrade milestone.
34
+
35
+ ## Supply-Chain Red Flags
36
+
37
+ - Maintainer transfer shortly before suspicious release.
38
+ - Sudden dependency graph expansion unrelated to package purpose.
39
+ - install/postinstall scripts performing unexpected network activity.
40
+ - Obfuscated source in runtime package.
41
+ - Package source not in approved registries.
42
+
43
+ ## Output Template (required)
44
+
45
+ - Dependency name and version delta
46
+ - Severity and advisory source
47
+ - Reachability evidence
48
+ - Classification (`exploitable-now` / `not-reachable` / `accepted-risk`)
49
+ - Decision and next action
50
+ - Owner and deadline
@@ -1,5 +1,16 @@
1
+ ---
2
+ name: threat-modeling
3
+ type: skill
4
+ description: "Apply STRIDE threat modeling to system designs, identify IDOR and authorization vulnerabilities, and build threat matrices for security reviews. Use when the user designs a new system, reviews an architecture, prepares for a security audit, or asks about common API vulnerabilities like IDOR or broken access control."
5
+ related-rules:
6
+ - security-baseline.md
7
+ allowed-tools: Read, Bash
8
+ ---
9
+
1
10
  # Skill: Threat Modeling
2
11
 
12
+ > **Expertise:** STRIDE framework, IDOR prevention, authorization boundary analysis, threat matrices for API and system security reviews.
13
+
3
14
  ## When to load
4
15
 
5
16
  When designing a new system, adding an integration, reviewing an architecture, or preparing for a security review.
@@ -15,6 +26,14 @@ When designing a new system, adding an integration, reviewing an architecture, o
15
26
  | **D**enial of Service | Can the service be made unavailable? | No rate limiting on public endpoints |
16
27
  | **E**levation of Privilege | Can a low-privilege user gain higher access? | IDOR, broken object-level authorization |
17
28
 
29
+ ## Threat Modeling Workflow
30
+
31
+ 1. **Identify assets** — list sensitive data, APIs, and trust boundaries in the system
32
+ 2. **Apply STRIDE** — walk through each threat category against every asset and boundary
33
+ 3. **Score risks** — rank by likelihood × impact (Critical / High / Medium / Low)
34
+ 4. **Prioritize mitigations** — address Critical/High first; document accepted risks for Medium/Low
35
+ 5. **Validate** — verify mitigations with code review, SAST/DAST scans, or penetration testing
36
+
18
37
  ## IDOR — Most Common API Vulnerability
19
38
 
20
39
  ```python
@@ -34,3 +53,10 @@ def get_invoice(invoice_id: int, current_user: User = Depends(get_current_user))
34
53
  raise HTTPException(status_code=404) # 404, not 403
35
54
  return invoice
36
55
  ```
56
+
57
+ ## Common Mistakes
58
+
59
+ - **Returning 403 instead of 404** — reveals that the resource exists, enabling enumeration
60
+ - **Client-side authorization only** — always enforce ownership and role checks server-side
61
+ - **Missing audit logs for sensitive actions** — makes repudiation threats undetectable
62
+ - **Trusting internal service-to-service calls** — apply zero-trust; validate JWTs at every boundary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetrabbits/agentic",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Agent Intelligence Configuration CLI",
5
5
  "bin": {
6
6
  "agentic": "bin/agentic.js"