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.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.