Why this matters
Pinned, auditable dependencies reduce the chance of weak crypto or supply chain attacks.
Pin cryptography libraries to vetted versions (e.g., BouncyCastle FIPS) and generate a CycloneDX SBOM as part of the build. Reject PRs introducing floating or insecure versions. (PCI DSS 4.0 Req. 6 & supply chain)
Pinned, auditable dependencies reduce the chance of weak crypto or supply chain attacks.
Side-by-side examples engineers can pattern-match during review.
// build.sbt — ❌ floating/insecure
libraryDependencies += "org.bouncycastle" % "bcpkix-jdk15on" % "+"
// build.sbt — ✅ pinned and FIPS-capable
libraryDependencies ++= Seq(
"org.bouncycastle" % "bc-fips" % "1.0.2.4",
"org.cyclonedx" %% "cyclonedx-core-java" % "9.0.4"
)
ThisBuild / versionScheme := Some("strict")%% "bcpkix-jdk15on" % "latest.integration"% "bc-fips" % "1.0.2.4"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)