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

Commit

Permalink
adding trivy nightly scan (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuafernandes committed May 4, 2023
1 parent d844f3a commit 53e60e7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ executors:
JAVA_TOOL_OPTIONS: -Xmx4096m
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4 -Xmx4096m

trivy_executor:
docker:
- image: docker:stable-git
auth:
username: $DOCKER_USER_RO
password: $DOCKER_PASSWORD_RO
resource_class: small
working_directory: ~/project

commands:
prepare:
description: "Prepare"
Expand Down Expand Up @@ -198,7 +207,25 @@ jobs:
./gradlew --no-daemon --parallel "-Pbranch=${CIRCLE_BRANCH}" dockerUpload
- notify


dockerScan:
executor: trivy_executor
steps:
- prepare
- setup_remote_docker:
docker_layer_caching: false
- run:
name: Install trivy
command: |
apk add --update-cache --upgrade curl bash
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
- run:
name: Scan with trivy
shell: /bin/sh
command: |
trivy -q image --exit-code 1 --no-progress --severity HIGH,CRITICAL --ignorefile "gradle/trivyignore.txt" --timeout 10m "consensys/ethsigner:develop"
- notify

workflows:
version: 2
nightly:
Expand All @@ -213,6 +240,9 @@ workflows:
- build:
context:
- protocols-dockerhub
- dockerScan:
context:
- protocols-dockerhub
- acceptanceTests:
requires:
- build
Expand Down
2 changes: 2 additions & 0 deletions gradle/trivyignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Only applicable when parsing yaml from untrusted sources
CVE-2022-1471

0 comments on commit 53e60e7

Please sign in to comment.