Skip to content

Security Scan

Security Scan #5

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Security scanning workflow for nvcf-go public GitHub repository.
# Runs on push to main and on a weekly schedule.
name: Security Scan
on:
push:
branches:
- main
schedule:
# Run weekly on Mondays at 08:00 UTC
- cron: "0 8 * * 1"
workflow_dispatch:
env:
GO_VERSION: "1.24"
jobs:
# ---------------------------------------------------------------------------
# Secret scanning — check for accidentally committed secrets
# ---------------------------------------------------------------------------
secret-scan:
name: Secret Scan (Gitleaks)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for thorough scan
- name: Run Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ---------------------------------------------------------------------------
# Dependency vulnerability scan
# ---------------------------------------------------------------------------
dependency-scan:
name: Dependency Scan (govulncheck)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run govulncheck
run: govulncheck ./...
# ---------------------------------------------------------------------------
# SAST — CodeQL static analysis
# ---------------------------------------------------------------------------
codeql:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
run: go build ./...
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3