Skip to content

Commit 6b8debb

Browse files
Merge pull request #1453 from nccgroup/develop
Release v5.12.0
2 parents 4300fc0 + d064666 commit 6b8debb

File tree

291 files changed

+10913
-1517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+10913
-1517
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ inc-scoutsuite-run*
5151
report-*
5252
*.db
5353

54-
# PyCharm
54+
# IntelliJ files
5555
.idea/
5656
*.iml
5757

@@ -73,4 +73,4 @@ report-*
7373
#Profiling output
7474
*.prof
7575

76-
!docker/bin
76+
!docker/bin

ScoutSuite/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = 'NCC Group'
2-
__version__ = '5.11.0'
2+
__version__ = '5.12.0'
33

44
ERRORS_LIST = []
55

ScoutSuite/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import copy
32
import os
43
import webbrowser
54

ScoutSuite/core/cli_parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,16 @@ def parse_args(self, args=None):
392392
'and Secret Access Key.')
393393
# Azure
394394
elif v.get('provider') == 'azure':
395-
if v.get('tenant_id') and not (v.get('service_principal') or v.get('user_account_browser')):
396-
self.parser.error('--tenant can only be set when using --user-account-browser or --service-principal authentication')
395+
if v.get('tenant_id') and not (v.get('service_principal') or v.get('user_account_browser') or v.get('user_account')):
396+
self.parser.error('--tenant can only be set when using --user-account-browser or --user-account or '
397+
'--service-principal authentication')
397398
if v.get('service_principal') and not v.get('tenant_id'):
398399
self.parser.error('You must provide --tenant when using --service-principal authentication')
399400
if v.get('user_account_browser') and not v.get('tenant_id'):
400401
self.parser.error('You must provide --tenant when using --user-account-browser authentication')
402+
if v.get('user_account') and not v.get('tenant_id'):
403+
self.parser.error('You must provide --tenant when using --user-account authentication')
401404
if v.get('subscription_ids') and v.get('all_subscriptions'):
402405
self.parser.error('--subscription-ids and --all-subscriptions are mutually exclusive options')
403406

404407
return args
405-

ScoutSuite/core/conditions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import netaddr
55
import re
6+
import ipaddress
67

78
from policyuniverse.expander_minimizer import get_actions_from_statement, _expand_wildcard_action
89

@@ -221,6 +222,12 @@ def pass_condition(b, test, a):
221222
break
222223
elif test == 'notInSubnets':
223224
result = (not pass_condition(b, 'inSubnets', a))
225+
elif test == 'isSubnetRange':
226+
result = not ipaddress.ip_network(b, strict=False).exploded.endswith("/32")
227+
elif test == 'isPrivateSubnet':
228+
result = ipaddress.ip_network(b, strict=False).is_private
229+
elif test == 'isPublicSubnet':
230+
result = not ipaddress.ip_network(b, strict=False).is_private
224231

225232
# Port/port ranges tests
226233
elif test == 'portsInPortList':

ScoutSuite/core/console.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class HostnameFilter(logging.Filter):
4040
def filter(self, record):
4141
record.hostname = HostnameFilter.hostname
4242
return True
43+
4344
# create file handler which logs messages
4445
fh = logging.FileHandler(output_file_path, 'w+')
4546
# Add filter to add hostname information
@@ -60,6 +61,10 @@ def print_generic(msg):
6061
logger.info(msg)
6162

6263

64+
def print_info(msg):
65+
print_generic(msg)
66+
67+
6368
def print_debug(msg):
6469
logger.debug(msg)
6570

@@ -68,6 +73,10 @@ def print_error(msg):
6873
logger.error(msg)
6974

7075

76+
def print_warning(msg):
77+
logger.warning(msg)
78+
79+
7180
def print_exception(exception, additional_details=None):
7281
try:
7382
exc = True
@@ -101,10 +110,6 @@ def print_exception(exception, additional_details=None):
101110
'additional_details': additional_details})
102111

103112

104-
def print_info(msg):
105-
print_generic(msg)
106-
107-
108113
########################################
109114
# Prompt functions
110115
########################################

0 commit comments

Comments
 (0)