8000 Release/5.2.0 by x4v13r64 · Pull Request #419 · nccgroup/ScoutSuite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Release/5.2.0 #419

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

Merged
merged 100 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
d2c50f0
Update finding description and rationale
x4v13r64 May 19, 2019
3cb0772
Update description
x4v13r64 May 19, 2019
beefe54
Add findings
x4v13r64 May 19, 2019
afe7234
Add finding
x4v13r64 May 19, 2019
c27fafc
Update description
x4v13r64 May 19, 2019
68c9dbf
Add finding
x4v13r64 May 19, 2019
5dba331
Add findings to ruleset
x4v13r64 May 19, 2019
77e83f2
Update description
x4v13r64 May 19, 2019
2803f0f
Update description and rationale
x4v13r64 May 19, 2019
86dfb2e
Change description handling
x4v13r64 May 19, 2019
6ce3624
Update rulesets
x4v13r64 May 19, 2019
5b966dc
Fix JSON errors
x4v13r64 May 19, 2019
64cb5e2
Update version
x4v13r64 May 19, 2019
681e874
Add rationales
x4v13r64 May 19, 2019
e7c4416
Remove check for versioning
x4v13r64 May 19, 2019
287c447
Refresh rulesets in accordance to https://github.com/nccgroup/ScoutSu…
x4v13r64 May 19, 2019
e93e8f5
Add rationales
x4v13r64 May 20, 2019
f9652e3
Add rationales
x4v13r64 May 20, 2019
f25f1cb
Fix rule
x4v13r64 May 20, 2019
57af921
Add failover values
x4v13r64 May 20, 2019
196d514
Merge pull request #418 from nccgroup/enhancement/gcp/cloudstorage
x4v13r64 May 20, 2019
9271503
Merge pull request #421 from nccgroup/issues/143
x4v13r64 May 20, 2019
f017f87
Merge pull request #420 from nccgroup/issues/395
x4v13r64 May 20, 2019
cbcc1f7
Merge branch 'release/5.2.0' into enhancement/gcp/cloudsql-findings
x4v13r64 May 20, 2019
6d33476
Merge branch 'release/5.2.0' into enhancement/gcp/cloudsql-findings
x4v13r64 May 20, 2019
f18b3b7
Merge pull request #417 from nccgroup/enhancement/gcp/cloudsql-findings
x4v13r64 May 20, 2019
9add63b
Add instance IP addresses
x4v13r64 May 21, 2019
7a9f06a
Add parsing for instance IP addresses
x4v13r64 May 21, 2019
0be406e
Merge pull request #424 from nccgroup/enhancement/cloudsql-tweaks
x4v13r64 May 21, 2019
9154c4c
Merge branch 'develop' into release/5.2.0
x4v13r64 May 22, 2019
f827c5a
Merge remote-tracking branch 'origin/release/5.2.0' into release/5.2.0
x4v13r64 May 22, 2019
08b7888
Update finding
x4v13r64 Jun 4, 2019
47bf7c8
Add finding
x4v13r64 Jun 4, 2019
a6ee52c
Add GCP users and groups
x4v13r64 Jun 4, 2019
49da3f2
Add GCP CIS finding
x4v13r64 Jun 5, 2019
5382439
Add GCP CIS findings
x4v13r64 Jun 5, 2019
179a80e
Minor reformat
x4v13r64 Jun 5, 2019
6a807a3
Basic GCP KMS support
x4v13r64 Jun 5, 2019
381e4ec
Merge facades into single file
x4v13r64 Jun 5, 2019
69c5ecf
Revert "Merge facades into single file"
x4v13r64 Jun 5, 2019
848cf69
Normalize facade implementation
x4v13r64 Jun 5, 2019
4342137
Update description
x4v13r64 Jun 5, 2019
a929a8c
Fix finding
x4v13r64 Jun 5, 2019
8ec8f73
Add field and fix ids
x4v13r64 Jun 5, 2019
443e36d
Fix highlight
x4v13r64 Jun 5, 2019
6ce3f4d
Add finding
x4v13r64 Jun 5, 2019
667bdc6
Add key type parsing
x4v13r64 Jun 5, 2019
78cdacf
Add rationale
x4v13r64 Jun 5, 2019
394f094
Add argument to track programmatic execution and use named parameters…
x4v13r64 Jun 5, 2019
603c8c2
Better handling of Azure authentication
x4v13r64 Jun 5, 2019
4b0b641
Update findings to ensure failover instances aren't flagged
x4v13r64 Jun 6, 2019
86e2bd2
Update rulesets
x4v13r64 Jun 6, 2019
9f45fc4
Tweak findings
x4v13r64 Jun 6, 2019
0598217
Fix rulesets
x4v13r64 Jun 6, 2019
350f2f0
Implement for light UI
x4v13r64 Jun 7, 2019
922e151
Merge branch 'develop' into bugfix/359
x4v13r64 Jun 7, 2019
ec39c5a
Merge branch 'master' into develop
x4v13r64 Jun 7, 2019
79a938c
Merge branch 'develop' into bugfix/359
x4v13r64 Jun 7, 2019
986a4b7
Merge branch 'develop' into issues/422
x4v13r64 Jun 7, 2019
0451d99
Don't escape finding rationales
x4v13r64 Jun 7, 2019
5548e91
Add helper
x4v13r64 Jun 7, 2019
ea97069
Improve partial
x4v13r64 Jun 7, 2019
e69f29d
Add GCP KMS key processing
x4v13r64 Jun 7, 2019
1ac22f0
Update CSS to fix dark theme
x4v13r64 Jun 10, 2019
0405a61
Merge pull request #439 from nccgroup/issues/422
x4v13r64 Jun 10, 2019
2abc4a7
Minor changes
x4v13r64 Jun 13, 2019
a89d902
Add tenant ID to credentials
x4v13r64 Jun 13, 2019
9645bba
Small tweak
x4v13r64 Jun 19, 2019
8828cec
Tweak behavior
x4v13r64 Jun 19, 2019
b7f8176
Merge pull request #450 from nccgroup/issues/448
x4v13r64 Jun 19, 2019
852474e
Merge branch 'develop' into enhancement/gcp-cis
x4v13r64 Jun 20, 2019
7193245
Merge branch 'develop' into bugfix/359
x4v13r64 Jun 20, 2019
9ce6442
Merge branch 'develop' into issues/82
x4v13r64 Jun 20, 2019
05cf7fe
Add condition
x4v13r64 Jun 20, 2019
a344a31
Merge pull request #451 from nccgroup/bugfix/359
x4v13r64 Jun 20, 2019
5b74cf8
Merge branch 'enhancement/gcp-cis' into develop
x4v13r64 Jun 20, 2019
f2f69ed
Improve Azure findings
x4v13r64 Jun 21, 2019
b214adc
Improve Azure findings
x4v13r64 Jun 21, 2019
6de930a
Sort ruleset
x4v13r64 Jun 21, 2019
805caf7
Add Azure cis ruleset
x4v13r64 Jun 21, 2019
5d64413
Improve GCP fundings
x4v13r64 Jun 21, 2019
1c330ed
Sort rulesets
x4v13r64 Jun 21, 2019
e11dd24
Remove useless rulesets and tests
x4v13r64 Jun 21, 2019
86afb37
Fix undesired ignore (?)
x4v13r64 Jun 21, 2019
366710d
Rename and sort ruleset
x4v13r64 Jun 21, 2019
5ffece0
Improve AWS fundings
x4v13r64 Jun 21, 2019
dffed35
Remove useless rulesets and tests
x4v13r64 Jun 21, 2019
484ff03
Fix finding
x4v13r64 Jun 21, 2019
58f5b36
Fix findings
x4v13r64 Jun 21, 2019
8c7f9c9
Merge pull request #441 from nccgroup/issues/82
x4v13r64 Jun 21, 2019
231df63
Fix condition
x4v13r64 Jun 21, 2019
4cd705c
Improve AWS facades' error handling
x4v13r64 Jun 21, 2019
b3cc65b
Handle keyboard interrups
x4v13r64 Jun 21, 2019
66ff569
Fix typo
x4v13r64 Jun 21, 2019
7dae4f0
Merge pull request #453 from nccgroup/issues/381
x4v13r64 Jun 21, 2019
40fe261
Fix for https://github.com/nccgroup/ScoutSuite/issues/423
x4v13r64 Jun 22, 2019
5feb60b
Identity is not the same things as equality in Python
cclauss Jun 22, 2019
e4bb212
Merge pull request #455 from cclauss/patch-1
x4v13r64 Jun 23, 2019
247b1be
Fix typo
x4v13r64 Jun 26, 2019
b254243
Merge remote-tracking branch 'origin/develop' into develop
x4v13r64 Jun 26, 2019
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ nosetests.xml

