General Settings
This page covers the core configuration settings inconfig.yaml, including server options, logging, provider setup, monitoring, and alerting.
Server Configuration
Configure the KoreShield server host and port:Parameters
IP address to bind the server to. Use
0.0.0.0 to listen on all interfaces.Port number for the KoreShield server
In production, KoreShield typically runs behind a load balancer or reverse proxy. Bind to
0.0.0.0 to accept connections from the proxy.Logging Configuration
Control logging output, format, and destination:Parameters
Log level. Options:
DEBUG, INFO, WARNING, ERROR, CRITICALEnable structured JSON logging for easier parsing by log aggregators
Log to stdout instead of files when running in containers
Log file path (ignored if
container_mode: true)Production Recommendations
Security Configuration
Define security policies and threat detection behavior:See Security Policies for detailed policy configuration.
Provider Configuration
Enable and configure AI provider integrations:Provider Parameters
Enable or disable the provider
Base URL for the provider’s API endpoint
Environment Variables
Provider API keys must be set via environment variables:Multi-Provider Setup
Enable multiple providers for failover or routing:How does KoreShield route between multiple providers?
How does KoreShield route between multiple providers?
When multiple providers are enabled, KoreShield routes requests based on the model specified in the API call. For example:
gpt-4→ OpenAIclaude-3-opus→ Anthropicdeepseek-chat→ DeepSeek
Can I use custom provider URLs?
Can I use custom provider URLs?
Yes, you can override the base URL for any provider. This is useful for:
- Self-hosted model endpoints
- Regional endpoints
- Custom proxy configurations
Redis Configuration
Enable distributed rate limiting with Redis:See Rate Limiting for detailed Redis configuration and production setup.
Monitoring Configuration
Enable health checks and monitoring:Parameters
Enable monitoring and health checks
Interval between health checks in seconds
Health Check Endpoint
When monitoring is enabled, KoreShield exposes a health check endpoint:Configure your load balancer to use
/health for health checks.Alerting Configuration
Configure alerts for security events and system health:Alert Parameters
Enable alerting system
Human-readable name for the alert rule
Condition expression that triggers the alert (e.g.,
attacks_detected > 10)Alert severity level:
info, warning, criticalNotification channels:
email, slack, pagerduty, webhookMinimum time between repeated alerts for the same condition
Enable or disable this specific alert rule
Alert Examples
Complete Production Example
Here’s a complete production-ready configuration:Frequently Asked Questions
How do I validate my configuration before deploying?
How do I validate my configuration before deploying?
KoreShield validates configuration on startup. To test:
Can I use environment variables in config.yaml?
Can I use environment variables in config.yaml?
Yes, use
${VARIABLE_NAME} syntax:What's the recommended logging level for production?
What's the recommended logging level for production?
Use
INFO for production. This provides:- Request/response logging
- Security event tracking
- Error reporting
DEBUG only for troubleshooting (generates high log volume).How do I rotate log files?
How do I rotate log files?
When using file-based logging (not container mode), use logrotate:
Related Documentation
Security Policies
Configure threat detection and response policies
Rate Limiting
Set up Redis-based distributed rate limiting
Production Checklist
Pre-deployment checklist for production
Monitoring
Monitor KoreShield metrics and health