Skip to main content

Find Security class modifications

io.moderne.cryptography.FindSecurityModifications

Finds invocations of java.security.Security methods that modify security configuration such as removeProvider, addProvider, insertProviderAt, setProperty, and removeProperty.

Recipe source

This recipe is only available to users of Moderne.

This recipe is available under the Moderne Proprietary License.

Example

Before
import java.security.Security;

public class SecurityExample {
public void removeBouncyCastle() {
// Remove the BouncyCastle provider
Security.removeProvider("BouncyCastleProvider");
}
}
After
import java.security.Security;

public class SecurityExample {
public void removeBouncyCastle() {
// Remove the BouncyCastle provider
/*~~>*/Security.removeProvider("BouncyCastleProvider");
}
}

Usage

This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI:

You will need to have configured the Moderne CLI on your machine before you can run the following command.

shell
mod run . --recipe FindSecurityModifications

If the recipe is not available locally, then you can install it using:

mod config recipes jar install io.moderne.recipe:rewrite-cryptography:0.11.2

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Security modifications

io.moderne.cryptography.table.SecurityModificationTable

Security class method invocations that modify the Java security configuration including provider management and property settings.

Column NameDescription
Source fileThe source file containing the Security modification
Line numberThe line number where the Security method is called
Method nameThe Security method being called (e.g., removeProvider, addProvider, insertProviderAt)
ArgumentsThe arguments passed to the Security method
ContextThe context in which the Security modification occurs (e.g., method name, class name)