Reachability Analysis with Bamboo

Reachability Analysis with Bamboo

You can configure Sonatype for Bamboo Data Center to perform Reachability Analysis, which can detect method signatures in your application code that contain components with potentially exploitable security vulnerabilities. Policy violations occurring due to these vulnerable components are labeled as Reachable and can be viewed on the application report.

By including additional parameters in the Lifecycle Policy Evaluation task you can enable the Reachability Analysis feature. The scan process will then analyze application code and dependencies in the scan target for Java (or any JVM language) and JavaScript/TypeScript projects. This allows you to detect reachable vulnerabilities, even in proprietary components within your application.

Permissions Required

Sonatype for Bamboo Data Center users should have the Evaluate Applications permissions to scan applications with Reachability Analysis.

To enable Reachability Analysis for Java, install or update the Sonatype for Bamboo Data Center plugin to version 3.2.0 or later on the Bamboo DC instance that runs your project builds.

Using Java Reachability Analysis on Bamboo DC

For Best Results with Reachability Analysis
Results for Reachability Analysis depend on the strategy used to select the types of methods to scan and the selection of namespaces to narrow down the scan entry points.

Reachability Evidence
When Sonatype for Bamboo Data Center runs a Java scan with reachability enabled, call path evidence is sent to IQ Server and displayed in the violation details view. See Reachability Evidence for details.

Use the parameters below to enable Reachability Analysis for your builds. Select Enable Java reachability analysis; all other parameters are optional.

Analysis Algorithm

These are the supported algorithms for Java reachability analysis:

Note
Sonatype recommends keeping the default (RTA_PLUS). Do not change this setting unless directed by Sonatype Support.

Includes

Multi-module projects could have several .jar files when built. Many of these .jar files are dependencies of another .jar file, which could be the one containing the main application. By specifying the path to this specific .jar when running reachability analysis, you can avoid multiple evaluations of the same .jar files, which would occur when:

The includes parameter specifies a target path for the artifacts to be analyzed. It limits the scope of the analysis, resulting in better precision and reducing the utilization of system resources. E.g. target/**/*.jar.

If the includes parameter is omitted, the target location for the analysis will be the same as specified in the Scan Targets parameter. This may increase the scope of the target analysis, leading to reduced precision.

Entrypoint Strategy

When Reachability Analysis is enabled in Bamboo, you can choose one of the following strategies:

JAVA_MAIN:Selects all methods matching public static void main(String[] args).

PUBLIC_CONCRETE: Selects public non-abstract/synthetic methods from non-interface/annotation classes.

ACCESSIBLE_CONCRETE: Selects public/protected non-abstract/synthetic methods from non-interface/annotation classes.

CONCRETE: Selects all non-abstract/synthetic methods from non-interface/annotation classes. This is the default entrypoint strategy.

ALL: Selects all methods from all non-interface/annotation classes.

Namespaces

Select the methods that should be considered as entry points (points in code where execution begins) for the analysis.

Namespaces are specified at the level of packages. All packages nested under a namespace are considered for entry point selection. If multiple namespaces are specified, all of them will be included.

Reachability Analysis will start with the namespaces specified and subsequently analyze all others in the execution path.

Example:

Consider the following project structure:

 src |—main | |—java | | |—com | | | |—example | | | | |—iq | | | | | |—domain | | | | | | |—DomainClassOne.java | | | | | |—application | | | | | |—repository | | | | |—wrappers | | | | | |—OktaLoginWrapper.java | | | | |—configs |
 |—test | |—java | | |—com | | | |—example | | | | |—iq | | | | | |—domain | | | | | | |—DomainClassOne.java | | | | | |—application | | | | | |—repository | | | | |—wrappers | | | | | |—OktaLoginWrapper.java | | | | |—configs

The namespaces parameter is configured as follows: com.example.iq.

In the example above, the namespaces property specifies the namespace 'com.example.iq', which will be considered as the entry point for the analysis. This namespace has domain, application, and repository packages under its scope. Methods belonging to DomainClassOne.java class (under the domain package in the 'com.example.iq' namespace) will be analyzed before other methods in the package classes. Similarly, methods belonging to classes under other applications and repository packages will be analyzed at the start of the analysis for the package.

