from fastapi import APIRouter from app.intelligence.threat_feeds import threat_intel_service from app.agents.orchestrator import orchestrator from datetime import datetime router = APIRouter() import json import traceback from fastapi import Response @router.get("/feed-stream") async def get_live_intelligence_feeds(): """ [SOC] Live CTI Feed Aggregator (Real-time). """ try: raw_feeds = await threat_intel_service.get_live_feeds() data = { "status": "success", "timestamp": datetime.utcnow().isoformat(), "feeds": raw_feeds, "attribution_engine": "SENTINEL_AI_CTI_v2" } return Response( content=json.dumps(data, default=str), media_type="application/json" ) except Exception as e: error_trace = traceback.format_exc() print(f" [❌] Intelligence Feed Critical Error:\n{error_trace}") return { "status": "error", "message": f"System error: {str(e)}", "trace": error_trace }