/prodsec-skills:go-securityfrom prodsec-skills
Enforces secure coding practices in Go applications. Use when building, reviewing, or auditing Go code that handles user input, database access, cryptography, TLS, or uses unsafe/cgo.
Ships in prodsec-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
go.sum checksum database provides assurance against module mutationgovulncheck regularly to scan for known vulnerabilities in dependenciesstrconv, regexp) or third-party validators like go-playground/validatorUse html/template (not text/template) for rendering HTML. It applies contextual autoescaping for HTML, CSS, JavaScript, and URL contexts.
name := r.FormValue("name")
tmpl := template.Must(template.ParseGlob("page.html"))
data["Name"] = name
err := tmpl.ExecuteTemplate(w, "page", data)
Use nosurf for CSRF prevention in HTTP handlers.
Use parameterized queries. In Go, statements are prepared on the DB, not the connection:
customerName := r.URL.Query().Get("name")
db.Exec("UPDATE creditcards SET name=? WHERE customerId=?", customerName, 233)
When using db.Query() with string formatting, sanitize all input first.
crypto and golang.org/x/crypto packagesEnforce HTTPS with HSTS headers and explicit TLS server configuration:
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
config := &tls.Config{ServerName: "yourServiceName"}
Always encrypt in-transit communication, even for internal services.
unsafe package bypasses Go's type system; subtle mistakes are commonunsafe unless there is no alternative (low-level system calls, performance-critical FFI)Avoid cgo when possible. Known issues:
if err != nil)When unmarshalling JSON into structs with pointer fields, unset pointers remain nil. Dereferencing them causes a panic:
type Foo struct {
Bar *Bar
}
var f Foo
json.Unmarshal([]byte(`{"other":"data"}`), &f)
// f.Bar is nil -- accessing f.Bar.Field will panic
Always check pointer fields for nil before dereferencing.
| Tool | Purpose |
|---|---|
| govulncheck | Scan dependencies for known vulnerabilities |
| golangci-lint | Aggregated linter collection |
| gosec | Go security checker |
go.sum integrity checkinggovulncheck runs in CIhtml/template is used for HTML rendering (not text/template)crypto packages are used (no custom crypto)ServerNameunsafe and cgo usage is justified, minimized, and reviewedWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
go-security, secure-coding, sql-injection, xss-prevention, cryptography, tls
npx claudepluginhub redhatproductsecurity/prodsec-skills --plugin prodsec-skills130 skills in this plugin
/address-sanitizerAddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.
/admin-interface-securitySecure the administrative interface of model registries. Use when building, deploying, or reviewing model registry access controls and admin interfaces./aflppAFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C/C++ projects.
Other plugins' skills for the same job