Initial version of firewall module.
This commit is contained in:
parent
a8880f15da
commit
c99142e389
3 changed files with 116 additions and 0 deletions
19
firewall/templates/pf.conf.erb
Normal file
19
firewall/templates/pf.conf.erb
Normal file
|
@ -0,0 +1,19 @@
|
|||
# options
|
||||
set block-policy return
|
||||
set skip on lo0
|
||||
|
||||
# scrub
|
||||
scrub in all no-df
|
||||
|
||||
# filter rules
|
||||
block all
|
||||
|
||||
pass in quick inet proto icmp all
|
||||
pass in quick inet6 proto icmp6 all
|
||||
|
||||
<% firewall_rules.each do |rule| -%>
|
||||
<% rule = /(tcp|udp)\/(\d+)( .+)?/.match(rule) -%>
|
||||
pass in quick proto <%= rule[1] %><% if rule[3] %> from<%= rule[3] %><% end %> to port <%= rule[2] %>
|
||||
<% end -%>
|
||||
|
||||
pass out quick all
|
Loading…
Add table
Add a link
Reference in a new issue