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

Support for the SARIF (Static Analysis Results Interchange Format) #646

Closed
abhaybhargav opened this issue Nov 20, 2020 · 8 comments · Fixed by #1113
Closed

Support for the SARIF (Static Analysis Results Interchange Format) #646

abhaybhargav opened this issue Nov 20, 2020 · 8 comments · Fixed by #1113
Labels
enhancement New feature or request
Milestone

Comments

@abhaybhargav
Copy link

Is your feature request related to a problem? Please describe.
I think integration is the name of the game today and the SARIF format (https://github.com/oasis-tcs/sarif-spec) is a standard that most static analysis tools have embraced. It would be great if Bandit could have that as well. Simply because this integrates with Github, Vulnerability Management Tools and makes results consistent

Describe the solution you'd like
Support for the sarif-spec based on the JSON spec listed here and --output and --format flags that support SARIF as an option in addition to JSON, XML, etc.

@ericwb ericwb added the enhancement New feature or request label Nov 20, 2020
@ericwb ericwb added this to the Release 2.0.0 milestone Dec 6, 2020
@kiwiz
Copy link

kiwiz commented Dec 30, 2020

For reference, it looks like Microsoft wrote a converter here: https://github.com/microsoft/bandit-sarif-formatter

@syl-ms
Copy link

syl-ms commented Jul 5, 2021

@ericwb Hi Eric. My team is planning to modify either bandit or the converter provided above so that the SARIF output includes suppression information. I see you've added this enhancement for 2.0.0 - is someone already working on this? How could we contribute? Thanks.

@damiencarol
Copy link

any news on this issue?

@ericwb
Copy link
Member

ericwb commented Jan 21, 2022

Since Microsoft has already created a Bandit formatter and sarif library, I don't think there's any reason for Bandit duplicate the effort. Instead, maybe we can look at an easier way to make use of 3rd party plugins such as this.

@damiencarol
Copy link

@ericwb like add something in the documentation? Because I tested the MS plugin but it was not very easy to find this module and use it.
Maybe just a link to the MS repo could by enough to help users

@Jeeppler
Copy link

We from SecHub project at Mercedes-Benz Tech Innovation would like to contribute a SARIF 2.1.0 formatter. We would like to have SARIF support as one of the standard report format options in Bandit.

The Bandit SARIF formatter by Microsoft does not seem to be developed anymore and we need to have support for the Common Weakness Enumeration (CWE) taxonomy in the SARIF report. As a result of the limitations, we are happy to contribute a SARIF 2.1.0 formatter to Bandit.

@ericwb is the SARIF open to the idea of adding the SARIF support directly to Bandit in case we develop and contribute it?

@ericwb
Copy link
Member

ericwb commented Sep 23, 2023

@Jeeppler we're definitely open to the creation of a new formatter that supports SARIF.

@Jeeppler
Copy link

Jeeppler commented Sep 23, 2023

@ericwb thanks for the quick reply. We will start working on it.

ericwb added a commit to ericwb/bandit that referenced this issue Mar 3, 2024
This commit adds a formatter that outputs JSON in a specific
SARIF format according to spec at [1].

This code is largely leveraged from an existing implementation
found here [2].

SARIF format is very useful for integration into ecosystems such
as GitHub's Actions.

[1] https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html
[2] https://github.com/microsoft/bandit-sarif-formatter

Closes PyCQA#646

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
ericwb added a commit to ericwb/bandit that referenced this issue Mar 5, 2024
This commit adds a formatter that outputs JSON in a specific
SARIF format according to spec at [1].

This code is largely leveraged from an existing implementation
found here [2].

SARIF format is very useful for integration into ecosystems such
as GitHub's Actions.

[1] https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html
[2] https://github.com/microsoft/bandit-sarif-formatter

Closes PyCQA#646

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
ericwb added a commit to ericwb/bandit that referenced this issue Mar 5, 2024
This commit adds a formatter that outputs JSON in a specific
SARIF format according to spec at [1].

This code is largely leveraged from an existing implementation
found here [2].

SARIF format is very useful for integration into ecosystems such
as GitHub's Actions.

[1] https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html
[2] https://github.com/microsoft/bandit-sarif-formatter

Closes PyCQA#646

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
ericwb added a commit to ericwb/bandit that referenced this issue Mar 5, 2024
This commit adds a formatter that outputs JSON in a specific
SARIF format according to spec at [1].

This code is largely leveraged from an existing implementation
found here [2].

SARIF format is very useful for integration into ecosystems such
as GitHub's Actions.

[1] https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html
[2] https://github.com/microsoft/bandit-sarif-formatter

Closes PyCQA#646

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
ericwb added a commit to ericwb/bandit that referenced this issue Mar 5, 2024
This commit adds a formatter that outputs JSON in a specific
SARIF format according to spec at [1].

This code is largely leveraged from an existing implementation
found here [2].

SARIF format is very useful for integration into ecosystems such
as GitHub's Actions.

[1] https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html
[2] https://github.com/microsoft/bandit-sarif-formatter

Closes PyCQA#646

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
ericwb added a commit to ericwb/bandit that referenced this issue Mar 5, 2024
This commit adds a formatter that outputs JSON in a specific
SARIF format according to spec at [1].

This code is largely leveraged from an existing implementation
found here [2].

SARIF format is very useful for integration into ecosystems such
as GitHub's Actions.

[1] https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html
[2] https://github.com/microsoft/bandit-sarif-formatter

Closes PyCQA#646

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
ericwb added a commit to ericwb/bandit that referenced this issue Mar 5, 2024
This commit adds a formatter that outputs JSON in a specific
SARIF format according to spec at [1].

This code is largely leveraged from an existing implementation
found here [2].

SARIF format is very useful for integration into ecosystems such
as GitHub's Actions.

[1] https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html
[2] https://github.com/microsoft/bandit-sarif-formatter

Closes PyCQA#646

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
ericwb added a commit that referenced this issue Mar 8, 2024
This commit adds a formatter that outputs JSON in a specific
SARIF format according to spec at [1].

This code is largely leveraged from an existing implementation
found here [2].

SARIF format is very useful for integration into ecosystems such
as GitHub's Actions.

[1] https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html
[2] https://github.com/microsoft/bandit-sarif-formatter

Closes #646

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants