-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jq): add json convert json tfsec to rdjson (#26)
* feat(jq): add json convert json tfsec to rdjson * fix(shell): remove jq install * fix(shell): remove jq path * fix(shell): remove jq path and call jq * fix(git): remove space Co-authored-by: Jeremy PLANCKEEL <[email protected]>
- Loading branch information
1 parent
ea54c23
commit 5f0c3bd
Showing
2 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Convert TFsec JSON output to Reviewdog Diagnostic Format (rdjson) | ||
# https://github.com/reviewdog/reviewdog/blob/f577bd4b56e5973796eb375b4205e89bce214bd9/proto/rdf/reviewdog.proto | ||
{ | ||
source: { | ||
name: "tfsec", | ||
url: "https://github.com/aquasecurity/tfsec" | ||
}, | ||
diagnostics: .results | map({ | ||
message: .description, | ||
code: { | ||
value: .rule_id, | ||
url: .links[0], | ||
} , | ||
location: { | ||
path: .location.filename, | ||
range: { | ||
start: { | ||
line: .location.start_line, | ||
}, | ||
} | ||
}, | ||
severity: (if .severity | startswith("HIGH") then | ||
"ERROR" | ||
elif .severity | startswith("MEDIUM") then | ||
"WARNING" | ||
elif .severity | startswith("LOW") then | ||
"INFO" | ||
else | ||
null | ||
end), | ||
}) | ||
} |