aiwg 2026.11.2 → 2026.11.3
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/agentic/code/addons/aiwg-utils/rules/sdlc-right-sizing.md +10 -0
- package/agentic/code/frameworks/forensics-complete/manifest.json +24 -1
- package/agentic/code/frameworks/forensics-complete/rules/evidence-integrity.md +1 -0
- package/agentic/code/frameworks/forensics-complete/rules/non-destructive.md +1 -0
- package/agentic/code/frameworks/forensics-complete/skills/exposure-analysis/SKILL.md +144 -0
- package/agentic/code/frameworks/forensics-complete/skills/exposure-analysis/scripts/analyze.mjs +133 -0
- package/agentic/code/frameworks/forensics-complete/skills/exposure-analysis/scripts/firewall.mjs +113 -0
- package/agentic/code/frameworks/forensics-complete/skills/forensics-quickref/SKILL.md +17 -0
- package/agentic/code/frameworks/forensics-complete/templates/investigation-plan.md +18 -18
- package/agentic/code/frameworks/media-marketing-kit/templates/advertising/ad-campaign-brief-template.md +14 -12
- package/agentic/code/frameworks/media-marketing-kit/templates/advertising/ppc-audit-template.md +8 -6
- package/agentic/code/frameworks/media-marketing-kit/templates/analytics/attribution-model-template.md +3 -1
- package/agentic/code/frameworks/media-marketing-kit/templates/analytics/campaign-report-template.md +3 -1
- package/agentic/code/frameworks/media-marketing-kit/templates/analytics/competitive-tracking-template.md +9 -7
- package/agentic/code/frameworks/media-marketing-kit/templates/analytics/kpi-dashboard-spec-template.md +3 -1
- package/agentic/code/frameworks/media-marketing-kit/templates/analytics/measurement-plan-template.md +11 -9
- package/agentic/code/frameworks/media-marketing-kit/templates/analytics/monthly-report-template.md +3 -1
- package/agentic/code/frameworks/media-marketing-kit/templates/card-metadata-standard.md +18 -9
- package/agentic/code/frameworks/media-marketing-kit/templates/creative/asset-request-template.md +18 -16
- package/agentic/code/frameworks/media-marketing-kit/templates/creative/creative-brief-template.md +12 -10
- package/agentic/code/frameworks/media-marketing-kit/templates/creative/photography-brief-template.md +14 -12
- package/agentic/code/frameworks/media-marketing-kit/templates/creative/video-production-brief-template.md +9 -7
- package/agentic/code/frameworks/media-marketing-kit/templates/events/event-planning-template.md +29 -27
- package/agentic/code/frameworks/media-marketing-kit/templates/events/event-sponsorship-template.md +17 -15
- package/agentic/code/frameworks/media-marketing-kit/templates/events/tradeshow-playbook-template.md +10 -8
- package/agentic/code/frameworks/media-marketing-kit/templates/events/webinar-brief-template.md +26 -24
- package/agentic/code/frameworks/media-marketing-kit/templates/governance/approval-workflow-template.md +15 -13
- package/agentic/code/frameworks/media-marketing-kit/templates/governance/content-audit-template.md +31 -29
- package/agentic/code/frameworks/media-marketing-kit/templates/governance/legal-review-checklist-template.md +8 -6
- package/agentic/code/frameworks/media-marketing-kit/templates/intake/audience-profile-template.md +2 -0
- package/agentic/code/frameworks/media-marketing-kit/templates/intake/campaign-intake-template.md +20 -16
- package/agentic/code/frameworks/media-marketing-kit/templates/intake/project-scope-template.md +44 -42
- package/agentic/code/frameworks/media-marketing-kit/templates/operations/agency-brief-template.md +54 -52
- package/agentic/code/frameworks/media-marketing-kit/templates/operations/asset-card.md +13 -11
- package/agentic/code/frameworks/media-marketing-kit/templates/operations/budget-tracker-template.md +2 -0
- package/agentic/code/frameworks/media-marketing-kit/templates/operations/campaign-card.md +17 -15
- package/agentic/code/frameworks/media-marketing-kit/templates/operations/content-card.md +6 -4
- package/agentic/code/frameworks/media-marketing-kit/templates/operations/vendor-brief-template.md +22 -20
- package/agentic/code/frameworks/media-marketing-kit/templates/pr-communications/crisis-response-plan-template.md +10 -8
- package/agentic/code/frameworks/media-marketing-kit/templates/pr-communications/media-kit-template.md +2 -0
- package/agentic/code/frameworks/media-marketing-kit/templates/pr-communications/press-briefing-template.md +5 -3
- package/agentic/code/frameworks/media-marketing-kit/templates/product-marketing/feature-release-brief-template.md +10 -8
- package/agentic/code/frameworks/media-marketing-kit/templates/product-marketing/product-launch-plan-template.md +10 -8
- package/agentic/code/frameworks/media-marketing-kit/templates/sales-enablement/proposal-template.md +17 -15
- package/agentic/code/frameworks/media-marketing-kit/templates/sales-enablement/roi-calculator-template.md +2 -0
- package/agentic/code/frameworks/media-marketing-kit/templates/sales-enablement/sales-deck-template.md +5 -3
- package/agentic/code/frameworks/media-marketing-kit/templates/sales-enablement/sales-playbook-template.md +8 -6
- package/agentic/code/frameworks/media-marketing-kit/templates/social/influencer-brief-template.md +20 -18
- package/agentic/code/frameworks/media-marketing-kit/templates/social/ugc-brief-template.md +8 -6
- package/agentic/code/frameworks/media-marketing-kit/templates/strategy/audience-segmentation-template.md +2 -0
- package/agentic/code/frameworks/media-marketing-kit/templates/strategy/content-calendar-template.md +2 -0
- package/agentic/code/frameworks/research-complete/templates/gap-report.md +20 -20
- package/agentic/code/frameworks/sdlc-complete/commands/address-issues.md +7 -1
- package/agentic/code/frameworks/sdlc-complete/skills/address-issues/SKILL.md +25 -19
- package/agentic/code/frameworks/sdlc-complete/skills/address-issues/references/milestone.md +208 -0
- package/agentic/code/frameworks/sdlc-complete/skills/address-issues/scripts/milestone-plan.mjs +109 -0
- package/agentic/code/frameworks/sdlc-complete/skills/sdlc-quickref/SKILL.md +7 -0
- package/agentic/code/frameworks/sdlc-complete/templates/configuration/flow-command-parameters-template.md +10 -10
- package/agentic/code/frameworks/sdlc-complete/templates/deployment/deployment-plan-template.md +3 -3
- package/agentic/code/frameworks/sdlc-complete/templates/examples/governance/adr-jwt-vs-session-complete.md +7 -7
- package/agentic/code/frameworks/sdlc-complete/templates/flow-patterns/requirements-sop-example.md +6 -6
- package/agentic/code/frameworks/sdlc-complete/templates/governance/adr-template.md +14 -14
- package/agentic/code/frameworks/sdlc-complete/templates/intake/option-matrix-template.md +10 -9
- package/agentic/code/frameworks/sdlc-complete/templates/management/epic-card.md +44 -43
- package/agentic/code/frameworks/sdlc-complete/templates/management/milestone-worker-brief.md +58 -0
- package/agentic/code/frameworks/sdlc-complete/templates/management/verification-oracle-checklist.md +55 -0
- package/agentic/code/frameworks/sdlc-complete/templates/management/work-package-card.md +6 -3
- package/agentic/code/frameworks/sdlc-complete/templates/test/regression-report.md +6 -6
- package/agentic/code/frameworks/security-engineering/manifest.json +32 -2
- package/agentic/code/frameworks/security-engineering/rules/RULES-INDEX.md +9 -2
- package/agentic/code/frameworks/security-engineering/rules/published-port-binding.md +70 -0
- package/agentic/code/frameworks/security-engineering/skills/host-hardening/SKILL.md +150 -0
- package/agentic/code/frameworks/security-engineering/skills/host-hardening/scripts/bindings.mjs +48 -0
- package/agentic/code/frameworks/security-engineering/skills/host-hardening/scripts/check.mjs +71 -0
- package/agentic/code/frameworks/security-engineering/skills/security-engineering-quickref/SKILL.md +20 -0
- package/agentic/code/plugins/agent-loop/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/agent-persistence/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/agentic-installer/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/aiwg-dev/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/aiwg-evals/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/auto-memory/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/browser-control/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/codex-sdlc/skills/address-issues/SKILL.md +25 -19
- package/agentic/code/plugins/codex-sdlc/skills/address-issues/references/milestone.md +208 -0
- package/agentic/code/plugins/codex-sdlc/skills/address-issues/scripts/milestone-plan.mjs +109 -0
- package/agentic/code/plugins/codex-sdlc/skills/sdlc-quickref/SKILL.md +7 -0
- package/agentic/code/plugins/codex-sdlc/templates/management/milestone-worker-brief.md +58 -0
- package/agentic/code/plugins/codex-sdlc/templates/management/verification-oracle-checklist.md +55 -0
- package/agentic/code/plugins/color-palette/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/compound-memory/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/context-curator/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/daemon/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/doc-intelligence/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/droid-bridge/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/forensics/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/forensics/rules/evidence-integrity.md +172 -0
- package/agentic/code/plugins/forensics/rules/non-destructive.md +213 -0
- package/agentic/code/plugins/forensics/skills/exposure-analysis/SKILL.md +144 -0
- package/agentic/code/plugins/forensics/skills/exposure-analysis/scripts/analyze.mjs +133 -0
- package/agentic/code/plugins/forensics/skills/exposure-analysis/scripts/firewall.mjs +113 -0
- package/agentic/code/plugins/forensics/skills/forensics-quickref/SKILL.md +17 -0
- package/agentic/code/plugins/guided-implementation/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/hooks/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/knowledge-base/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/line-memory/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/llm-wiki/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/marketing/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/media-curator/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/nlp-prod/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/ops/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/prose-integration/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/research/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/rlm/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/sdlc/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/sdlc/commands/address-issues.md +7 -1
- package/agentic/code/plugins/sdlc/skills/address-issues/SKILL.md +25 -19
- package/agentic/code/plugins/sdlc/skills/address-issues/references/milestone.md +208 -0
- package/agentic/code/plugins/sdlc/skills/address-issues/scripts/milestone-plan.mjs +109 -0
- package/agentic/code/plugins/sdlc/skills/sdlc-quickref/SKILL.md +7 -0
- package/agentic/code/plugins/sdlc/templates/management/milestone-worker-brief.md +58 -0
- package/agentic/code/plugins/sdlc/templates/management/verification-oracle-checklist.md +55 -0
- package/agentic/code/plugins/security-engineering/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/security-engineering/rules/published-port-binding.md +70 -0
- package/agentic/code/plugins/security-engineering/skills/host-hardening/SKILL.md +150 -0
- package/agentic/code/plugins/security-engineering/skills/host-hardening/scripts/bindings.mjs +48 -0
- package/agentic/code/plugins/security-engineering/skills/host-hardening/scripts/check.mjs +71 -0
- package/agentic/code/plugins/security-engineering/skills/security-engineering-quickref/SKILL.md +20 -0
- package/agentic/code/plugins/semantic-memory/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/skill-factory/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/star-prompt/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/testing-quality/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/twelve-factor/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/uat-mcp/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/utils/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/validation-complete/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/verbalized-sampling/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/voice/.claude-plugin/plugin.json +1 -1
- package/agentic/code/plugins/writing/.claude-plugin/plugin.json +1 -1
- package/agentic/code/providers/capability-matrix.yaml +2 -2
- package/agentic/code/providers/model-capabilities.v1.json +17 -16
- package/dist/src/cli/handlers/dataset.js +17 -0
- package/dist/src/cli/handlers/use.js +17 -3
- package/dist/src/cli/services/deployment-verification.js +1 -1
- package/dist/src/config/decision-config.js +2 -1
- package/dist/src/config/jev-credential-reference.js +56 -0
- package/dist/src/config/user-config.js +13 -19
- package/dist/src/decision/ask.js +3 -2
- package/dist/src/decision/jev-credentials.d.ts +3 -2
- package/dist/src/decision/jev-credentials.js +22 -0
- package/dist/src/decision/offload.d.ts +3 -2
- package/dist/src/decision/offload.js +1 -1
- package/dist/src/decision/openbao-kv-resolver.mjs +96 -0
- package/dist/src/decision/openbao-runtime.d.ts +6 -0
- package/dist/src/decision/openbao-runtime.js +101 -0
- package/dist/src/smiths/context-pipeline/workspace-doctor.js +4 -0
- package/dist/src/smiths/hook-bridge/factory-trust.js +56 -0
- package/docs/_manifest.json +8 -0
- package/docs/cli/sensitive-values.md +1 -1
- package/docs/dataset-orchestration.md +1 -1
- package/docs/decision/jev-quickstart.md +44 -1
- package/docs/hook-patterns.md +132 -16
- package/docs/providers/claude-direct.md +46 -19
- package/docs/providers/route-feasibility-inventory.md +1 -1
- package/docs/releases/_manifest.json +1 -0
- package/docs/releases/v2026.11.3-announcement.md +37 -0
- package/package.json +1 -1
- package/prebuilt/fortemi-core/framework/aiwg-fortemi-index-v2.json +1 -1
- package/prebuilt/fortemi-core/framework/manifest.json +5 -5
- package/prebuilt/fortemi-core/framework/source-stats.json +1 -1
- package/prebuilt/framework-relations/bindings.json +84 -5
- package/prebuilt/framework-relations/manifest.json +4 -4
- package/prebuilt/framework-relations/relations.json +189 -7
- package/tools/cli/decision-offload-report.mjs +2 -0
- package/tools/decision/openbao-kv-credential-resolver.mjs +13 -97
- package/tools/plugin/package-plugins.mjs +6 -1
- package/tools/ralph-external/lib/claude-adapter.mjs +2 -2
|
@@ -3,6 +3,7 @@ activation: summary
|
|
|
3
3
|
summary: Choose the smallest SDLC workflow and artifact set justified by the change; reserve intake and phase ceremony for work whose scope warrants them.
|
|
4
4
|
bound_to:
|
|
5
5
|
skills:
|
|
6
|
+
- address-issues
|
|
6
7
|
- flow-architecture-evolution
|
|
7
8
|
- flow-change-control
|
|
8
9
|
- flow-compliance-validation
|
|
@@ -110,6 +111,7 @@ For any work, ask: "what's the minimum that captures the decision and enables re
|
|
|
110
111
|
|---|---|
|
|
111
112
|
| Bug fix, small enhancement, docs typo, dependency bump | Commit. Maybe an issue. No ADR unless the fix encodes a non-obvious design choice. |
|
|
112
113
|
| Small feature (single component, well-bounded) | Issue. ADR only if a non-trivial design decision is made. No intake. No phase gates. |
|
|
114
|
+
| Milestone containing bounded engineering issues | `address-issues --milestone <name> --dispatch workers`; triage, briefs, independent checks, policy delivery and post-merge CI. |
|
|
113
115
|
| Medium feature (cross-component, new public surface, security implications) | Issue. ADR. Plan document if helpful. Lightweight option matrix if multiple paths considered. Intake is optional, not default. |
|
|
114
116
|
| Large feature / new addon / new framework / new track | Intake + ADR. Plan document. Use cases for the user-facing surface. Phase-gate discipline. |
|
|
115
117
|
| Refactor crossing module boundaries / architectural shift | Full SDLC: intake + Inception phase + SAD + ADRs + phase gates. |
|
|
@@ -170,6 +172,13 @@ Resist the urge to convert every issue into an intake form. Issues are lower-fri
|
|
|
170
172
|
|
|
171
173
|
### Rule 6: Right-size BEFORE launching flows
|
|
172
174
|
|
|
175
|
+
For "work through this milestone with workers", "work this milestone", or
|
|
176
|
+
"get the engineering track going", prefer the **address-issues milestone mode**.
|
|
177
|
+
Load `aiwg show skill address-issues --body`; use `--dry-run` for a triage and
|
|
178
|
+
dispatch preview. Reserve Delivery Track for a requested full iteration with
|
|
179
|
+
quality gates and iteration assessment. A handful of bounded issues needs the
|
|
180
|
+
milestone loop; it does not by itself trigger intake or phase ceremony.
|
|
181
|
+
|
|
173
182
|
Before invoking any SDLC flow command (`flow-inception-to-elaboration`, `flow-architecture-evolution`, etc.):
|
|
174
183
|
|
|
175
184
|
1. Identify the actual change shape (Rule 1 table)
|
|
@@ -183,6 +192,7 @@ The `sdlc-orchestration` rule layers this step in explicitly.
|
|
|
183
192
|
| User says | Interpret as |
|
|
184
193
|
|---|---|
|
|
185
194
|
| "fix this", "small change", "quick X", "just make it work" | Lightweight; commit + maybe issue |
|
|
195
|
+
| "work this milestone", "get the engineering track going" | Address-issues milestone mode; workers within caps, then independent verification and CI |
|
|
186
196
|
| "add feature X" without scope qualifier | Medium-default; one focused question if scope unclear |
|
|
187
197
|
| "let's plan a new addon / framework / track" | Intake-worthy if substantial |
|
|
188
198
|
| "start an intake for X" | Explicit invocation — do intake |
|
|
@@ -14,6 +14,29 @@
|
|
|
14
14
|
"templates": "templates",
|
|
15
15
|
"rules": "rules"
|
|
16
16
|
},
|
|
17
|
+
"skills": [
|
|
18
|
+
"cloud-forensics",
|
|
19
|
+
"container-forensics",
|
|
20
|
+
"evidence-preservation",
|
|
21
|
+
"exposure-analysis",
|
|
22
|
+
"forensics-acquire",
|
|
23
|
+
"forensics-hunt",
|
|
24
|
+
"forensics-investigate",
|
|
25
|
+
"forensics-ioc",
|
|
26
|
+
"forensics-profile",
|
|
27
|
+
"forensics-quickref",
|
|
28
|
+
"forensics-report",
|
|
29
|
+
"forensics-status",
|
|
30
|
+
"forensics-timeline",
|
|
31
|
+
"forensics-triage",
|
|
32
|
+
"ioc-extraction",
|
|
33
|
+
"linux-forensics",
|
|
34
|
+
"log-analysis",
|
|
35
|
+
"memory-forensics",
|
|
36
|
+
"sigma-hunting",
|
|
37
|
+
"supply-chain-forensics",
|
|
38
|
+
"target-profiling"
|
|
39
|
+
],
|
|
17
40
|
"workspace": {
|
|
18
41
|
"subdirs": [
|
|
19
42
|
"profiles",
|
|
@@ -40,7 +63,7 @@
|
|
|
40
63
|
"last_updated": "2026-02-27",
|
|
41
64
|
"total_agents": 13,
|
|
42
65
|
"total_commands": 0,
|
|
43
|
-
"total_skills":
|
|
66
|
+
"total_skills": 21,
|
|
44
67
|
"total_rules": 4,
|
|
45
68
|
"status": "active"
|
|
46
69
|
},
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
namespace: aiwg
|
|
3
|
+
name: exposure-analysis
|
|
4
|
+
platforms: [all]
|
|
5
|
+
description: Read-only firewall analysis and effective host exposure reconstruction for Docker published ports, UFW bypass, stale rules, CDN scope, IPv6 asymmetry and external probe allowlists.
|
|
6
|
+
triggers:
|
|
7
|
+
- "firewall analysis"
|
|
8
|
+
- "docker published ports"
|
|
9
|
+
- "what is reachable from the internet"
|
|
10
|
+
- "reconstruct host exposure"
|
|
11
|
+
tools: Read, Bash, Write
|
|
12
|
+
requires:
|
|
13
|
+
- operator-named host and authorized local or SSH read-only collection
|
|
14
|
+
- sanitized timestamped listener, Docker and firewall captures
|
|
15
|
+
ensures:
|
|
16
|
+
- effective exposure report with evidence hashes, limitations and pass/fail/unknown summary
|
|
17
|
+
invariants:
|
|
18
|
+
- never changes host firewall rules, services, containers or credentials
|
|
19
|
+
- unknown or incomplete evidence never proves a port closed
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Exposure Analysis
|
|
23
|
+
|
|
24
|
+
## Purpose
|
|
25
|
+
|
|
26
|
+
Relate listener inventory from `sys-host-audit` / Sys Host Profiler to host
|
|
27
|
+
firewall and Docker paths. Explain why a port is exposed, rather than trusting
|
|
28
|
+
`ufw status`. Use `container-forensics` for compromise indicators. This skill
|
|
29
|
+
produces reports and recommendations only, locally or over explicitly authorized
|
|
30
|
+
SSH. Do not install tools, elevate privileges, alter rules or probe unnamed hosts.
|
|
31
|
+
|
|
32
|
+
## Triggers
|
|
33
|
+
|
|
34
|
+
- "firewall analysis"
|
|
35
|
+
- "docker published ports"
|
|
36
|
+
- "UFW says closed but Docker publishes it"
|
|
37
|
+
- "CDN origin exposure" / "stale firewall rules"
|
|
38
|
+
|
|
39
|
+
## Behavior
|
|
40
|
+
|
|
41
|
+
1. Confirm host, interface/address inventory, capture time in UTC, permitted
|
|
42
|
+
collection scope and artifact destination (`aiwg artifacts path --json --check-write`).
|
|
43
|
+
Load `evidence-integrity`, `non-destructive`, `ops-safety` and
|
|
44
|
+
`ops-information-governance` before collection. Keep this workflow read-only
|
|
45
|
+
even when a caller asks to fix findings.
|
|
46
|
+
2. Reuse the existing host inventory when available. Within authorized scope,
|
|
47
|
+
collect bounded metadata using `ss -ltnup`, `ip -j address show`,
|
|
48
|
+
`iptables-save`, `ip6tables-save`, `ufw status numbered`,
|
|
49
|
+
`nft -j list ruleset` or `firewall-cmd --list-all-zones` as applicable.
|
|
50
|
+
Review runtime and persistent firewalld configuration separately. Record
|
|
51
|
+
permission failures as UNKNOWN; never interpret a failed command as no rules.
|
|
52
|
+
For SSH use the operator-named host with batch mode and a bounded connect
|
|
53
|
+
timeout; no fleet expansion or private configuration searches.
|
|
54
|
+
3. Narrow Docker inspection to Name, NetworkMode, PortBindings,
|
|
55
|
+
NetworkSettings.Ports and Networks. NEVER capture full `docker inspect`,
|
|
56
|
+
process environments, datastore secrets, private keys or container Env.
|
|
57
|
+
Route collected bytes through the existing information-governance boundary
|
|
58
|
+
before terminal, artifact or report emission. Operator-held raw evidence is
|
|
59
|
+
hashed at acquisition; sanitized derivatives have separate hashes and custody
|
|
60
|
+
links. The helper only accepts already sanitized snapshots.
|
|
61
|
+
4. Classify every listener by address family, protocol and bind scope:
|
|
62
|
+
loopback, private, named VPN address, all interfaces, public or unknown.
|
|
63
|
+
Record owning process/PID from ss and correlate its unit/container using
|
|
64
|
+
approved inventory metadata. Missing process/unit ownership stays unknown.
|
|
65
|
+
5. Trace new inbound traffic in actual rule order. Docker rootful bridge traffic
|
|
66
|
+
normally traverses PREROUTING DNAT → FORWARD → DOCKER-USER → DOCKER.
|
|
67
|
+
INPUT/UFW denies do not protect this forwarding path. Include earlier raw,
|
|
68
|
+
mangle and native nft hooks, interface matches, conntrack and default policies.
|
|
69
|
+
Record each rule's listener/publish match; flag missing bind addresses, empty
|
|
70
|
+
DOCKER-USER guards, unused allows, earlier covering terminal rules, public-IP
|
|
71
|
+
allow-all and CDN ranges permitting ports beyond the reviewed 80/443 scope.
|
|
72
|
+
A stale rule is a review candidate: check socket activation, maintenance and
|
|
73
|
+
standby services before recommending removal.
|
|
74
|
+
6. Review IPv4 and IPv6 independently, including IPv6 Docker publishing,
|
|
75
|
+
wildcard dual-stack sockets and differing defaults. Different family rules
|
|
76
|
+
are a review signal, not proof of equivalent reachability. Never infer IPv6
|
|
77
|
+
closure from an IPv4-only capture.
|
|
78
|
+
7. External verification is optional and requires the operator to name the
|
|
79
|
+
vantage, source addresses, target and bounded port set. Compare the probe's
|
|
80
|
+
actual public egress/NAT source to all source allowlists, including CDN/VPN
|
|
81
|
+
and both address families. If the source matches an allow rule, explicitly
|
|
82
|
+
warn that a closed result proves nothing about ordinary internet sources.
|
|
83
|
+
A clean probe is still limited to that vantage/protocol/time. The helper
|
|
84
|
+
consumes supplied results; it never launches probes.
|
|
85
|
+
8. Hash-check evidence before analysis and again before report finalization.
|
|
86
|
+
Include capture times, commands, collection failures, custody links and
|
|
87
|
+
rule paths. For "reachable on date X", use dated config history/backups
|
|
88
|
+
with their own hashes and distinguish reconstructed historical configuration
|
|
89
|
+
from observed reachability; today's captures cannot establish past exposure.
|
|
90
|
+
|
|
91
|
+
## Offline helper
|
|
92
|
+
|
|
93
|
+
Run the bundled helper against an operator-supplied JSON snapshot:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
node "$AIWG_ROOT/agentic/code/frameworks/forensics-complete/skills/exposure-analysis/scripts/analyze.mjs" --snapshot sanitized-snapshot.json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Required metadata: `host`, `capturedAt` (ISO UTC). Capture fields are strings:
|
|
100
|
+
`ss`, `docker` (JSON array of narrowed inspect records), `iptables4`,
|
|
101
|
+
`iptables6`, `ufw`. Supply `ingressInterface`, `vpnAddresses`, `cdnRanges`
|
|
102
|
+
(operator-reviewed CIDRs), and `hashes` mapping capture names to acquisition
|
|
103
|
+
SHA-256 values. Omitted hashes are explicitly unverified; a supplied mismatch
|
|
104
|
+
stops analysis. Optional `external` entries contain `source`, `port`, `protocol`,
|
|
105
|
+
`result`, capture time and vantage identity.
|
|
106
|
+
|
|
107
|
+
The helper supports ordered iptables/ip6tables filter and DNAT paths with
|
|
108
|
+
simple source/destination, protocol, port, interface and NEW-state selectors.
|
|
109
|
+
Unsupported selectors/chains, extra hook tables, native nftables/firewalld,
|
|
110
|
+
rootless/userland proxies and routed/host networks require manual analysis;
|
|
111
|
+
helper verdicts remain UNKNOWN. A host-path verdict never establishes upstream
|
|
112
|
+
internet routing or cloud controls. Do not represent the helper as a complete
|
|
113
|
+
Linux firewall evaluator. Cloud/Kubernetes controls are out of scope; attach
|
|
114
|
+
separately reviewed adapter findings to the existing network-audit report.
|
|
115
|
+
|
|
116
|
+
## Examples
|
|
117
|
+
|
|
118
|
+
Input: `-p 6379:6379`, UFW deny 6379, matching DNAT and forwarding accepts,
|
|
119
|
+
empty DOCKER-USER. Output: **internet-reachable via Docker** on the captured
|
|
120
|
+
host path; `docker-ufw-bypass`, `missing-bind`, `empty-docker-user` findings.
|
|
121
|
+
A DOCKER-USER DROP before the Docker accept instead reports the captured path
|
|
122
|
+
blocked. An unused 5432 allow is stale; a CDN source allowing all ports is
|
|
123
|
+
`over-broad-cdn`. See sanitized fixtures in `test/fixtures/host-exposure/`.
|
|
124
|
+
|
|
125
|
+
## Output and recurring checks
|
|
126
|
+
|
|
127
|
+
Use the existing `network-audit-report` template for the human report, storing
|
|
128
|
+
it under the resolved `.aiwg/forensics/reports/` and evidence/custody under
|
|
129
|
+
`.aiwg/forensics/evidence/`. The helper writes JSON only to stdout; caller owns
|
|
130
|
+
sanitization and artifact routing. Include a compact operations-log record:
|
|
131
|
+
`host, capturedAt, status, failed, unknown, report reference`.
|
|
132
|
+
Exit codes: 0 PASS, 2 FAIL, 3 UNKNOWN, 1 input/integrity error. Alert on any
|
|
133
|
+
nonzero result, not only FAIL. Post-deploy and monthly callers use existing
|
|
134
|
+
operator scheduling; every run needs fresh captures. No timer or service is
|
|
135
|
+
installed by this skill.
|
|
136
|
+
|
|
137
|
+
## References
|
|
138
|
+
|
|
139
|
+
- ../../rules/evidence-integrity.md
|
|
140
|
+
- ../../rules/non-destructive.md
|
|
141
|
+
- ../../../ops-complete/rules/ops-safety.md
|
|
142
|
+
- ../container-forensics/SKILL.md
|
|
143
|
+
- ../../../../extensions/net/templates/network-audit-report.md
|
|
144
|
+
- ../../../security-engineering/skills/host-hardening/SKILL.md
|
package/agentic/code/frameworks/forensics-complete/skills/exposure-analysis/scripts/analyze.mjs
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Reconstruct exposure from operator-supplied sanitized captures without host access.
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { isIP } from 'node:net';
|
|
6
|
+
import { inRange, scope, parseFirewall, trace, listeners } from './firewall.mjs';
|
|
7
|
+
|
|
8
|
+
export function analyze(data) {
|
|
9
|
+
if (!data.host || !Number.isFinite(Date.parse(data.capturedAt))) throw new Error('host and ISO capturedAt are required');
|
|
10
|
+
const findings = [];
|
|
11
|
+
const add = (code, detail, extra = {}) => findings.push({ code, detail, ...extra });
|
|
12
|
+
const evidence = {};
|
|
13
|
+
for (const key of ['ss', 'docker', 'iptables4', 'iptables6', 'ufw', 'nftables', 'firewalld']) {
|
|
14
|
+
if (typeof data[key] === 'string') {
|
|
15
|
+
const sha256 = createHash('sha256').update(data[key]).digest('hex');
|
|
16
|
+
if (data.hashes?.[key] && data.hashes[key] !== sha256) throw new Error(`Integrity mismatch for ${key}`);
|
|
17
|
+
evidence[key] = { sha256, verification: data.hashes?.[key] ? 'matched supplied collection hash' : 'collection hash not supplied' };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const sockets = listeners(data.ss, data.vpnAddresses ?? []);
|
|
21
|
+
const firewalls = { 4: parseFirewall(data.iptables4, 4), 6: parseFirewall(data.iptables6, 6) };
|
|
22
|
+
const rules = Object.values(firewalls).flatMap(firewall => firewall.rules);
|
|
23
|
+
for (const [key, code] of [['ss', 'missing-listener-evidence'], ['docker', 'missing-docker-evidence'],
|
|
24
|
+
['iptables4', 'missing-ipv4-evidence'], ['iptables6', 'missing-ipv6-evidence']]) {
|
|
25
|
+
if (!data[key]) add(code, `${key} unavailable; absence is not proof of closure`);
|
|
26
|
+
}
|
|
27
|
+
if (data.nftables || data.firewalld) add('manual-backend-review', 'Native nftables/firewalld order and hook priorities need manual correlation; automated verdicts are unknown');
|
|
28
|
+
const containers = JSON.parse(data.docker ?? '[]');
|
|
29
|
+
const exposures = [];
|
|
30
|
+
for (const container of containers) {
|
|
31
|
+
for (const [containerPort, bindings] of Object.entries(container.NetworkSettings?.Ports ?? {})) {
|
|
32
|
+
if (!bindings) continue;
|
|
33
|
+
const [targetPort, protocol] = containerPort.split('/');
|
|
34
|
+
for (const binding of bindings) {
|
|
35
|
+
const address = binding.HostIp ?? '';
|
|
36
|
+
const family = isIP(address) || 4;
|
|
37
|
+
const port = Number(binding.HostPort);
|
|
38
|
+
const firewall = firewalls[family];
|
|
39
|
+
const bindScope = scope(address, data.vpnAddresses ?? []);
|
|
40
|
+
const requested = container.HostConfig?.PortBindings?.[containerPort] ?? [];
|
|
41
|
+
if (!address || requested.some(entry => !entry.HostIp)) add('missing-bind', 'Publish omitted a bind address', { port, family });
|
|
42
|
+
const guard = firewall.tables.filter?.['DOCKER-USER'];
|
|
43
|
+
if (!guard || guard.rules.every(rule => rule.target === 'RETURN')) add('empty-docker-user', 'DOCKER-USER has no effective guard', { family, port });
|
|
44
|
+
const packet = { port, protocol, source: '*', destination: scope(address) === 'all-interfaces' ? '*' : address, input: data.ingressInterface };
|
|
45
|
+
const nat = trace(firewall, 'nat', 'PREROUTING', packet);
|
|
46
|
+
const translated = nat.rule?.dnat?.match(/^(?:\[([^\]]+)\]|([^:]+)):(\d+)$/);
|
|
47
|
+
const destination = translated?.[1] ?? translated?.[2];
|
|
48
|
+
const networkAddresses = Object.values(container.NetworkSettings?.Networks ?? {}).flatMap(network => [network.IPAddress, network.GlobalIPv6Address]);
|
|
49
|
+
const forward = trace(firewall, 'filter', 'FORWARD', { ...packet, destination, port: Number(translated?.[3]) });
|
|
50
|
+
let verdict = 'unknown';
|
|
51
|
+
const unsupported = data.nftables || data.firewalld || Object.keys(firewall.tables).some(table => !['filter', 'nat'].includes(table));
|
|
52
|
+
if (!unsupported && nat.verdict === 'DNAT' && Number(translated?.[3]) === Number(targetPort) && networkAddresses.includes(destination)) {
|
|
53
|
+
if (['DROP', 'REJECT'].includes(forward.verdict)) verdict = 'blocked on captured host path';
|
|
54
|
+
if (forward.verdict === 'ACCEPT' && ['all-interfaces', 'public'].includes(bindScope)) verdict = 'internet-reachable via Docker';
|
|
55
|
+
if (forward.verdict === 'ACCEPT' && ['private', 'vpn', 'loopback'].includes(bindScope)) verdict = 'restricted bind; routing requires review';
|
|
56
|
+
}
|
|
57
|
+
const entry = { container: container.Name, port, protocol, address, family, scope: bindScope,
|
|
58
|
+
verdict, path: [...nat.path, ...forward.path], limitation: 'Captured host path only; upstream routing and cloud controls unverified' };
|
|
59
|
+
exposures.push(entry);
|
|
60
|
+
const input = trace(firewall, 'filter', 'INPUT', packet);
|
|
61
|
+
const ufwDeny = (data.ufw ?? '').split('\n').some(line => new RegExp(`^${port}(?:/${protocol})?\\s+DENY`).test(line));
|
|
62
|
+
if (verdict === 'internet-reachable via Docker' && (ufwDeny || ['DROP', 'REJECT'].includes(input.verdict))) {
|
|
63
|
+
add('docker-ufw-bypass', 'UFW/INPUT deny is bypassed by Docker DNAT and FORWARD', { port, family });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
for (const rule of rules) {
|
|
69
|
+
if (rule.target === 'ACCEPT' && rule.port && /^\d+$/.test(rule.port) && rule.chain === 'INPUT' && data.ss) {
|
|
70
|
+
const active = sockets.some(socket => (socket.family === rule.family || socket.family === 0) && socket.port === Number(rule.port)
|
|
71
|
+
&& (!rule.protocol || socket.protocol === rule.protocol));
|
|
72
|
+
const published = exposures.some(entry => entry.family === rule.family && entry.port === Number(rule.port));
|
|
73
|
+
if (!active && !published) add('stale-rule', 'No captured listener or publish; validate standby/activation before removal', { port: Number(rule.port), family: rule.family, rule: rule.raw });
|
|
74
|
+
}
|
|
75
|
+
if (rule.target === 'ACCEPT' && rule.source && !rule.port && !rule.unknown) {
|
|
76
|
+
if ((data.cdnRanges ?? []).includes(rule.source)) add('over-broad-cdn', 'CDN source range permits all ports; recommend reviewed 80/443 scope', { rule: rule.raw });
|
|
77
|
+
else if (['public', 'all-interfaces'].includes(scope(rule.source.split('/')[0]))) add('over-broad-source', 'Public source permits all ports', { rule: rule.raw });
|
|
78
|
+
}
|
|
79
|
+
const chainRules = firewalls[rule.family].tables[rule.table][rule.chain].rules;
|
|
80
|
+
const earlier = chainRules.slice(0, chainRules.indexOf(rule));
|
|
81
|
+
const selectors = ['source', 'destination', 'protocol', 'port', 'input', 'output', 'state', 'dstType'];
|
|
82
|
+
if (!rule.unknown && earlier.some(first => !first.unknown && ['ACCEPT', 'DROP', 'REJECT'].includes(first.target)
|
|
83
|
+
&& selectors.every(key => !first[key] || first[key] === rule[key]))) add('shadowed-rule', 'Earlier terminal rule covers these selectors', { family: rule.family, rule: rule.raw });
|
|
84
|
+
}
|
|
85
|
+
if (data.iptables4 && data.iptables6) {
|
|
86
|
+
const signature = family => JSON.stringify({ policy: firewalls[family].tables.filter?.INPUT?.policy,
|
|
87
|
+
rules: rules.filter(rule => rule.family === family && rule.table === 'filter').map(rule => rule.raw) });
|
|
88
|
+
if (signature(4) !== signature(6)) add('v4-v6-asymmetry', 'IPv4/IPv6 policy or rule coverage differs; review family-specific listener reachability');
|
|
89
|
+
}
|
|
90
|
+
const hostExposures = sockets.flatMap(socket => {
|
|
91
|
+
const families = socket.family ? [socket.family] : [4, 6];
|
|
92
|
+
return families.map(family => {
|
|
93
|
+
const firewall = firewalls[family];
|
|
94
|
+
const packet = { port: socket.port, protocol: socket.protocol, source: '*',
|
|
95
|
+
destination: socket.scope === 'all-interfaces' ? '*' : socket.address, input: data.ingressInterface };
|
|
96
|
+
const result = trace(firewall, 'filter', 'INPUT', packet);
|
|
97
|
+
const unsupported = data.nftables || data.firewalld || Object.keys(firewall.tables).some(table => !['filter', 'nat'].includes(table));
|
|
98
|
+
const verdict = unsupported ? 'unknown' : ['loopback', 'vpn', 'private'].includes(socket.scope) ? 'restricted bind; routing requires review'
|
|
99
|
+
: result.verdict === 'ACCEPT' ? 'accepted on captured host path'
|
|
100
|
+
: ['DROP', 'REJECT'].includes(result.verdict) ? 'blocked on captured host path' : 'unknown';
|
|
101
|
+
return { ...socket, family, verdict, path: result.path };
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
const policies = Object.entries(firewalls).flatMap(([family, firewall]) => Object.entries(firewall.tables).flatMap(([table, chains]) =>
|
|
105
|
+
Object.entries(chains).filter(([, body]) => body.policy !== '-').map(([chain, body]) =>
|
|
106
|
+
({ family: Number(family), table, chain, type: 'policy', target: body.policy }))));
|
|
107
|
+
const mappedRules = rules.map(rule => ({ ...rule, listenerMatches: sockets.filter(socket =>
|
|
108
|
+
(socket.family === rule.family || !socket.family) && (!rule.port || Number(rule.port) === socket.port)
|
|
109
|
+
&& (!rule.protocol || rule.protocol === socket.protocol)).map(socket => `${socket.address}:${socket.port}/${socket.protocol}`) }));
|
|
110
|
+
const external = (data.external ?? []).map(probe => {
|
|
111
|
+
const family = isIP(probe.source);
|
|
112
|
+
const allow = rules.find(rule => rule.family === family && rule.target === 'ACCEPT' && rule.source
|
|
113
|
+
&& !['0.0.0.0/0', '::/0'].includes(rule.source) && inRange(probe.source, rule.source));
|
|
114
|
+
if (allow) add('allowlisted-vantage', 'Probe source matches an allowlist; external coverage is unrepresentative', { family, port: probe.port });
|
|
115
|
+
return { ...probe, provesClosed: false, reason: allow
|
|
116
|
+
? 'Probe source matches an allowlist; closed result proves nothing about ordinary internet sources'
|
|
117
|
+
: 'Result is limited to this vantage, protocol, port and capture time; it cannot prove general closure' };
|
|
118
|
+
});
|
|
119
|
+
const unknown = findings.filter(finding => /missing-.*evidence|manual-backend/.test(finding.code)).length + exposures.filter(entry => entry.verdict === 'unknown').length;
|
|
120
|
+
const failed = findings.length - findings.filter(finding => /missing-.*evidence|manual-backend/.test(finding.code)).length;
|
|
121
|
+
return { host: data.host, capturedAt: data.capturedAt, mode: 'read-only', evidence,
|
|
122
|
+
listeners: sockets, rules: [...mappedRules, ...policies], exposures, hostExposures, findings, external,
|
|
123
|
+
summary: { status: failed ? 'FAIL' : unknown ? 'UNKNOWN' : 'PASS', failed, unknown } };
|
|
124
|
+
}
|
|
125
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
126
|
+
try {
|
|
127
|
+
const args = process.argv.slice(2);
|
|
128
|
+
if (args.length !== 2 || args[0] !== '--snapshot') throw new Error('Usage: analyze.mjs --snapshot sanitized-snapshot.json');
|
|
129
|
+
const report = analyze(JSON.parse(readFileSync(args[1], 'utf8')));
|
|
130
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
131
|
+
process.exitCode = report.summary.status === 'FAIL' ? 2 : report.summary.status === 'UNKNOWN' ? 3 : 0;
|
|
132
|
+
} catch (error) { process.stderr.write(`${error.message}\n`); process.exitCode = 1; }
|
|
133
|
+
}
|
package/agentic/code/frameworks/forensics-complete/skills/exposure-analysis/scripts/firewall.mjs
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Parse captured iptables rules and conservatively trace a new inbound packet.
|
|
2
|
+
import { isIP } from 'node:net';
|
|
3
|
+
|
|
4
|
+
function addressNumber(address) {
|
|
5
|
+
if (isIP(address) === 4) return address.split('.').reduce((n, part) => (n << 8n) + BigInt(part), 0n);
|
|
6
|
+
if (isIP(address) !== 6) return undefined;
|
|
7
|
+
let text = address;
|
|
8
|
+
if (text.includes('.')) {
|
|
9
|
+
const split = text.lastIndexOf(':');
|
|
10
|
+
const v4 = addressNumber(text.slice(split + 1));
|
|
11
|
+
text = `${text.slice(0, split)}:${(v4 >> 16n).toString(16)}:${(v4 & 65535n).toString(16)}`;
|
|
12
|
+
}
|
|
13
|
+
const halves = text.split('::');
|
|
14
|
+
const left = halves[0] ? halves[0].split(':') : [];
|
|
15
|
+
const right = halves[1] ? halves[1].split(':') : [];
|
|
16
|
+
const groups = halves.length === 2 ? [...left, ...Array(8 - left.length - right.length).fill('0'), ...right] : left;
|
|
17
|
+
return groups.reduce((n, group) => (n << 16n) + BigInt(`0x${group}`), 0n);
|
|
18
|
+
}
|
|
19
|
+
export function inRange(address, cidr) {
|
|
20
|
+
const [base, mask] = cidr.split('/');
|
|
21
|
+
const family = isIP(base);
|
|
22
|
+
if (!family || isIP(address) !== family) return false;
|
|
23
|
+
const bits = family === 4 ? 32 : 128;
|
|
24
|
+
const prefix = mask === undefined ? bits : Number(mask);
|
|
25
|
+
if (!Number.isInteger(prefix) || prefix < 0 || prefix > bits) return false;
|
|
26
|
+
const shift = BigInt(bits - prefix);
|
|
27
|
+
return addressNumber(address) >> shift === addressNumber(base) >> shift;
|
|
28
|
+
}
|
|
29
|
+
export function scope(address, vpn = []) {
|
|
30
|
+
if (vpn.includes(address)) return 'vpn';
|
|
31
|
+
if (['*', '0.0.0.0', '::', ''].includes(address)) return 'all-interfaces';
|
|
32
|
+
if (inRange(address, '127.0.0.0/8') || address === '::1') return 'loopback';
|
|
33
|
+
if (['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', '169.254.0.0/16', 'fc00::/7', 'fe80::/10'].some(range => inRange(address, range))) return 'private';
|
|
34
|
+
return isIP(address) ? 'public' : 'unknown';
|
|
35
|
+
}
|
|
36
|
+
export function parseFirewall(raw, family) {
|
|
37
|
+
const tables = {};
|
|
38
|
+
const rules = [];
|
|
39
|
+
let table;
|
|
40
|
+
for (const line of (raw ?? '').split('\n')) {
|
|
41
|
+
if (line.startsWith('*')) { table = line.slice(1); tables[table] = {}; }
|
|
42
|
+
if (line.startsWith(':') && table) {
|
|
43
|
+
const [name, policy] = line.slice(1).split(/\s+/);
|
|
44
|
+
tables[table][name] = { policy, rules: [] };
|
|
45
|
+
}
|
|
46
|
+
if (!line.startsWith('-A ') || !table) continue;
|
|
47
|
+
const tokens = line.match(/"[^"]*"|\S+/g) ?? [];
|
|
48
|
+
const rule = { family, table, chain: tokens[1], raw: line, unknown: false };
|
|
49
|
+
for (let i = 2; i < tokens.length; i++) {
|
|
50
|
+
const token = tokens[i];
|
|
51
|
+
const fields = { '-s': 'source', '-d': 'destination', '-p': 'protocol', '--dport': 'port',
|
|
52
|
+
'-j': 'target', '--to-destination': 'dnat', '-i': 'input', '-o': 'output', '--ctstate': 'state', '--dst-type': 'dstType' };
|
|
53
|
+
if (fields[token]) rule[fields[token]] = tokens[++i];
|
|
54
|
+
else if (token === '-m') { if (!['tcp', 'udp', 'conntrack', 'addrtype', 'comment'].includes(tokens[++i])) rule.unknown = true; }
|
|
55
|
+
else if (token === '--comment') i++;
|
|
56
|
+
else rule.unknown = true;
|
|
57
|
+
}
|
|
58
|
+
if (!tables[table][rule.chain]) tables[table][rule.chain] = { policy: '-', rules: [] };
|
|
59
|
+
tables[table][rule.chain].rules.push(rule);
|
|
60
|
+
rules.push(rule);
|
|
61
|
+
}
|
|
62
|
+
return { tables, rules };
|
|
63
|
+
}
|
|
64
|
+
function match(rule, packet) {
|
|
65
|
+
let unknown = rule.unknown;
|
|
66
|
+
for (const key of ['source', 'destination']) {
|
|
67
|
+
if (!rule[key] || ['0.0.0.0/0', '::/0'].includes(rule[key])) continue;
|
|
68
|
+
if (!packet[key] || packet[key] === '*') unknown = true;
|
|
69
|
+
else if (!inRange(packet[key], rule[key])) return false;
|
|
70
|
+
}
|
|
71
|
+
if (rule.protocol && rule.protocol !== 'all' && rule.protocol !== packet.protocol) return false;
|
|
72
|
+
if (rule.port) {
|
|
73
|
+
if (!/^\d+$/.test(rule.port)) unknown = true;
|
|
74
|
+
else if (Number(rule.port) !== packet.port) return false;
|
|
75
|
+
}
|
|
76
|
+
for (const key of ['input', 'output']) {
|
|
77
|
+
if (!rule[key]) continue;
|
|
78
|
+
if (!packet[key]) unknown = true;
|
|
79
|
+
else if (rule[key] !== packet[key]) return false;
|
|
80
|
+
}
|
|
81
|
+
if (rule.state && !rule.state.split(',').includes('NEW')) return false;
|
|
82
|
+
if (rule.dstType && rule.dstType !== 'LOCAL') unknown = true;
|
|
83
|
+
return unknown ? 'unknown' : true;
|
|
84
|
+
}
|
|
85
|
+
export function trace(firewall, table, chain, packet, seen = []) {
|
|
86
|
+
const name = `${table}/${chain}`;
|
|
87
|
+
const path = [name];
|
|
88
|
+
const body = firewall.tables[table]?.[chain];
|
|
89
|
+
if (!body || seen.includes(name)) return { verdict: 'UNKNOWN', path };
|
|
90
|
+
for (const rule of body.rules) {
|
|
91
|
+
const matches = match(rule, packet);
|
|
92
|
+
if (matches === false) continue;
|
|
93
|
+
if (matches === 'unknown') return { verdict: 'UNKNOWN', path };
|
|
94
|
+
const target = rule.target;
|
|
95
|
+
if (['ACCEPT', 'DROP', 'REJECT', 'RETURN', 'DNAT'].includes(target)) return { verdict: target, path, rule };
|
|
96
|
+
if (['LOG', 'NFLOG'].includes(target)) continue;
|
|
97
|
+
const nested = trace(firewall, table, target, packet, [...seen, name]);
|
|
98
|
+
path.push(...nested.path);
|
|
99
|
+
if (nested.verdict !== 'RETURN') return { ...nested, path };
|
|
100
|
+
}
|
|
101
|
+
return { verdict: body.policy === '-' ? 'RETURN' : body.policy, path };
|
|
102
|
+
}
|
|
103
|
+
export function listeners(raw, vpn) {
|
|
104
|
+
return (raw ?? '').split('\n').flatMap(line => {
|
|
105
|
+
const columns = line.trim().split(/\s+/);
|
|
106
|
+
if (!['tcp', 'udp'].includes(columns[0]) || !['LISTEN', 'UNCONN'].includes(columns[1])) return [];
|
|
107
|
+
const endpoint = columns[4]?.match(/^(?:\[([^\]]+)\]|(.+)):(\d+)$/);
|
|
108
|
+
if (!endpoint) return [];
|
|
109
|
+
const address = endpoint[1] ?? endpoint[2];
|
|
110
|
+
return [{ protocol: columns[0], address, port: Number(endpoint[3]), family: isIP(address) || 0,
|
|
111
|
+
scope: scope(address, vpn), owner: line.match(/users:\(\((.*)\)\)/)?.[1] ?? 'unknown' }];
|
|
112
|
+
});
|
|
113
|
+
}
|
|
@@ -46,6 +46,8 @@ Digital forensics & incident response. RFC 3227-aligned triage, multi-source tim
|
|
|
46
46
|
| **Threat hunting** | Sigma rule application across log sources |
|
|
47
47
|
| **Reporting** | Investigation reports with evidence, timeline reconstruction |
|
|
48
48
|
|
|
49
|
+
| **Host exposure** | Listener/firewall/Docker correlation, stale and over-broad rules, IPv6 and probe allowlists |
|
|
50
|
+
|
|
49
51
|
## Curated discovery phrases
|
|
50
52
|
|
|
51
53
|
### Triage & acquisition
|
|
@@ -67,6 +69,21 @@ aiwg discover "container forensics" # → container-forensics
|
|
|
67
69
|
aiwg discover "supply chain compromise" # → supply-chain-forensics
|
|
68
70
|
```
|
|
69
71
|
|
|
72
|
+
### Host exposure reconstruction
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
aiwg discover "firewall analysis" # → exposure-analysis
|
|
76
|
+
aiwg discover "docker published ports" # → exposure-analysis
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`exposure-analysis` is read-only. It correlates listeners, ordered host firewall
|
|
80
|
+
rules, Docker DNAT/FORWARD paths, IPv4/IPv6 and probe-source allowlists. The
|
|
81
|
+
bundled offline helper consumes sanitized captures and emits evidence hashes
|
|
82
|
+
plus PASS/FAIL/UNKNOWN summaries for post-deploy and monthly operator checks.
|
|
83
|
+
Unsupported native firewall semantics require manual review. Route preventive
|
|
84
|
+
baseline and remediation recommendations to `security-engineering/host-hardening`;
|
|
85
|
+
neither skill changes host firewall rules or services.
|
|
86
|
+
|
|
70
87
|
### Investigation orchestration
|
|
71
88
|
|
|
72
89
|
```bash
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
|
|
57
57
|
## Investigation Phases
|
|
58
58
|
|
|
59
|
-
Check each phase as completed.
|
|
59
|
+
Check each phase as completed. Name the evidence scope and verification gate; retain observed incident timestamps separately.
|
|
60
60
|
|
|
61
|
-
| Phase | Description |
|
|
61
|
+
| Phase | Description | Scope Units | Status | Completion Gate |
|
|
62
62
|
|-------|-------------|-----------|--------|-------------|
|
|
63
|
-
| 1 | Initial Triage | `{{
|
|
64
|
-
| 2 | User and Authentication Analysis | `{{
|
|
65
|
-
| 3 | Process and Service Audit | `{{
|
|
66
|
-
| 4 | Persistence Mechanism Sweep | `{{
|
|
67
|
-
| 5 | Filesystem and Artifact Analysis | `{{
|
|
68
|
-
| 6 | Network Forensics | `{{
|
|
69
|
-
| 7 | Log Analysis and Timeline | `{{
|
|
70
|
-
| 8 | Container / Docker Audit | `{{
|
|
71
|
-
| 9 | Evidence Collection and Preservation | `{{
|
|
72
|
-
| 10 | Reporting | `{{
|
|
63
|
+
| 1 | Initial Triage | `{{triage_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
64
|
+
| 2 | User and Authentication Analysis | `{{auth_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
65
|
+
| 3 | Process and Service Audit | `{{process_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
66
|
+
| 4 | Persistence Mechanism Sweep | `{{persistence_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
67
|
+
| 5 | Filesystem and Artifact Analysis | `{{filesystem_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
68
|
+
| 6 | Network Forensics | `{{network_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
69
|
+
| 7 | Log Analysis and Timeline | `{{logs_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
70
|
+
| 8 | Container / Docker Audit | `{{containers_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
71
|
+
| 9 | Evidence Collection and Preservation | `{{evidence_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
72
|
+
| 10 | Reporting | `{{reporting_scope}}` | [ ] Not started | `{{evidence_verified_or_not_applicable}}` |
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
@@ -359,10 +359,10 @@ If any of the following are discovered, immediately pause investigation and noti
|
|
|
359
359
|
|
|
360
360
|
## Reporting Requirements
|
|
361
361
|
|
|
362
|
-
| Deliverable | Format | Recipient |
|
|
362
|
+
| Deliverable | Format | Recipient | Handoff Gate |
|
|
363
363
|
|-------------|--------|-----------|----------|
|
|
364
|
-
| Preliminary findings | Verbal / brief written | `{{primary_recipient}}` |
|
|
365
|
-
| Draft forensic report | Markdown / PDF | `{{report_recipients}}` | `{{
|
|
366
|
-
| Final forensic report | `{{report_format}}` | `{{report_recipients}}` | `{{
|
|
367
|
-
| IOC register | YAML + CSV | `{{ioc_recipients}}` | `{{
|
|
368
|
-
| Remediation plan | Markdown | `{{remediation_recipients}}` | `{{
|
|
364
|
+
| Preliminary findings | Verbal / brief written | `{{primary_recipient}}` | Triage findings verified |
|
|
365
|
+
| Draft forensic report | Markdown / PDF | `{{report_recipients}}` | `{{evidence_index_verified}}` |
|
|
366
|
+
| Final forensic report | `{{report_format}}` | `{{report_recipients}}` | `{{report_review_approved}}` |
|
|
367
|
+
| IOC register | YAML + CSV | `{{ioc_recipients}}` | `{{ioc_validation_passed}}` |
|
|
368
|
+
| Remediation plan | Markdown | `{{remediation_recipients}}` | `{{findings_prioritized_and_owned}}` |
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Advertising Campaign Brief
|
|
2
2
|
|
|
3
|
+
> **Planning basis**: Plan work in scope units, roles, passes, and completion gates. Dates are operator-supplied commitments with a source (leave unset if unknown), or observed chronology; customer/event dates, media lengths, service timings, and measurement windows are separate from work estimates. See [Card Metadata Standard](../card-metadata-standard.md).
|
|
4
|
+
|
|
3
5
|
**Card ID**: `ADV-{PROJECT}-{NNNN}`
|
|
4
6
|
**Version**: 1.0
|
|
5
7
|
**Status**: Draft | In Review | Approved | Active | Complete
|
|
@@ -30,15 +32,15 @@
|
|
|
30
32
|
| Agency fees | ${Amount} | {%} |
|
|
31
33
|
| **Total** | **${Amount}** | **100%** |
|
|
32
34
|
|
|
33
|
-
###
|
|
35
|
+
### Scope and Gates
|
|
34
36
|
|
|
35
|
-
| Phase |
|
|
37
|
+
| Phase | Scope Units | Responsible Role | Completion Gate |
|
|
36
38
|
|-------|-------|-----|----------|
|
|
37
|
-
| Planning |
|
|
38
|
-
| Creative development |
|
|
39
|
-
| Production |
|
|
40
|
-
| Campaign flight |
|
|
41
|
-
| Reporting |
|
|
39
|
+
| Planning | Brief and audience definition | Campaign lead | Brief approved |
|
|
40
|
+
| Creative development | Concepts and copy variants | Creative lead | Direction approved |
|
|
41
|
+
| Production | Channel asset set | Designer and reviewer | Specs and brand checks pass |
|
|
42
|
+
| Campaign flight | Approved placements | Media buyer | Tracking verified before activation |
|
|
43
|
+
| Reporting | Campaign analysis | Analyst | Metrics reconciled and reviewed |
|
|
42
44
|
|
|
43
45
|
---
|
|
44
46
|
|
|
@@ -176,12 +178,12 @@
|
|
|
176
178
|
|
|
177
179
|
### Creative Deliverables
|
|
178
180
|
|
|
179
|
-
| Deliverable |
|
|
181
|
+
| Deliverable | Completion Gate | Owner |
|
|
180
182
|
|-------------|----------|-------|
|
|
181
|
-
| Creative brief |
|
|
182
|
-
| Concepts |
|
|
183
|
-
| First draft |
|
|
184
|
-
| Final creative |
|
|
183
|
+
| Creative brief | [Acceptance checks for Creative brief pass] | {Name} |
|
|
184
|
+
| Concepts | [Acceptance checks for Concepts pass] | {Name} |
|
|
185
|
+
| First draft | [Acceptance checks for First draft pass] | {Name} |
|
|
186
|
+
| Final creative | [Acceptance checks for Final creative pass] | {Name} |
|
|
185
187
|
|
|
186
188
|
### Brand Guidelines
|
|
187
189
|
|