Skip to content

[FIX] removed unused ignore path; #55

[FIX] removed unused ignore path;

[FIX] removed unused ignore path; #55

name: ci-security-scanner-checks
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
schedule:
- cron: "0 0 * * *"
permissions:
contents: read
jobs:
trivy_scan:
name: trivy-scans
runs-on: ubuntu-20.04
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
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'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
snyk_scan:
name: snyk-scans
runs-on: ubuntu-20.04
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: snyk/actions/setup@master
- name: Get Go Version
run: |
#!/bin/bash
GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVERSION }}
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/golang@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_AUTH_TOKEN }}
with:
args: --sarif-file-output=snyk-results.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'snyk-results.sarif'
nancy_check:
name: nancy-check
runs-on: ubuntu-20.04
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get Go Version
run: |
#!/bin/bash
GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVERSION }}
- name: WriteGoList
run: go list -json -m all > go.list
- name: Nancy
uses: sonatype-nexus-community/nancy-github-action@main
with:
nancyVersion: "v1.0.46"
nancyCommand: sleuth --loud
ossf_scan:
name: openssf-scorecard
runs-on: ubuntu-20.04
permissions:
security-events: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run analysis
uses: ossf/scorecard-action@main
with:
results_file: 'ossf-results.sarif'
results_format: sarif
publish_results: true
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: 'OSSF Sarif file'
path: 'ossf-results.sarif'
retention-days: 5
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'ossf-results.sarif'