Quick Links
API Endpoints
Detection Service
:8001
POST
/api/v1/predict
Classify network flow
POST
/api/v1/predict/batch
Batch prediction
GET
/api/v1/model/info
Current model info
GET
/health
Health check
Labeling Service
:8002
GET
/api/v1/queue
Get labeling queue
GET
/api/v1/sample/{id}
Get sample details
POST
/api/v1/label
Submit label
GET
/api/v1/similar/{id}
Find similar samples
GET
/api/v1/stats
Labeling statistics
Deployment Service
:8003
GET
/api/v1/models
List all models
POST
/api/v1/deploy
Deploy model
POST
/api/v1/canary/increment
Increase canary traffic
POST
/api/v1/rollback
Rollback deployment
Architecture
π‘ Hubble (Cilium eBPF)
β
π₯ Flow Collector
β
βοΈ Feature Extractor
β
π§ ML Model (XGBoost)
β
β Clean
β Queue
β Block
β
πΎ PostgreSQL
β
π Prometheus + Grafana
ML Features (12)
1
method_encoded
categorical
2
status_code_int
numeric
3
source_encoded
categorical
4
count_normalized
numeric
5
endpoint_depth
numeric
6
has_api
boolean
7
has_auth
boolean
8
is_sensitive_file
boolean
9
is_error_status
boolean
10
is_server_error
boolean
11
log_count
numeric
12
relative_freq
numeric
Classification Thresholds
0.0
0.3
0.8
1.0
Attack
score < 0.3
BLOCK + ALERT
Suspicious
0.3 β€ score < 0.8
QUEUE for review
Clean
score β₯ 0.8
PASS
Request Example
curl
curl -X POST "http://localhost:8001/api/v1/predict" \ -H "Content-Type: application/json" \ -d '{ "source": "frontend-pod", "target": "backend-api:8080", "method": "POST", "path": "/api/users/search", "status_code": 200, "request_body": {"query": "admin"}, "timestamp": "2024-12-19T14:32:17Z" }'
Response Schema
{
"id": string required
"classification": enum [clean, suspicious, attack]
"score": float [0.0, 1.0]
"confidence": float [0.0, 1.0]
"attack_type": string | null
"explanation": {
"shap_values": object
"top_features": array
"text": string
}
"latency_ms": integer
"model_version": string
}
Tech Stack
ML / AI
XGBoost
SHAP
Pandas
NumPy
Backend
FastAPI
Python 3.11
Uvicorn
Pydantic
Storage
PostgreSQL
Redis
MinIO (S3)
Infrastructure
Kubernetes
Docker
Cilium
Hubble
Monitoring
Prometheus
Grafana
Alertmanager
CI/CD
GitHub Actions
Helm
ArgoCD