-
Notifications
You must be signed in to change notification settings - Fork 786
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
ScoutSuite integration #519
Comments
DDRWe are mostly going to talk about boundaries. High-level designWe will program some utility functions into ScoutSuite to make it usable as a library and not only as a standalone program with HTML output. The main goal is to create a single endpoint called The Monkey agent will run this function and send the results to the Island as telemetry. Since ScoutSuite's results are already separated into RedYellowGreen, we will not need to parse and choose the severity ourselves. We need to decide what is a test, a finding and an event in the context of ScoutSuite. Options which have been considered but rejected
DDAffected componentsScoutSuiteTODO: Detail changes in our fork. I'm working with NCC to understand what's the best approach there. Seems like almost no changes will be required - maybe logger config or output file path. Nothing major for sure. We'll need to create our own subset of their test - this is a param to the main "run" function, but might get rather complex since we're choosing a subset of a lot of tests. Monkey agentThe decision right now is to call ScoutSuite async here: https://github.com/ShayNehmad/ScoutSuite/blob/43a931fe24ae332133a098f337584baf5a4bf2ff/ScoutSuite/__main__.py#L76 If we're on AWS, almost no params. If we're on Azure, we'll do Wait for the results, read the results file (JSON) and send telemetry. If ScoutSuite failed to execute, capture the error and send that in telemetry as well.
IslandThe island should get the results from telemetry, but the processing should be rather "generic" since the results are coming already with status etc. - this is UNLIKE the previous ZT tests which were collected on Monkey side and processed on Island side. A ScoutSuite results parser + "enricher" (which ZT test each ScoutSuite test belongs to) should exist. Report UINo major changes will be done to the Zero Trust report or its UI. We will add a "which environments have been recognized" panel and we need to add an infobox explaining tests are filtered based on this.
Testing🤕 Assumption - we'll only be as good as ScoutSuite. We can open PRs to ScoutSuite to fix issues we're unhappy with. SanitySet up a situation where one check is red, one is yellow, one is green, one is grey.
Edge casesAll parsing code should be edge-cased via Unit Tests and NOT manual cloud testing; this will be much more efficient. Risks + opportunitiesRISK: Cloud setups will take a lot of time to get up and running and to debug and test on. Tasks
Dev
|
DDR 1 with @danielguardicore :
|
WIPScoutSuite Exploratory Surgery for DDRSetupI set up the following machines, and I'm debugging Directly from PyCharm using remote SSH shell:
ConclusionsInstallationsThere are quite a lot of extra dependencies this bestows on the Monkey (mostly cloud stuff)). First execution - AWSWent with AWS. Ran using Python 3.7 - Started debugging. The main mechanism seems to be an asyncio event loop which uses a ThreadPool - they already thought about MultiThreading. Need to make sure I can run this async myself. I didn't debug the internals by accident, so let's start with analyzing the results (and the results FILE) for now and approach the internals + interesting parameters later. Results analysisInteresting categoriesThe "baseline" will be AWS (Azure equivalent will be provided later). For sureWe'll have the following "categories", meaning tests, per cloud provider:
Maybe listMight fits in Storage category
Might fit in general Orchastration category...
Nope
Second execution - Azure
To fix:
Results are MUCH less extensive, seems like ScoutSuite care much less about Azure. |
Common terms:Monkey findingMonkey finding is zero trust finding created by monkey. It contains usual ZT finding structure, it's details contain events. Monkey finding data structure corresponds to:
Monkey finding details correspond to:
Scoutsuite findingScoutsuite finding is zero trust finding created using scoutsuite report data. It contains usual ZT finding structure, it's details contain scoutsuite rules. Scoutsuite finding data structure corresponds to:
Scoutsuite finding details data structure corresponds to::
ResourcesResources represent items on cloud. Resources can also contain other resources, for example regions have vpc's which have instances and so on. Obviously, data between different resource types varies greatly. Resources are part of data ScoutSuite generates, and will be stored on the database. Example data of ec-2 instance: ScoutSuite data -> Scoutsuite ZT finding.Data analysis:Scoutsuite findings are ordered by cloud service. Each service contains some form of resources (buckets, vpc's, instances, security groups etc.) and In the ec2 service, relevant resources are
Items contain a path to relevant resources in scoutsuite data. This is how we know which field/resource is vulnerable/misconfigured. Process overviewHigh level overview of ZT workflow, involving ScoutSuite data parsing
|
We'd like to use ScoutSuite to collect and present Cloud findings in our Zero Trust report.
PDR
Problem statement
The problem currently is that we don't cover the Workloads and Orchestration pillars of Zero Trust and our report can generate more value to the users, especially enterprise ones.
The business value of this will be for the Enterprise cloud users and will be measured via download #s of this new version.
Scope
MH
NTH
Out of scope
Reference materials
https://github.com/nccgroup/ScoutSuite
Specific Components PDR
Information Gathering in the Monkeys
Functional requirements
Inputs: Collect Cloud info is configured. This will run ScoutSuite. The exact software boundaries between ScoutSuite and Infection Monkey will be discussed in the DDR including if and how to update our ScoutSuite fork.
Outputs: Telemetry, how many checks were performed, how many resources were found.
Logs + error logs
Quality Requirements
The setup MUST BE very clearly defined and documented so users can use this feature by adding the relevant AWS role to their EC2 machines. THIS MIGHT BE INSECURE.
Zero Trust Report
Functional requirements
Inputs: Cloud data from Monkeys via telemetries.
Outputs: Zero Trust Findings
Logs on telemetry parsing + errors
Quality Requirements
Performance must be unhindered with MANY findings. A 2000 findings report MUST be generated in under 7 seconds.
Checklist: Requirements
The requirements checklist contains a list of questions to ask yourself about your project’s requirements.
Use the list as a sanity check at construction time to determine how solid the ground that you’re standing on is—where you are on the requirements Richter scale. Not all of the checklist questions will apply to your project. If you’re working on an informal project, you’ll find some that you don’t even need to think about. You’ll find others that you need to think about but don’t need to answer formally. If you’re working on a large, formal project, however, you may need to consider every one.
Specific Functional Requirements
Specific Nonfunctional (Quality) Requirements
Requirements Quality
Requirements Completeness
The text was updated successfully, but these errors were encountered: