diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index c323bbe800..f9a8e12071 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -80,7 +80,7 @@ jobs: sonar_analysis: needs: build-maven-pre-registration - if: "${{ github.event_name != 'pull_request' }}" + if: "${{ github.event_name != 'pull_request' }}" uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master with: SERVICE_LOCATION: ./pre-registration @@ -92,3 +92,34 @@ jobs: OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} GPG_SECRET: ${{ secrets.GPG_SECRET }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + trivy_scan: + needs: build-dockers + runs-on: ubuntu-latest + strategy: + matrix: + include: + - SERVICE_NAME: 'pre-registration-application-service' + - SERVICE_NAME: 'pre-registration-batchjob' + - SERVICE_NAME: 'pre-registration-datasync-service' + - SERVICE_NAME: 'pre-registration-captcha-service' + steps: + - name: Set environment variables + run: | + echo "SERVICE_NAME=${{ matrix.SERVICE_NAME }}" >> $GITHUB_ENV + echo "VERSION=latest" >> $GITHUB_ENV + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@0.20.0 + with: + image-ref: 'docker.io/${{ env.SERVICE_NAME }}:${{ env.VERSION }}' + format: 'sarif' + output: 'trivy-results.sarif' + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'trivy-results.sarif' diff --git a/README.md b/README.md index fe5d16a5fa..cb46a777e6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Maven Package upon a push](https://github.com/mosip/pre-registration/actions/workflows/push_trigger.yml/badge.svg?branch=release-1.2.0.1)](https://github.com/mosip/pre-registration/actions/workflows/push_trigger.yml) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=release-1.2.0.1&project=mosip_pre-registration&metric=alert_status)](https://sonarcloud.io/dashboard?branch=release-1.2.0.1&id=mosip_pre-registration) +[![Maven Package upon a push](https://github.com/mosip/pre-registration/actions/workflows/push-trigger.yml/badge.svg?branch=master)](https://github.com/mosip/pre-registration/actions/workflows/push-trigger.yml) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=master&project=mosip_pre-registration&metric=alert_status)](https://sonarcloud.io/dashboard?branch=master&id=mosip_pre-registration) # Pre-registration This repository contains the source code and design documents for MOSIP Pre-registration server. For an overview refer [here](https://docs.mosip.io/1.2.0/modules/pre-registration). The modules exposes API endpoints. For a reference front-end UI implementation refer to [Pre-registration UI github repo](https://github.com/mosip/pre-registration-ui/)