diff --git a/.drone.yml b/.drone.yml index f090f80..5a342a1 100755 --- a/.drone.yml +++ b/.drone.yml @@ -129,6 +129,26 @@ steps: branch: master event: [push, pull_request] + # Trivy Security Scannner + - name: scan-image + pull: always + image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/trivy/client:latest + resources: + limits: + cpu: 1000 + memory: 1024Mi + environment: + IMAGE_NAME: end-tenancy:${DRONE_COMMIT_SHA} + SEVERITY: MEDIUM,HIGH,CRITICAL + FAIL_ON_DETECTION: false + IGNORE_UNFIXED: true + ALLOW_CVE_LIST_FILE: hof-services-config/UKVI_End_Tenancy/trivy-cve-exceptions.txt + when: + event: + - pull_request + - push + - tag + # Deploy to pull request UAT environment - name: deploy_to_branch pull: if-not-exists @@ -230,7 +250,7 @@ steps: branch: master event: pull_request - # Snyk & Anchore security scans which run after branch deployment to prevent blocking of PR UAT tests + # Snyk security scans which run after branch deployment to prevent blocking of PR UAT tests - name: snyk_scan pull: if-not-exists image: node:lts @@ -246,18 +266,6 @@ steps: - feature/* event: pull_request - - name: anchore_scan - image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/anchore-submission:latest - pull: always - environment: - IMAGE_NAME: end-tenancy:${DRONE_COMMIT_SHA} - LOCAL_IMAGE: true - TOLERATE: medium - WHITELIST_FILE: hof-services-config/UKVI_End_Tenancy/anchore-cve-exceptions.txt - when: - branch: master - event: pull_request - # Deploy to Master UAT environment - name: deploy_to_uat pull: if-not-exists @@ -393,7 +401,7 @@ steps: cron: tear_down_pr_envs event: cron - # CRON job steps that runs security scans using Snyk & Anchore + # CRON job steps that runs security scans using Snyk & Trivy - name: cron_clone_repos image: alpine/git environment: @@ -432,14 +440,15 @@ steps: cron: security_scans event: cron - - name: cron_anchore_scan - image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/anchore-submission:latest + - name: cron_trivy_scan + image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/trivy/client:latest pull: always environment: IMAGE_NAME: end-tenancy:${DRONE_COMMIT_SHA} - LOCAL_IMAGE: true - TOLERATE: medium - WHITELIST_FILE: hof-services-config/UKVI_End_Tenancy/anchore-cve-exceptions.txt + SEVERITY: MEDIUM,HIGH,CRITICAL + FAIL_ON_DETECTION: false + IGNORE_UNFIXED: true + ALLOW_CVE_LIST_FILE: hof-services-config/UKVI_End_Tenancy/trivy-cve-exceptions.txt when: cron: security_scans event: cron @@ -483,13 +492,6 @@ services: - name: docker image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/dind - # Anchore scanning needs background service to run - - name: anchore-submission-server - image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/anchore-submission:latest - pull: always - commands: - - /run.sh server - # Redis session setup in background so integration tests can run - name: session image: redis diff --git a/Dockerfile b/Dockerfile index fd94b1d..fefb5db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM node:lts-alpine@sha256:19eaf41f3b8c2ac2f609ac8103f9246a6a6d46716cdbe49103fd USER root -# Update packages as a result of Anchore security vulnerability checks RUN apk update && \ apk add --upgrade gnutls binutils nodejs apk-tools libjpeg-turbo libcurl libx11 libxml2