Packages of type wrappers, with namespace 'com.example.wrappers' and config packages with namespace 'com.example.configs' will be omitted when an entry point for the analysis is being established. Similarly, methods belonging to the OktaLoginWrapper class with namespace 'com.example.wrappers.OktaLoginWrapper.java' will be omitted when establishing an entry point.

Notes:

Example: For org.foo.example, you can use regular expressions with '/' at the start and end of the string as /^org\.+.*\.example$/.

Using JavaScript Reachability Analysis on Bamboo DC

JavaScript Reachability Analysis detects exploitable vulnerabilities in JavaScript/TypeScript application dependencies by analyzing your application code and identifying which vulnerable dependency methods are actually called during execution.

JavaScript Reachability Prerequisites

If you plan to use JavaScript Reachability Analysis, ensure the following prerequisites are met before configuring the plugin:

Node.js Installation

JavaScript Reachability Analysis requires Node.js to be installed on the Bamboo build agents where analysis will run.

Project Structure Requirements

For JavaScript Reachability Analysis to function correctly, your project must include:

Enabling JavaScript Reachability

To enable JavaScript reachability analysis in your Bamboo task configuration:

  1. Navigate to your build plan and select the Sonatype Lifecycle task.

  2. In the Reachability Analysis section, locate JavaScript Reachability Analysis and select it.

  3. Configure the required and optional parameters described below.

Configuration Parameters

Source File Patterns (Required)

Specifies glob patterns identifying which JavaScript or TypeScript files contain your application code. Multiple patterns can be specified, one per line.

src/**/*.js
lib/**/*.ts
app/**/*.{js,ts}

Exclude File Patterns (Optional)

Specifies glob patterns for files or directories to exclude from analysis. Use this to skip test files, build artifacts, or other non-application code.

**/node_modules/**
**/*.test.js
**/dist/**
**/build/**

Node.js Path (Optional)

Specifies the full path to the Node.js executable if it is not available in the system PATH.

Project Root Directory (Optional)

Specifies the directory containing your project's package.json file, relative to the Bamboo workspace root.

Bamboo Variables

All text fields support Bamboo variable substitution for flexible configuration.

Using .NET Reachability Analysis on Bamboo DC

.NET reachability is supported in Sonatype for Bamboo Data Center 4.5.0 and later.

Use the options below to enable Reachability Analysis for your builds. Select Enable .NET reachability analysis; all the others are optional.

Option Description
Enable .NET reachability analysis Enables .NET reachability analysis for IQ policy evaluation. This will help you find vulnerable .NET code that is in use.
Namespaces Namespace prefixes to scope entry points for .NET reachability analysis. Use space-separated values. e.g. MyCompany.App MyCompany.Core
Dotnet Executable Path Absolute path to .NET executable. When not specified, assumes .NET is available on the system PATH.

Entrypoint Strategy

Entrypoint strategy for .NET reachability analysis.

Strategy Description
CONCRETE (Default) All non-abstract, non-synthetic methods in non-interface classes.
PUBLIC_CONCRETE Public, non-abstract, non-synthetic methods. Recommended for web applications and library projects.
ACCESSIBLE_CONCRETE Public or protected, non-abstract, non-synthetic methods in non-interface classes.
DOTNET_MAIN Static methods matching the standard .NET Main signatures (C#, VB.NET, F#). Does not match C# 9+ top-level statement entry points; use PUBLIC_CONCRETE with namespace filtering for those projects.
ALL All methods in non-interface classes, including abstract methods

Running Reachability Analysis Across Multiple Ecosystems

The Sonatype for Bamboo Data Center plugin supports running reachability analysis for multiple ecosystems in a single build.

Enabling Multiple Ecosystems

To analyze multiple ecosystems in a single build:

  1. Select the reachability analysis options for the ecosystems you want to analyze in the task configuration.

  2. Configure language-specific parameters for each analysis type.

  3. The selected analyses will run during the build, with results aggregated automatically.

Result Aggregation

When multiple reachability analyzers run: