gosec is a static security scanner for Go projects. It examines source code for insecure constructs and common classes of vulnerability without needing to execute the program.
The scanner combines AST-based rules with SSA analysis and data-flow tracking. This lets it identify both straightforward coding mistakes and problems where untrusted data can reach security-sensitive operations.
Rules span general secure coding, injection attacks, filesystem handling, cryptography, TLS, unsafe APIs and Go-specific security problems.
This is free and open source software.
Key Features
- Pattern-based AST rules detect common insecure coding practices.
- SSA analysis covers issues involving type conversions, slice bounds and cryptographic usage.
- Taint analysis tracks untrusted data through applications to detect SQL injection, command injection, path traversal, SSRF, XSS and other vulnerabilities.
- Rules cover general secure coding, injections, file handling, cryptography, TLS and Go-specific security issues.
- Individual rules can be included or excluded, with additional path-specific exclusions.
- Supports inline suppression directives and can track suppression reasons for auditing.
- Produces text, JSON, YAML, CSV, HTML, JUnit XML, SonarQube and SARIF reports.
- Supports Go build tags and project-specific configuration.
- Integrates with GitHub Actions and GitHub code scanning.
- Available as both a command-line application and Go analysis components for integration into other tooling.
Website: github.com/securego/gosec
Support:
Developer: securego
License: Apache License 2.0
gosec is written in Go. Learn Go with our recommended free books and free tutorials.
Related Software
| Go Linters | |
|---|---|
| revive | Designed as a drop-in replacement for golint |
| golangci-lint | Fast Go linters runner |
| gosec | Security scanner for Go projects |
| Staticcheck | Advanced Go linter |
| go-critic | Opinionated Go source code linter |
| Vet | Examines Go source code and reports suspicious constructs |
| gofumpt | Stricter gofmt |
| gofmt | Formats Go programs |
| goconst | Find repeated Go literals that could be replaced with constants |
| go-ruleguard | Analysis-based Go linter that runs dynamically loaded rules |
| sloglint | Enforce consistent structured logging conventions in Go |
| forbidigo | Go linter for forbidding identifiers |
| godot | Keep source code comments consistent |
| Godoc-Lint | Enforce consistent documentation comments in Go code |
| exhaustive | Check Go switch statements for missing enum cases |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.