Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit 20fb1f7

Browse files
authored
Fix: [AEA-0000] - add more details to scan output (#21)
* add more details to sbom * better error reporting
1 parent 7c9e224 commit 20fb1f7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

check-sbom-issues-against-ignores.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,41 @@ CRITICAL_FOUND=false
2323
# Loop through vulnerabilities in the scan results
2424
while IFS= read -r MATCH; do
2525
VULN_ID=$(echo "$MATCH" | jq -r '.vulnerability.id')
26+
DESCRIPTION=$(echo "$MATCH" | jq -r '.vulnerability.description')
27+
DATASOURCE=$(echo "$MATCH" | jq -r '.vulnerability.dataSource')
2628

2729
# Check if the vulnerability ID is in the ignored list
2830
FOUND=false
2931
for IGNORED in "${IGNORED_ISSUES[@]}"; do
3032
if [[ "$IGNORED" == "$VULN_ID" ]]; then
3133
FOUND=true
34+
echo
35+
echo "***************************"
3236
echo "Warning: Ignored vulnerability found: $VULN_ID"
37+
echo "Warning: Description: $DESCRIPTION"
38+
echo "Warning: dataSource: $DATASOURCE"
39+
echo "***************************"
3340
break
3441
fi
3542
done
3643

3744
# If the vulnerability is not found in the ignored list, mark critical as found
3845
if [[ "$FOUND" == false ]]; then
46+
echo
47+
echo "***************************"
3948
echo "Error: Critical vulnerability found that is not in the ignore list: $VULN_ID"
49+
echo "Error: Description: $DESCRIPTION"
50+
echo "Error: dataSource: $DATASOURCE"
51+
echo "***************************"
4052
CRITICAL_FOUND=true
4153
fi
4254
done < <(jq -c '.matches[] | select(.vulnerability.severity == "Critical")' "$SCAN_RESULTS_FILE")
4355

4456
# Exit with error if critical vulnerability is found
4557
if [[ "$CRITICAL_FOUND" == true ]]; then
4658
echo "ERROR: Address the critical vulnerabilities before proceeding."
59+
echo "To add this to an ignore list, add the vulnerability to ignored_security_issues.json"
60+
echo "See https://github.com/NHSDigital/eps-action-sbom for more details"
4761
exit 1
4862
fi
4963

0 commit comments

Comments
 (0)