Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix allow port from internet #358

Merged
merged 4 commits into from
Jan 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion libraries/azure_network_security_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def allow_rdp_from_internet?
end
RSpec::Matchers.alias_matcher :allow_rdp_from_internet, :be_allow_rdp_from_internet

SPECIFIC_CRITERIA = %i(specific_port access_allow direction_inbound source_open).freeze
SPECIFIC_CRITERIA = %i(specific_port access_allow direction_inbound source_open not_icmp).freeze
def allow_port_from_internet?(specific_port)
return unless exists?
@specific_port = specific_port
Expand Down Expand Up @@ -207,6 +207,11 @@ def source_open?(properties)
def direction_inbound?(properties)
properties.direction == 'Inbound'
end

def not_icmp?(properties)
!properties.protocol.match?(/ICMP/)
end

# Code for backward compatibility ends here <<<<<<<<
end

Expand Down