Skip to content

Commit

Permalink
Merge pull request puppetlabs#61 from adamgibbins/master
Browse files Browse the repository at this point in the history
Improved Puppet DSL style as per the guidelines.
  • Loading branch information
kbarber committed Mar 26, 2012
2 parents 72fac84 + 94db3e6 commit b14a4dd
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion examples/ip6tables/test.pp
Expand Up @@ -30,7 +30,7 @@
}

firewall { '006 INPUT disregard netbios':
port => ['netbios-ns', 'netbios-dgm', 'netbios-ssn'],
port => ['netbios-ns', 'netbios-dgm', 'netbios-ssn'],
action => drop,
proto => 'udp',
provider => 'ip6tables'
Expand Down
34 changes: 17 additions & 17 deletions examples/iptables/readme.pp
@@ -1,33 +1,33 @@
firewall { '000 allow packets with valid state':
state => ['RELATED', 'ESTABLISHED'],
jump => 'ACCEPT',
state => ['RELATED', 'ESTABLISHED'],
jump => 'ACCEPT',
}
firewall { '001 allow icmp':
proto => 'icmp',
jump => 'ACCEPT',
proto => 'icmp',
jump => 'ACCEPT',
}
firewall { '002 allow all to lo interface':
iniface => 'lo',
jump => 'ACCEPT',
iniface => 'lo',
jump => 'ACCEPT',
}
firewall { '100 allow http':
proto => 'tcp',
dport => '80',
jump => 'ACCEPT',
proto => 'tcp',
dport => '80',
jump => 'ACCEPT',
}
firewall { '100 allow ssh':
proto => 'tcp',
dport => '22',
jump => 'ACCEPT',
proto => 'tcp',
dport => '22',
jump => 'ACCEPT',
}
firewall { '100 allow mysql from internal':
proto => 'tcp',
dport => '3036',
source => '10.5.5.0/24',
jump => 'ACCEPT',
proto => 'tcp',
dport => '3036',
source => '10.5.5.0/24',
jump => 'ACCEPT',
}
firewall { '999 drop everything else':
jump => 'DROP',
jump => 'DROP',
}

resources { 'firewall':
Expand Down
74 changes: 37 additions & 37 deletions examples/iptables/test.pp
@@ -1,23 +1,23 @@
firewall { '000 allow foo':
dport => [7061, 7062],
dport => [7061, 7062],
action => accept,
proto => "tcp",
proto => 'tcp',
}

firewall { '975 log test':
state => 'NEW',
state => 'NEW',
log_level => 'panic',
jump => 'LOG'
jump => 'LOG'
}

firewall { '001 allow boo':
action => accept,
iniface => "eth0",
sport => "123",
dport => "123",
proto => "tcp",
destination => "1.1.1.0/24",
source => "2.2.2.0/24",
action => accept,
iniface => 'eth0',
sport => '123',
dport => '123',
proto => 'tcp',
destination => '1.1.1.0/24',
source => '2.2.2.0/24',
}

firewall { '100 snat for network foo2':
Expand All @@ -31,72 +31,72 @@

firewall { '999 bar':
action => accept,
dport => "1233",
proto => "tcp",
dport => '1233',
proto => 'tcp',
}

firewall { '002 foo':
action => drop,
dport => "1233",
proto => "tcp",
dport => '1233',
proto => 'tcp',
}

firewall { '010 icmp':
action => accept,
proto => "icmp",
icmp => "echo-reply",
proto => 'icmp',
icmp => 'echo-reply',
}

firewall { '010 INPUT allow loopback':
action => accept,
action => accept,
iniface => 'lo',
chain => 'INPUT',
chain => 'INPUT',
}

firewall { '005 INPUT disregard DHCP':
action => drop,
dport => ['bootpc', 'bootps'],
proto => 'udp'
dport => ['bootpc', 'bootps'],
proto => 'udp'
}

firewall { '006 INPUT disregard netbios':
action => drop,
proto => 'udp',
dport => ['netbios-ns', 'netbios-dgm', 'netbios-ssn'],
proto => 'udp',
dport => ['netbios-ns', 'netbios-dgm', 'netbios-ssn'],
}

firewall { '006 Disregard CIFS':
action => drop,
dport => 'microsoft-ds',
proto => 'tcp'
dport => 'microsoft-ds',
proto => 'tcp'
}

firewall { '050 INPUT drop invalid':
action => drop,
state => 'INVALID',
state => 'INVALID',
}

firewall { '051 INPUT allow related and established':
action => accept,
state => ['RELATED', 'ESTABLISHED'],
state => ['RELATED', 'ESTABLISHED'],
}

firewall { '053 INPUT allow ICMP':
action => accept,
icmp => '8',
proto => 'icmp',
icmp => '8',
proto => 'icmp',
}

firewall { '055 INPUT allow DNS':
action => accept,
proto => 'udp',
sport => 'domain'
proto => 'udp',
sport => 'domain'
}

firewall { '056 INPUT allow web in and out':
action => accept,
proto => 'tcp',
port => 80
port => 80
}

firewall { '057 INPUT limit NTP':
Expand All @@ -108,19 +108,19 @@

firewall { '999 FORWARD drop':
action => drop,
chain => 'FORWARD',
chain => 'FORWARD',
}

firewall { '001 OUTPUT allow loopback':
action => accept,
chain => 'OUTPUT',
action => accept,
chain => 'OUTPUT',
outiface => 'lo',
}

firewall { '100 OUTPUT drop invalid':
action => drop,
chain => 'OUTPUT',
state => 'INVALID',
chain => 'OUTPUT',
state => 'INVALID',
}

resources { 'firewall':
Expand Down

0 comments on commit b14a4dd

Please sign in to comment.