An automated system that leverages AI to analyze security alerts from Elastic Security, providing intelligent triage and analysis through GPT-4.
- Automated Alert Analysis: Processes security alerts from Elastic Security using GPT-4
- Intelligent Triage: Provides severity assessments and actionable insights
- MITRE ATT&CK Integration: Analyzes alerts in context of MITRE ATT&CK framework
- Detailed Documentation: AI generates comprehensive analysis notes for each alert
- Seamless Integration: Works with Elasticsearch and Kibana APIs
- Debug Logging: Detailed logging for troubleshooting and audit trails
- Python 3.8+
- Access to OpenAI API
- Elasticsearch/Kibana instance
- Required Python packages (see Installation)
- Clone the repository
- Install required packages:
pip install openai elasticsearch python-dotenv pyyaml
- Create a
.env
file with your credentials:
ELASTIC_URL=https://your-elasticsearch-instance
KIBANA_URL=https://your-kibana-instance
ELASTIC_USERNAME=your-username
ELASTIC_PASSWORD=your-password
OPENAI_API_KEY=your-openai-key
The system uses three main connector classes:
- KibanaConnector: Interfaces with Kibana API for rule management and note addition
- ElasticsearchConnector: Retrieves security signals from Elasticsearch
- AISecurityAnalyst: Processes alerts using OpenAI's GPT-4
The AI analyst can be configured with:
- Custom OpenAI model selection
- Temperature adjustment for response randomness
- Customizable prompt templates
Run the main script to start processing alerts:
python main.py
The system will:
- Fetch detection rules from Kibana
- Retrieve security signals from Elasticsearch
- Process each signal with AI analysis
- Add detailed notes back to Kibana
The AI analysis includes:
- Severity Assessment
- Rule Description
- Host and User Context
- Detailed Technical Analysis
- Recommended Actions
- SSL verification can be configured for both Elasticsearch and Kibana connections
- Credentials are stored securely in environment variables
- Debug logs are saved in NDJSON format for audit trails
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for GPT-4 API
- Elastic for Elasticsearch and Kibana
- MITRE for the ATT&CK framework