chore(haproxy,terraform): harden haproxy stats and pin incus provider
- Add maxconn limit and HTTP timeouts to mitigate slowloris attacks - Restrict stats endpoint to internal LAN and localhost only - Hide HAProxy version on stats page - Pin Incus Terraform provider to ~> 1.0 for stability
This commit is contained in:
@@ -9,6 +9,7 @@ global
|
|||||||
log /dev/log local0
|
log /dev/log local0
|
||||||
log /dev/log local1 notice
|
log /dev/log local1 notice
|
||||||
stats timeout 30s
|
stats timeout 30s
|
||||||
|
maxconn 4096
|
||||||
# Ubuntu systemd service handles user/group and daemonization
|
# Ubuntu systemd service handles user/group and daemonization
|
||||||
|
|
||||||
# Default SSL material locations
|
# Default SSL material locations
|
||||||
@@ -30,16 +31,24 @@ defaults
|
|||||||
timeout connect 5s
|
timeout connect 5s
|
||||||
timeout client 50s
|
timeout client 50s
|
||||||
timeout server 50s
|
timeout server 50s
|
||||||
|
# Slowloris protection: cap time to receive the full request/keep-alive idle
|
||||||
|
timeout http-request 10s
|
||||||
|
timeout http-keep-alive 10s
|
||||||
|
|
||||||
# Stats page with Prometheus metrics
|
# Stats page with Prometheus metrics
|
||||||
listen stats
|
listen stats
|
||||||
bind *:{{ haproxy_stats_port }}
|
bind *:{{ haproxy_stats_port }}
|
||||||
mode http
|
mode http
|
||||||
|
# Restrict to the Ouranos LAN + localhost (Alloy scrapes via localhost).
|
||||||
|
# Belt-and-suspenders alongside host-level firewalling.
|
||||||
|
acl from_internal src 10.10.0.0/16 127.0.0.0/8
|
||||||
|
http-request deny unless from_internal
|
||||||
stats enable
|
stats enable
|
||||||
stats uri /metrics
|
stats uri /metrics
|
||||||
stats refresh 15s
|
stats refresh 15s
|
||||||
stats show-legends
|
stats show-legends
|
||||||
stats show-node
|
stats show-node
|
||||||
|
stats hide-version
|
||||||
|
|
||||||
# Prometheus metrics endpoint
|
# Prometheus metrics endpoint
|
||||||
http-request use-service prometheus-exporter if { path /metrics }
|
http-request use-service prometheus-exporter if { path /metrics }
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
incus = {
|
incus = {
|
||||||
source = "lxc/incus"
|
source = "lxc/incus"
|
||||||
|
version = "~> 1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user