Cloud Security Posture Management (CSPM)
CloudSploit by Aqua - Cloud Security Scans =================
Quick Start
Generic
$ git clone https://github.com/aquasecurity/cloudsploit.git
$ cd cloudsploit
$ npm install
$ ./index.js -h
Docker
$ git clone https://github.com/aquasecurity/cloudsploit.git
$ cd cloudsploit
$ docker build . -t cloudsploit:0.0.1
$ docker run cloudsploit:0.0.1 -h
$ docker run -e AWSACCESSKEYID=XX -e AWSSECRETACCESSKEY=YY cloudsploit:0.0.1 --compliance=pci
Documentation
+ Self-Hosted + Hosted at Aqua Wave + Amazon Web Services + Microsoft Azure + Google Cloud Platform + Oracle Cloud Infrastructure + CloudSploit Config File + Credential Files + AWS + Azure + GCP + Oracle OCI + Environment Variables + HIPAA + PCI + CIS Benchmarks + Console Output + Ignoring Passing Results + CSV + JSON + JUnit XML + Collection OutputBackground
CloudSploit by Aqua is an open-source project designed to allow detection of security risks in cloud infrastructure accounts, including: Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI), and GitHub. These scripts are designed to return a series of potential misconfigurations and security risks.Deployment Options
CloudSploit is available in two deployment options:Self-Hosted
Follow the instructions below to deploy the open-source version of CloudSploit on your machine in just a few simple steps.Hosted at Aqua Wave
A commercial version of CloudSploit hosted at Aqua Wave. Try Aqua Wave today!Installation
Ensure that NodeJS is installed. If not, install it from here.$ git clone git@github.com:cloudsploit/scans.git
$ npm install
Configuration
CloudSploit requires read-only permission to your cloud account. Follow the guides below to provision this access: For AWS, you can run CloudSploit directly and it will detect credentials using the default AWS credential chain.CloudSploit Config File
The CloudSploit config file allows you to pass cloud provider credentials by:- A JSON file on your file system
- Environment variables
- Hard-coding (not recommended)
$ cp config_example.js config.js
Edit the config file by uncommenting the relevant sections for the cloud provider you are testing. Each cloud has both a credential_file option, as well as inline options. For example:
azure: { // OPTION 1: If using a credential JSON file, enter the path below // credential_file: '/path/to/file.json', // OPTION 2: If using hard-coded credentials, enter them below // applicationid: process.env.AZUREAPPLICATION_ID || '', // keyvalue: process.env.AZUREKEY_VALUE || '', // directoryid: process.env.AZUREDIRECTORY_ID || '', // subscriptionid: process.env.AZURESUBSCRIPTION_ID || '' }
Credential Files
If you use thecredential_file option, point to a file in your file system that follows the correct format for the cloud you are using.
AWS
{
"accessKeyId": "YOURACCESSKEY",
"secretAccessKey": "YOURSECRETKEY"
}
Azure
{
"ApplicationID": "YOURAZUREAPPLICATIONID",
"KeyValue": "YOURAZUREKEYVALUE",
"DirectoryID": "YOURAZUREDIRECTORYID",
"SubscriptionID": "YOURAZURESUBSCRIPTIONID"
}
GCP
Note: For GCP, you generate a JSON file directly from the GCP console, which you should not edit.{
"type": "service_account",
"project": "GCPPROJECTNAME",
"client_email": "GCPCLIENTEMAIL",
"private_key": "GCPPRIVATEKEY"
}
Oracle OCI
{
"tenancyId": "YOURORACLETENANCYID",
"compartmentId": "YOURORACLECOMPARTMENTID",
"userId": "YOURORACLEUSERID",
"keyFingerprint": "YOURORACLEKEYFINGERPRINT",
"keyValue": "YOURORACLEKEYVALUE",
}
Environment Variables
CloudSploit supports passing environment variables, but you must first uncomment the section of yourconfig.js file relevant to the cloud provider being scanned.
You can then pass the variables listed in each section. For example, for AWS:
{ accesskey: process.env.AWSACCESSKEYID || '', secretaccesskey: process.env.AWSSECRETACCESS_KEY || '', sessiontoken: process.env.AWSSESSION_TOKEN || '', }
Running
To run a standard scan, showing all outputs and results, simply run:$ ./index.js
CLI Options
CloudSploit supports many options to customize the run time. Some popular options include:- AWS GovCloud support:
--govcloud - AWS China support:
--china - Save the raw cloud provider response data:
--collection=file.json - Ignore passing (OK) results:
--ignore-ok - Exit with a non-zero code if non-passing results are found:
--exit-code
- Change the output from a table to raw text:
--console=text
Click for a full list of options
$ ./index.js -h--compliance_ / _| | | |/ | | | () | | | | | | | ( | | _ | |_ | | | |/ \| | | |/
|\ \| ' \| |/ _ \| | | | |_| | () | || | (| |_) | |) | | () | | | \||\/ \,|\,|/| ./||\/|_|\| | | |_|CloudSploit by Aqua Security, Ltd. Cloud security auditing for AWS, Azure, GCP, Oracle, and GitHub
usage: index.js [-h] --config CONFIG [--compliance {hipaa,cis,cis1,cis2,pci}] [--plugin PLUGIN] [--govcloud] [--china] [--csv CSV] [--json JSON] [--junit JUNIT] [--table] [--console {none,text,table}] [--collection COLLECTION] [--ignore-ok] [--exit-code] [--skip-paginate] [--suppress SUPPRESS]
optional arguments: -h, --help show this help message and exit --config CONFIG The path to a cloud provider credentials file. --compliance {hipaa,cis,cis1,cis2,pci} Compliance mode. Only return results applicable to the selected program. --plugin PLUGIN A specific plugin to run. If none provided, all plugins will be run. Obtain from the exports.js file. E.g. acmValidation --govcloud AWS only. Enables GovCloud mode. --china AWS only. Enables AWS China mode. --csv CSV Output: CSV file --json JSON Output: JSON file --junit JUNIT Output: Junit file --table Output: table --console {none,text,table} Console output format. Default: table --collection COLLECTION Output: full collection JSON as file --ignore-ok Ignore passing (OK) results --exit-code Exits with a non-zero status code if non-passing results are found --skip-paginate AWS only. Skips pagination (for debugging). --suppress SUPPRESS Suppress results matching the provided Regex. Format: pluginId:region:resourceId</code></pre> </details>
Compliance
CloudSploit supports mapping of its plugins to particular compliance policies. To run the compliance scan, use the
flag. For example: <pre><code class="lang-">$ ./index.js --compliance=hipaa $ ./index.js --compliance=pci</code></pre>--compliance=cisMultiple compliance modes can be run at the same time: <pre><code class="lang-">$ ./index.js --compliance=cis1 --compliance=cis2</code></pre>
CloudSploit currently supports the following compliance mappings:
HIPAA
<pre><code class="lang-">$ ./index.js --compliance=hipaa</code></pre> HIPAA scans map CloudSploit plugins to the Health Insurance Portability and Accountability Act of 1996.PCI
<pre><code class="lang-">$ ./index.js --compliance=pci</code></pre> PCI scans map CloudSploit plugins to the Payment Card Industry Data Security Standard.CIS Benchmarks
<pre><code class="lang-">$ ./index.js --compliance=cis $ ./index.js --compliance=cis1 $ ./index.js --compliance=cis2</code></pre>CIS Benchmarks are supported, both for Level 1 and Level 2 controls. Passing
will run both level 1 and level 2 controls.--ignore-okOutput Formats
CloudSploit supports output in several formats for consumption by other tools. If you do not specify otherwise, CloudSploit writes output to standard output (the console) as a table.Note: You can pass multiple output formats and combine options for further customization. For example: <pre><code class="lang-"># Print a table to the console and save a CSV file $ ./index.js --csv=file.csv --console=table
Print text to the console and save a JSON and JUnit file while ignoring passing results
$ ./index.js --json=file.json --junit=file.xml --console=text --ignore-ok</code></pre>Console Output
By default, CloudSploit results are printed to the console in a table format (with colors). You can override this and use plain text instead, by running: <pre><code class="lang-">$ ./index.js --console=text</code></pre>Alternatively, you can suppress the console output entirely by running: <pre><code class="lang-">$ ./index.js --console=none</code></pre>
Ignoring Passing Results
You can ignore results from output that return an OK status by passing acommandline argument.--suppressCSV
<pre><code class="lang-">$ ./index.js --csv=file.csv</code></pre>JSON
<pre><code class="lang-">$ ./index.js --json=file.json</code></pre>JUnit XML
<pre><code class="lang-">$ ./index.js --junit=file.xml</code></pre>Collection Output
CloudSploit saves the data queried from the cloud provider APIs in JSON format, which can be saved alongside other files for debugging or historical purposes. <pre><code class="lang-">$ ./index.js --collection=file.json</code></pre>Suppressions
Results can be suppressed by passing theflag (multiple options are supported) with the following format: <pre><code class="lang-">--suppress pluginId:region:resourceId</code></pre>--pluginFor example: <pre><code class="lang-"># Suppress all results for the acmValidation plugin $ ./index.js --suppress acmValidation::
Suppress all us-east-1 region results
$ ./index.js --suppress :us-east-1:Suppress all results matching the regex "certificate/*" in all regions for all plugins
$ ./index.js --suppress ::certificate/*</code></pre>Running a Single Plugin
Theflag can be used if you only wish to run one plugin. <pre><code class="lang-">$ ./index.js --plugin acmValidation</code></pre>--remediate` flag can be used if you want to run remediation for the plugins mentioned as part of this argument. This takes a list of plugin names. Please see our developing remediation guide for more details.Architecture
CloudSploit works in two phases. First, it queries the cloud infrastructure APIs for various metadata about your account, namely the "collection" phase. Once all the necessary data is collected, the result is passed to the "scanning" phase. The scan uses the collected data to search for potential misconfigurations, risks, and other security issues, which are the resulting output.Writing a Plugin
Please see our contribution guidelines and complete guide to writing CloudSploit plugins.Writing a remediation
TheOther Notes
For other details about the Aqua Wave SaaS product, AWS security policies, and more, click here.

