AS
asieduernest12/symon-dokploy-monitoring-sec
Ashia LXC Monitoring and Security Implementation
This project replicates the monitoring and security stack from schrep-ofin to ashia-lxc using Dokploy.
Services Included
- Prometheus: Metrics collection and alerting
- Grafana: Visualization dashboard
- Loki: Log aggregation
- Node Exporter: System metrics
- cAdvisor: Container metrics
- Alloy: Telemetry collection agent
- Crowdsec: Threat detection with Traefik bouncer
Deployment to Dokploy
-
Create Project:
# Via Dokploy API (replace with your values) curl -X POST http://your-dokploy-server:3000/api/projects \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "monitoring-manager", "description": "LXC monitoring and security"}'
-
Upload Configuration:
- Upload
docker-compose.yml - Upload all config files in
monitoring/andsecurity/ - Set environment variables from
.env
- Upload
-
Configure Domain:
- Set domain to
monitoring.ashia-lxc.com - Ensure SSL certificates are configured
- Set domain to
-
Deploy:
- Deploy the stack via Dokploy interface
- Run the setup script to generate Crowdsec API keys
Local Development
# Copy environment
cp .env.example .env
# Edit .env with your values
# Run setup
./setup.sh
# Access services locally:
# Grafana: http://localhost:3000
# Prometheus: http://localhost:9090Configuration Files
monitoring/prometheus.yml: Prometheus scrape targetsmonitoring/loki/config.yml: Loki configurationmonitoring/alloy/config.alloy: Alloy telemetry configsecurity/crowdsec/acquis.yaml: Crowdsec log sourcesmonitoring/grafana/provisioning/datasources.yml: Grafana datasources
Security Features
- Crowdsec threat detection
- Rate limiting (50 req/min, burst 100)
- Security headers (HSTS, etc.)
- Path-based authentication for services
Monitoring URLs
- Grafana:
https://monitoring.ashia-lxc.com/grafana - Prometheus:
https://monitoring.ashia-lxc.com/prometheus
Troubleshooting
- Crowdsec not detecting threats: Check acquis.yaml and log paths
- Metrics not appearing: Verify service discovery in Prometheus
- Traefik routing issues: Check labels and domain configuration
- Bouncer blocking legitimate traffic: Adjust Crowdsec rules