soc-agent-toolkit 0.1.0__tar.gz

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.
Files changed (30) hide show
  1. soc_agent_toolkit-0.1.0/LICENSE +21 -0
  2. soc_agent_toolkit-0.1.0/PKG-INFO +462 -0
  3. soc_agent_toolkit-0.1.0/README.md +433 -0
  4. soc_agent_toolkit-0.1.0/pyproject.toml +59 -0
  5. soc_agent_toolkit-0.1.0/setup.cfg +4 -0
  6. soc_agent_toolkit-0.1.0/soc_agent_toolkit/__init__.py +19 -0
  7. soc_agent_toolkit-0.1.0/soc_agent_toolkit/agent.py +209 -0
  8. soc_agent_toolkit-0.1.0/soc_agent_toolkit/cache.py +98 -0
  9. soc_agent_toolkit-0.1.0/soc_agent_toolkit/cli.py +580 -0
  10. soc_agent_toolkit-0.1.0/soc_agent_toolkit/config.py +101 -0
  11. soc_agent_toolkit-0.1.0/soc_agent_toolkit/enrichment.py +295 -0
  12. soc_agent_toolkit-0.1.0/soc_agent_toolkit/enrichment_async.py +168 -0
  13. soc_agent_toolkit-0.1.0/soc_agent_toolkit/logging_setup.py +39 -0
  14. soc_agent_toolkit-0.1.0/soc_agent_toolkit/mitre.py +208 -0
  15. soc_agent_toolkit-0.1.0/soc_agent_toolkit/models.py +110 -0
  16. soc_agent_toolkit-0.1.0/soc_agent_toolkit/parser.py +251 -0
  17. soc_agent_toolkit-0.1.0/soc_agent_toolkit/schemas.py +145 -0
  18. soc_agent_toolkit-0.1.0/soc_agent_toolkit/summarizer.py +114 -0
  19. soc_agent_toolkit-0.1.0/soc_agent_toolkit/tests/__init__.py +0 -0
  20. soc_agent_toolkit-0.1.0/soc_agent_toolkit/tests/test_models.py +57 -0
  21. soc_agent_toolkit-0.1.0/soc_agent_toolkit/tests/test_parser.py +80 -0
  22. soc_agent_toolkit-0.1.0/soc_agent_toolkit/tests/test_triage.py +92 -0
  23. soc_agent_toolkit-0.1.0/soc_agent_toolkit/triage.py +198 -0
  24. soc_agent_toolkit-0.1.0/soc_agent_toolkit/tui.py +253 -0
  25. soc_agent_toolkit-0.1.0/soc_agent_toolkit.egg-info/PKG-INFO +462 -0
  26. soc_agent_toolkit-0.1.0/soc_agent_toolkit.egg-info/SOURCES.txt +28 -0
  27. soc_agent_toolkit-0.1.0/soc_agent_toolkit.egg-info/dependency_links.txt +1 -0
  28. soc_agent_toolkit-0.1.0/soc_agent_toolkit.egg-info/entry_points.txt +2 -0
  29. soc_agent_toolkit-0.1.0/soc_agent_toolkit.egg-info/requires.txt +5 -0
  30. soc_agent_toolkit-0.1.0/soc_agent_toolkit.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Maulana Yasyfa'u Al Azhiim Yudho Leksono
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,462 @@
1
+ Metadata-Version: 2.4
2
+ Name: soc-agent-toolkit
3
+ Version: 0.1.0
4
+ Summary: AI-assisted SOC alert triage and incident analysis toolkit
5
+ Author: Maulana Yasyfa'u Al Azhiim Yudho Leksono
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/ByteBreakerGhost-69/soc-agent-toolkit
8
+ Project-URL: Repository, https://github.com/ByteBreakerGhost-69/soc-agent-toolkit
9
+ Project-URL: Issues, https://github.com/ByteBreakerGhost-69/soc-agent-toolkit/issues
10
+ Keywords: soc,security,cybersecurity,incident-response,threat-detection,mitre-attack,ioc,ai,cli
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Information Technology
13
+ Classifier: Topic :: Security
14
+ Classifier: Topic :: System :: Monitoring
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Operating System :: OS Independent
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: requests>=2.31
24
+ Requires-Dist: anthropic>=0.40
25
+ Requires-Dist: httpx>=0.27
26
+ Requires-Dist: python-dateutil>=2.9
27
+ Requires-Dist: rich>=15.0.0
28
+ Dynamic: license-file
29
+
30
+ # SOC Agent Toolkit
31
+
32
+ **AI-assisted SOC alert triage and incident analysis toolkit for the command line.**
33
+
34
+ SOC Agent Toolkit is a modular Python CLI for processing security alerts from the terminal. It normalizes alerts, maps events to MITRE ATT&CK techniques, enriches indicators of compromise (IOCs), deduplicates related alerts, prioritizes incidents, and generates analyst-ready incident summaries.
35
+
36
+ Designed for **Linux, WSL, macOS, Windows PowerShell, and Windows CMD**.
37
+
38
+ > Defensive security tooling only. Use it only with systems, logs, domains, IPs, and files you are authorized to investigate.
39
+
40
+ ## Features
41
+
42
+ - **Multi-format alert parsing** — JSON, CEF, and syslog
43
+ - **MITRE ATT&CK mapping** — heuristic mapping with optional STIX-based matching
44
+ - **IOC enrichment** — IP, domain, and file-hash reputation through configured threat-intelligence providers
45
+ - **Smart deduplication** — fuzzy signature matching with a configurable time window
46
+ - **Priority scoring** — scores alerts from 0–100 and assigns P1–P4 tiers
47
+ - **Asset criticality weighting** — increases priority for important hosts or assets
48
+ - **AI incident summaries** — Claude-powered summaries with an offline deterministic fallback
49
+ - **Interactive terminal UI** — logo, system status, command menu, and interactive prompt
50
+ - **Live pipeline progress** — visible stages for parsing, MITRE mapping, enrichment, triage, and summarization
51
+ - **Machine-readable JSON** — structured output for scripts and automation
52
+ - **CLI-first design** — built for terminal and security workflows
53
+ - **Defensive only** — no automatic blocking, isolation, or production changes
54
+
55
+ ## Architecture
56
+
57
+ ```text
58
+ Raw Security Alerts
59
+
60
+
61
+ ┌──────────────┐
62
+ │ Parser │
63
+ │ JSON / CEF / │
64
+ │ Syslog │
65
+ └──────┬───────┘
66
+
67
+
68
+ ┌──────────────┐
69
+ │ MITRE │
70
+ │ ATT&CK Map │
71
+ └──────┬───────┘
72
+
73
+
74
+ ┌──────────────┐
75
+ │ IOC │
76
+ │ Enrichment │
77
+ └──────┬───────┘
78
+
79
+
80
+ ┌──────────────┐
81
+ │ Deduplication│
82
+ │ + Scoring │
83
+ └──────┬───────┘
84
+
85
+
86
+ ┌──────────────┐
87
+ │ Priority P1 │
88
+ │ to P4 │
89
+ └──────┬───────┘
90
+
91
+
92
+ ┌──────────────┐
93
+ │ AI Incident │
94
+ │ Summary │
95
+ └──────────────┘
96
+ ```
97
+
98
+ ## Requirements
99
+
100
+ - Python **3.10+**
101
+ - Git
102
+ - Internet access only when using external threat-intelligence providers or Claude
103
+
104
+ ## Installation
105
+
106
+ ### Development / from source
107
+
108
+ ```bash
109
+ git clone https://github.com/ByteBreakerGhost-69/soc-agent-toolkit.git
110
+ cd soc-agent-toolkit
111
+ python -m venv .venv
112
+ ```
113
+
114
+ Linux / WSL / macOS:
115
+
116
+ ```bash
117
+ source .venv/bin/activate
118
+ ```
119
+
120
+ Windows PowerShell:
121
+
122
+ ```powershell
123
+ .venv\Scripts\Activate.ps1
124
+ ```
125
+
126
+ Windows CMD:
127
+
128
+ ```cmd
129
+ .venv\Scripts\activate
130
+ ```
131
+
132
+ Install the package:
133
+
134
+ ```bash
135
+ python -m pip install --upgrade pip
136
+ pip install -e .
137
+ ```
138
+
139
+ The `soc-agent` executable is then available in the active environment.
140
+
141
+ ### Package installation
142
+
143
+ Once published to PyPI, the intended user experience is:
144
+
145
+ ```bash
146
+ pip install soc-agent-toolkit
147
+ soc-agent
148
+ ```
149
+
150
+ ## Interactive TUI
151
+
152
+ Running `soc-agent` without arguments opens the interactive terminal interface:
153
+
154
+ ```bash
155
+ soc-agent
156
+ ```
157
+
158
+ Available commands inside the prompt:
159
+
160
+ ```text
161
+ analyze <file> Analyze security alerts
162
+ mitre "<text>" Map text to MITRE ATT&CK
163
+ enrich-ip <ip> Check IP reputation
164
+ enrich-domain <domain> Check domain reputation
165
+ enrich-hash <hash> Check file hash reputation
166
+ version Show version
167
+ help Show commands
168
+ exit Exit
169
+ ```
170
+
171
+ The interface also displays toolkit status, the author footer, and pipeline progress during analysis.
172
+
173
+ ## CLI Usage
174
+
175
+ ### Help
176
+
177
+ ```bash
178
+ soc-agent --help
179
+ ```
180
+
181
+ ### Analyze alerts
182
+
183
+ ```bash
184
+ soc-agent analyze alerts.json
185
+ ```
186
+
187
+ The pipeline performs:
188
+
189
+ ```text
190
+ Parse
191
+
192
+ MITRE mapping
193
+
194
+ IOC enrichment
195
+
196
+ Deduplication
197
+
198
+ Priority scoring
199
+
200
+ Incident summary
201
+ ```
202
+
203
+ ### JSON output
204
+
205
+ ```bash
206
+ soc-agent analyze alerts.json --json
207
+ ```
208
+
209
+ The JSON result is suitable for automation and can be redirected to a file:
210
+
211
+ ```bash
212
+ soc-agent analyze alerts.json --json > result.json
213
+ ```
214
+
215
+ ### Analyze from stdin
216
+
217
+ ```bash
218
+ cat alerts.json | soc-agent analyze -
219
+ ```
220
+
221
+ This allows SOC Agent Toolkit to be chained with other command-line tools.
222
+
223
+ ### Asset criticality
224
+
225
+ Create `assets.json`:
226
+
227
+ ```json
228
+ {
229
+ "10.0.0.12": 15,
230
+ "10.0.0.20": 10
231
+ }
232
+ ```
233
+
234
+ Run:
235
+
236
+ ```bash
237
+ soc-agent analyze alerts.json --assets assets.json
238
+ ```
239
+
240
+ Higher asset criticality increases the priority score of related alerts.
241
+
242
+ ## MITRE ATT&CK Mapping
243
+
244
+ ```bash
245
+ soc-agent mitre "SSH brute force login attempt"
246
+ ```
247
+
248
+ Example:
249
+
250
+ ```text
251
+ MITRE ATT&CK Matches
252
+ ====================
253
+ T1110 — Brute Force
254
+ Tactic: Credential Access
255
+ ```
256
+
257
+ ## IOC Enrichment
258
+
259
+ ### IP
260
+
261
+ ```bash
262
+ soc-agent enrich-ip 8.8.8.8
263
+ ```
264
+
265
+ ### Domain
266
+
267
+ ```bash
268
+ soc-agent enrich-domain example.com
269
+ ```
270
+
271
+ ### File hash
272
+
273
+ ```bash
274
+ soc-agent enrich-hash 44d88612fea8a8f36de82e1278abb02f
275
+ ```
276
+
277
+ Supported hash inputs include MD5, SHA-1, and SHA-256.
278
+
279
+ When a reputation provider is unavailable, the toolkit reports `unknown` rather than inventing reputation data.
280
+
281
+ ## Threat Intelligence Configuration
282
+
283
+ Supported environment variables:
284
+
285
+ ```text
286
+ ABUSEIPDB_API_KEY
287
+ VT_API_KEY
288
+ OTX_API_KEY
289
+ ```
290
+
291
+ Claude integration uses:
292
+
293
+ ```text
294
+ ANTHROPIC_API_KEY
295
+ ```
296
+
297
+ ### Linux / WSL / macOS
298
+
299
+ ```bash
300
+ export VT_API_KEY="YOUR_KEY"
301
+ export ABUSEIPDB_API_KEY="YOUR_KEY"
302
+ export OTX_API_KEY="YOUR_KEY"
303
+ export ANTHROPIC_API_KEY="YOUR_KEY"
304
+ ```
305
+
306
+ ### Windows PowerShell
307
+
308
+ ```powershell
309
+ $env:VT_API_KEY="YOUR_KEY"
310
+ $env:ABUSEIPDB_API_KEY="YOUR_KEY"
311
+ $env:OTX_API_KEY="YOUR_KEY"
312
+ $env:ANTHROPIC_API_KEY="YOUR_KEY"
313
+ ```
314
+
315
+ Never commit API keys, tokens, passwords, or secret `.env` files to GitHub.
316
+
317
+ ## Offline Behavior
318
+
319
+ External enrichment is optional. Without reputation API keys, enrichment returns an `unknown` verdict when external evidence is unavailable.
320
+
321
+ Without Claude, the toolkit uses a deterministic offline incident-summary fallback so the core parsing, MITRE mapping, triage, deduplication, and scoring pipeline can continue.
322
+
323
+ ## Priority Model
324
+
325
+ Alerts receive a score from **0–100** and one of four priority levels:
326
+
327
+ ```text
328
+ P1 — Critical
329
+ P2 — High
330
+ P3 — Medium
331
+ P4 — Low
332
+ ```
333
+
334
+ The score can incorporate alert severity, repeated occurrences, IOC reputation, MITRE ATT&CK matches, and asset criticality.
335
+
336
+ ## Project Structure
337
+
338
+ ```text
339
+ soc-agent-toolkit/
340
+
341
+ ├── soc_agent_toolkit/
342
+ │ ├── __init__.py
343
+ │ ├── agent.py
344
+ │ ├── cache.py
345
+ │ ├── cli.py
346
+ │ ├── config.py
347
+ │ ├── enrichment.py
348
+ │ ├── enrichment_async.py
349
+ │ ├── logging_setup.py
350
+ │ ├── mitre.py
351
+ │ ├── models.py
352
+ │ ├── parser.py
353
+ │ ├── schemas.py
354
+ │ ├── summarizer.py
355
+ │ ├── triage.py
356
+ │ └── tui.py
357
+
358
+ ├── soc_agent_toolkit/tests/
359
+ ├── alerts.json
360
+ ├── pyproject.toml
361
+ ├── .gitignore
362
+ └── README.md
363
+ ```
364
+
365
+ ### Core modules
366
+
367
+ | Module | Purpose |
368
+ | --- | --- |
369
+ | `parser.py` | Normalize JSON / CEF / syslog alerts |
370
+ | `mitre.py` | MITRE ATT&CK technique mapping |
371
+ | `enrichment.py` | IP / domain / hash reputation lookups |
372
+ | `enrichment_async.py` | Concurrent enrichment |
373
+ | `triage.py` | Deduplication and priority scoring |
374
+ | `summarizer.py` | AI and offline incident summaries |
375
+ | `schemas.py` | AI tool-use definitions and dispatcher |
376
+ | `agent.py` | End-to-end pipeline and agentic loop |
377
+ | `cli.py` | Command-line interface |
378
+ | `tui.py` | Interactive Rich terminal interface |
379
+ | `config.py` | Configurable scoring and toolkit settings |
380
+
381
+ ## Example Workflow
382
+
383
+ ```bash
384
+ # Launch interactive TUI
385
+ soc-agent
386
+
387
+ # Analyze alerts
388
+ soc-agent analyze alerts.json
389
+
390
+ # Get structured JSON output
391
+ soc-agent analyze alerts.json --json
392
+
393
+ # Map an alert to MITRE ATT&CK
394
+ soc-agent mitre "SSH brute force login attempt"
395
+
396
+ # Check an IP
397
+ soc-agent enrich-ip 8.8.8.8
398
+
399
+ # Check a domain
400
+ soc-agent enrich-domain example.com
401
+
402
+ # Check a file hash
403
+ soc-agent enrich-hash 44d88612fea8a8f36de82e1278abb02f
404
+
405
+ # Show version
406
+ soc-agent version
407
+ ```
408
+
409
+ ## Testing
410
+
411
+ Run the full test suite:
412
+
413
+ ```bash
414
+ pytest -q
415
+ ```
416
+
417
+ Expected project validation includes:
418
+
419
+ ```bash
420
+ python -m py_compile soc_agent_toolkit/cli.py
421
+ python -m compileall -q soc_agent_toolkit
422
+ pytest -q
423
+ ```
424
+
425
+ ## Design Principles
426
+
427
+ ### Defensive by design
428
+
429
+ The toolkit analyzes, enriches, prioritizes, and summarizes security events. It does not automatically block IP addresses, isolate endpoints, or modify production systems.
430
+
431
+ ### Evidence over guessing
432
+
433
+ When reputation information is unavailable, the toolkit reports `unknown` instead of inventing a verdict.
434
+
435
+ ### Deterministic core
436
+
437
+ The main security pipeline remains deterministic and inspectable, while AI is used for natural-language reasoning and analyst-facing summaries.
438
+
439
+ ### CLI-first
440
+
441
+ The project is designed to work naturally inside terminal-based SOC workflows and automation pipelines.
442
+
443
+ ## Roadmap
444
+
445
+ - Additional threat-intelligence providers
446
+ - Expanded MITRE ATT&CK coverage
447
+ - More extensive test coverage
448
+ - CI/CD automation
449
+ - Package distribution and release automation
450
+ - Improved AI agent workflows
451
+
452
+ ## License
453
+
454
+ This project is currently distributed without a declared license.
455
+
456
+ A permissive open-source license such as **MIT** can be added before public package distribution.
457
+
458
+ ## Author
459
+
460
+ **Maulana Yasyfa’u Al Azhiim Yudho Leksono**
461
+
462
+ GitHub: https://github.com/ByteBreakerGhost-69