Skip to content

Instantly share code, notes, and snippets.

@nkukard
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkukard/a20906259e9a0cb3b03c to your computer and use it in GitHub Desktop.
Save nkukard/a20906259e9a0cb3b03c to your computer and use it in GitHub Desktop.
# Create empty file
/etc/shorewall/rules:
file.managed:
- user: root
- group: root
- mode: 644
- template: jinja
- source: salt://shorewall/rules.jinja2
- replace: False
# Add managed rules block
/etc/shorewall/rules-block:
file.blockreplace:
- name: /etc/shorewall/rules
- marker_start: "### START SALT MANAGED SECTION ###"
- marker_end: "### END SALT MANAGED SECTION ###"
- append_if_not_found: True
/etc/shorewall/rules-block-allow-ssh:
file.accumulated:
- filename: /etc/shorewall/rules
- name: rules-block-accumulator
- text: |
?COMMENT Allow SSH traffic in at a rate of 3 per min
SSH(ACCEPT) net fw - - - - s:ssh:3/min:5
- require_in:
- file: /etc/shorewall/rules-block
/etc/shorewall/rules-block-allow-ping:
file.accumulated:
- filename: /etc/shorewall/rules
- name: rules-block-accumulator
- text: |
?COMMENT Allow Ping traffic
Ping(ACCEPT) net fw
- require_in:
- file: /etc/shorewall/rules-block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment