Saltstack Official UFW Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ufw.sysctl.tmpl.jinja 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ########################################################################
  2. # File managed by Salt at <{{ source }}>.
  3. # Your changes will be overwritten.
  4. ########################################################################
  5. {%- set forwarding = ufw_sysctl.get('forwarding', 0) %}
  6. {%- set rp_filter = ufw_sysctl.get('rp_filter', 1) %}
  7. {%- set accept_source_route = ufw_sysctl.get('accept_source_route', 0) %}
  8. {%- set accept_redirects = ufw_sysctl.get('accept_redirects', 0) %}
  9. {%- set icmp_echo_ignore_broadcasts = ufw_sysctl.get('icmp_echo_ignore_broadcasts', 1) %}
  10. {%- set icmp_ignore_bogus_error_responses = ufw_sysctl.get('icmp_ignore_bogus_error_responses', 1) %}
  11. {%- set icmp_echo_ignore_all = ufw_sysctl.get('icmp_echo_ignore_all', 0) %}
  12. {%- set log_martians = ufw_sysctl.get('log_martians', 0) %}
  13. {%- set tcp_syncookies = ufw_sysctl.get('tcp_syncookies', 0) %}
  14. {%- set tcp_sack = ufw_sysctl.get('tcp_sack', 1) %}
  15. {%- set ipv6_autoconf = ufw_sysctl.get('ipv6_autoconf', 1) %}
  16. {%- set use_tempaddr = ufw_sysctl.get('use_tempaddr', 1) %}
  17. # Configuration file for setting network variables. Please note these settings
  18. # override /etc/sysctl.conf. If you prefer to use /etc/sysctl.conf, please
  19. # adjust IPT_SYSCTL in /etc/default/ufw.
  20. # Uncomment this to allow this host to route packets between interfaces
  21. net/ipv4/ip_forward={{ forwarding }}
  22. net/ipv6/conf/default/forwarding={{ forwarding }}
  23. net/ipv6/conf/all/forwarding={{ forwarding }}
  24. # Turn on Source Address Verification in all interfaces to prevent some
  25. # spoofing attacks
  26. net/ipv4/conf/default/rp_filter={{ rp_filter }}
  27. net/ipv4/conf/all/rp_filter={{ rp_filter }}
  28. # Do not accept IP source route packets (we are not a router)
  29. net/ipv4/conf/default/accept_source_route={{ accept_source_route }}
  30. net/ipv4/conf/all/accept_source_route={{ accept_source_route }}
  31. net/ipv6/conf/default/accept_source_route={{ accept_source_route }}
  32. net/ipv6/conf/all/accept_source_route={{ accept_source_route }}
  33. # Disable ICMP redirects. ICMP redirects are rarely used but can be used in
  34. # MITM (man-in-the-middle) attacks. Disabling ICMP may disrupt legitimate
  35. # traffic to those sites.
  36. net/ipv4/conf/default/accept_redirects={{ accept_redirects }}
  37. net/ipv4/conf/all/accept_redirects={{ accept_redirects }}
  38. net/ipv6/conf/default/accept_redirects={{ accept_redirects }}
  39. net/ipv6/conf/all/accept_redirects={{ accept_redirects }}
  40. # Ignore bogus ICMP errors
  41. net/ipv4/icmp_echo_ignore_broadcasts={{ icmp_echo_ignore_broadcasts }}
  42. net/ipv4/icmp_ignore_bogus_error_responses={{ icmp_ignore_bogus_error_responses }}
  43. net/ipv4/icmp_echo_ignore_all={{ icmp_echo_ignore_all }}
  44. # Don't log Martian Packets (impossible packets)
  45. net/ipv4/conf/default/log_martians={{ log_martians }}
  46. net/ipv4/conf/all/log_martians={{ log_martians }}
  47. # Change to '1' to enable TCP/IP SYN cookies This disables TCP Window Scaling
  48. # (http://lkml.org/lkml/2008/2/5/167)
  49. net/ipv4/tcp_syncookies={{ tcp_syncookies }}
  50. #net/ipv4/tcp_fin_timeout=30
  51. #net/ipv4/tcp_keepalive_intvl=1800
  52. # normally allowing tcp_sack is ok, but if going through OpenBSD 3.8 RELEASE or
  53. # earlier pf firewall, should set this to 0
  54. net/ipv4/tcp_sack={{ tcp_sack }}
  55. # Uncomment this to turn off ipv6 autoconfiguration
  56. net/ipv6/conf/default/autoconf={{ ipv6_autoconf }}
  57. net/ipv6/conf/all/autoconf={{ ipv6_autoconf }}
  58. # Uncomment this to enable ipv6 privacy addressing
  59. net/ipv6/conf/default/use_tempaddr={{ use_tempaddr }}
  60. net/ipv6/conf/all/use_tempaddr={{ use_tempaddr }}