Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

gosec

github.com

  • Free plan
  • Open source
  • macOS
  • Linux
  • API
  • Self-hosted
7.6 Club score Visit github.com

What gosec is

gosec is a free security checker that scans Go source code for potential security issues. It analyzes abstract syntax trees and static single assignment representations, using pattern-based rules, SSA analyzers, and taint analysis. Its checks include injection, path traversal, server-side request forgery, unsafe deserialization, cryptography and TLS, file handling, blocklisted imports, and Go-specific concerns. Each detected issue maps to a Common Weakness Enumeration entry. Users can select or exclude rules, set path-based exclusions, and adjust global settings such as audit mode. Reports are available in formats including text, JSON, YAML, CSV, JUnit XML, HTML, SonarQube, golint, and SARIF. The project documents GitHub Actions use and SARIF uploads to GitHub code scanning; its goanalysis package supports compatible tools such as Bazel nogo. Local installation requires Go 1.25 or newer, and package dependencies are resolved automatically in most Go module projects. An optional AI feature can suggest fixes through listed providers or custom OpenAI-compatible APIs. Automated detection may produce false positives, which users can suppress with code annotations when findings are verified safe.

Who it suits

gosec suits Go developers and teams adding source-code security checks to CI/CD. It may also fit workflows that consume SARIF or use compatible Go analysis tools.

Good to know, and what to watch

  • Maps findings to CWE entries
  • Offers multiple report formats, including SARIF
  • Supports rule and path exclusions
  • Documents GitHub Actions integration
  • Local installation requires Go 1.25 or newer
  • Automated detection can produce false positives
  • AI fix suggestions require calling an AI API

gosec

Free

Free plan

The verdict

gosec provides configurable static security analysis for Go, with reporting and CI integration options. Teams should account for its Go version requirement and review findings for false positives.

What the maker publishes

AI providers
Documented providers include Atlas Cloud, Gemini, Claude, OpenAI and arbitrary OpenAI-compatible endpoints such as Azure OpenAI, LocalAI and Ollama. source
AI remediation
An optional autofix mode calls an AI API to suggest fixes for findings. source
AI suggestions
An optional feature can suggest vulnerability fixes by calling an AI API, with providers including Atlas Cloud, Gemini, Claude, OpenAI, and custom OpenAI-compatible APIs. source
Bazel integration
The goanalysis package exposes a golang.org/x/tools/go/analysis Analyzer usable by Bazel nogo. source
CI integration
The project documents running gosec in GitHub Actions and uploading SARIF results to GitHub code scanning. source
CI integration
The project supplies an official GitHub Action for scanning repositories in workflows. source
Community
The Secure Go site links to project guidelines, tools, a community Slack, Stack Overflow, and a blog. source
Configuration
Users can select or exclude rules, configure path-based exclusions, and adjust global settings such as audit mode. source
Configuration
A JSON configuration file supports global settings such as audit mode and suppression behavior. source
CWE mapping
Each detected issue is mapped to a Common Weakness Enumeration identifier. source
Dependencies
gosec loads packages using Go modules and says dependencies are resolved automatically in most projects. source
Detection
It includes pattern-based rules, SSA analyzers, and taint analysis for risks such as injection, path traversal, SSRF, and unsafe deserialization. source
Documentation depth
Secure Go publishes per-rule guidance pages and links to API reference, Stack Overflow and Slack support channels. source
Exit behavior
Exit code 0 means no unsuppressed findings or processing errors; code 1 indicates at least one finding or processing error, while -no-fail forces 0. source
False positives
The documentation says automated detection can produce false positives and supports code annotations to suppress verified safe findings. source
GitHub code scanning
SARIF results can be uploaded through GitHub's upload-sarif action for code-scanning findings. source
Independent description
DEV.co describes gosec as a Go static analyzer using pattern matching, control-flow analysis and taint tracking with SARIF support. source
Independent feature summary
AppSec Santa reports more than 50 CWE-mapped rules covering credentials, injection, cryptography, filesystem, network and memory issues. source
Independent installation example
Google's Secure Source Code codelab installs gosec 2.15.0 with the project's install script and runs it with a policy file. source
Independent praise: deployment
AppSec Santa praises that the core scanner runs locally through Go modules without a hosted control plane or build server. source
License
The repository states that gosec is licensed under Apache License 2.0. source
Limit: coverage scope
AppSec Santa says gosec does not exercise a running application, validate exploitability, model authorization logic or replace dependency scanning and secret rotation. source
Limit: false positives
A 2026 NDSS study found gosec had the broadest coverage among evaluated tools but also the highest noise, with 68 findings comprising 31 true positives and 37 false positives (45.59% precision). source
Limit: language scope
AppSec Santa says gosec analyzes Go only, so mixed-language repositories need other scanners for languages, infrastructure and containers. source

Checked against the maker's pages on 21 Oct 2026.