provisioning tool for building opinionated architecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

8 months ago
  1. table inet lxd {
  2. chain pstrt.lxdbr0 {
  3. type nat hook postrouting priority srcnat; policy accept;
  4. {%- if target != 'prod' %}
  5. # BLOCK SMTP PORTS
  6. tcp dport { 25, 465, 587 } ip saddr {{ firewall.bridge_subnet }} {%- if firewall.container_mail_passthrough %} ip saddr
  7. != {{ env.ip_mail_passthrough }} {% endif %} log prefix "Drop SMTP away from container: " drop
  8. {% endif -%}
  9. ip saddr {{ firewall.bridge_subnet }} ip daddr != {{ firewall.bridge_subnet }} masquerade
  10. }
  11. chain fwd.lxdbr0 {
  12. type filter hook forward priority filter; policy accept;
  13. ip version 4 oifname "lxdbr0" accept
  14. ip version 4 iifname "lxdbr0" accept
  15. }
  16. chain in.lxdbr0 {
  17. type filter hook input priority filter; policy accept;
  18. iifname "lxdbr0" tcp dport 53 accept
  19. iifname "lxdbr0" udp dport 53 accept
  20. iifname "lxdbr0" icmp type { destination-unreachable, time-exceeded, parameter-problem } accept
  21. iifname "lxdbr0" udp dport 67 accept
  22. }
  23. chain out.lxdbr0 {
  24. type filter hook output priority filter; policy accept;
  25. oifname "lxdbr0" tcp sport 53 accept
  26. oifname "lxdbr0" udp sport 53 accept
  27. oifname "lxdbr0" icmp type { destination-unreachable, time-exceeded, parameter-problem } accept
  28. oifname "lxdbr0" udp sport 67 accept
  29. }
  30. }