Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

SARIF output support #616

Closed
HariSekhon opened this issue May 12, 2022 · 5 comments
Closed

SARIF output support #616

HariSekhon opened this issue May 12, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request up for grabs Looking for a contributor to take this task
Projects

Comments

@HariSekhon
Copy link

Please support Sarif output format so that it can be uploaded as part of GitHub Actions workflows for issues to go into the GitHub Security tab.

Relates to #125

@HariSekhon HariSekhon added the enhancement New feature or request label May 12, 2022
@eyarz
Copy link
Member

eyarz commented May 13, 2022

@HariSekhon do you know if it's possible to convert XML, yaml or JUnit to SARIF?

@HariSekhon
Copy link
Author

Looks like it's already JSON + schema:

https://github.com/microsoft/sarif-tutorials/blob/main/docs/1-Introduction.md

I'm not familiar with any tool to convert from one to the other, as most of the other security tools I've used already support this output as it's the standard way of putting alerts into GitHub Security tab.

@eyarz eyarz added the up for grabs Looking for a contributor to take this task label May 13, 2022
@github-actions github-actions bot added this to To Do in Datree May 13, 2022
@eyarz eyarz changed the title Sarif support to integrate issues into GitHub Security tab under code scanning SARIF output support May 22, 2022
@eyarz
Copy link
Member

eyarz commented May 22, 2022

@hadar-co did some research for the person that will take this task:

SARIF is is an industry-standard format for the output of static analysis tools. It is based on JSON and has its own specifications/schema. It seems that this format is gaining traction, and many tools already provide support for it. Github provides an action that uploads a SARIF file and displays it under the “Security” tab of a repo.

There is no available converter from an output that Datree supports to SARIF. Therefore, to support this format we need to write a conversion ourselves.

Some helpful resources:

@eyarz
Copy link
Member

eyarz commented May 24, 2022

The action will also need to use the codeql action to upload the SARIF file:

      - name: Upload result to GitHub Code Scanning
        uses: github/codeql-action/upload-sarif@v2
        with:
          sarif_file: results_output.sarif

@hadar-co
Copy link
Contributor

The SARIF format is now supported, see our action for instructions on how to create a SARIF report & upload it to Github code scanning :)

Datree automation moved this from To Do to Done Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request up for grabs Looking for a contributor to take this task
Projects
Development

No branches or pull requests

3 participants