انتقل إلى المحتوى الرئيسي

REST API Endpoints

AuroraSOC exposes 57 REST endpoints via FastAPI at http://localhost:8000. All endpoints (except /health and /api/v1/auth/token) require JWT authentication.

Authentication Flow

Base URL

http://localhost:8000/api/v1

Endpoints by Category

Authentication

MethodPathAuthPermissionDescription
POST/api/v1/auth/tokenNoneGet JWT access token

Request:

{
"username": "admin",
"password": "admin"
}

Response:

{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "bearer"
}

Users

MethodPathAuthPermissionDescription
GET/api/v1/users/meJWTCurrent user profile
GET/api/v1/usersJWTadmin roleList all users
POST/api/v1/usersJWTadmin roleCreate user
DELETE/api/v1/users/{username}JWTadmin roleDelete user

System

MethodPathAuthPermissionDescription
GET/healthNonePublic health check

Alerts

MethodPathAuthPermissionDescription
GET/api/v1/alertsJWTalerts:readList alerts (paginated)
POST/api/v1/alertsJWTalerts:writeCreate alert
GET/api/v1/alerts/{alert_id}JWTalerts:readGet single alert
PATCH/api/v1/alerts/{alert_id}JWTalerts:writeUpdate alert status

Query Parameters for GET /api/v1/alerts:

ParamTypeDefaultDescription
skipint0Pagination offset
limitint50Page size (max 200)
severitystringFilter: critical|high|medium|low|info
statusstringFilter: new|triaged|investigating|...
sourcestringFilter by source system

Alert creation includes deduplication:

dedup_hash = SHA256(f"{title}|{source}|{sorted(iocs)}")
# If matching hash exists, returns existing alert instead of creating duplicate

Cases

MethodPathAuthPermissionDescription
GET/api/v1/casesJWTcases:readList cases
POST/api/v1/casesJWTcases:writeCreate incident case
GET/api/v1/cases/{case_id}JWTcases:readGet case with timeline
PATCH/api/v1/cases/{case_id}JWTcases:writeUpdate case

Create Case Request:

{
"title": "Lateral Movement via PsExec",
"severity": "high",
"description": "Multiple hosts showing PsExec activity",
"alert_ids": ["uuid-1", "uuid-2"],
"assignee": "analyst@example.com"
}

Agents

MethodPathAuthPermissionDescription
GET/api/v1/agentsJWTagents:readList all 16 agents
POST/api/v1/agents/{id}/enableJWTagents:manageEnable agent
POST/api/v1/agents/{id}/disableJWTagents:manageDisable agent
POST/api/v1/agents/{id}/deployJWTagents:manageDeploy to site
PATCH/api/v1/agents/{id}/scaleJWTagents:manageScale instances (0-10)
POST/api/v1/agents/investigateJWTinvestigation:triggerStart investigation

Agent filtering parameters:

ParamTypeDescription
sitestringFilter by SOC site
statusstringactive|disabled|error
typestringAgent type enum

Investigation request (rate-limited):

{
"alert_context": "Suspicious DNS queries to known C2 domain t1.evil.com from 10.0.1.50",
"has_cps_assets": false,
"severity": "high"
}

Sites

MethodPathAuthPermissionDescription
GET/api/v1/sitesJWTsites:readList SOC sites
POST/api/v1/sitesJWTsites:manageRegister site
DELETE/api/v1/sites/{id}JWTsites:manageRemove site

SIEM

MethodPathAuthPermissionDescription
GET/api/v1/siem/logsJWTsiem:readSearch logs
GET/api/v1/siem/sourcesJWTsiem:readList log sources
GET/api/v1/siem/statsJWTsiem:readSIEM statistics

EDR

MethodPathAuthPermissionDescription
GET/api/v1/edr/endpointsJWTedr:readList endpoints
GET/api/v1/edr/endpoints/{id}JWTedr:readEndpoint detail
POST/api/v1/edr/endpoints/{id}/isolateJWTedr:manageIsolate endpoint
POST/api/v1/edr/endpoints/{id}/unisolateJWTedr:manageRemove isolation
POST/api/v1/edr/endpoints/{id}/scanJWTedr:manageTrigger scan
GET/api/v1/edr/statsJWTedr:readEDR statistics

SOAR

MethodPathAuthPermissionDescription
GET/api/v1/soar/playbooksJWTsoar:readList playbooks
GET/api/v1/soar/playbooks/{id}JWTsoar:readPlaybook details
POST/api/v1/soar/playbooks/{id}/toggleJWTsoar:manageToggle enabled
POST/api/v1/soar/playbooks/{id}/executeJWTsoar:executeExecute playbook
GET/api/v1/soar/executionsJWTsoar:readExecution history
GET/api/v1/soar/rulesJWTsoar:readAutomation rules
POST/api/v1/soar/rules/{id}/toggleJWTsoar:manageToggle rule

Playbooks

MethodPathAuthPermissionDescription
GET/api/v1/playbooksJWTplaybooks:readList playbooks
POST/api/v1/playbooks/{id}/executeJWTplaybooks:executeExecute playbook
GET/api/v1/playbooks/executionsJWTplaybooks:readExecution history

CPS / IoT Devices

MethodPathAuthPermissionDescription
GET/api/v1/cps/devicesJWTcps:readList CPS devices
GET/api/v1/cps/devices/{id}JWTcps:readDevice detail
POST/api/v1/cps/devices/{id}/revokeJWTcps:manageRevoke certificate
GET/api/v1/cps/attestationsJWTcps:readAttestation results

Human Approvals

MethodPathAuthPermissionDescription
GET/api/v1/approvalsJWTapprovals:manageList pending approvals
POST/api/v1/approvals/{id}/decideJWTapprovals:manageApprove/deny

Decision request:

{
"decision": "approved",
"reason": "Verified - safe to isolate compromised host"
}

Reports

MethodPathAuthPermissionDescription
GET/api/v1/reportsJWTreports:readList reports
GET/api/v1/reports/{id}JWTreports:readFull report

Threat Intelligence

MethodPathAuthPermissionDescription
GET/api/v1/iocsJWTiocs:readList IOCs
POST/api/v1/iocsJWTiocs:writeCreate IOC

Statistics & Dashboard

MethodPathAuthPermissionDescription
GET/api/v1/stats/overviewJWTstats:readDashboard overview
GET/api/v1/dashboard/statsJWTstats:readFlat stats for frontend
GET/api/v1/correlationsJWTcps:readPhysical-cyber events
GET/api/v1/firmwareJWTcps:readFirmware inventory

Rate Limiting

Endpoint CategoryRate LimitWindow
General API100 reqper minute
Investigation trigger10 reqper minute
Playbook execution5 reqper minute

Error Responses

All errors follow a consistent format:

{
"detail": "Alert not found"
}
Status CodeMeaning
400Bad request / validation error
401Missing or invalid JWT token
403Insufficient permissions
404Resource not found
429Rate limit exceeded
503Database unavailable (degraded mode)

Degraded Mode

When PostgreSQL is unavailable, the API automatically falls back to in-memory data stores with demo data. This ensures the dashboard and monitoring remain functional during database maintenance.

@app.exception_handler(DatabaseUnavailable)
async def _handle_db_unavailable(request, exc):
return JSONResponse(
status_code=503,
content={"detail": "Database unavailable — running in degraded mode"},
)