The Project Asylum feedback loop is the core of the system’s self-adapting capabilities. It continuously monitors honeypot activity, analyzes attacker behavior using AI/ML models, and automatically adjusts infrastructure to optimize security and deception.
orchestration/api/server.js)if (anomaly_rate > 0.5) {
// Critical: Scale infrastructure
actions = ['scale_up', 'rotate_honeypots']
} else if (anomaly_rate > 0.2) {
// High: Increase monitoring
actions = ['scale_up']
} else if (anomaly_rate > 0.1) {
// Medium: Monitor closely
actions = ['increase_sensitivity']
}
terraform/variables.tf with new valuesterraform plan to preview changesgraph TD
A[Honeypot Logs] --> B[Logstash]
B --> C[Elasticsearch]
C --> D[Scheduler]
D --> E[Fetch & Extract Features]
E --> F[AI Analysis]
F --> G{Severity?}
G -->|Critical| H[Immediate Action]
G -->|High| I[Scheduled Action]
G -->|Medium| J[Monitor]
G -->|Low| K[Log Only]
H --> L[Orchestration API]
I --> L
L --> M{Action Type}
M -->|Scale| N[Update Terraform]
M -->|Rotate| O[Rotate Honeypots]
M -->|Alert| P[Send Notifications]
N --> Q[Apply Changes]
O --> Q
Q --> R[Update State]
R --> S[Feedback to AI]
S --> F
# Analysis frequency (cron format)
ANALYSIS_INTERVAL="*/15 * * * *" # Every 15 minutes
# Infrastructure drift check
DRIFT_CHECK_INTERVAL="0 */6 * * *" # Every 6 hours
# Model retraining schedule
MODEL_RETRAIN_INTERVAL="0 2 * * *" # Daily at 2 AM
# Anomaly thresholds
ANOMALY_THRESHOLD_CRITICAL=0.5
ANOMALY_THRESHOLD_HIGH=0.2
ANOMALY_THRESHOLD_MEDIUM=0.1
For production environments, it’s recommended to require manual approval:
# terraform/main.tf
lifecycle {
prevent_destroy = true
}
Enable auto-apply only for development:
export TF_AUTO_APPROVE=true # Development only
orchestration_events_total{type="anomaly_handled"}: Count of anomaly eventsevent_processing_duration_seconds: Time to process eventsinfrastructure_state{component="terraform"}: Current infrastructure state{
"query": {
"bool": {
"filter": [
{ "range": { "@timestamp": { "gte": "now-1h" } } },
{ "term": { "event_category": "feedback_loop" } }
]
}
}
}
# Stop the scheduler
docker-compose stop scheduler
# Or disable auto-actions via environment
export FEEDBACK_LOOP_ENABLED=false
# Check Terraform plan
cd terraform
terraform plan
# Review AI recommendations
curl http://localhost:8000/state
# Trigger immediate analysis
curl -X POST http://localhost:3001/events \
-H "Content-Type: application/json" \
-d '{
"type": "manual_analysis",
"source": "admin",
"data": {}
}'
docker-compose logs schedulercurl http://ai-api:8000/healthANOMALY_THRESHOLD_CRITICALterraform force-unlockdocker-compose logs orchestration-api