{
  "openapi": "3.1.0",
  "info": {
    "title": "Oltanom Siber Tehdit İstihbaratı (CTI) & REST API",
    "version": "1.2.0",
    "description": "Bankalar, Finans Kuruluşları, SOC/CERT Ekipleri, SIEM/SOAR Platformları ve Kurumsal Güvenlik Duvarları (EDL/RPZ) için gerçek zamanlı Milli Siber Tehdit İstihbarat Beslemesi ve URL Risk Analiz API'si.",
    "contact": {
      "name": "Oltanom Güvenlik Operasyonları",
      "url": "https://oltanom.com/istihbarat-api",
      "email": "destek@oltanom.com"
    },
    "license": {
      "name": "Oltanom Açık Siber Güvenlik Topluluk Lisansı",
      "url": "https://oltanom.com/kullanim-kosullari"
    }
  },
  "servers": [
    {
      "url": "https://oltanom.com",
      "description": "Canlı Üretim Sunucusu (Production - Global CDN)"
    },
    {
      "url": "http://localhost:3000",
      "description": "Yerel Geliştirme & Test Sunucusu"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/api/v1/feed/stix": {
      "get": {
        "summary": "OASIS STIX 2.1 Tehdit Paketi (Bundle) Beslemesi",
        "description": "Tespit edilen aktif oltalama saldırılarını, taklit edilen marka kimliklerini (MITRE ATT&CK T1566) ve IoC ilişkilerini OASIS STIX 2.1 formatında toplu bundle nesnesi olarak döner.",
        "tags": ["Tehdit İstihbarat Beslemeleri (Feeds)"],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Dönecek maksimum tehdit nesnesi adedi (Varsayılan: 100, Maks: 500)",
            "required": false,
            "schema": { "type": "integer", "default": 100 }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı STIX 2.1 Bundle paketi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": { "type": "string", "example": "bundle" },
                    "id": { "type": "string", "example": "bundle--b5687740-4289-4b68-98e6-e96a4d7cf38b" },
                    "objects": { "type": "array", "items": { "type": "object" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/feed/iocs": {
      "get": {
        "summary": "Hafif JSON Tehdit Göstergeleri (IoC Feed)",
        "description": "SIEM, SOAR, Python scriptleri veya otomasyon araçlarının doğrudan parse edebileceği, domain, IP, hedef marka ve güven skorunu içeren sadeleştirilmiş JSON listesi.",
        "tags": ["Tehdit İstihbarat Beslemeleri (Feeds)"],
        "responses": {
          "200": {
            "description": "Aktif IoC listesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "feed": { "type": "string", "example": "Oltanom Cyber Threat Indicators (IoC)" },
                    "total_indicators": { "type": "integer", "example": 42 },
                    "indicators": { "type": "array", "items": { "type": "object" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/feed/domains.txt": {
      "get": {
        "summary": "Düz Metin (Plain Text) Domain Blok Listesi",
        "description": "FortiGate, Palo Alto Networks External Dynamic Lists (EDL), pfSense, AdGuard ve Pi-hole için satır satır engelleme listesi (Her satırda bir zararlı domain).",
        "tags": ["Firewall & Ağ Güvenliği"],
        "responses": {
          "200": {
            "description": "Satır satır domain listesi",
            "content": {
              "text/plain": {
                "schema": { "type": "string", "example": "ornek-banka-kredi-kampanyasi.xyz\nindirim-kuponu-firsat.site\ntrafik-cezasi-odeme.top" }
              }
            }
          }
        }
      }
    },
    "/api/v1/feed/rpz": {
      "get": {
        "summary": "BIND 9 DNS RPZ (Response Policy Zone) Beslemesi",
        "description": "Kurumsal DNS sunucularında (BIND 9 / PowerDNS / Unbound) oltalama alan adlarını anında sinkhole IP adresine yönlendiren standart RPZ zone formatı.",
        "tags": ["DNS Koruma & Sinkhole"],
        "responses": {
          "200": {
            "description": "BIND 9 RPZ Zone dosyası",
            "content": {
              "text/plain": {
                "schema": { "type": "string", "example": "$TTL 300\n@ IN SOA localhost. root.localhost. ( 2026090301 3600 600 86400 300 )\n@ IN NS localhost.\nornek-banka-onay.xyz CNAME .\nmagaza-firsat.site CNAME ." }
              }
            }
          }
        }
      }
    },
    "/api/v1/feed/misp": {
      "get": {
        "summary": "MISP (Malware Information Sharing Platform) Uyumlu Olay Beslemesi",
        "description": "MISP tehdit paylaşım platformları için `Feeds -> Add Feed` üzerinden içe aktarılabilir standart JSON Event formatı.",
        "tags": ["Tehdit İstihbarat Beslemeleri (Feeds)"],
        "responses": {
          "200": {
            "description": "MISP Event JSON yapısı",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/api/v1/scan": {
      "post": {
        "summary": "Canlı URL Risk Analiz & Tehdit Sınıflandırma API'si",
        "description": "Verilen URL'yi Oltanom'un 17 güvenlik katmanı, Levenshtein marka taklit analizi, SSL sertifika denetimi, DOM sosyal mühendislik ve Siber Güvenlik Başkanlığı/DNSBL kalkanları üzerinden anlık tarayarak detaylı risk skoru (0-100) üretir.",
        "tags": ["Gerçek Zamanlı Analiz (Scan API)"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Analiz edilecek şüpheli web sitesi adresi veya SMS bağlantısı",
                    "example": "https://ornek-banka-sube-giris.xyz"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı risk analiz sonucu",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "data": {
                      "type": "object",
                      "properties": {
                        "domain": { "type": "string", "example": "ornek-banka-sube-giris.xyz" },
                        "risk_score": { "type": "integer", "example": 15 },
                        "status": { "type": "string", "example": "high_risk" },
                        "summary": { "type": "string", "example": "Yüksek Oltalama ve Sahte Bankacılık Riski" },
                        "resolved_brand": { "type": "string", "example": "Örnek Banka" }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz parametre veya eksik URL"
          },
          "429": {
            "description": "Hız sınırı (Rate-Limit) veya kota aşıldı"
          }
        }
      }
    },
    "/api/v1/sms/analyze": {
      "post": {
        "summary": "Mobil SMS Filtreleme & Smishing Kalkanı Analiz API'si",
        "description": "Gelen SMS metnini ve gönderen bilgisini analiz eder; sahte kargo, ceza, icra, hediye ve banka oltalama kalıplarını tespit edip içindeki linkleri OTI RAM kalkanı ile denetler. iOS IdentityLookup ve Android SMS filter için aksiyon ('allow', 'filter_to_junk', 'warn_user') üretir.",
        "tags": ["Mobil SMS & Smishing Armor"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["text"],
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Analiz edilecek gelen SMS metni",
                    "example": "Sn. Vatandas, adres eksikligi nedeniyle paketiniz teslim edilemedi: https://kargo-teslimat-takip.top/tr"
                  },
                  "sender": {
                    "type": "string",
                    "description": "SMS gönderen başlığı veya numarası",
                    "example": "B002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı SMS ve Smishing analiz kararı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "data": {
                      "type": "object",
                      "properties": {
                        "isThreat": { "type": "boolean", "example": true },
                        "riskLevel": { "type": "string", "example": "HIGH_RISK" },
                        "threatScore": { "type": "integer", "example": 85 },
                        "action": { "type": "string", "example": "filter_to_junk" },
                        "matchedPatterns": { "type": "array", "items": { "type": "string" } },
                        "extractedUrls": { "type": "array", "items": { "type": "string" } },
                        "reasons": { "type": "array", "items": { "type": "string" } }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz parametre veya boş SMS metni"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Header formatı: `Authorization: Bearer <API_KEY>`. Test için sandbox demo anahtarını kullanabilirsiniz: `olt_sandbox_public_demo_key`"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Alternatif Header formatı: `X-API-Key: <API_KEY>`"
      }
    }
  }
}
