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 Tests | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
| jobs: | ||
| security-tests: | ||
| name: Security Tests | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| # Security and performance validation | ||
| security-scan: | ||
| name: Security Scan | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Install and run Gosec | ||
| run: | | ||
| go install github.com/securecodewarrior/gosec/v2/cmd/gosec@latest | ||
| gosec -fmt sarif -out gosec-results.sarif -exclude-dir=third_party -exclude-dir=vendor ./... || true | ||
| continue-on-error: true | ||
| - name: Run Trivy vulnerability scanner | ||
| uses: aquasecurity/trivy-action@master | ||
| with: | ||
| scan-type: 'fs' | ||
| scan-ref: '.' | ||
| format: 'sarif' | ||
| output: 'trivy-results.sarif' | ||
| continue-on-error: true | ||
| - name: Upload security scan results | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: 'gosec-results.sarif' | ||
| continue-on-error: true | ||
| - name: Upload Trivy scan results | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: 'trivy-results.sarif' | ||
| continue-on-error: true | ||