cloudsploit icon indicating copy to clipboard operation
cloudsploit copied to clipboard

Adding output handler for SARIF JSON format

Open alfespa17 opened this issue 2 years ago • 2 comments

This PR will allow to generate the output using SARIF JSON format when using the following command

node index.js --cloud aws --config ./config.js --sarif=output.sarif.json --console=none --plugin s3Encryption

Basically it just adding a new parameter "sarif=filename"

The output handle will generate the following format:

{
  "version": "2.1.0",
  "$schema": "http://json.schemastore.org/sarif-2.1.0",
  "runs": [
    {
      "tool": {
        "driver": {
          "name": "cloudsploit",
          "version": "3.1.0",
          "informationUri": "https://github.com/aquasecurity/cloudsploit"
        }
      },
      "results": [
        {
          "level": "error",
          "message": {
            "text": "No bucket policy found; encryption not enforced"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "arn:aws:s3:::sfqdwr"
                }
              }
            }
          ],
          "ruleId": "S3-S3ENCRYPTION"
        }
      ]
    }
  ]
}

This is a valid SARIF file, check here

Fix #1726

alfespa17 avatar Sep 29 '23 16:09 alfespa17

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 29 '23 16:09 CLAassistant

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Sep 29 '23 16:09 CLAassistant