AI-Assisted Cloud Log Monitoring & Threat Triage Pipeline
Smart Log Monitor is a hybrid security pipeline that ingests AWS CloudWatch logs, reduces noise using semantic deduplication, and performs AI-assisted threat triage.
It is designed to simulate a Security Operations Center (SOC) workflow with focus on:
- Log ingestion
- Noise reduction
- Threat detection
- Automated triage
This project consists of two integrated layers:
- CloudTrail → EventBridge → Lambda
- Detects suspicious AWS API activity
- Enriches logs with OSINT data
-
Fetches logs from CloudWatch
-
Deduplicates using embeddings
-
Routes anomalies to AI agents
AWS CloudWatch ───> Python Bridge (Boto3) ───> Semantic Cache (Local) (fetcher.py) (Deduplication) │ ▼ Alerting/Output <─── CrewAI Agents (LLMs) <─── Anomaly Router (Security Triage) (agent_router.py)
See architecture.md for details.
- Pulls logs from CloudWatch
- Maintains checkpoint state
- Routes anomalies to AI agents
- Uses CrewAI + LLM APIs
- Stores processed results
- Enables audit/log persistence
- Stores runtime state (checkpoint + semantic cache)
- Example files provided for reference
smart-log-monitor/
├── src/
│ ├── main.py
│ ├── fetcher.py
│ ├── agent_router.py
│ ├── db_manager.py
│ └── state/
│ ├── checkpoint.example.txt
│ └── semantic_cache.example.json
│
├── cloud/
│ └── lambda_function.py
│
├── screenshots/
├── sample_logs/
├── requirements.txt
├── architecture.md
├── README.md
git clone https://github.com/yourusername/smart-log-monitor.git
cd smart-log-monitorpython3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtCreate .env from .env.example:
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=ap-south-1
LOG_GROUP_NAME=
GEMINI_API_KEY=python src/main.py[SYSTEM] Checkpoint loaded. Last sync: 2026-04-22 21:00:00
[BRIDGE] 150 new log events ingested from CloudWatch.
[CACHE] Semantic check: 142 logs match existing patterns. Suppressing noise...
[ROUTER] 8 unique anomalies detected. Routing to AI Agents...
[AI TRIAGE REPORT]
---------------------------------------------------------
ALERT: Potential Unauthorized IAM Modification
SEVERITY: High
REASONING: Logs show 'UpdateAssumeRolePolicy' followed by a 'CreateAccessKey'
from an unrecognized IP. This matches a backdoor creation pattern.
ACTION: Quarantine IAM User and Rotate Keys.
---------------------------------------------------------
Bala Focus: Cloud Security | SOC Engineering | Threat Detection