Vulnerabilities Checks #428
This file contains hidden or 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
| name: Vulnerabilities Checks | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # Every day | |
| workflow_dispatch: {} | |
| env: | |
| JAVA_VERSION: '21' | |
| permissions: | |
| contents: read | |
| jobs: | |
| dependency-check: | |
| name: Dependency Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Checkout GitHub Actions | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: kestra-io/actions | |
| path: actions | |
| ref: main | |
| # Setup build | |
| - uses: ./actions/.github/actions/setup-build | |
| id: build | |
| with: | |
| java-enabled: true | |
| node-enabled: true | |
| caches-enabled: true | |
| # Npm | |
| - name: Npm - Install | |
| shell: bash | |
| working-directory: ui | |
| run: npm ci | |
| # Run OWASP dependency check plugin | |
| - name: Gradle Dependency Check | |
| env: | |
| NVD_API_KEY: ${{ secrets.NIST_APIKEY }} | |
| run: | | |
| ./gradlew dependencyCheckAggregate | |
| # Upload dependency check report | |
| - name: Upload dependency check report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ always() }} | |
| with: | |
| name: dependency-check-report | |
| path: build/reports/dependency-check-report.html | |
| develop-image-check: | |
| name: Image Check (develop) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| security-events: write | |
| actions: read | |
| steps: | |
| # Checkout | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Checkout GitHub Actions | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: kestra-io/actions | |
| path: actions | |
| ref: main | |
| # Setup build | |
| - uses: ./actions/.github/actions/setup-build | |
| id: build | |
| with: | |
| java-enabled: false | |
| node-enabled: false | |
| caches-enabled: true | |
| # Run Trivy image scan for Docker vulnerabilities, see https://github.com/aquasecurity/trivy-action | |
| - name: Docker Vulnerabilities Check | |
| uses: aquasecurity/[email protected] | |
| with: | |
| image-ref: kestra/kestra:develop | |
| format: 'template' | |
| template: '@/contrib/sarif.tpl' | |
| severity: 'CRITICAL,HIGH' | |
| output: 'trivy-results.sarif' | |
| skip-dirs: /app/plugins | |
| - name: Upload Trivy scan results to GitHub Security tab | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: 'trivy-results.sarif' | |
| category: docker- | |
| latest-image-check: | |
| name: Image Check (latest) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| security-events: write | |
| actions: read | |
| steps: | |
| # Checkout | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Checkout GitHub Actions | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: kestra-io/actions | |
| path: actions | |
| ref: main | |
| # Setup build | |
| - uses: ./actions/.github/actions/setup-build | |
| id: build | |
| with: | |
| java-enabled: false | |
| node-enabled: false | |
| caches-enabled: true | |
| # Run Trivy image scan for Docker vulnerabilities, see https://github.com/aquasecurity/trivy-action | |
| - name: Docker Vulnerabilities Check | |
| uses: aquasecurity/[email protected] | |
| with: | |
| image-ref: kestra/kestra:latest | |
| format: table | |
| skip-dirs: /app/plugins | |
| scanners: vuln | |
| severity: 'CRITICAL,HIGH' | |
| output: 'trivy-results.sarif' | |
| - name: Upload Trivy scan results to GitHub Security tab | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: 'trivy-results.sarif' |