π Keep your Go dependencies secure, up-to-date, and compliant.
Go Guard is a CLI tool + GitHub Action for scanning Go projects to detect: Vulnerabilities, Outdated dependencies, Unmaintained packages, License risks. It helps developers keep Go projects secure, up-to-date, and compliant with minimal effort.
π Current version: v0.3.0
- π Scan
go.mod/go.sumdependencies - π‘οΈ Detect vulnerable dependencies using Go vulnerability database
- π¦ Check for outdated dependencies via the Go proxy
- ποΈ Detect unmaintained repos (archived or stale >2 years)
- βοΈ Identify licenses (via GitHub
LICENSEfile) - π Output as table or JSON or HTML
- πͺ Exit codes for CI pipelines (see below)
- β² Each module gets a RiskScore (numeric) and RiskLevel (Low / Medium / High).
- 0 β All checks passed (OK)
- 1 β Warnings detected (e.g. outdated or risky license or stale repo)
- 2 β Failures detected (vulnerabilities, archived repos)
Use these exit codes in CI/CD pipelines to fail builds on security issues.
go install github.com/AumSahayata/goguard@latestgoguard scanOutputs a table of all modules, their versions, and issues on the console.
goguard scan --jsongoguard scan --json-file result.jsongoguard scan --html-file result.htmlgoguard scan --verbosegoguard scan --strictFails even for warnings
name: GoGuard Scan
on:
pull_request:
branches: [main]
jobs:
goguard:
name: GoGuard
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Install goguard
run: go install github.com/AumSahayata/goguard@latest
- name: Run gogurad
run: goguard scan --json-file report.json --verbose| Package | Version | Latest | Status | Issues |
|---|---|---|---|---|
| github.com/gin-gonic/gin | v1.7.0 | v1.9.1 | [WARN] Outdated | CVE-2023-1234 (High) |
| github.com/pkg/errors | v0.9.1 | v0.9.1 | [OK] Up-to-date | - |
| github.com/old/lib | v1.0.0 | Unknown | [FAIL] Unmaint. | Repo archived |
[
{
"Name": "golang.org/x/mod",
"Version": "v0.28.0",
"Latest": "v0.28.0",
"Vulnerable": false,
"CVEs": [],
"Status": "[WARN] License",
"Issues": "License: Unknown",
"RiskScore": 2,
"RiskLevel": "Low"
},
]
MIT License. See LICENSE for details.
PRs and issues are welcome and feel free to suggest features.