new openmpp version, config modified, trivy updated #309
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a docker container, publish it to Azure Container Registry, and deploy it to Azure Kubernetes Service using a helm chart. | |
# | |
# https://github.com/Azure/actions-workflow-samples/tree/master/Kubernetes | |
# | |
# To configure this workflow: | |
# | |
# 1. Set up the following secrets in your workspace: | |
# a. REGISTRY_USERNAME with ACR username | |
# b. REGISTRY_PASSWORD with ACR Password | |
# c. AZURE_CREDENTIALS with the output of `az ad sp create-for-rbac --sdk-auth` | |
# | |
# 2. Change the values for the REGISTRY_NAME, CLUSTER_NAME, CLUSTER_RESOURCE_GROUP and NAMESPACE environment variables (below). | |
name: build | |
on: [pull_request] | |
# Environment variables available to all jobs and steps in this workflow | |
jobs: | |
listimages: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@master | |
- id: set-matrix | |
run: echo "::set-output name=matrix::{\"image\":[$(ls -d */ | sed 's~\(.*\)/$~\"\1\"~g' | paste -sd ',')]}" | |
build: | |
env: | |
TRIVY_VERSION: "v0.43.1" | |
HADOLINT_VERSION: "2.12.0" | |
needs: listimages | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.listimages.outputs.matrix)}} | |
runs-on: ubuntu-latest | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
steps: | |
- uses: actions/checkout@master | |
# Container build and push to a Azure Container registry (ACR) | |
- run: | | |
docker build -f ${{ matrix.image }}/Dockerfile -t localhost:5000/${{ matrix.image }}:${{ github.sha }} ${{ matrix.image }} | |
docker push localhost:5000/${{ matrix.image }}:${{ github.sha }} | |
docker image prune | |
# Scan image for vulnerabilities | |
- name: Aqua Security Trivy image scan | |
run: | | |
printf ${{ secrets.CVE_ALLOWLIST }} > .trivyignore | |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin ${{ env.TRIVY_VERSION }} | |
trivy image localhost:5000/${{ matrix.image }}:${{ github.sha }} --exit-code 1 --timeout=20m --security-checks vuln --severity CRITICAL | |
# Run Hadolint | |
- name: Run Hadolint | |
run: | | |
sudo curl -L https://github.com/hadolint/hadolint/releases/download/v${{ env.HADOLINT_VERSION }}/hadolint-Linux-x86_64 --output hadolint | |
sudo chmod +x hadolint | |
./hadolint ${{ matrix.image }}/Dockerfile --no-fail |