Skip to content

Commit 5faf5e2

Browse files
authored
Merge pull request #59 from mdabir1203/codex/add-social-intelligence-insights-for-security
[core] feat: integrate social intelligence orchestration
2 parents c22027d + 865da9e commit 5faf5e2

11 files changed

Lines changed: 2935 additions & 869 deletions

File tree

Cargo.lock

Lines changed: 1491 additions & 853 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ reqwest = { version = "0.12", features = ["json", "gzip", "brotli", "deflate", "
2121
# JSON + serialization
2222
serde = { version = "1.0", features = ["derive"] }
2323
serde_json = "1.0"
24+
serde_yaml = "0.9"
2425

2526
# CSV export
2627
csv = "1.3"

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ ShadowMap aligns its operational safeguards with SOC 2 Trust Services Criteria a
117117
[Data Security and Compliance Strategy](docs/data-security.md) describes the control owners, evidence expectations, and
118118
validation activities that keep reconnaissance data secure throughout its lifecycle.
119119

120+
### Social intelligence-driven security automation
121+
122+
Teams layering social listening on top of ShadowMap can adopt the
123+
[Social Intelligence Insights for Security](docs/social-intelligence-security.md) guide. It explains how the Codex
124+
agent configuration transforms emerging chatter into normalized signals, correlates them with known assets, and drives
125+
guardrailed remediation playbooks.
126+
127+
The framework now runs those social intelligence stages natively during every autonomous scan. Normalized mentions are
128+
correlated with live assets, exported alongside the technical report, and surfaced in the interactive dashboard so
129+
teams can immediately see high-signal chatter, affected hosts, and recommended responses. Override the baked-in Codex
130+
plan by setting `SHADOWMAP_SOCIAL_CONFIG=/path/to/framework.yaml` before launching a run to load a custom orchestration
131+
file without recompiling.
132+
120133
### Technical report automation
121134

122135
Run `./scripts/generate-technical-report.sh` to materialize the latest reconnaissance brief as `build/technical-report.md`.

configs/social-intelligence.yaml

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
version: "1.0"
2+
name: "ShadowMap Codex Intelligence Framework"
3+
description: >
4+
Hybrid AI system combining social listening with cloud security asset intelligence.
5+
Powered by Codex Agents orchestrated for collection, classification, correlation, remediation, and reporting.
6+
7+
agents:
8+
- id: planner
9+
role: Planner
10+
goal: >
11+
Create an optimal plan of tool calls to gather evidence, classify risk, correlate with assets,
12+
and propose mitigations.
13+
prompt: |
14+
You are the Planner. Given a topic or signal, plan the minimal sequence of tools to collect, classify,
15+
correlate, remediate, and report. Prefer cheapest tools first. Limit plan to <= 6 steps.
16+
output_schema: planner_plan_schema
17+
confidence_threshold: 0.6
18+
19+
- id: classifier
20+
role: Social Classifier
21+
goal: >
22+
Convert unstructured social or open-source data into normalized, machine-actionable security signals.
23+
prompt: |
24+
You are the Social Classifier. Given text feeds or social posts, identify type, cloud vendor,
25+
services, regions, indicators, severity, and confidence.
26+
Merge duplicates within 48h. Produce normalized JSON.
27+
output_schema: signal_schema
28+
confidence_threshold: 0.7
29+
30+
- id: correlator
31+
role: Correlator
32+
goal: >
33+
Map each normalized signal to ShadowMap asset graph, compute risk scores, and
34+
identify actionable matches.
35+
prompt: |
36+
You are the Correlator. Use ShadowMap's asset_graph and vuln_scan to match
37+
assets with social signals. Compute risk_score and confidence.
38+
Penalize sandbox assets and boost prod/payments/PII-tagged ones.
39+
output_schema: correlation_schema
40+
confidence_threshold: 0.65
41+
42+
- id: remediator
43+
role: Remediator
44+
goal: >
45+
Generate stepwise, reversible, low-impact remediations with rollback and verification.
46+
prompt: |
47+
You are the Remediator. Build playbooks that fix issues with minimal disruption.
48+
Always include rollback, verification, and respect change windows.
49+
output_schema: remediation_schema
50+
confidence_threshold: 0.8
51+
52+
- id: reporter
53+
role: Reporter
54+
goal: >
55+
Create dual-view reports (executive and engineer) summarizing the signal, affected assets,
56+
actions, and business impact.
57+
prompt: |
58+
You are the Reporter. Generate concise summaries in plain language for executives,
59+
and detailed evidence + commands for engineers. Output both as JSON + markdown.
60+
output_schema: report_schema
61+
62+
schemas:
63+
planner_plan_schema:
64+
type: object
65+
properties:
66+
topic: { type: string }
67+
intents: { type: array, items: { type: string } }
68+
plan:
69+
type: array
70+
items:
71+
type: object
72+
properties:
73+
step: { type: integer }
74+
tool: { type: string }
75+
args: { type: object }
76+
why: { type: string }
77+
confidence: { type: number }
78+
79+
signal_schema:
80+
type: object
81+
properties:
82+
signals:
83+
type: array
84+
items:
85+
type: object
86+
properties:
87+
signal_id: { type: string }
88+
type: { type: string }
89+
topic: { type: string }
90+
vendor_cloud: { type: array, items: { type: string } }
91+
services: { type: array, items: { type: string } }
92+
regions: { type: array, items: { type: string } }
93+
severity_guess: { type: string }
94+
confidence: { type: number }
95+
evidence: { type: array }
96+
summary: { type: string }
97+
98+
correlation_schema:
99+
type: object
100+
properties:
101+
matches:
102+
type: array
103+
items:
104+
type: object
105+
properties:
106+
asset_id: { type: string }
107+
reasons: { type: array, items: { type: string } }
108+
risk_score: { type: number }
109+
supporting_findings: { type: array }
110+
coverage_stats: { type: object }
111+
next_best_actions: { type: array }
112+
confidence: { type: number }
113+
114+
remediation_schema:
115+
type: object
116+
properties:
117+
playbook:
118+
type: object
119+
properties:
120+
title: { type: string }
121+
steps: { type: array }
122+
rollback: { type: array }
123+
verification: { type: array }
124+
owner: { type: object }
125+
change_window: { type: string }
126+
ticket:
127+
type: object
128+
properties:
129+
project: { type: string }
130+
title: { type: string }
131+
severity: { type: string }
132+
due_days: { type: integer }
133+
134+
report_schema:
135+
type: object
136+
properties:
137+
executive_brief: { type: object }
138+
engineer_brief: { type: object }
139+
kb_markdown: { type: string }
140+
141+
guardrails:
142+
- id: evidence_check
143+
description: "Reject any claim not supported by tool output"
144+
- id: rollback_required
145+
description: "Ensure all remediation steps have rollback"
146+
- id: schema_validation
147+
description: "Validate JSON output against schema before next agent"
148+
- id: duplicate_filter
149+
description: "Suppress repeated findings or assets"
150+
151+
tools:
152+
- name: social_feed.fetch
153+
description: "Collect public signals from X, GitHub, Reddit, etc."
154+
- name: nvd_cve.search
155+
description: "Search NVD for matching CVEs or CWEs."
156+
- name: asset_graph.search
157+
description: "Query internal ShadowMap asset graph."
158+
- name: vuln_scan.query
159+
description: "Get live vulnerability findings."
160+
- name: cloud_cfg.check
161+
description: "Verify cloud config policies."
162+
- name: notify.create
163+
description: "Open ticket in incident tracker."
164+
- name: page.create
165+
description: "Write report to knowledge base."
166+
167+
defaults:
168+
org_filters:
169+
env: ["prod", "staging"]
170+
regions: ["ap-south-1", "asia-south1"]
171+
controls_available: ["scp", "config_rules", "security_hub"]
172+
change_windows: ["Sun 02:00-04:00 BST"]
173+
localization:
174+
geo: "Bangladesh"
175+
languages: ["en", "bn"]
176+
177+
testing:
178+
scenarios:
179+
- name: redis_exploit
180+
topic: "Unauthenticated Redis 6379 exploit ap-south-1"
181+
expected_output: ["plan", "signals", "correlation", "remediation", "report"]
182+
- name: s3_public_acl
183+
topic: "Public S3 bucket misconfig leak"
184+
- name: iam_mfa_fatigue
185+
topic: "IAM console MFA fatigue attacks"

0 commit comments

Comments
 (0)