Why this matters
Strong transport encryption prevents interception of CHD and tokens.
All outbound connections that may carry CHD/PAN tokens must enforce TLS >= 1.2, validate hostname/chain, and optionally pin gateway SPKI. Disable insecure ciphers/versions. (PCI DSS 4.0 Req. 4)
Strong transport encryption prevents interception of CHD and tokens.
Side-by-side examples engineers can pattern-match during review.
client := &http.Client{}
resp, _ := client.Get(gatewayURL) // ❌ default TLS; no checkstr := &http.Transport{TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
ServerName: "api.paygateway.com",
// Optional pinning example
VerifyPeerCertificate: func(rawCerts [][]byte, verifiedChains [][]x509.Certificate) error {
cert, _ := x509.ParseCertificate(rawCerts[0])
spki := sha256.Sum256(cert.RawSubjectPublicKeyInfo)
want := mustDecodeHex("d4e5...ab")
if !bytes.Equal(spki[:], want) { return errors.New("pin mismatch") }
return nil
},
}};
client := &http.Client{Transport: tr}
resp, err := client.Get(gatewayURL)tls.Config{MinVersion: 0}tls.Config{MinVersion: tls.VersionTLS12}From the same buckets as this rule.
Never emit Primary Account Number (PAN) or Sensitive Authentication Data (SAD: CVV/CVC, full track data, PIN) to application or audit logs. Per PCI DSS 4.0 Req. 3 and 10, always mask PAN as first6last4 and fully redact SAD before logging.
Reject PRs adding real PAN/CVV in fixtures, seeds, or mocks. Only use Luhn-valid test PANs from the gateway or opaque tokens (e.g., tok_) and never include CVV. Add a check to fail if a PAN regex is matched. (PCI DSS data minimization)