diff --git a/privfrontends/blocked-ranges.yaml b/privfrontends/blocked-ranges.yaml new file mode 100644 index 0000000..4b67981 --- /dev/null +++ b/privfrontends/blocked-ranges.yaml @@ -0,0 +1,2 @@ +# As of now, this only includes Alibaba AS45102 +blocked_ranges: "2400:b200:4100::/48 2400:b200:4101::/48 2400:b200:4102::/48 2400:b200:4103::/48 2401:b180:4100::/48 2404:2280:1000::/36 2404:2280:1000::/37 2404:2280:1800::/37 2404:2280:2000::/36 2404:2280:2000::/37 2404:2280:2800::/37 2404:2280:4ffe::/48 2404:2280:4fff::/48 2408:4000:1000::/48 2408:4000:1001::/48 2408:4009:500::/48 240b:4000::/32 240b:4000::/33 240b:4000:8000::/33 240b:4001::/32 240b:4001::/33 240b:4001:8000::/33 240b:4002::/32 240b:4002::/33 240b:4002:8000::/33 240b:4003:e::/48 240b:4004::/32 240b:4004::/33 240b:4004:8000::/33 240b:4005::/32 240b:4005::/33 240b:4005:8000::/33 240b:4007::/32 240b:4007::/33 240b:4007:8000::/33 240b:4007:fffd::/48 240b:4009::/32 240b:4009::/33 240b:4009:8000::/33 240b:400b::/32 240b:400b::/33 240b:400b:8000::/33 240b:400c::/32 240b:400c::/33 240b:400c::/40 240b:400c::/41 240b:400c:80::/41 240b:400c:100::/40 240b:400c:100::/41 240b:400c:180::/41 240b:400c:f00::/48 240b:400c:f01::/48 240b:400c:8000::/33 240b:400d::/32 240b:400d::/33 240b:400d:8000::/33 240b:400e::/32 240b:400e::/33 240b:400e:8000::/33 240b:400f::/32 240b:400f::/33 240b:400f:8000::/33 240b:4011::/32 240b:4011::/33 240b:4011:8000::/33 240b:4011:fffc::/48 240b:4012::/48 5.181.224.0/23 8.208.0.0/16 8.208.0.0/17 8.208.0.0/18 8.208.0.0/19 8.208.32.0/19 8.208.128.0/17 8.209.0.0/19 8.209.0.0/20 8.209.16.0/20 8.209.36.0/23 8.209.36.0/24 8.209.37.0/24 8.209.38.0/23 8.209.38.0/24 8.209.39.0/24 8.209.40.0/22 8.209.40.0/23 8.209.42.0/23 8.209.44.0/22 8.209.44.0/23 8.209.46.0/23 8.209.48.0/20 8.209.48.0/21 8.209.56.0/21 8.209.64.0/18 8.209.64.0/19 8.209.96.0/19 8.209.128.0/18 8.209.128.0/19 8.209.160.0/19 8.209.192.0/18 8.209.192.0/19 8.209.224.0/19 8.210.0.0/16 8.210.0.0/17 8.210.128.0/17 8.210.240.0/24 8.211.0.0/17 8.211.0.0/18 8.211.64.0/18 8.211.128.0/18 8.211.128.0/19 8.211.160.0/19 8.211.192.0/18 8.211.192.0/19 8.211.224.0/19 8.211.226.0/24 8.212.0.0/17 8.212.0.0/18 8.212.64.0/18 8.212.128.0/18 8.212.128.0/19 8.212.160.0/19 8.212.192.0/18 8.212.192.0/19 8.212.224.0/19 8.213.0.0/17 8.213.0.0/18 8.213.64.0/18 8.213.128.0/19 8.213.128.0/20 8.213.144.0/20 8.213.160.0/21 8.213.160.0/22 8.213.164.0/22 8.213.176.0/20 8.213.176.0/21 8.213.184.0/21 8.213.192.0/18 8.213.192.0/19 8.213.224.0/19 8.213.251.0/24 8.213.252.0/24 8.214.0.0/16 8.214.0.0/17 8.214.128.0/17 8.215.0.0/16 8.215.0.0/17 8.215.128.0/17 8.215.160.0/24 8.216.0.0/17 8.216.0.0/18 8.216.64.0/18 8.216.69.0/24 8.216.128.0/17 8.216.128.0/18 8.216.148.0/24 8.216.192.0/18 8.217.0.0/16 8.217.0.0/17 8.217.128.0/17 8.218.0.0/16 8.218.0.0/17 8.218.128.0/17 8.219.0.0/16 8.219.0.0/17 8.219.128.0/17 8.220.0.0/18 8.220.0.0/19 8.220.32.0/19 8.220.64.0/18 8.220.64.0/19 8.220.96.0/19 8.220.116.0/23 8.220.116.0/24 8.220.128.0/18 8.220.128.0/19 8.220.147.0/24 8.220.160.0/19 8.220.192.0/18 8.220.192.0/19 8.220.224.0/19 8.220.229.0/24 8.221.0.0/17 8.221.0.0/18 8.221.64.0/18 8.221.128.0/17 8.221.128.0/18 8.221.192.0/18 8.222.0.0/20 8.222.0.0/21 8.222.8.0/21 8.222.16.0/20 8.222.16.0/21 8.222.24.0/21 8.222.32.0/20 8.222.32.0/21 8.222.40.0/21 8.222.48.0/20 8.222.48.0/21 8.222.56.0/21 8.222.64.0/20 8.222.64.0/21 8.222.72.0/21 8.222.80.0/20 8.222.80.0/21 8.222.88.0/21 8.222.128.0/17 8.222.128.0/18 8.222.192.0/18 8.223.0.0/17 8.223.0.0/18 8.223.64.0/18 43.91.0.0/16 43.91.0.0/17 43.91.128.0/17 43.96.0.0/24 43.96.1.0/24 43.96.2.0/24 43.96.3.0/24 43.96.4.0/24 43.96.5.0/24 43.96.7.0/24 43.96.8.0/24 43.96.9.0/24 43.96.10.0/24 43.96.11.0/24 43.96.12.0/24 43.96.13.0/24 43.96.16.0/24 43.96.17.0/24 43.96.18.0/24 43.96.19.0/24 43.96.20.0/24 43.96.21.0/24 43.96.23.0/24 43.96.24.0/24 43.96.25.0/24 43.96.26.0/24 43.96.27.0/24 43.96.28.0/24 43.96.29.0/24 43.96.32.0/24 43.96.33.0/24 43.96.34.0/24 43.96.35.0/24 43.96.36.0/24 43.96.66.0/24 43.96.67.0/24 43.96.68.0/24 43.96.69.0/24 43.96.70.0/24 43.96.71.0/24 43.96.72.0/24 43.96.73.0/24 43.96.74.0/24 43.96.75.0/24 43.96.77.0/24 43.96.80.0/24 45.196.28.0/24 45.199.179.0/24 47.52.0.0/16 47.52.0.0/17 47.52.128.0/17 47.56.0.0/15 47.56.0.0/16 47.57.0.0/16 47.74.0.0/18 47.74.0.0/19 47.74.0.0/21 47.74.32.0/19 47.74.64.0/18 47.74.64.0/19 47.74.96.0/19 47.74.128.0/17 47.74.128.0/18 47.74.192.0/18 47.75.0.0/16 47.75.0.0/17 47.75.128.0/17 47.76.0.0/16 47.76.0.0/17 47.76.128.0/17 47.77.0.0/22 47.77.0.0/23 47.77.2.0/23 47.77.4.0/22 47.77.4.0/23 47.77.6.0/23 47.78.0.0/16 47.78.0.0/17 47.78.128.0/17 47.79.0.0/20 47.79.0.0/21 47.79.8.0/21 47.79.16.0/20 47.79.16.0/21 47.79.24.0/21 47.79.32.0/20 47.79.32.0/21 47.79.40.0/21 47.79.48.0/20 47.79.48.0/21 47.79.52.0/23 47.79.54.0/23 47.79.56.0/21 47.79.56.0/23 47.79.58.0/23 47.79.60.0/23 47.79.62.0/23 47.79.64.0/20 47.79.64.0/21 47.79.72.0/21 47.79.96.0/19 47.79.96.0/20 47.79.104.0/21 47.79.112.0/20 47.80.0.0/18 47.80.0.0/19 47.80.32.0/19 47.80.64.0/18 47.80.64.0/19 47.80.96.0/19 47.82.0.0/18 47.82.0.0/19 47.82.32.0/19 47.82.32.0/21 47.88.0.0/17 47.88.0.0/18 47.88.41.0/24 47.88.42.0/24 47.88.43.0/24 47.88.64.0/18 47.88.128.0/17 47.88.128.0/18 47.88.135.0/24 47.88.192.0/18 47.89.0.0/18 47.89.0.0/19 47.89.32.0/19 47.89.71.0/24 47.89.72.0/22 47.89.72.0/23 47.89.74.0/23 47.89.76.0/22 47.89.76.0/23 47.89.78.0/23 47.89.80.0/23 47.89.82.0/23 47.89.84.0/24 47.89.85.0/24 47.89.88.0/22 47.89.88.0/23 47.89.90.0/23 47.89.92.0/22 47.89.92.0/23 47.89.94.0/23 47.89.96.0/24 47.89.97.0/24 47.89.98.0/23 47.89.99.0/24 47.89.100.0/24 47.89.101.0/24 47.89.102.0/24 47.89.103.0/24 47.89.104.0/21 47.89.104.0/22 47.89.108.0/22 47.89.122.0/24 47.89.123.0/24 47.89.124.0/23 47.89.124.0/24 47.89.125.0/24 47.89.128.0/18 47.89.128.0/19 47.89.160.0/19 47.89.192.0/18 47.89.192.0/19 47.89.221.0/24 47.89.224.0/19 47.90.0.0/17 47.90.0.0/18 47.90.64.0/18 47.90.128.0/17 47.90.128.0/18 47.90.192.0/18 47.91.0.0/19 47.91.0.0/20 47.91.16.0/20 47.91.32.0/19 47.91.32.0/20 47.91.48.0/20 47.91.64.0/19 47.91.64.0/20 47.91.80.0/20 47.91.96.0/19 47.91.96.0/20 47.91.112.0/20 47.91.128.0/17 47.91.128.0/18 47.91.192.0/18 47.235.0.0/19 47.235.0.0/22 47.235.0.0/23 47.235.1.0/24 47.235.2.0/23 47.235.4.0/24 47.235.5.0/24 47.235.6.0/23 47.235.6.0/24 47.235.7.0/24 47.235.8.0/24 47.235.9.0/24 47.235.10.0/23 47.235.10.0/24 47.235.11.0/24 47.235.12.0/23 47.235.12.0/24 47.235.13.0/24 47.235.16.0/23 47.235.16.0/24 47.235.18.0/23 47.235.18.0/24 47.235.19.0/24 47.235.20.0/24 47.235.21.0/24 47.235.22.0/24 47.235.24.0/22 47.235.24.0/23 47.235.26.0/23 47.235.28.0/23 47.235.28.0/24 47.235.29.0/24 47.236.0.0/15 47.236.0.0/16 47.237.0.0/16 47.237.34.0/24 47.238.0.0/15 47.238.0.0/16 47.239.0.0/16 47.240.0.0/16 47.240.0.0/17 47.240.128.0/17 47.240.213.0/24 47.241.0.0/16 47.241.0.0/17 47.241.128.0/17 47.242.0.0/15 47.242.0.0/16 47.243.0.0/16 47.244.0.0/16 47.244.0.0/17 47.244.73.0/24 47.244.128.0/17 47.245.0.0/18 47.245.0.0/19 47.245.32.0/19 47.245.64.0/18 47.245.64.0/19 47.245.96.0/19 47.245.128.0/17 47.245.128.0/18 47.245.192.0/18 47.246.32.0/22 47.246.64.0/24 47.246.66.0/24 47.246.67.0/24 47.246.68.0/23 47.246.68.0/24 47.246.69.0/24 47.246.72.0/21 47.246.72.0/22 47.246.76.0/22 47.246.80.0/24 47.246.82.0/23 47.246.82.0/24 47.246.83.0/24 47.246.84.0/22 47.246.84.0/23 47.246.86.0/23 47.246.88.0/22 47.246.88.0/23 47.246.90.0/23 47.246.92.0/23 47.246.92.0/24 47.246.93.0/24 47.246.96.0/21 47.246.96.0/22 47.246.100.0/22 47.246.104.0/21 47.246.104.0/22 47.246.108.0/22 47.246.120.0/24 47.246.121.0/24 47.246.122.0/24 47.246.123.0/24 47.246.124.0/24 47.246.125.0/24 47.246.128.0/22 47.246.128.0/23 47.246.130.0/23 47.246.132.0/22 47.246.132.0/23 47.246.134.0/23 47.246.136.0/21 47.246.136.0/22 47.246.140.0/22 47.246.144.0/23 47.246.144.0/24 47.246.145.0/24 47.246.146.0/23 47.246.146.0/24 47.246.147.0/24 47.246.148.0/23 47.246.148.0/24 47.246.149.0/24 47.246.150.0/23 47.246.150.0/24 47.246.151.0/24 47.246.152.0/23 47.246.152.0/24 47.246.153.0/24 47.246.154.0/24 47.246.155.0/24 47.246.156.0/22 47.246.156.0/23 47.246.158.0/23 47.246.160.0/20 47.246.160.0/21 47.246.168.0/21 47.246.176.0/20 47.246.176.0/21 47.246.184.0/21 47.246.192.0/22 47.246.192.0/23 47.246.194.0/23 47.246.196.0/22 47.246.196.0/23 47.246.198.0/23 47.250.0.0/17 47.250.0.0/18 47.250.64.0/18 47.250.99.0/24 47.250.128.0/17 47.250.128.0/18 47.250.192.0/18 47.251.0.0/16 47.251.0.0/17 47.251.128.0/17 47.252.0.0/17 47.252.0.0/18 47.252.64.0/18 47.252.67.0/24 47.252.128.0/17 47.252.128.0/18 47.252.192.0/18 47.253.0.0/16 47.253.0.0/17 47.253.128.0/17 47.254.0.0/17 47.254.0.0/18 47.254.64.0/18 47.254.113.0/24 47.254.128.0/18 47.254.128.0/19 47.254.160.0/19 47.254.192.0/18 47.254.192.0/19 47.254.224.0/19 59.82.136.0/23 103.81.186.0/23 103.183.154.0/23 110.76.21.0/24 110.76.23.0/24 116.251.64.0/18 139.95.0.0/23 139.95.2.0/23 139.95.4.0/23 139.95.6.0/23 139.95.8.0/23 139.95.10.0/23 139.95.12.0/23 139.95.14.0/23 139.95.16.0/23 139.95.18.0/23 140.205.1.0/24 140.205.122.0/24 147.139.0.0/17 147.139.0.0/18 147.139.26.0/24 147.139.64.0/18 147.139.128.0/17 147.139.128.0/18 147.139.192.0/18 149.129.0.0/16 149.129.0.0/20 149.129.0.0/21 149.129.8.0/21 149.129.16.0/23 149.129.32.0/19 149.129.64.0/18 149.129.64.0/19 149.129.96.0/19 149.129.128.0/18 149.129.128.0/19 149.129.160.0/19 149.129.192.0/18 149.129.192.0/19 149.129.224.0/19 156.227.20.0/24 156.236.12.0/24 156.236.17.0/24 156.240.76.0/23 156.245.1.0/24 161.117.0.0/16 161.117.0.0/17 161.117.126.0/24 161.117.127.0/24 161.117.128.0/17 161.117.128.0/24 161.117.129.0/24 161.117.138.0/24 161.117.143.0/24 170.33.24.0/24 170.33.29.0/24 170.33.30.0/24 170.33.31.0/24 170.33.32.0/24 170.33.33.0/24 170.33.34.0/24 170.33.35.0/24 170.33.72.0/24 170.33.73.0/24 170.33.74.0/24 170.33.75.0/24 170.33.76.0/24 170.33.77.0/24 170.33.78.0/24 170.33.79.0/24 170.33.80.0/24 170.33.81.0/24 170.33.82.0/24 170.33.83.0/24 170.33.84.0/24 170.33.85.0/24 170.33.86.0/24 170.33.104.0/24 170.33.105.0/24 170.33.106.0/24 170.33.107.0/24 185.78.106.0/23 198.11.128.0/18 198.11.137.0/24 198.11.184.0/21 202.144.199.0/24 203.107.64.0/24 203.107.65.0/24 203.107.66.0/24 203.107.67.0/24 203.107.68.0/24 205.204.96.0/19 205.204.102.0/23 205.204.111.0/24 205.204.117.0/24 205.204.125.0/24 223.5.5.0/24 223.6.6.0/24" diff --git a/privfrontends/playbook.yaml b/privfrontends/playbook.yaml index 76421df..a271b66 100644 --- a/privfrontends/playbook.yaml +++ b/privfrontends/playbook.yaml @@ -16,6 +16,8 @@ when: service.value.docker_settings - name: Setup Caddy hosts: privfrontends + vars_files: + - ./blocked-ranges.yaml tasks: - name: Copy Caddyfile ansible.builtin.template: diff --git a/privfrontends/templates/Caddyfile.j2 b/privfrontends/templates/Caddyfile.j2 index 7216a00..07eba5a 100644 --- a/privfrontends/templates/Caddyfile.j2 +++ b/privfrontends/templates/Caddyfile.j2 @@ -76,6 +76,10 @@ } } } + @denied client_ip {{ blocked_ranges }} + respond @denied 403 "Unfortunately, your IP is part of a range that has been involved in mass spam to our servers. If you think our action was a mistake, please email contact@projectsegfau.lt." + + import acmedns }