Skip to content

Commit

Permalink
Merge pull request #23 from opus-codium/netfilter-to-iptables
Browse files Browse the repository at this point in the history
Rename Netfilter classes to Iptables
  • Loading branch information
smortex authored Dec 17, 2022
2 parents 7b57e53 + 20eb11f commit 9033c95
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Features

* Generate rules for [Netfilter](http://www.netfilter.org/) and [PF](http://www.openbsd.org/faq/pf/) (extensible);
* Generate rules for [iptables](http://www.netfilter.org/) and [PF](http://www.openbsd.org/faq/pf/) (extensible);
* IPv6 and IPv4 support;
* Define the configuration of multiple *nodes* in a single file;
* Define *services* as group of rules to mix-in in *nodes* rules definitions;
Expand Down
4 changes: 2 additions & 2 deletions features/generate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Feature: Generate firewall rules
"""

Scenario: Generate IPv4 firewall rules for a Linux node
When I successfully run `puffy generate -f Netfilter4 network.puffy example.com`
When I successfully run `puffy generate -f Iptables4 network.puffy example.com`
Then the stdout should contain:
"""
-A INPUT -m conntrack --ctstate NEW -p tcp --dport 80 -j ACCEPT
-A INPUT -m conntrack --ctstate NEW -p tcp --dport 443 -j ACCEPT
"""

Scenario: Generate IPv6 firewall rules for a Linux node
When I successfully run `puffy generate -f Netfilter6 network.puffy example.com`
When I successfully run `puffy generate -f Iptables6 network.puffy example.com`
Then the stdout should contain:
"""
-A INPUT -m conntrack --ctstate NEW -p tcp --dport 80 -j ACCEPT
Expand Down
2 changes: 1 addition & 1 deletion lib/puffy/formatters/iptables4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Puffy
module Formatters
module Netfilter4 # :nodoc:
module Iptables4 # :nodoc:
# IPv4 Iptables implementation of a Puffy Ruleset formatter.
class Ruleset < Puffy::Formatters::Iptables::Ruleset # :nodoc:
# Return an IPv4 Iptables String representation of the provided +rules+ Puffy::Rule with the +policy+ policy.
Expand Down
2 changes: 1 addition & 1 deletion lib/puffy/formatters/iptables6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Puffy
module Formatters
module Netfilter6 # :nodoc:
module Iptables6 # :nodoc:
# IPv6 Iptables implementation of a Puffy Ruleset formatter.
class Ruleset < Puffy::Formatters::Iptables::Ruleset # :nodoc:
# Return an IPv6 Iptables String representation of the provided +rules+ Puffy::Rule with the +policy+ policy.
Expand Down
4 changes: 2 additions & 2 deletions lib/puffy/puppet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def initialize(path, parser)

@formatters = [
Puffy::Formatters::Pf::Ruleset.new,
Puffy::Formatters::Netfilter4::Ruleset.new,
Puffy::Formatters::Netfilter6::Ruleset.new,
Puffy::Formatters::Iptables4::Ruleset.new,
Puffy::Formatters::Iptables6::Ruleset.new,
]
end

Expand Down

0 comments on commit 9033c95

Please sign in to comment.