whitelist homelab edge management ranges
Homelab Main / validate (push) Successful in 15s Details
Homelab Main / running-update (push) Successful in 7s Details
Homelab Main / debian-ops (push) Successful in 1m12s Details

This commit is contained in:
juvenal.diaz 2026-09-28 09:19:59 -06:00
parent 3b99ce0486
commit 200e11d23c
3 changed files with 18 additions and 0 deletions

View File

@ -11,6 +11,7 @@ terraform {
locals {
compose_file = templatefile("${path.module}/templates/docker-compose.yml.tftpl", {})
crowdsec_acquis = templatefile("${path.module}/templates/crowdsec-acquis.yaml.tftpl", {})
crowdsec_whitelist = templatefile("${path.module}/templates/crowdsec-homelab-whitelist.yaml.tftpl", {})
heimdall_server_name = "heimdall.${var.server_name}"
heimdall_backend_host = var.heimdall_backend_host != "" ? var.heimdall_backend_host : var.gitea_backend_host
server_names = distinct(concat([var.server_name, local.heimdall_server_name], var.additional_server_names))
@ -53,6 +54,7 @@ locals {
config_hash = sha256(join("\n---\n", [
local.compose_file,
local.crowdsec_acquis,
local.crowdsec_whitelist,
local.default_conf,
local.default_vcl,
local.haproxy_cfg,
@ -112,6 +114,11 @@ resource "null_resource" "edge_services" {
destination = "/tmp/homelab-edge/config_files/crowdsec-acquis.yaml"
}
provisioner "file" {
content = local.crowdsec_whitelist
destination = "/tmp/homelab-edge/config_files/crowdsec-homelab-whitelist.yaml"
}
provisioner "file" {
content = local.default_vcl
destination = "/tmp/homelab-edge/config_files/default.vcl"
@ -204,6 +211,7 @@ sudo mkdir -p \
"$install_dir/letsencrypt"
sudo cp /tmp/homelab-edge/docker-compose.yml "$install_dir/docker-compose.yml"
sudo cp /tmp/homelab-edge/config_files/crowdsec-acquis.yaml "$install_dir/config_files/crowdsec-acquis.yaml"
sudo cp /tmp/homelab-edge/config_files/crowdsec-homelab-whitelist.yaml "$install_dir/config_files/crowdsec-homelab-whitelist.yaml"
sudo cp /tmp/homelab-edge/config_files/default.conf "$install_dir/config_files/default.conf"
sudo cp /tmp/homelab-edge/config_files/default.vcl "$install_dir/config_files/default.vcl"
sudo cp /tmp/homelab-edge/config_files/haproxy.cfg "$install_dir/config_files/haproxy.cfg"

View File

@ -0,0 +1,9 @@
name: homelab/edge-whitelist
description: "Whitelist homelab operator and private management ranges"
whitelist:
reason: "Homelab operator and management networks"
ip:
- "189.203.207.201"
cidr:
- "192.168.100.0/24"
- "100.64.0.0/10"

View File

@ -30,6 +30,7 @@ services:
- crowdsec_config:/etc/crowdsec
- crowdsec_data:/var/lib/crowdsec/data
- ./config_files/crowdsec-acquis.yaml:/etc/crowdsec/acquis.d/nginx.yaml:ro
- ./config_files/crowdsec-homelab-whitelist.yaml:/etc/crowdsec/parsers/s02-enrich/homelab-whitelist.yaml:ro
haproxy-dev:
image: haproxy:alpine