Java security best practices

Proprietary

Applies security best practices to Java code.

org.openrewrite.java.security.JavaSecurityBestPractices
mod run . --recipe=org.openrewrite.java.security.JavaSecurityBestPractices

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. XML parser XXE vulnerability
  2. Use Files#createTempDirectory
  3. Use secure temporary file creation
  4. Zip slip
  5. Replace Runtime.exec(String) with Runtime.exec(String[])
  6. Fix permissive X509TrustManager implementations
  7. Fix permissive HostnameVerifier implementations
  8. Replace SQL string concatenation with a PreparedStatement
  9. SecureRandom seeds are not constant or predictable
  10. Restrict deserialized classes for JMS ObjectMessage
  11. Modernize BufferedWriter creation and prevent file descriptor leaks
  12. Use comparison rather than equality checks in for conditions