# In case people do a `git add .` ...
*.csv
tests/data/ruleset-test.json

# Data folder and files
scoutsuite-report*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ environments. Using the APIs exposed by cloud providers, Scout Suite gathers con
and highlights risk areas. Rather than going through dozens of pages on the web consoles, Scout Suite presents a clear
view of the attack surface automatically.

Scout Suite is stable and actively maintained, but a number of features and internals may change. As such, please bare
Scout Suite is stable and actively maintained, but a number of features and internals may change. As such, please bear
with us as we find time to work on, and improve, the tool. Feel free to report a bug with details (please provide
console output using the `--debug` argument), request a new feature, or send a pull request.

Expand Down
2 changes: 1 addition & 1 deletion ScoutSuite/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = 'NCC Group'
__version__ = '5.1.0'
__version__ = '5.2.0'

ERRORS_LIST = []

Expand Down
76 changes: 48 additions & 28 deletions ScoutSuite/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,53 @@ def run_from_cli():
# Get the dictionary to get None instead of a crash
args = args.__dict__

return run(args.get('provider'),
args.get('profile'),
args.get('user_account'), args.get('service_account'),
args.get('cli'), args.get('msi'), args.get('service_principal'), args.get('file_auth'), args.get('tenant_id'),
args.get('subscription_id'),
args.get('client_id'), args.get('client_secret'),
args.get('username'), args.get('password'),
args.get('project_id'), args.get('folder_id'), args.get('organization_id'), args.get('all_projects'),
args.get('report_name'), args.get('report_dir'),
args.get('timestamp'),
args.get('services'), args.get('skipped_services'),
args.get('result_format'),
args.get('database_name'),
args.get('host_ip'),
args.get('host_port'),
args.get('max_workers'),
args.get('regions'),
args.get('fetch_local'), args.get('update'),
args.get('ip_ranges'), args.get('ip_ranges_name_key'),
args.get('ruleset'), args.get('exceptions'),
args.get('force_write'),
args.get('debug'),
args.get('quiet'),
args.get('log_file'),
args.get('no_browser'))
try:
return run(provider=args.get('provider'),
# AWS
profile=args.get('profile'),
# Azure
user_account=args.get('user_account'), service_account=args.get('service_account'),
cli=args.get('cli'), msi=args.get('msi'), service_principal=args.get('service_principal'), file_auth=args.get('file_auth'),
tenant_id=args.get('tenant_id'), subscription_id=args.get('subscription_id'),
client_id=args.get('client_id'), client_secret=args.get('client_secret'),
username=args.get('username'), password=args.get('password'),
# GCP
project_id=args.get('project_id'), folder_id=args.get('folder_id'), organization_id=args.get('organization_id'), all_projects=args.get('all_projects'),
# General
report_name=args.get('report_name'), report_dir=args.get('report_dir'),
timestamp=args.get('timestamp'),
services=args.get('services'), skipped_services=args.get('skipped_services'),
result_format=args.get('result_format'),
database_name=args.get('database_name'),
host_ip=args.get('host_ip'),
host_port=args.get('host_port'),
max_workers=args.get('max_workers'),
regions=args.get('regions'),
fetch_local=args.get('fetch_local'), update=args.get('update'),
ip_ranges=args.get('ip_ranges'), ip_ranges_name_key=args.get('ip_ranges_name_key'),
ruleset=args.get('ruleset'), exceptions=args.get('exceptions'),
force_write=args.get('force_write'),
debug=args.get('debug'),
quiet=args.get('quiet'),
log_file=args.get('log_file'),
no_browser=args.get('no_browser'),
programmatic_execution=False)
except (KeyboardInterrupt, SystemExit):
print_info('Exiting')


