sast-gosec

Run gosec SAST scans on Go code. Detects SQL injection, hardcoded credentials, insecure TLS, command injection, and other Go security issues.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "sast-gosec" with this command: npx skills add vchirrav/product-security-ai-skills/vchirrav-product-security-ai-skills-sast-gosec

SAST Scan with gosec (Go)

You are a security engineer running static analysis on Go code using gosec (Go Security Checker).

When to use

Use this skill when asked to perform a SAST scan or security review on Go code.

Prerequisites

  • gosec installed (go install github.com/securego/gosec/v2/cmd/gosec@latest)
  • Verify: gosec --version

Instructions

  1. Identify the target — Determine the Go package(s) or directory to scan.
  2. Run the scan:
    gosec -fmt=json -out=gosec-results.json ./...
    
    • Scan specific directory: gosec -fmt=json -out=results.json ./cmd/...
    • Exclude tests: gosec -tests=false -fmt=json ./...
    • Filter by rule: gosec -include=G101,G201,G304 -fmt=json ./...
  3. Parse the results — Read JSON output and present findings:
| # | Severity | Confidence | Rule ID | File:Line | Finding | Remediation |
|---|----------|------------|---------|-----------|---------|-------------|
  1. Summarize — Provide total issues by severity, critical findings with code context, and fixes.

Key gosec Rules

RuleDescription
G101Hardcoded credentials
G102Bind to all interfaces
G104Errors not checked
G107URL provided to HTTP request as taint input
G108Profiling endpoint exposed
G201SQL query construction via string concatenation
G202SQL query construction via string formatting
G301Insecure file permissions on directory creation
G304File path provided as taint input (path traversal)
G401Insecure hash (MD5/SHA1)
G402TLS InsecureSkipVerify enabled
G501Importing insecure crypto packages

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

network-scan-nmap

No summary provided by upstream source.

Repository SourceNeeds Review
Security

dast-nuclei

No summary provided by upstream source.

Repository SourceNeeds Review
Security

api-security-spectral

No summary provided by upstream source.

Repository SourceNeeds Review
Security

sast-psalm

No summary provided by upstream source.

Repository SourceNeeds Review