Skip to content

Add Java reachability rule and test file

What does this MR do and why?

Adds a Semgrep reachability rule to detect imports in Java code.

Important:

Some form of post-processing will likely be needed on the captured $LIB values, as the syntax makes it impossible to distinguish between package name and a symbol such as a class or constant, like:

import org.springframework.boot.SpringApplication;

In this scenario, the entire org.springframework.boot.SpringApplication will be captured in $LIB even though the dependency name is just org.springframework.boot. So post-processing is needed where parts between . are removed from right to left until the string matches a known dependency from the SBOM.

Related issues

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports

Loading