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.

README.md 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ufw-formula
  2. ===========
  3. This module manages your firewall using ufw with pillar configured rules.
  4. See the full [Salt Formulas installation and usage instructions](http://docs.saltstack.com/topics/development/conventions/formulas.html).
  5. Usage
  6. -----
  7. All the configuration for the firewall is done via pillar (pillar.example).
  8. Enable firewall, applying default configuration:
  9. ```javascript
  10. ufw:
  11. enabled: True
  12. ```
  13. Allow 80/tcp (http) traffic from only two remote addresses:
  14. ```
  15. ufw:
  16. services:
  17. http:
  18. protocol: tcp
  19. from_addr:
  20. - 10.0.2.15
  21. - 10.0.2.16
  22. ```
  23. Allow 443/tcp (https) traffic from network 10.0.0.0/8 to an specific local ip:
  24. ```
  25. ufw:
  26. services:
  27. https:
  28. protocol: tcp
  29. from_addr:
  30. - 10.0.0.0/8
  31. to_addr: 10.0.2.1
  32. ```
  33. Allow from a service port:
  34. ```
  35. ufw:
  36. services:
  37. smtp:
  38. protocol: tcp
  39. ```
  40. Allow from an specific port, by number:
  41. ```
  42. ufw:
  43. services:
  44. 139:
  45. protocol: tcp
  46. ```
  47. Allow from a range of ports, udp:
  48. ```
  49. ufw:
  50. services:
  51. "10000:20000":
  52. protocol: udp
  53. ```
  54. Allow from two specific ports, udp:
  55. ```
  56. ufw:
  57. services:
  58. "30000,40000":
  59. protocol: udp
  60. ```
  61. Allow an application defined at /etc/ufw/applications.d/:
  62. ```
  63. ufw:
  64. applications:
  65. - OpenSSH
  66. ```
  67. Authors
  68. -------
  69. Original state and module based on the work from [Yigal Duppen](https://github.com/publysher/infra-example-nginx/tree/develop).
  70. Salt formula developed by Mario del Pozo.