Skip to content

Commit

Permalink
Map semgrep severity level keys
Browse files Browse the repository at this point in the history
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
  • Loading branch information
samet-akcay committed Dec 12, 2024
1 parent 461f6d7 commit 9887c94
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/actions/security/bandit/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ inputs:
default: "pyproject.toml"
severity_level:
description: "Minimum severity level to report (all/LOW/MEDIUM/HIGH)"
required: false
default: "LOW"
confidence_level:
description: "Minimum confidence level to report (all/LOW/MEDIUM/HIGH)"
Expand Down
18 changes: 17 additions & 1 deletion .github/actions/security/semgrep/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ runs:
id: run-semgrep
shell: bash
run: |
# Map standard severity levels to Semgrep's levels
case "${{ inputs.severity }}" in
"LOW")
SEMGREP_SEVERITY="INFO"
;;
"MEDIUM")
SEMGREP_SEVERITY="WARNING"
;;
"HIGH"|"CRITICAL")
SEMGREP_SEVERITY="ERROR"
;;
*)
SEMGREP_SEVERITY="WARNING"
;;
esac
# Create results directory
mkdir -p security-results/semgrep
Expand All @@ -126,7 +142,7 @@ runs:
semgrep \
--config ${{ inputs.config }} \
--severity ${{ inputs.severity }} \
--severity $SEMGREP_SEVERITY \
--timeout ${{ inputs.timeout }} \
--${{ inputs.output-format }} \
-o "${REPORT_FILE}" \
Expand Down

0 comments on commit 9887c94

Please sign in to comment.