Fix output and sarif upload trivy
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
37
.github/workflows/make.yaml
vendored
37
.github/workflows/make.yaml
vendored
@@ -38,19 +38,43 @@ jobs:
|
|||||||
args: "release --clean --snapshot"
|
args: "release --clean --snapshot"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- uses: "aquasecurity/trivy-action@0.28.0"
|
- name: Scan Docker image with Trivy
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
uses: "aquasecurity/trivy-action@0.28.0"
|
||||||
with:
|
with:
|
||||||
image-ref: "ghcr.io/getprobo/probo:latest-amd64"
|
image-ref: "ghcr.io/getprobo/probo:latest-amd64"
|
||||||
format: "sarif"
|
format: "sarif"
|
||||||
output: "trivy-results.sarif"
|
output: "trivy-results.sarif"
|
||||||
|
exit-code: 0
|
||||||
|
ignore-unfixed: true
|
||||||
|
vuln-type: "os,library"
|
||||||
|
severity: "CRITICAL,HIGH"
|
||||||
|
- name: Scan Docker image with Trivy
|
||||||
|
if: github.ref != 'refs/heads/main'
|
||||||
|
uses: "aquasecurity/trivy-action@0.28.0"
|
||||||
|
with:
|
||||||
|
image-ref: "ghcr.io/getprobo/probo:latest-amd64"
|
||||||
|
format: "table"
|
||||||
exit-code: 1
|
exit-code: 1
|
||||||
ignore-unfixed: true
|
ignore-unfixed: true
|
||||||
vuln-type: "os,library"
|
vuln-type: "os,library"
|
||||||
severity: "CRITICAL,HIGH"
|
severity: "CRITICAL,HIGH"
|
||||||
- name: Upload Trivy scan results to GitHub Security tab
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
uses: github/codeql-action/upload-sarif@v4
|
uses: github/codeql-action/upload-sarif@v4
|
||||||
with:
|
with:
|
||||||
sarif_file: "trivy-results.sarif"
|
sarif_file: "trivy-results.sarif"
|
||||||
|
- uses: anchore/sbom-action@da167eac915b4e86f08b264dbdbc867b61be6f0c #v0.20.5
|
||||||
|
with:
|
||||||
|
path: ./
|
||||||
|
format: cyclonedx-json
|
||||||
|
output-file: sbom.json
|
||||||
|
- uses: anchore/scan-action@1638637db639e0ade3258b51db49a9a137574c3e #v6.5.1
|
||||||
|
with:
|
||||||
|
path: ./
|
||||||
|
fail-build: true
|
||||||
|
severity-cutoff: critical
|
||||||
|
output-format: table
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: "test"
|
name: "test"
|
||||||
@@ -77,17 +101,6 @@ jobs:
|
|||||||
coverage.html
|
coverage.html
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
- run: "make lint"
|
- run: "make lint"
|
||||||
- uses: anchore/sbom-action@da167eac915b4e86f08b264dbdbc867b61be6f0c #v0.20.5
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
format: cyclonedx-json
|
|
||||||
output-file: sbom.json
|
|
||||||
- uses: anchore/scan-action@1638637db639e0ade3258b51db49a9a137574c3e #v6.5.1
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
fail-build: true
|
|
||||||
severity-cutoff: critical
|
|
||||||
output-format: table
|
|
||||||
|
|
||||||
test-e2e:
|
test-e2e:
|
||||||
name: "test-e2e"
|
name: "test-e2e"
|
||||||
|
|||||||
18
.github/workflows/release.yaml
vendored
18
.github/workflows/release.yaml
vendored
@@ -10,6 +10,7 @@ permissions:
|
|||||||
packages: write
|
packages: write
|
||||||
id-token: write
|
id-token: write
|
||||||
attestations: write
|
attestations: write
|
||||||
|
security-events: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
github-release:
|
github-release:
|
||||||
@@ -64,6 +65,23 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Scan Docker image with Trivy
|
||||||
|
uses: aquasecurity/trivy-action@0.28.0
|
||||||
|
with:
|
||||||
|
image-ref: "ghcr.io/getprobo/probo:${{ github.ref_name }}"
|
||||||
|
format: "sarif"
|
||||||
|
output: "trivy-results.sarif"
|
||||||
|
exit-code: 1
|
||||||
|
ignore-unfixed: true
|
||||||
|
vuln-type: "os,library"
|
||||||
|
severity: "CRITICAL,HIGH"
|
||||||
|
|
||||||
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
|
uses: github/codeql-action/upload-sarif@v4
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
sarif_file: "trivy-results.sarif"
|
||||||
|
|
||||||
- name: Generate SBOM
|
- name: Generate SBOM
|
||||||
uses: anchore/sbom-action@da167eac915b4e86f08b264dbdbc867b61be6f0c #v0.20.5
|
uses: anchore/sbom-action@da167eac915b4e86f08b264dbdbc867b61be6f0c #v0.20.5
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user