Skip to content
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

SARIF output handler #1726

Open
alfespa17 opened this issue Sep 29, 2023 · 2 comments · May be fixed by #1727
Open

SARIF output handler #1726

alfespa17 opened this issue Sep 29, 2023 · 2 comments · May be fixed by #1727

Comments

@alfespa17
Copy link

alfespa17 commented Sep 29, 2023

Currently there is an option to generate the output in JSON format that basically print the result array in this part of the code when using the parameter "--json=filename"

Example:

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

Adding a new output handler using a new parameter "--sarif=filename" could allow to export the result using SARIF format, this will allow to upload the result to any tool that support the specification.

In a high level the new parameter "--sarif=filename" could generate a SARIF file like this example

{
  "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:::XXXXXX"
                }
              }
            }
          ],
          "ruleId": "S3-S3ENCRYPTION"
        }
      ]
    }
  ]
}

The command to generate that output could be like:

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

I already did a small poc creating a new output handler, is not really a big change in the code, it is just creating a new handler similar to the one that generate the JSON format but using the SARIF json structure.

I would like to help with this issue and send a PR if the cloudsploit team think that this feature could be usefull to other people that is currently using this tool.

@alfespa17 alfespa17 linked a pull request Sep 29, 2023 that will close this issue
@fperez-applaudo
Copy link

That would be super helpful, as more tools are using it, and it can be integrated to other reports easily.

@alphadev4
Copy link
Collaborator

hi @alfespa17 , our team is looking into your pr, will update you soon. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants