Claude 24f816b6a3
Consolidate 22 sibling repos into layered organism structure
Place useful parts of the surrounding repos into sica-fondt by layer, per the
body model (Ada = membrane; brain/endocrine/capabilities/knowledge non-Ada):

- brain/        LLM reasoning + providers (dapr, hermes, MoMoA)
- capabilities/ REPRAG sidecars: hermes tools/skills, dapr tools, parallel
                dispatch, A51 channels, and the OSINT cluster
- knowledge/    LORAG corpus: 754 cyber-skills, agency personas, secure-coding,
                MITRE ATT&CK data
- reference/    defensive threat-reference (C3, shhbruh doc) + AdaYaml parser

License handling: AGPL sources (worldosint, advanced_evolution, mercury,
Reticulum) and GPL DeTTECT are SPEC-only clean-room/port descriptions — no
copyleft code copied. MIT/Apache/data parts copied as working trees.

Safety: shhbruh escape/persistence material and C3 covert-C2 kept as reference
only, not wired into the running organism. See CONSOLIDATION.md.

https://claude.ai/code/session_01UehUqEXXJJCsHoA4voCU5c
2026-06-10 06:53:01 +00:00

76 lines
1.7 KiB
Markdown

# Network Traffic Baselining API Reference
## NetFlow/IPFIX CSV Format
### Expected Columns
```
timestamp,src_ip,dst_ip,src_port,dst_port,protocol,bytes,packets
2024-01-15T08:30:00Z,10.0.1.5,203.0.113.10,54321,443,6,15234,42
```
### Alternative Column Names (auto-mapped)
```
ts -> timestamp sa -> src_ip da -> dst_ip
sp -> src_port dp -> dst_port pr -> protocol
ibyt -> bytes ipkt -> packets
```
### Protocol Numbers
| Number | Protocol |
|--------|----------|
| 1 | ICMP |
| 6 | TCP |
| 17 | UDP |
## Pandas Analysis Functions
### Hourly Aggregation
```python
df["hour"] = df["timestamp"].dt.hour
hourly = df.groupby("hour").agg(
total_bytes=("bytes", "sum"),
total_packets=("packets", "sum"),
flow_count=("bytes", "count"),
)
```
### Z-Score Anomaly Detection
```python
mean = host_stats["total_bytes"].mean()
std = host_stats["total_bytes"].std()
host_stats["zscore"] = (host_stats["total_bytes"] - mean) / std
anomalies = host_stats[host_stats["zscore"].abs() >= 3.0]
```
### IQR Outlier Detection
```python
q1 = series.quantile(0.25)
q3 = series.quantile(0.75)
iqr = q3 - q1
outliers = series[(series < q1 - 1.5 * iqr) | (series > q3 + 1.5 * iqr)]
```
## NetFlow Export Tools
### nfdump CSV Export
```bash
nfdump -r nfcapd.202401 -o csv > flows.csv
```
### SiLK rwcut Export
```bash
rwcut --fields=sIP,dIP,sPort,dPort,protocol,bytes,packets,sTime flows.rw > flows.csv
```
### Elastic NetFlow to CSV
```json
GET netflow-*/_search
{ "size": 10000, "query": { "range": { "@timestamp": { "gte": "now-7d" } } } }
```
## CLI Usage
```bash
python agent.py --netflow-csv flows.csv --output baseline.json
python agent.py --netflow-csv flows.csv --zscore-threshold 2.5 --scan-threshold 30
```