Skip to content

Synapse Admin API

The Synapse admin API runs on port 6191 by default and provides runtime management endpoints.

Authentication

All admin endpoints require the X-Admin-Key header matching the admin_api_key in config.yaml. If no key is configured, a random key is generated at startup and logged.

sh
curl http://localhost:6191/status -H "X-Admin-Key: $ADMIN_KEY"

Health & Status

MethodPathDescription
GET/statusRuntime status and health information
GET/metricsPrometheus-format metrics

GET /status response:

json
{
  "status": "healthy",
  "uptime_seconds": 3600,
  "workers": 4,
  "rules_loaded": 237,
  "entities_tracked": 1523,
  "requests_processed": 458201
}

Configuration

MethodPathDescription
GET/configGet current runtime configuration
POST/configUpdate runtime configuration fields
POST/reloadHot-reload configuration from file (~240 μs)

Hot-reload:

sh
curl -X POST http://localhost:6191/reload -H "X-Admin-Key: $ADMIN_KEY"
json
{
  "status": "reloaded",
  "duration_us": 240
}

Entity Management

MethodPathDescription
GET/entitiesList tracked entities with risk scores
POST/blockBlock an IP or fingerprint
POST/releaseRelease a blocked entity
POST/release-allRelease all blocked entities

Block an IP:

sh
curl -X POST http://localhost:6191/block \
  -H "X-Admin-Key: $ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip": "192.168.1.100", "reason": "manual block"}'

List entities:

sh
curl http://localhost:6191/entities -H "X-Admin-Key: $ADMIN_KEY"
json
{
  "entities": [
    {
      "ip": "192.168.1.100",
      "risk_score": 85,
      "blocked": true,
      "first_seen": "2026-03-23T10:00:00Z",
      "last_seen": "2026-03-23T14:30:00Z",
      "request_count": 450
    }
  ]
}

WAF Rules

MethodPathDescription
GET/rulesList loaded WAF rules
POST/rules/addAdd a custom rule
POST/rules/removeRemove a rule by ID
POST/rules/clearClear all custom rules
POST/evaluateTest a request against the rule engine

Evaluate a test request:

sh
curl -X POST http://localhost:6191/evaluate \
  -H "X-Admin-Key: $ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path": "/api/users?id=1 OR 1=1", "method": "GET"}'
json
{
  "risk_score": 85,
  "matched_rules": ["200200"],
  "action": "block",
  "detection_time_us": 25
}

Site Management

MethodPathDescription
GET/_tenant/sitesList all configured sites
POST/_tenant/sitesCreate new site
GET/_tenant/sites/:idGet site configuration
PUT/_tenant/sites/:idUpdate site configuration
DELETE/_tenant/sites/:idRemove site
PUT/_tenant/sites/:hostname/wafUpdate WAF config (threshold, rule overrides)
PUT/_tenant/sites/:hostname/rate-limitUpdate rate limit (RPS, burst)

Config changes apply immediately via graceful reload — zero dropped connections.

Actor & Session Tracking

MethodPathDescription
GET/_sensor/actorsList tracked actors
GET/_sensor/actors/statsActor statistics summary
GET/_sensor/actors/:idActor details with composite identity
GET/_sensor/sessionsList active sessions
GET/_sensor/sessions/statsSession statistics
GET/_sensor/sessions/:idSession details with hijack alerts

Profiling & Payload

MethodPathDescription
GET/debug/profilesView all learned profiles (what the WAF is thinking)
GET/_sensor/profiling/statsProfiling statistics
GET/_sensor/profiling/templatesLearned path templates
GET/_sensor/profiling/baselinesEndpoint baselines
GET/_sensor/profiling/schemasLearned API schemas
GET/_sensor/payload/statsPayload statistics
GET/_sensor/payload/bandwidthGlobal bandwidth + timeline
GET/_sensor/payload/endpointsPer-endpoint payload stats
GET/_sensor/payload/entitiesTop entities by bandwidth
GET/_sensor/payload/anomaliesPayload anomalies

Campaigns & Signals

MethodPathDescription
GET/_sensor/campaignsList detected campaigns
GET/_sensor/campaigns/statsCampaign statistics
GET/_sensor/campaigns/:idCampaign details
GET/_sensor/campaigns/:id/actorsActors in campaign
GET/_sensor/campaigns/:id/timelineCampaign event timeline
GET/_sensor/signalsList signals
GET/_sensor/signals/statsSignal statistics
GET/_sensor/signals/anomaliesSignal anomalies
GET/_sensor/trendsTrend data

Interrogator & DLP

MethodPathDescription
GET/_sensor/interrogator/statsAll interrogator statistics
GET/_sensor/interrogator/tarpitTarpit statistics
GET/_sensor/interrogator/challengesChallenge statistics
GET/_sensor/injection/statsInjection tracker statistics
GET/_sensor/injection/headlessHeadless browser detections
GET/_sensor/dlp/statsDLP scanning statistics
GET/_sensor/dlp/patternsActive DLP patterns

Persistence

MethodPathDescription
GET/_sensor/persistence/statsPersistence statistics
POST/_sensor/persistence/saveForce immediate state save
GET/_sensor/persistence/exportExport full state
POST/_sensor/persistence/importImport state

Automatic persistence

Learned profiles snapshot to data/profiles.json automatically. WAF retains intelligence across restarts — no cold-start learning period.

Authentication Model

SettingBehavior
admin_api_key setWrite endpoints require Authorization: Bearer <token>
No key configuredRead-only endpoints (health, metrics, stats) accessible without auth

Read-only endpoints (GET /health, /metrics, /sites, /stats) do not require authentication. All write endpoints (POST, PUT, DELETE) require the admin API key.

Prometheus Metrics (40+)

GET /metrics returns Prometheus-format metrics. Key categories:

Request counters:

MetricType
synapse_requests_totalCounter
synapse_requests_by_status{status="2xx|3xx|4xx|5xx"}Counter
synapse_requests_blockedCounter

Latency histogram:

MetricDescription
synapse_request_duration_us_bucket{le="X"}Cumulative buckets (100 μs to 1 s)
synapse_request_duration_us_sumTotal latency microseconds
synapse_request_duration_us_countTotal observations

WAF metrics:

MetricType
synapse_waf_analyzedCounter
synapse_waf_blockedCounter
synapse_waf_challengedCounter
synapse_waf_loggedCounter
synapse_waf_detection_avg_usGauge
synapse_waf_rule_matches{rule_id="X"}Counter (per-rule)

Profiling/anomaly:

MetricType
synapse_profiles_active_countGauge
synapse_anomalies_detected_total{type="X"}Counter
synapse_avg_anomaly_scoreGauge (0–10)
synapse_requests_with_anomaliesCounter

Backend:

MetricType
synapse_backend_requests{backend="X"}Counter
synapse_backend_healthy{backend="X"}Gauge (0/1)
synapse_uptime_secondsGauge

Licensed under AGPL-3.0 · atlascrew.dev