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

output finding information as json #45

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

praetorian-thendrickson
Copy link
Contributor

Added a -j flag to output the finding information as JSON. Modified the -s flag to only output the sarif data. This allows for piping into programs like jq without an issue

[/Users/tomis/Desktop/gokart]$ ./gokart scan ../go-test-bench -s  | jq
parse error: Invalid numeric literal at line 1, column 6

now

[/Users/tomis/Desktop/gokart]$ ./gokart scan ../go-test-bench -s  | jq                                         
{                       
  "version": "2.1.0",              
  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", 
  "runs": [  
...
[/Users/tomis/Desktop/gokart]$ ./gokart scan ../go-test-bench -j | jq                                                                                                                                                         
[                                                                                                                                                                                                                             
  {                                                                                                                                                                                                                           
    "Vulnerable_Function": {                                                                                   
      "SourceCode": "\t\tcommand = exec.Command(\"echo\", userInput)", 
... 

Copy link
Contributor

@isp1r0 isp1r0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This killer. Loving the upgrade for CI/CD and testing.

@isp1r0 isp1r0 merged commit 120a1ef into praetorian-inc:main Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants