Use Cases
- Centralized LLM security proxy for multiple apps and teams
- Compliance workloads that require audit trails and private networking
- High-throughput production traffic with autoscaling and managed ingress
Architecture Choices
- EC2 + Docker for low-cost, low-ops environments
- ECS Fargate for managed compute and simpler scaling
- Optional: ALB in front of the service for TLS termination and health checks
Option A: EC2 + Docker
Provision an EC2 Instance
- Choose Amazon Linux 2023 or Ubuntu 22.04
- Open inbound ports for your app and KoreShield (default 8000)
- Prefer placing the instance in a private subnet with an ALB in front
Option B: ECS (Fargate)
Create an ECS Task Definition
- Container port: 8000
- Environment variables: provider keys
- Mount your config or bake it into the image
- Attach an IAM role for Secrets Manager or SSM access
Secrets and Config
Store provider keys in AWS Secrets Manager or SSM Parameter Store for enhanced security.
- Store provider keys in AWS Secrets Manager or SSM Parameter Store
- Pass secrets to the task as environment variables
- Use
CONFIG_FILEif you mount a custom config path
Networking and TLS
- Terminate TLS at the ALB
- Restrict inbound access to known CIDR ranges or VPC endpoints
- Use a WAF if the endpoint is internet-facing
Observability
- Enable
json_logs: trueand ship logs to CloudWatch - Scrape
/metricswith Prometheus or use a sidecar exporter - Create CloudWatch alarms for high error rates and latency
Security Notes
- Store API keys in AWS Secrets Manager or SSM Parameter Store
- Use
json_logs: truein production - Restrict inbound access to the proxy endpoint
Troubleshooting
Next Steps
- Configure providers in /configuration/
- Add monitoring in ../monitoring/prometheus.mdx