diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af36d82..7b20b89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,30 +44,30 @@ dev_deploy: before_script: - base64 -d $SA_Development | docker login -u _json_key --password-stdin https://eu.gcr.io stage: docker + artifacts: + public: false + expire_in: 12h + paths: + - scan script: - docker build -t $IMAGE_TAG . - docker push $IMAGE_TAG + - mkdir -p + - docker image save $IMAGE_TAG -o scan/hybridauth.tgz only: - master dev_trivy: - image: - name: docker.io/aquasec/trivy:latest - entrypoint: [""] - variables: - # No need to clone the repo, we exclusively work on artifacts. See - # https://docs.gitlab.com/ee/ci/runners/README.html#git-strategy - GIT_STRATEGY: none - TRIVY_USERNAME: "" - TRIVY_PASSWORD: "" - TRIVY_AUTH_URL: "" - FULL_IMAGE_NAME: $IMAGE_TAG + image: eu.gcr.io/vnc-development/docker-vnc-runner:latest stage: scan script: - - trivy --version - # cache cleanup is needed when scanning images with the same tags, it does not remove the database - - time trivy image --clear-cache - - trivy image --clear-cache $IMAGE_TAG + - apt -y update + - apt -y install wget apt-transport-https gnupg lsb-release + - wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | apt-key add - + - echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" >> /etc/apt/sources.list.d/trivy.list + - apt -y update + - apt -y install trivy + - trivy image --input scan/hybridauth.tgz only: - master diff --git a/scan/.keep b/scan/.keep new file mode 100644 index 0000000..e69de29