-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to firewall module for ubuntu
- Loading branch information
1 parent
f5c3692
commit b6c8a6b
Showing
7 changed files
with
72 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Class: observium::firewall | ||
# | ||
# Manage UFW on ubuntu | ||
# | ||
# @api private | ||
# | ||
class observium::firewall { | ||
assert_private() | ||
Firewall { | ||
require => undef, | ||
} | ||
|
||
# Default firewall rules | ||
firewall { '000 accept all icmp': | ||
proto => 'icmp', | ||
jump => 'accept', | ||
} | ||
-> firewall { '001 accept all to lo interface': | ||
proto => 'all', | ||
iniface => 'lo', | ||
jump => 'accept', | ||
} | ||
-> firewall { '002 reject local traffic not on loopback interface': | ||
iniface => '! lo', | ||
proto => 'all', | ||
destination => '127.0.0.1/8', | ||
jump => 'reject', | ||
} | ||
-> firewall { '003 accept related established rules': | ||
proto => 'all', | ||
state => ['RELATED', 'ESTABLISHED'], | ||
jump => 'accept', | ||
} | ||
# Add rules for apache | ||
if $observium::manage_ssl { | ||
firewall { "50 Allow https access ${observium::apache_sslport}": | ||
dport => $observium::apache_sslport, | ||
proto => 'tcp', | ||
jump => 'accept', | ||
} | ||
} | ||
else { | ||
firewall { "50 Allow http access ${observium::apache_port}": | ||
dport => $observium::apache_port, | ||
proto => 'tcp', | ||
jump => 'accept', | ||
} | ||
} | ||
# Ensure ssh is open | ||
firewall { '004 Allow inbound SSH': | ||
dport => 22, | ||
proto => 'tcp', | ||
jump => 'accept', | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters