AI-powered digital forensics assistant combining Model Context Protocol (MCP) with Amazon Bedrock for intelligent cybersecurity investigations.
# Install dependencies
pip install -r requirements.txt
# Configure AWS credentials
aws configure
# Run the assistant
python bedrock_mcp_client.pyThis tool provides 5 specialized forensic capabilities powered by AI:
| Tool | Purpose | Use Case |
|---|---|---|
analyze_log_file() |
Security log analysis | Detect attack patterns, brute force attempts |
check_ip_reputation() |
IP threat intelligence | Verify malicious IPs, get geo info |
extract_iocs() |
IOC extraction | Find IPs, domains, hashes, URLs in text |
generate_timeline() |
Incident timeline | Reconstruct attack chronology |
generate_incident_report() |
Executive reporting | Professional incident summaries |
- Python 3.8+
- AWS Account with Bedrock access
- MCP Library:
pip install mcp - AWS SDK:
pip install boto3
pip install -r requirements.txtaws configure
# Enter your AWS credentials
# Region: us-east-1 (recommended)python -c "from bedrock_mcp_client import ForensicMCPClient; print('✅ Ready')"python bedrock_mcp_client.py --interactivefrom bedrock_mcp_client import ForensicMCPClient
async def analyze_incident():
async with ForensicMCPClient("forensic_mcp_server.py") as client:
await client.connect_to_mcp_server()
result = await client.query_bedrock(
"Analyze security logs for suspicious authentication patterns"
)
print(result)# 1. Analyze suspicious logs
log_analysis = await client.query_bedrock(
"Analyze /var/log/auth.log for brute force attacks"
)
# 2. Check IP reputation
ip_check = await client.query_bedrock(
"Check reputation of IP 192.168.1.100"
)
# 3. Extract IOCs
iocs = await client.query_bedrock(
"Extract all IOCs from the analyzed logs"
)
# 4. Generate timeline
timeline = await client.query_bedrock(
"Create incident timeline for the last 24 hours"
)
# 5. Create executive report
report = await client.query_bedrock(
"Generate incident report INC-2025-001"
)┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ User Query │───▶│ Bedrock Client │───▶│ Amazon Bedrock │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ MCP Server │
│ (5 Forensic │
│ Tools) │
└──────────────────┘
- Input: File path, analysis type
- Output: Risk score, findings, recommendations
- Detects: Brute force, malware execution, lateral movement
- Input: IP address
- Output: Threat classification, geo info, recommendations
- Sources: Built-in threat intelligence database
- Input: Text content
- Output: IPs, domains, hashes, URLs, emails
- Features: Automatic threat classification
- Input: Incident data, time window
- Output: Chronological event sequence
- Analysis: Attack phases, evidence correlation
- Input: Incident ID, analysis data
- Output: Executive summary, technical details
- Format: Professional incident response report
❌ "MCP library not found"
pip install mcp❌ "Access denied to Bedrock"
# Check AWS credentials
aws sts get-caller-identity
# Verify Bedrock access
aws bedrock list-foundation-models --region us-east-1❌ "Server connection failed"
# Start MCP server first
python forensic_mcp_server.py
# Then run client
python bedrock_mcp_client.pyexport LOG_LEVEL=DEBUG
python bedrock_mcp_client.py --interactiveforensic-mcp-bedrock/
├── bedrock_mcp_client.py # Main client with Bedrock integration
├── forensic_mcp_server.py # MCP server with forensic tools
├── requirements.txt # Python dependencies
└── README.md # This file
MIT License - see LICENSE for details.
🕵️ Happy investigating with AI-powered forensics!
Built for the cybersecurity community