Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add trivy dockerScan #3295

Merged
merged 6 commits into from Jan 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions .circleci/config.yml
@@ -1,6 +1,7 @@
---
version: 2.1
orbs:
slack: circleci/slack@3.4.2
win: circleci/windows@2.2.0

executors:
Expand All @@ -25,6 +26,12 @@ executors:
image: ubuntu-2004:202101-01
resource_class: xlarge

trivy_executor:
docker:
- image: docker:stable-git
resource_class: small
working_directory: ~/project

notify:
webhooks:
- url: $HUBOT_URL
Expand Down Expand Up @@ -128,6 +135,27 @@ jobs:
build\distributions\besu\bin\besu.bat --help
build\distributions\besu\bin\besu.bat --version

dockerScan:
executor: trivy_executor
steps:
- prepare
- setup_remote_docker:
docker_layer_caching: true
- 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: |
for FILE in $(ls docker)
do
docker pull -q "hyperledger/besu:develop-$FILE"
trivy -q image --exit-code 1 --no-progress --severity HIGH,CRITICAL "hyperledger/besu:develop-$FILE"
done

unitTests:
executor: besu_executor_xl
steps:
Expand Down Expand Up @@ -335,3 +363,13 @@ workflows:
- besu-dockerhub-ro
- besu-dockerhub-rw
- besu-acr-rw
nightly:
triggers:
- schedule:
cron: "0 19 * * *"
filters:
branches:
only:
- main
jobs:
- dockerScan