Skip to content

Commit

Permalink
Merge pull request #161 from SemioticLabs/3-5-Fix-loopback-address-match
Browse files Browse the repository at this point in the history
3-5 Fix loopback address match
  • Loading branch information
schurzi authored Dec 4, 2023
2 parents c5174f9 + 95a2a7a commit 35abce0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controls/3_5_firewall_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
tag cis: 'distribution-independent-linux:3.5.1.4'
tag level: 1

port.where { address !~ /^(127\.|::1)$/ }.ports.each do |port|
port.where { address !~ /^(127\.[0-9]+\.[0-9]+\.[0-9]+|::1)$/ }.ports.each do |port|
describe "Firewall rule should exist for port #{port}" do
subject { ip6tables.retrieve_rules.any? { |s| s =~ /\s--(dport|dports) #{port}\s/ } }
it { should be true }
Expand Down Expand Up @@ -214,7 +214,7 @@
tag cis: 'distribution-independent-linux:3.5.2.4'
tag level: 1

port.where { address !~ /^(127\.|::1)$/ }.ports.each do |port|
port.where { address !~ /^(127\.[0-9]+\.[0-9]+\.[0-9]+|::1)$/ }.ports.each do |port|
describe "Firewall rule should exist for port #{port}" do
subject { iptables.retrieve_rules.any? { |s| s =~ /\s--(dport|dports) #{port}\s/ } }
it { should be true }
Expand Down

0 comments on commit 35abce0

Please sign in to comment.