AI-SOC Triage Alert System
Kurulum (uv + brew)
1. Brew (macOS + Linux)
# macOS
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Linux
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
2. uv Kurulumu
# macOS
brew install uv
# Linux
brew install uv
3. Redis (Phase 2)
brew install redis
# Servisi başlat
brew services start redis
# Manuel başlat
redis-server
4. Proje Kurulumu
# Projeye git
cd ai-soc-project
# Virtual env oluştur ve dependencies kur
uv sync
# Virtual env'i aktif et
source .venv/bin/activate
# .env dosyasını oluştur
cp .env.example .env
# .env dosyasını düzenle (aşağıdaki tablo)
4.1 .env Değişkenleri
| Grup | Değişken | Açıklama |
|---|---|---|
| Core | APP_NAME |
Uygulama adı |
DEBUG |
Hata ayıklama (dev) | |
LOG_LEVEL |
DEBUG/INFO/WARNING/ERROR/CRITICAL |
|
LOG_FORMAT |
json/console (yoksa DEBUG'a göre) |
|
| Elasticsearch | ELASTICSEARCH_HOST |
Cluster URL |
ELASTICSEARCH_USERNAME / ELASTICSEARCH_PASSWORD |
Basic auth | |
ELASTICSEARCH_API_KEY |
API key (varsa) | |
ELASTICSEARCH_CA_CERTS |
TLS CA (varsa → verify_certs=True) |
|
ELASTICSEARCH_CASE_USERNAME / ELASTICSEARCH_CASE_PASSWORD |
Case yazımı için named user | |
ELASTICSEARCH_PROFILE_UID |
created_by.profile_uid |
|
| Telegram | TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_ID |
Faz 1 |
| Dış API | VIRUSTOTAL_API_KEY |
VirusTotal |
ABUSEIPDB_API_KEY |
AbuseIPDB | |
GREYNOISE_API_KEY |
GreyNoise (boş = anonim kota) | |
OPENAI_API_KEY / OPENAI_MODEL |
Faz 4 agent | |
| MCP | MCP_TRANSPORT |
stdio/http |
MCP_SERVER_PORT |
http transport portu | |
| Redis | REDIS_URL |
cache |
REDIS_CACHE_TTL |
saniye | |
| Security | JWT_SECRET_KEY / JWT_ALGORITHM |
— |
WEBHOOK_SECRET |
— | |
| Retry/Rate | MAX_RETRIES / REQUEST_TIMEOUT |
ES |
RATE_LIMIT_REQUESTS / RATE_LIMIT_WINDOW |
— | |
| Aggregation | AGGREGATION_ENABLED |
gruplama açık/kapalı |
AGGREGATION_DEDUP_WINDOW_SECONDS / AGGREGATION_TIME_WINDOW_SECONDS |
— | |
AGGREGATION_CORRELATION_WINDOW_SECONDS / AGGREGATION_MAX_ALERTS_PER_GROUP |
— | |
AGGREGATION_POLL_INTERVAL_SECONDS |
poller aralığı |
rest_api_host/rest_api_portyalnızca eski REST için — kaldırılmış durumda, README'de listelenmez.
5. Çalıştırma
REST (FastAPI) kaldırıldı — entry point MCP server'dır (Faz 3). Transport/port
Settings.mcp_transport (stdio | http) ve mcp_server_port ile ayarlanır.
# MCP server (stdio)
uv run python -m src.mcp.server
# MCP server (http) — MCP_TRANSPORT=http ise
MCP_TRANSPORT=http uv run python -m src.mcp.server
# veya aktif venv ile
python -m src.mcp.server
MCP server entry point'i Faz 3'te tamamlanacak; şu an
src/mcp/iskelettir.
6. Test
uv run pytest
uv run pytest --cov=src
7. Lint & Type Check
uv run ruff check .
uv run ruff format .
uv run mypy src/
Komutlar Özeti
| Komut | Açıklama |
|---|---|
uv sync |
Dependencies kur (pyproject.toml'dan) |
uv run <command> |
Virtual env içinde komut çalıştır |
uv add <package> |
Yeni dependency ekle |
uv remove <package> |
Dependency kaldır |
uv pip list |
Kurulu paketleri listele |
uv run python -m src.mcp.server |
MCP server başlat (Faz 3) |
brew services start redis |
Redis'i başlat |
brew services stop redis |
Redis'i durdur |
Proje Yapısı
ai-soc-project/
├── src/
│ ├── core/
│ │ ├── config/settings.py
│ │ ├── config/logging_config.py # merkezi structlog (JSON/console, censor)
│ │ ├── models/schemas.py
│ │ ├── interfaces/ # case_provider, alert_provider
│ │ └── services/ # aggregator.py (alert gruplama)
│ ├── integrations/
│ │ ├── elasticsearch/service.py # ES + case_client (OCC)
│ │ ├── telegram/service.py
│ │ └── external/ # virustotal, abuseipdb, greynoise,
│ │ │ # cache, rate_limiter, enrichment
│ ├── mcp/ # Faz 3 — MCP server/tools (iskelet)
│ └── agent/ # Faz 4 — LangChain agent
├── tests/
│ ├── core/
│ └── integrations/
├── docs/
├── pyproject.toml
├── .env.example
└── docker-compose.yml
Fazlar
| Faz | Açıklama | Süre |
|---|---|---|
| Phase 1 | Alert → Telegram | 1 hafta |
| Phase 2 | Case + Enrichment + MCP (REST iptal) | 2 hafta |
| Phase 3 | MCP Server | 2 hafta |
| Phase 4 | AI Agent (LangChain) | 2-3 hafta |
| Phase 5 | Slack + Wazuh + Deployment | İsteğe bağlı |
Metadata
Release files for siphai-core 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| siphai_core-0.1.0.tar.gz | 359.9 kB | Without provenance | Details for siphai_core-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| siphai_core-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for siphai_core-0.1.0-py3-none-any.whl |
Total release size: 402.5 kB
Release files / siphai_core-0.1.0.tar.gz
| Download URL | siphai_core-0.1.0.tar.gz |
|---|---|
| Size | 359.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
808bffd8434a56e248ec3f7351db5fcfcf82f4196e1acdd0eb966e51d077f4c0
|
|
BLAKE2b-256 checksum How to use checksums |
d6f1275c725f6ed66574ad08452a3dbd561009651ce5a4f8c21b5a8c01ba44d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / siphai_core-0.1.0-py3-none-any.whl
| Download URL | siphai_core-0.1.0-py3-none-any.whl |
|---|---|
| Size | 42.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
17345395f823ad524ec5ff6ceeb35ae12f7874e3ab546b4a81cdaa09e0009702
|
|
BLAKE2b-256 checksum How to use checksums |
3e8068b87c4494af7918e65e70335c6e7140ec167acde36f682ef72f93cc0527
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for siphai-core 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.