Saltstack Official UFW Formula
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.

121 lines
2.5KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=yaml
  3. ---
  4. ufw:
  5. enabled: true
  6. settings:
  7. loglevel: low
  8. ipv6: true
  9. default_input_policy: 'DROP'
  10. default_output_policy: 'ACCEPT'
  11. default_forward_policy: 'DROP'
  12. default_application_policy: 'SKIP'
  13. manage_builtins: false
  14. ipt_sysctl: '/etc/ufw/sysctl.conf'
  15. ipt_modules:
  16. - nf_conntrack_ftp
  17. - nf_nat_ftp
  18. - nf_conntrack_netbios_ns
  19. sysctl:
  20. forwarding: 1
  21. rp_filter: 1
  22. accept_source_route: 0
  23. accept_redirects: 0
  24. icmp_echo_ignore_broadcasts: 1
  25. icmp_ignore_bogus_error_responses: 1
  26. icmp_echo_ignore_all: 0
  27. log_martians: 0
  28. tcp_syncookies: 0
  29. tcp_sack: 1
  30. ipv6_autoconf: 1
  31. use_tempaddr: 1
  32. services:
  33. # Allow 80/tcp (http) traffic from only two remote addresses.
  34. http:
  35. protocol: tcp
  36. from_addr:
  37. - 10.0.2.15
  38. - 10.0.2.16
  39. comment: Upstream loadbalancers
  40. # Allow 443/tcp (https) traffic from network 10.0.0.0/8 to an specific local ip.
  41. https:
  42. protocol: tcp
  43. from_addr:
  44. - 10.0.0.0/8
  45. to_addr: 10.0.2.1
  46. comment: Intraweb portal
  47. # Allow from a service port.
  48. smtp:
  49. protocol: tcp
  50. comment: Mail relay
  51. # Allow from a specific port, by number.
  52. 139:
  53. protocol: tcp
  54. comment: Netbios
  55. # Deny from a specific port, by number, but don't force
  56. # the rule as the first rule in the ufw state
  57. 140:
  58. protocol: tcp
  59. deny: true
  60. force_first: false
  61. # Deny everything from a specific ip address
  62. '*':
  63. protocol: tcp
  64. deny: true
  65. from_addr: 10.0.0.1
  66. # Deny everything from multiple ip addresses and avoid
  67. # conflicts with already defined service '*'
  68. '*/multiple':
  69. to_port: '*'
  70. protocol: tcp
  71. deny: true
  72. from_addr:
  73. - 10.0.0.2
  74. - 10.0.0.3
  75. # Limit a specific port, by number.
  76. 170:
  77. limit: true
  78. protocol: tcp
  79. comment: Print service
  80. # Allow from a range of ports, udp.
  81. "10000:20000":
  82. protocol: udp
  83. comment: We need ports, lots of ports
  84. # Allow from two specific ports, udp.
  85. "30000,40000":
  86. protocol: udp
  87. comment: Game server and admin
  88. # Allow applications defined at /etc/ufw/applications.d/
  89. applications:
  90. OpenSSH:
  91. enabled: true
  92. comment: We are using fail2ban anyway
  93. # Limit access to salt master
  94. Saltmaster:
  95. limit: true
  96. # Deny access to Postgresql
  97. Postgresql:
  98. deny: true
  99. # Allow all traffic in on the specified interface
  100. interfaces:
  101. eth1:
  102. comment: Honey pot