Complete configuration reference for the Security Documents Generator.
- Overview
- Configuration File
- Environment Variables
- Kibana Integration
- AI Service Configuration
- Index Configuration
- Theme Configuration
- Space Management
- Troubleshooting
The Security Documents Generator uses a JSON configuration file (config.json) to manage Kibana connections, AI services, and generation parameters. The tool creates this file automatically on first run if it doesn't exist.
# Auto-generate config on first run
yarn start generate-alerts --count 10
# The tool will prompt for required values and create config.json{
"kibana": {
"host": "https://your-elastic-deployment.es.region.cloud.es.io:9243",
"username": "elastic",
"password": "your-password",
"space": "default"
},
"ai": {
"openai": {
"apiKey": "sk-your-openai-key",
"model": "gpt-4"
},
"claude": {
"apiKey": "your-claude-key",
"model": "claude-3-sonnet-20240229"
},
"gemini": {
"apiKey": "your-gemini-key",
"model": "gemini-pro"
}
},
"generation": {
"defaultBatchSize": 10,
"maxRetries": 3,
"timeoutMs": 30000,
"defaultTheme": "corporate"
},
"features": {
"aiGeneration": true,
"mitre": true,
"sessionView": true,
"visualAnalyzer": true
}
}# Kibana connection
export KIBANA_HOST="https://your-deployment.es.region.cloud.es.io:9243"
export KIBANA_USERNAME="elastic"
export KIBANA_PASSWORD="your-password"
# AI services (at least one required for AI features)
export OPENAI_API_KEY="sk-your-openai-key"
export CLAUDE_API_KEY="your-claude-key"
export GEMINI_API_KEY="your-gemini-key"# Default space
export KIBANA_SPACE="default"
# Generation settings
export DEFAULT_BATCH_SIZE="10"
export DEFAULT_THEME="corporate"
# Debug settings
export DEBUG_AI_RESPONSES="true"
export VERBOSE_LOGGING="true"-
Get your cloud deployment URL:
- Format:
https://deployment-id.es.region.cloud.es.io:9243 - Example:
https://my-deployment.es.us-central1.gcp.cloud.es.io:9243
- Format:
-
Authentication:
- Use built-in
elasticuser for initial setup - Create dedicated service account for production use
- Use built-in
-
Test connection:
yarn start generate-alerts --count 1 --test-connection
{
"kibana": {
"host": "https://your-kibana-host:5601",
"username": "your-username",
"password": "your-password",
"space": "default",
"ssl": {
"rejectUnauthorized": false
}
}
}{
"kibana": {
"host": "https://your-deployment.cloud.es.io:9243",
"username": "elastic",
"password": "your-password",
"space": "security-testing",
"timeout": 30000,
"keepAlive": true,
"headers": {
"X-Custom-Header": "value"
}
}
}{
"ai": {
"openai": {
"apiKey": "sk-your-key",
"model": "gpt-4",
"temperature": 0.7,
"maxTokens": 4000,
"timeout": 30000
}
}
}{
"ai": {
"claude": {
"apiKey": "your-claude-key",
"model": "claude-3-sonnet-20240229",
"maxTokens": 4000,
"temperature": 0.7
}
}
}{
"ai": {
"gemini": {
"apiKey": "your-gemini-key",
"model": "gemini-pro",
"temperature": 0.7,
"topP": 0.8,
"topK": 40
}
}
}The tool attempts AI services in this order:
- OpenAI (if configured)
- Claude (if configured)
- Gemini (if configured)
- If no AI service is configured, the tool generates using templates
- If AI service fails, automatic fallback to template generation
- Configurable retry logic with exponential backoff
{
"indices": {
"alerts": "alerts-security.alerts-{space}",
"logs": "logs-{type}-{space}",
"cases": "cases-{space}",
"knowledgeBase": "knowledge-base-{space}"
}
}{
"indices": {
"alerts": "custom-alerts-{space}-{date}",
"logs": "custom-logs-{type}-{space}-{date}",
"rollover": {
"enabled": true,
"maxSize": "50gb",
"maxAge": "30d"
}
}
}{
"ilm": {
"enabled": true,
"policy": "security-data-policy",
"rolloverAlias": "security-data",
"phases": {
"hot": { "max_age": "7d" },
"warm": { "max_age": "30d" },
"cold": { "max_age": "90d" },
"delete": { "max_age": "365d" }
}
}
}- corporate: Business-appropriate names and scenarios
- marvel: Marvel superhero universe entities
- starwars: Star Wars universe entities
- lotr: Lord of the Rings universe entities
{
"themes": {
"custom": {
"users": ["john.doe", "jane.smith", "admin.user"],
"hosts": ["web-server-01", "db-server-02", "workstation-03"],
"processes": ["custom-app.exe", "security-scanner.exe"],
"domains": ["corporate.com", "internal.local"],
"description": "Custom corporate theme"
}
}
}# Use specific theme
yarn start generate-alerts --theme marvel --count 100
# Use default theme from config
yarn start generate-alerts --count 100{
"spaces": {
"default": {
"kibana": {
"space": "default"
}
},
"training": {
"kibana": {
"space": "security-training"
}
},
"testing": {
"kibana": {
"space": "soc-testing"
}
}
}
}# Generate in specific space
yarn start generate-alerts --space training --count 100
# Generate across multiple spaces
yarn start generate-campaign apt --environments 5 --count 200{
"generation": {
"batchSize": 10,
"maxConcurrent": 3,
"retryPolicy": {
"maxRetries": 3,
"backoffMultiplier": 2,
"maxDelay": 30000
}
}
}{
"performance": {
"caching": {
"enabled": true,
"ttl": 3600,
"maxSize": 1000
},
"connection": {
"poolSize": 10,
"keepAlive": true,
"timeout": 30000
}
}
}{
"logging": {
"level": "info",
"file": {
"enabled": true,
"path": "./logs/generator.log",
"maxSize": "100mb",
"maxFiles": 5
},
"console": {
"enabled": true,
"colorize": true
}
}
}{
"security": {
"apiKeys": {
"rotation": {
"enabled": true,
"intervalDays": 30
},
"encryption": {
"enabled": true,
"algorithm": "aes-256-gcm"
}
}
}
}{
"network": {
"proxy": {
"enabled": true,
"host": "proxy.company.com",
"port": 8080,
"auth": {
"username": "proxy-user",
"password": "proxy-pass"
}
},
"ssl": {
"verify": true,
"ca": "/path/to/ca.pem"
}
}
}# Validate configuration
yarn start validate-config
# Test all connections
yarn start test-connections
# Test specific service
yarn start test-kibana
yarn start test-ai# Check system health
yarn start health-check
# Check specific components
yarn start health-check --component kibana
yarn start health-check --component aiIssue: Cannot connect to Kibana Solutions:
- Verify host URL format
- Check authentication credentials
- Validate network connectivity
- Review SSL/TLS settings
Issue: AI services not responding Solutions:
- Verify API keys are valid
- Check service quotas and limits
- Review timeout settings
- Test fallback services
Issue: Field mapping conflicts Solutions:
- Run setup-mappings command
- Check existing index templates
- Verify field type consistency
{
"debug": {
"enabled": true,
"components": ["kibana", "ai", "generation"],
"logLevel": "debug",
"tracing": {
"enabled": true,
"sampleRate": 0.1
}
}
}{
"monitoring": {
"metrics": {
"enabled": true,
"interval": 60000
},
"alerts": {
"enabled": true,
"thresholds": {
"errorRate": 0.05,
"responseTime": 5000
}
}
}
}Need help with configuration? Start with the auto-generated config and customize as needed for your environment!