gosec – Go Security Checker

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
reviveDesigned as a drop-in replacement for golint
golangci-lintFast Go linters runner
gosecSecurity scanner for Go projects
StaticcheckAdvanced Go linter
go-criticOpinionated Go source code linter
VetExamines Go source code and reports suspicious constructs
gofumptStricter gofmt
gofmtFormats Go programs
goconstFind repeated Go literals that could be replaced with constants
go-ruleguardAnalysis-based Go linter that runs dynamically loaded rules
sloglintEnforce consistent structured logging conventions in Go
forbidigoGo linter for forbidding identifiers
godotKeep source code comments consistent
Godoc-LintEnforce consistent documentation comments in Go code
exhaustiveCheck Go switch statements for missing enum cases

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted