Skip to content

Commit

Permalink
install docker scout
Browse files Browse the repository at this point in the history
  • Loading branch information
zainasir committed Jan 3, 2025
1 parent 5128f9c commit 3aabb4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ jobs:
BASE_REPO: cbioportal/cbioportal
DEV_REPO: cbioportal/cbioportal-dev
steps:
- run:
name: Install Docker Scout
command: |
curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s -- -b /home/circleci/bin
- run:
name: Log in to Docker
command: |
Expand All @@ -386,8 +390,8 @@ jobs:
SORT='sort_by(.severity | if . == "CRITICAL" then 0 elif . == "HIGH" then 1 elif . == "MEDIUM" then 2 elif . == "LOW" then 3 else 4 end)'
docker pull $BASE_IMAGE
docker pull $PR_IMAGE
docker scout cves $BASE_IMAGE --format sbom | jq -r "[.vulnerabilities.[].vulnerabilities[] | $OUTPUT_FORMAT] | $SORT" > base_report.sbom
docker scout cves $PR_IMAGE --format sbom | jq -r "[.vulnerabilities.[].vulnerabilities[] | $OUTPUT_FORMAT] | $SORT" > pr_report.sbom
docker-scout cves $BASE_IMAGE --format sbom | jq -r "[.vulnerabilities[].vulnerabilities[] | $OUTPUT_FORMAT] | $SORT" > base_report.sbom
docker-scout cves $PR_IMAGE --format sbom | jq -r "[.vulnerabilities[].vulnerabilities[] | $OUTPUT_FORMAT] | $SORT" > pr_report.sbom
DIFF=$(jq -s 'map(map(.source_id)) | .[0] - .[1]' pr_report.sbom base_report.sbom)
COUNT=$(echo $DIFF | jq 'length')
if [ "$COUNT" -gt 0 ]; then
Expand Down

0 comments on commit 3aabb4a

Please sign in to comment.