X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/3dd8e177f260478b9da3c5c5be583bd262e1f6e9..52f0a525050450d5d41431314a5c8d9a9b81950b:/cookbooks/networking/resources/firewall_rule.rb diff --git a/cookbooks/networking/resources/firewall_rule.rb b/cookbooks/networking/resources/firewall_rule.rb index 63970e661..e5f07dca6 100644 --- a/cookbooks/networking/resources/firewall_rule.rb +++ b/cookbooks/networking/resources/firewall_rule.rb @@ -33,7 +33,6 @@ property :dest_ports, :kind_of => [String, Integer, Array] property :source_ports, :kind_of => [String, Integer, Array] property :rate_limit, :kind_of => String, :default => "-" property :connection_limit, :kind_of => [String, Integer], :default => "-" -property :helper, :kind_of => String, :default => "-" property :compile_time, TrueClass, :default => true @@ -69,10 +68,7 @@ action_class do when "inet6" then "ip6" end - proto = case new_resource.proto - when "udp" then "udp" - when "tcp", "tcp:syn" then "tcp" - end + proto = new_resource.proto if new_resource.source_ports rule << "#{proto} sport { #{nftables_source_ports} }" @@ -98,9 +94,7 @@ action_class do rule << "#{ip} daddr { #{addresses} }" end - if new_resource.proto == "tcp:syn" - rule << "ct state new" - end + rule << "ct state new" if new_resource.proto == "tcp" if new_resource.connection_limit != "-" set = "connlimit-#{new_resource.rule}-#{ip}"