kowainik / kowainik/stan

Supporting SARIF output

Open
#467 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
597
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Hello ๐Ÿ‘‹

My name is Nick, I am one of the architects here at GitHub ๐Ÿ‘‹ lovely to meet you all ๐Ÿ‘‹

Firstly, love what you are doing here ๐Ÿ’ฏ

I am working on [advanced security](https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security) and one thing that we are starting to see is people want to integrate stan with[ Code Scanning](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning).

tl;dr code scanning is a service that allows customers to integrate the output of security tools (and quality tools) into GitHub so they don't need to go between multiple tools, and it's all represented in the same way.

The one requirement is data is outputted from the tool within [SARIF](https://docs.oasis-open.org/sarif/sarif/v2.0/sarif-v2.0.html) . Think of SARIF as a structured JSON object that tells us what the vulnerabilities are, and where they are found.

I see this tool supports: `[--json-output]`, it would be great if it supported `[--sarif-output]` and we could then pass this SARIF either to the [upload SARIF action](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github), or the [upload SARIF API](https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data).

The SARIF support docs are [here](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning) for GitHub, and tells you what is needed :)

Taking a quick look through the code, we can see you have a lot of the data needed for the output, you would just need to structure it in the right way to be SARIF compliant. I would **love** to contribute but my Haskell knowledge is not up to par here ๐Ÿ˜ข

I wondered if this is something you would be willing to add as a feature request? โค๏ธ

Here is an example PR that adds SARIF for [another tool](https://github.com/stelligent/cfn_nag/pull/573), you can see other tools that support SARIF here: [Security Workflows(https://github.com/kowainik/stan/actions/new?category=security), if you would like to see how other tools do it ๐Ÿ‘ (would also love to add you to this list if you did end up supporting SARIF โค๏ธ

Anyways, thanks for hearing me out :)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing --json-output entry point and reviewing the SARIF support documentation linked in the issue. Define the --sarif-output behavior and map Stan's available analysis data into a SARIF-compliant result that can be accepted by GitHub Code Scanning's upload action or API.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
devtools, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.