Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1109 from shift8nix/issue_1038
Browse files Browse the repository at this point in the history
fix issue 1038
  • Loading branch information
mikegrima authored Sep 19, 2018
2 parents 0bd65d6 + 4cf6c7d commit 00ff52a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions security_monkey/auditors/gcp/gce/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ def _port_range_exists(self, allowed_list, error_cat='ALLOWED'):
Check to see if a port range exists in the allowed field.
"""
errors = []
for allowed in allowed_list:
ports = allowed.get('ports', None)
if ports:
for port in ports:
if str(port).find('-') > -1:
ae = make_audit_issue(
error_cat, 'EXISTS', 'PORTRANGE')
ae.notes = '%s:%s' % (allowed['IPProtocol'], port)
errors.append(ae)
if allowed_list:
for allowed in allowed_list:
ports = allowed.get('ports', None)
if ports:
for port in ports:
if str(port).find('-') > -1:
ae = make_audit_issue(
error_cat, 'EXISTS', 'PORTRANGE')
ae.notes = '%s:%s' % (allowed['IPProtocol'], port)
errors.append(ae)
return errors

def _target_tags_valid(self, target_tags, error_cat='TARGET_TAGS'):
Expand Down

0 comments on commit 00ff52a

Please sign in to comment.