Security Scanning #561
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 Scanning | |
| # Canonical Trivy / Checkov security scanning workflow. | |
| # Image Trivy on the published CI image also runs via the | |
| # `.github/actions/security-scan` composite from `ci.yml` (push to main). | |
| # This workflow covers filesystem + IaC scans and a standalone image build scan | |
| # on schedule / main pushes / manual dispatch. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "**.rs" | |
| - "**.yaml" | |
| - "**.yml" | |
| - "charts/**" | |
| - "Dockerfile*" | |
| - "Makefile" | |
| - ".github/workflows/security-scan.yml" | |
| - ".github/actions/security-scan/**" | |
| schedule: | |
| - cron: "0 3 * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: security-scan-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| trivy-fs-scan: | |
| name: Trivy Filesystem Scan | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| security-events: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Run Trivy filesystem scan | |
| uses: aquasecurity/trivy-action@v0.36.0 | |
| with: | |
| scan-type: fs | |
| scan-ref: . | |
| format: sarif | |
| output: trivy-fs-results.sarif | |
| severity: CRITICAL,HIGH | |
| - name: Upload Trivy FS results | |
| uses: github/codeql-action/upload-sarif@v4 | |
| if: always() | |
| with: | |
| sarif_file: trivy-fs-results.sarif | |
| docker-trivy: | |
| name: Trivy Container Scan | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| security-events: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Build Docker image | |
| run: docker build -t stellar-operator:scan . | |
| - name: Security Scan | |
| uses: ./.github/actions/security-scan | |
| with: | |
| image-ref: stellar-operator:scan | |
| iac-checkov: | |
| name: IaC Security Scan (Helm/K8s manifests) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| security-events: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Checkov IaC scan | |
| uses: bridgecrewio/checkov-action@v12 | |
| with: | |
| directory: charts/ | |
| framework: helm | |
| output_format: sarif | |
| output_file_path: checkov-results.sarif | |
| continue-on-error: true | |
| - name: Upload Checkov results | |
| uses: github/codeql-action/upload-sarif@v4 | |
| if: always() | |
| with: | |
| sarif_file: checkov-results.sarif |