Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Black Duck Open Source Software Composition Analysis

· 6 min read · Home Tech

In this article
  1. How Black Duck Identifies Open Source Components
  2. Managing Open Source License Compliance
  3. Detecting Open Source Vulnerabilities
  4. What Happens When Black Duck Returns a False Positive?
  5. Applying Black Duck to the Software Development Lifecycle
  6. Rule of Thumb for Open Source Management

Black Duck is a commercial Software Composition Analysis (SCA) platform used to identify open source components within a codebase. It is not an open source project itself, but a tool designed to manage the risks associated with using open source software.

How Black Duck Identifies Open Source Components

Black Duck uses a process called signature scanning to determine which open source libraries are present in a project. The tool analyzes the source code, binaries, and package manager files to create a digital fingerprint of the components. It then compares these fingerprints against a massive proprietary database known as the KnowledgeBase, which contains metadata for millions of open source projects.

The scanning process looks for specific markers such as file hashes, directory structures, and unique code snippets. This allows the tool to detect components even if a developer has renamed a file or modified a small portion of the original source code. By mapping the detected components to the KnowledgeBase, the platform identifies the exact version of the library being used, which is critical for determining whether that specific version contains known vulnerabilities.

Integration typically happens within the CI/CD pipeline. Developers configure the tool to run during the build process, ensuring that every commit is checked for new open source additions. This prevents the accidental introduction of unapproved libraries into a production environment. Labels and menu paths for these integrations may differ by version, but generally follow a pattern of Settings > Integrations > CI/CD Pipeline.

Managing Open Source License Compliance

Every open source component comes with a license that dictates how the software can be used, modified, and distributed. Black Duck categorizes these licenses into risk levels based on the requirements they impose on the user. For example, permissive licenses like MIT or Apache 2.0 allow for broad use with minimal restrictions, while copyleft licenses like the GNU General Public License (GPL) may require the entire derivative work to be released under the same license.

The platform allows legal and engineering teams to set global policies. If a scan detects a component with a license that violates company policy, the tool triggers an alert or fails the build. This automation removes the need for manual audits of every single library used in a large-scale application. Teams can create a whitelist of approved licenses and a blacklist of forbidden ones to streamline the approval process.

When a license conflict is found, the user must decide on a remediation path. This might involve replacing the library with one that has a more permissive license, seeking a commercial license from the author, or changing the way the software is distributed to comply with the copyleft requirements. The tool provides the specific license text and the obligations associated with it to help make this decision.

Detecting Open Source Vulnerabilities

Security vulnerabilities in open source libraries are tracked via Common Vulnerabilities and Exposures (CVE) identifiers. Black Duck monitors these databases and maps them to the components identified in the scan. When a new vulnerability is discovered in a library you are using, the platform notifies the security team and provides the CVE ID, the severity score, and the affected versions.

The tool helps prioritize remediation by analyzing whether the vulnerable code is actually being called by the application. This is known as reachability analysis. If a library contains a vulnerability in a function that your application never executes, the risk is lower than if the vulnerability exists in a core function used throughout the system. This distinction prevents developers from wasting time on patches that do not actually improve the security posture of the application.

Remediation usually involves updating the component to a patched version. Black Duck often suggests the minimum version upgrade required to resolve the vulnerability. For example, if version 1.2.0 has a critical flaw and version 1.2.4 fixes it, the tool will recommend upgrading to 1.2.4. This minimizes the risk of introducing breaking changes that often accompany major version jumps.

What Happens When Black Duck Returns a False Positive?

A false positive occurs when the tool identifies a component as a specific open source library, but it is actually something else or a custom piece of code. This often happens when a developer writes a function that happens to match a signature in the KnowledgeBase or when a library is heavily modified to the point where it no longer behaves like the original open source project.

To resolve a false positive, an administrator must manually review the evidence provided by the scan. The tool shows the specific files and snippets that triggered the match. If the user determines the match is incorrect, they can mark the component as a false positive in the interface. This action tells the system to ignore that specific match in future scans of that project, preventing the same alert from appearing repeatedly.

Another common issue is the "version mismatch," where the tool identifies the library but assigns it the wrong version number. This happens if the version metadata in the package file is missing or incorrect. In these cases, the user must manually override the version based on their own knowledge of the dependency. Accurate versioning is essential because vulnerability data is tied directly to specific version ranges.

Applying Black Duck to the Software Development Lifecycle

Integrating Black Duck effectively requires a tiered approach to scanning. The first tier is the developer's local environment, where lightweight scans can be run before code is even pushed to a repository. This allows developers to catch license conflicts or critical vulnerabilities at the earliest possible stage, reducing the cost of remediation.

The second tier is the build server. Here, a full scan is performed on the compiled artifacts. This ensures that dependencies introduced by the build process itself, such as transitive dependencies (libraries that your libraries depend on), are captured. Transitive dependencies are a common source of hidden risk because they are not explicitly listed in the project's primary requirement files.

The third tier is the production monitoring phase. Because new vulnerabilities are discovered daily, a project that was secure yesterday may be vulnerable today. Black Duck continuously monitors the Bill of Materials (BOM) for deployed applications. If a new CVE is published for a component already in production, the system sends an immediate alert, allowing the team to patch the live environment without waiting for the next scheduled build.

Rule of Thumb for Open Source Management

A reliable rule of thumb for managing open source is to treat every external library as a potential security liability and a legal obligation. Use an SCA tool like Black Duck to maintain a living Software Bill of Materials (SBOM) so that you know exactly what is in your code at all times. If you cannot identify the version or license of a component, do not include it in a production release.

Comparing Signature Scanning to Package Analysis

Package analysis relies on manifest files like package.json, pom.xml, or requirements.txt. It is fast and accurate for declared dependencies but misses components that are manually copied into the source tree. Signature scanning, which Black Duck employs, is more thorough because it looks at the actual content of the files. While signature scanning takes longer to execute and can produce more false positives, it is the only way to find "hidden" open source code that was not properly declared in a manifest file.

Handling Transitive Dependency Risks

Transitive dependencies create a complex web of risk. For instance, if your project uses Library A, and Library A uses Library B, a vulnerability in Library B still affects your application. Black Duck maps these relationships in a dependency tree. To fix a transitive vulnerability, you typically cannot update Library B directly; instead, you must update Library A to a version that utilizes a patched version of Library B. If Library A has not yet been updated by its maintainers, you may need to use a dependency override or a shading technique to force the use of a secure version of Library B.