interfaces << interface[:interface]
end
-interfaces << "eth0" if kitchen? && interfaces.empty?
-
template "/etc/nftables.conf" do
source "nftables.conf.erb"
owner "root"
end
stop_commands = [
- "/usr/sbin/nft delete table inet filter"
+ "-/usr/sbin/nft delete table inet filter",
+ "-/usr/sbin/nft delete table inet chef-filter"
]
-stop_commands << "/usr/sbin/nft delete table ip nat" if node[:roles].include?("gateway")
+stop_commands << "-/usr/sbin/nft delete table ip nat" if node[:roles].include?("gateway")
+stop_commands << "-/usr/sbin/nft delete table ip chef-nat" if node[:roles].include?("gateway")
systemd_service "nftables-stop" do
service "nftables"
action :accept
source "net"
dest "fw"
- proto "tcp:syn"
- dest_ports "http"
- rate_limit node[:networking][:firewall][:http_rate_limit]
- connection_limit node[:networking][:firewall][:http_connection_limit]
-end
-
-firewall_rule "accept-https" do
- action :accept
- source "net"
- dest "fw"
- proto "tcp:syn"
- dest_ports "https"
+ proto "tcp"
+ dest_ports %w[http https]
rate_limit node[:networking][:firewall][:http_rate_limit]
connection_limit node[:networking][:firewall][:http_connection_limit]
end