fix(ha): namespace identity by UUID, not just bdev name #504
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: Security Scan | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 6 * * *' # Daily at 06:00 UTC | |
| workflow_dispatch: | |
| env: | |
| IMAGE_NAME: simplyblock/simplyblock | |
| jobs: | |
| scan: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image for scanning (linux/amd64 only) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| platforms: linux/amd64 | |
| load: true | |
| tags: ${{ env.IMAGE_NAME }}:scan | |
| # Grype uses Red Hat's Security Data API — much more current than Trivy's OVAL source. | |
| - name: Run Grype vulnerability scan (Red Hat advisories) | |
| id: grype | |
| uses: anchore/scan-action@v6 | |
| with: | |
| image: ${{ env.IMAGE_NAME }}:scan | |
| severity-cutoff: medium | |
| fail-build: true | |
| only-fixed: true | |
| output-format: table | |
| - name: Run Trivy vulnerability scan (Python packages + secrets) | |
| uses: aquasecurity/trivy-action@v0.35.0 | |
| with: | |
| image-ref: ${{ env.IMAGE_NAME }}:scan | |
| format: table | |
| severity: CRITICAL,HIGH,MEDIUM | |
| ignore-unfixed: true | |
| exit-code: '1' | |
| scanners: vuln,secret | |
| trivyignores: .trivyignore.yaml | |
| - name: Generate SBOM (CycloneDX) | |
| uses: aquasecurity/trivy-action@v0.35.0 | |
| with: | |
| image-ref: ${{ env.IMAGE_NAME }}:scan | |
| format: cyclonedx | |
| output: sbom.cdx.json | |
| - name: Upload SBOM artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sbom-${{ github.sha }} | |
| path: sbom.cdx.json | |
| retention-days: 90 | |
| - name: Notify Slack on scan failure | |
| if: failure() | |
| uses: slackapi/slack-github-action@v2 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { | |
| "text": ":rotating_light: *Security scan failed* — vulnerabilities found in `${{ github.repository }}`", | |
| "attachments": [ | |
| { | |
| "color": "danger", | |
| "fields": [ | |
| { "title": "Branch", "value": "${{ github.ref_name }}", "short": true }, | |
| { "title": "Commit", "value": "${{ github.sha }}", "short": true }, | |
| { "title": "Workflow", "value": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View run>", "short": false } | |
| ] | |
| } | |
| ] | |
| } |