Skip to content

[UPD] added Security scanners; #4

[UPD] added Security scanners;

[UPD] added Security scanners; #4

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
runner_defaults: &runner_defaults
runs-on: ubuntu-20.04
default_permissions: &default_permissions
permissions:
contents: read
security-events: write
actions: read
jobs:
trivy_scan:
<<: *default_permissions
name: trivy-scans
<<: *runner_defaults

Check failure on line 34 in .github/workflows/ci-security-scanner-checks.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci-security-scanner-checks.yml

Invalid workflow file

You have an error in your yaml syntax on line 34
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@main
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:
<<: *default_permissions
name: snyk-scans
<<: *runner_defaults
steps:
- name: Checkout code
uses: actions/checkout@main
- uses: snyk/actions/setup@main
- 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@main
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:
<<: *default_permissions
name: nancy-check
<<: *runner_defaults
steps:
- name: Checkout code
uses: actions/checkout@main
- 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"