SKY-G280 · Go-specific rules
Go weak TLS version
TLS 1.0 and 1.1 are old versions of the protocol behind HTTPS, deprecated since 2021 because of known weaknesses. SKY-G280 reports a Go tls.Config{...} literal whose MinVersion is VersionTLS10 or VersionTLS11, which lets connections fall back to them.
- Languages
- Go
- Quality gate
- counted toward the gate limits (full and diff scans). Counted toward
max_securityandmax_high. - Finding type
- review
Why it matters
An attacker on the network can push a connection down to the weakest version both sides accept. Compliance scans and standards such as PCI DSS also fail a service that still accepts TLS 1.0.
What Skylos flags
package payments import ( "crypto/tls" "net/http") func NewClient() *http.Client { cfg := &tls.Config{ MinVersion: tls.VersionTLS10, } return &http.Client{Transport: &http.Transport{TLSClientConfig: cfg}}}What Skylos leaves alone
package payments import ( "crypto/tls" "net/http") func NewClient() *http.Client { cfg := &tls.Config{ MinVersion: tls.VersionTLS12, MaxVersion: tls.VersionTLS13, } return &http.Client{Transport: &http.Transport{TLSClientConfig: cfg}}}Why Skylos leaves it alone
The same client pins TLS 1.2 as the minimum. Only a MinVersion of VersionTLS10 or VersionTLS11 is reported.
How Skylos decides
- Runs with
--danger. The bundled Go engine,skylos-go, parses each.gofile with Go's own parser._test.gofiles, symbolic links and files undervendor,testdata,node_modulesand hidden folders are skipped. - Finds composite literals of
Configfrom thecrypto/tlsimport (tls.Config{...}or&tls.Config{...}). - Reports when the literal sets
MinVersionto a selector ending inVersionTLS10orVersionTLS11. A constant number such as0x0301, a variable, or a later assignmentcfg.MinVersion = ...is not checked. - Reports HIGH on the line where the literal starts. The ID stays SKY-G280 in the output.
How to fix it
Set MinVersion to tls.VersionTLS12 or tls.VersionTLS13. Go has defaulted clients to TLS 1.2 since 1.18, so removing an old setting also works for a client.
package payments import ( "crypto/tls" "net/http") func NewClient() *http.Client { cfg := &tls.Config{Removed: MinVersion: tls.VersionTLS10,Added: MinVersion: tls.VersionTLS12, } return &http.Client{Transport: &http.Transport{TLSClientConfig: cfg}}}When it can be wrong
- A client that must talk to an old device or partner system that only speaks TLS 1.0 is reported; the risk is real, but it may be accepted.
- It misses the same setting made outside the literal (
cfg.MinVersion = tls.VersionTLS10) or through a variable.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
At the end of the reported line, where the literal starts:
Go cfg := &tls.Config{ // skylos: ignore[SKY-G280] legacy terminal, isolated VLAN[tool.skylos] ignore = ["SKY-G280"]in apyproject.tomlat the project root turns the rule off. A baseline accepts existing findings, but it records the absolute file path and the line, so an entry stops matching when the checkout moves or the line shifts.