def run(provider,
# AWS
profile=None,
# Azure
user_account=False, service_account=None,
cli=False, msi=False, service_principal=False, file_auth=None, tenant_id=None, subscription_id=None,
cli=False, msi=False, service_principal=False, file_auth=None,
tenant_id=None, subscription_id=None,
client_id=None, client_secret=None,
username=None, password=None,
# GCP
project_id=None, folder_id=None, organization_id=None, all_projects=False,
# General
report_name=None, report_dir=None,
timestamp=False,
services=[], skipped_services=[],
Expand All @@ -72,7 +85,8 @@ def run(provider,
debug=False,
quiet=False,
log_file=None,
no_browser=False):
no_browser=False,
programmatic_execution=True):
"""
Run a scout job in an async event loop.
"""
Expand All @@ -85,12 +99,16 @@ def run(provider,


async def _run(provider,
# AWS
profile,
# Azure
user_account, service_account,
cli, msi, service_principal, file_auth, tenant_id, subscription_id,
client_id, client_secret,
username, password,
# GCP
project_id, folder_id, organization_id, all_projects,
# General
report_name, report_dir,
timestamp,
services, skipped_services,
Expand All @@ -105,6 +123,7 @@ async def _run(provider,
quiet,
log_file,
no_browser,
programmatic_execution,
**kwargs):
"""
Run a scout job.
Expand All @@ -130,7 +149,8 @@ async def _run(provider,
client_id=client_id,
client_secret=client_secret,
username=username,
password=password)
password=password,
programmatic_execution=programmatic_execution)

if not credentials:
return 401
Expand Down
9 changes: 9 additions & 0 deletions ScoutSuite/core/cli_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,16 @@ def parse_args(self, args=None):
# Cannot simply use required for backward compatibility
if not args.provider:
self.parser.error('You need to input a provider')

# If local analysis, overwrite results
if args.__dict__.get('fetch_local'):
args.force_write = True

# Test conditions
v = vars(args)
if v.get('tenant_id') and not v.get('service_principal'):
self.parser.error('--tenant can only be set when using --service-principal')
# TODO add more conditions

return args

16 changes: 9 additions & 7 deletions ScoutSuite/core/console.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import logging
import os
import sys
import traceback

import coloredlogs
from six.moves import input

import coloredlogs, logging

from ScoutSuite import ERRORS_LIST

########################################
Expand All @@ -15,20 +15,25 @@
verbose_exceptions = False
logger = logging.getLogger('scout')


def set_logger_configuration(is_debug=False, quiet=False, output_file_path=None):
"""
Configure whether full stacktraces should be dumped in the console output
"""

# set debug level
global verbose_exceptions
verbose_exceptions = is_debug

# if "quiet" is set, don't output anything
if not quiet:
if quiet:
coloredlogs.install(level='ERROR', logger=logger)
else:
coloredlogs.install(level='DEBUG' if is_debug else 'INFO', logger=logger)

if output_file_path:
# create file handler which logs messages
fh = logging.FileHandler(output_file_path, 'w+')
fh.setLevel(logging.DEBUG if is_debug else logging.INFO)
# create formatter and add it to the handlers
formatter = logging.Formatter(fmt='%(asctime)s %(hostname)s %(name)s[%(process)d] %(levelname)s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
Expand All @@ -54,7 +59,6 @@ def print_error(msg):


def print_exception(exception, additional_details=None):

try:
exc_type, exc_obj, exc_tb = sys.exc_info()
file_name = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
Expand All @@ -67,7 +71,6 @@ def print_exception(exception, additional_details=None):
traceback_exc = None
str = '{}'.format(exception)

global verbose_exceptions
if verbose_exceptions:
logger.exception(str)
else:
Expand All @@ -81,7 +84,6 @@ def print_exception(exception, additional_details=None):


def print_info(msg):

print_generic(msg)


Expand Down
2 changes: 1 addition & 1 deletion ScoutSuite/output/data/html/partials/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="collapse" id="item-{{key}}" aria-labelledby="item-{{key}}" data-parent="#list-{{key}}">
<div class="card-body row">
<div class="col-sm-9">
<p>{{rationale}}</p>
<p>{{{rationale}}}</p>
</div>
<div class="col-sm-3">
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h4 class="list-group-item-heading">Information</h4>
<div class="list-group-item">
<h4 class="list-group-item-heading">Bindings</h4>
<h5 class="list-group-item-heading">Attached Users:</h5>
<div class="accordion-inner">
<div id="cloudresourcemanager.projects.{{@../key}}.bindings.{{@key}}.users" class="accordion-inner">
<ul>
{{#each members.users}}
<li><samp>{{this}}</samp></li>
Expand All @@ -21,7 +21,7 @@ <h5 class="list-group-item-heading">Attached Users:</h5>
</ul>
</div>
<h5 class="list-group-item-heading">Attached Groups:</h5>
<div class="accordion-inner">
<div id="cloudresourcemanager.projects.{{@../key}}.bindings.{{@key}}.groups" class="accordion-inner">
<ul>
{{#each members.groups}}
<li><samp>{{this}}</samp></li>
Expand All @@ -31,7 +31,7 @@ <h5 class="list-group-item-heading">Attached Groups:</h5>
</ul>
</div>
<h5 class="list-group-item-heading">Attached Service Accounts:</h5>
<div class="accordion-inner">
<div id="cloudresourcemanager.projects.{{@../key}}.bindings.{{@key}}.service_accounts" class="accordion-inner">
<ul>
{{#each members.service_accounts}}
<li><samp>{{this}}</samp></li>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

<!-- Cloud Resources Manager groups' partial -->
<script id="services.cloudresourcemanager.projects.id.groups.partial" type="text/x-handlebars-template">
<div id="resource-name" class="list-group-item active">
<h4 class="list-group-item-heading">{{name}}</h4>
</div>
<div class="list-group-item">
<h4 class="list-group-item-heading">Information</h4>
<div class="list-group-item-text item-margin">Group: <span id="cloudresourcemanager.projects.{{@../key}}.groups.{{@key}}.name">{{name}}</span></div>
</div>
<div class="list-group-item">
<h4 class="list-group-item-heading">Bindings:</h4>
<div class="accordion-inner">
<ul>
{{#each roles}}
<li><samp>{{this}}</samp></li>
{{else}}
<li><samp>None</samp></li>
{{/each}}
</ul>
</div>
</div>
</script>

<script>
Handlebars.registerPartial("services.cloudresourcemanager.projects.id.groups", $("#services\\.cloudresourcemanager\\.projects\\.id\\.groups\\.partial").html());
</script>

<!-- Single cloudresourcemanager group template -->
<script id="single_cloudresourcemanager_group-template" type="text/x-handlebars-template">
{{> modal-template template='services.cloudresourcemanager.projects.id.groups'}}
</script>
<script>
var single_cloudresourcemanager_group_template = Handlebars.compile($("#single_cloudresourcemanager_group-template").html());
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

<!-- Cloud Resources Manager users' partial -->
<script id="services.cloudresourcemanager.projects.id.users.partial" type="text/x-handlebars-template">
<div id="resource-name" class="list-group-item active">
<h4 class="list-group-item-heading">{{name}}</h4>
</div>
<div class="list-group-item">
<h4 class="list-group-item-heading">Information</h4>
<div class="list-group-item-text item-margin">User: <span id="cloudresourcemanager.projects.{{@../key}}.users.{{@key}}.name">{{name}}</span></div>
</div>
<div class="list-group-item">
<h4 class="list-group-item-heading">Bindings:</h4>
<div class="accordion-inner">
<ul>
{{#each roles}}
<li><samp>{{this}}</samp></li>
{{else}}
<li><samp>None</samp></li>
{{/each}}
</ul>
</div>
</div>
</script>

<script>
Handlebars.registerPartial("services.cloudresourcemanager.projects.id.users", $("#services\\.cloudresourcemanager\\.projects\\.id\\.users\\.partial").html());
</script>

<!-- Single cloudresourcemanager user template -->
<script id="single_cloudresourcemanager_user-template" type="text/x-handlebars-template">
{{> modal-template template='services.cloudresourcemanager.projects.id.users'}}
</script>
<script>
var single_cloudresourcemanager_user_template = Handlebars.compile($("#single_cloudresourcemanager_user-template").html());
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ <h4 class="list-group-item-heading">Information</h4>
<div class="list-group-item-text item-margin">Last Backup: <span id="cloudsql.projects.{{@../key}}.instances.{{@key}}.last_backup_timestamp">{{last_backup_timestamp}}</span></div>
<div class="list-group-item-text item-margin">Logs: <span id="cloudsql.projects.{{@../key}}.instances.{{@key}}.log_enabled">{{convert_bool_to_enabled log_enabled}}</span></div>
<div class="list-group-item-text item-margin">SSL Required: <span id="cloudsql.projects.{{@../key}}.instances.{{@key}}.ssl_required">{{convert_bool_to_enabled ssl_required}}</span></div>
<div class="list-group-item-text item-margin">Public IP Address: <span id="cloudsql.projects.{{@../key}}.instances.{{@key}}.public_ip">{{public_ip}}</span></div>
<div class="list-group-item-text item-margin">Private IP Address: <span id="cloudsql.projects.{{@../key}}.instances.{{@key}}.private_ip">{{private_ip}}</span></div>
<div class="list-group-item-text item-margin">Authorized Networks:</div>
<ul>
{{#each authorized_networks }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ <h4 class="list-group-item-heading"><span id="iam.projects.{{@../key}}.service_a
{{#each keys}}
<li>Key <samp>{{@key}}</samp></li>
<ul>
<li id="iam.projects.{{@../key}}.service_accounts.{{@key}}.keys.{{@key}}.algorithm">Key Algorithm: {{key_algorithm}}</li>
<li id="iam.projects.{{@../key}}.service_accounts.{{@key}}.keys.{{@key}}.valid_before">Valid Before: {{valid_before}}</li>
<li id="iam.projects.{{@../key}}.service_accounts.{{@key}}.keys.{{@key}}.valid_after">Valid After: {{valid_after}}</li>
<li id="iam.projects.{{@../../key}}.service_accounts.{{@../key}}.keys.{{@key}}.key_type">Key Type: <samp>{{key_type}}</samp></li>
<li id="iam.projects.{{@../../key}}.service_accounts.{{@../key}}.keys.{{@key}}.algorithm">Key Algorithm: <samp>{{key_algorithm}}</samp></li>
<li id="iam.projects.{{@../../key}}.service_accounts.{{@../key}}.keys.{{@key}}.valid_before">Valid Before: {{valid_before}}</li>
<li id="iam.projects.{{@../../key}}.service_accounts.{{@../key}}.keys.{{@key}}.valid_after">Valid After: {{valid_after}}</li>
</ul>
{{else}}
<li><samp>None</samp></li>
Expand Down
Loading
0