An advanced SIEM system with integrated AI-powered detection, real-time log analysis, and intelligent correlation capabilities.
# Clone the repository
git clone https://github.com/BadBoy0170/SIEMcli.git
cd SIEMcli
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the SIEM
python3 src/siem_core.py
-
Real-time Log Collection
- System logs
- Network logs
- Application logs
- Custom log sources support
- Automatic log file creation and monitoring
-
AI-Powered Detection
- Machine learning-based anomaly detection
- Deep learning pattern recognition
- Signature-based detection
- Adaptive learning from historical data
- Hybrid detection approach (ML + Rule-based)
-
Advanced Analytics
- Pattern matching
- Event correlation
- Frequency analysis
- Sequence detection
- Similarity analysis
-
Smart Alerting
- Severity-based prioritization
- Alert correlation
- False positive reduction
- Customizable thresholds
- Real-time notifications
SIEMcli/
├── config/
│ └── custom_signatures.yaml # Custom detection signatures
├── logs/
│ ├── system.log # System logs
│ ├── network.log # Network logs
│ └── app.log # Application logs
├── src/
│ ├── siem_core.py # Main SIEM engine
│ ├── collectors.py # Log collectors
│ ├── analyzer.py # Log analyzer
│ └── ai_detection.py # AI detection engine
├── requirements.txt # Python dependencies
└── README.md # This file
You can add custom detection signatures in config/custom_signatures.yaml
:
custom_threats:
- name: "Custom Malware Pattern"
pattern: "your_pattern_here"
severity: "HIGH"
web_attacks:
- name: "Custom Web Attack"
pattern: "attack_pattern"
severity: "CRITICAL"
By default, the SIEM monitors these log files:
logs/system.log
: System-level eventslogs/network.log
: Network traffic and security eventslogs/app.log
: Application-specific logs
- Start the SIEM:
python3 src/siem_core.py
- The system will:
- Display a banner with version information
- Initialize all components
- Start monitoring configured log files
- Begin real-time analysis
Run the test suite to verify functionality:
python3 test_siem.py
This will:
- Test all components
- Generate sample events
- Verify detection capabilities
- Create a new log file in the
logs
directory - Update
src/collectors.py
to include the new log source:
self.source_configs = {
'your_source': {
'paths': ['logs/your_log.log'],
'patterns': ['error', 'warning', 'critical']
}
}
- Open
config/custom_signatures.yaml
- Add your signature under appropriate category:
your_category:
- name: "Signature Name"
pattern: "regex_pattern"
severity: "HIGH" # CRITICAL, HIGH, MEDIUM, LOW
Detects known patterns including:
- Malware and backdoors
- Command injection
- SQL injection
- Privilege escalation
- Data exfiltration
- Reconnaissance activities
- Anomaly detection using Isolation Forest
- Pattern recognition using neural networks
- Adaptive learning from historical data
- Feature extraction for different log types
- Rule-based correlation
- Temporal correlation
- Sequence detection
- Frequency analysis
The SIEM provides real-time alerts for:
- Critical security events
- Anomalous behavior
- Pattern matches
- Correlated events
Alert severity levels:
- CRITICAL: Immediate action required
- HIGH: Requires prompt attention
- MEDIUM: Should be investigated
- LOW: Informational
-
Permission Errors
sudo chmod 644 logs/*.log sudo chown $USER logs/
-
Module Import Errors
pip install -r requirements.txt --upgrade
-
Log File Access
- Ensure log files exist
- Check file permissions
- Verify paths in configuration
-
Memory Usage
- Adjust
maxlen
in event history - Modify batch processing size
- Configure cleanup intervals
- Adjust
-
CPU Usage
- Adjust processing intervals
- Optimize pattern matching
- Configure event batching
-
Log File Security
- Use appropriate file permissions
- Implement log rotation
- Secure backup storage
-
Detection Rules
- Regularly update signatures
- Tune detection thresholds
- Monitor false positives
-
System Access
- Restrict file access
- Use secure configurations
- Monitor system resources
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and feature requests:
- Check existing issues
- Create a new issue with:
- Clear description
- Steps to reproduce
- Expected behavior
- System information