nccgroup / Scout2

Security auditing tool for AWS environments
http://nccgroup.github.io/Scout2/
GNU General Public License v2.0
1.73k stars 300 forks source link

allocation size overflow in JavaScript console #298

Closed andresriancho closed 5 years ago

andresriancho commented 6 years ago

It looks like the JS code is having issues with the large report too. Getting this in the JavaScript console when clicking on one of the S3 findings:

screenshot from 2018-09-10 15-50-38

The link I'm trying to follow:

file:///home/eth/tools/Scout2/scout2-report/report.html#services.s3.findings.s3-bucket-world-Put-policy.items

I'm clicking there:

screenshot from 2018-09-10 15-49-40

And there are quite a few S3 findings shown in the main report page:

screenshot from 2018-09-10 15-49-23

Any ideas on how to solve / workaround this one?

andresriancho commented 6 years ago

This is a known limitation for tools like Jupyter (see the table with the different browsers): https://jupyterlab.readthedocs.io/en/latest/user/file_formats.html#delimiter-separated-values

https://github.com/jupyterlab/jupyterlab/issues/4015

andresriancho commented 6 years ago

Found workaround, will split my assessment in batches by service, eg:

python Scout2.py --services awslambda cloudformation cloudtrail cloudwatch directconnect --report-dir=batch-1 --debug --force
x4v13r64 commented 6 years ago

This is most likely because of the size of the json file created by Scout. Not sure how to fix this in the tool per say. I'd recommend splitting the analysis between services/regions.

andresriancho commented 6 years ago

A potential fix to be implemented in the tool (without looking at the code, not sure really) would be to generate various .js files instead of a huge one. Those smaller .js files which contain the output would be loaded only when required:

x4v13r64 commented 6 years ago

That would work, yes. Although this is really an edge case at this point.

x4v13r64 commented 5 years ago

Closing this and labeling as wontfix.

This is a known issue and a limitation of browsers' memory management. In addition, generating such a large report is considered as an edge case.