Skip to content

Commit 4300fc0

Browse files
Merge pull request #912 from nccgroup/develop
release/5.11.0
2 parents b9b8e20 + 8605c63 commit 4300fc0

File tree

275 files changed

+30089
-5431
lines changed

Some content is hidden

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

275 files changed

+30089
-5431
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
**Make sure the PR is against the `develop` branch (see [Contributing](https://github.com/nccgroup/ScoutSuite/blob/master/CONTRIBUTING.md)).**
44

5+
**Make sure to set the corresponding milestone in the PR.**
6+
57
Please include a summary of the change(s) and which issue(s) it addresses. Please also include relevant motivation and context.
68

79
Fixes # (issue)

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ report-*
5353

5454
# PyCharm
5555
.idea/
56+
*.iml
5657

5758
# Vs Code
5859
.vscode/
@@ -69,4 +70,7 @@ report-*
6970
/private*/
7071
/**/private*/
7172

73+
#Profiling output
74+
*.prof
75+
7276
!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.10.2'
2+
__version__ = '5.11.0'
33

44
ERRORS_LIST = []
55

ScoutSuite/__main__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,14 @@ async def _run(provider,
273273
if update:
274274
try:
275275
print_info('Updating existing data')
276-
current_run_services = copy.deepcopy(cloud_provider.services)
276+
#Load previous results
277277
last_run_dict = report.encoder.load_from_file('RESULTS')
278-
cloud_provider.services = last_run_dict['services']
279-
for service in cloud_provider.service_list:
280-
cloud_provider.services[service] = current_run_services[service]
278+
#Get list of previous services which were not updated during this run
279+
previous_services = [prev_service for prev_service in last_run_dict['service_list'] if prev_service not in cloud_provider.service_list]
280+
#Add previous services
281+
for service in previous_services:
282+
cloud_provider.service_list.append(service)
283+
cloud_provider.services[service] = last_run_dict['services'][service]
281284
except Exception as e:
282285
print_exception('Failure while updating report: {}'.format(e))
283286

ScoutSuite/core/cli_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class ScoutSuiteArgumentParser:
66

77
def __init__(self):
8-
self.parser = argparse.ArgumentParser()
8+
self.parser = argparse.ArgumentParser(epilog='To get addtional help on a specific provider run: scout.py {provider} -h')
99

1010
# People will still be able to use the old --provider syntax
1111
self.parser.add_argument("--provider",

ScoutSuite/core/conditions.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,18 @@ def pass_condition(b, test, a):
181181
if re.match(c, b):
182182
result = True
183183
break
184+
elif test == 'matchInList':
185+
if type(a) != list:
186+
a = [a]
187+
if type(b) !=list:
188+
b = [b]
189+
for c in a:
190+
for d in b:
191+
if re.match(c, d):
192+
result = True
193+
break
194+
if result:
195+
break
184196
elif test == 'notMatch':
185197
result = (not pass_condition(b, 'match', a))
186198

@@ -277,6 +289,19 @@ def pass_condition(b, test, a):
277289
if c == a or re.match(r'arn:aws:iam:.*?:%s:.*' % a, c):
278290
result = True
279291
break
292+
elif test == 'isAccountRoot':
293+
result = False
294+
if type(b) != list:
295+
b = [b]
296+
for c in b:
297+
if type(c) == dict and 'AWS' in c:
298+
c = c['AWS']
299+
if type(c) != list:
300+
c = [c]
301+
for i in c:
302+
if i == a or re.match(r'arn:aws:iam:.*?:%s:root' % a, i):
303+
result = True
304+
break
280305

281306
# Unknown test case
282307
else:

0 commit comments

Comments
 (0)