NoLog4Shell: Identify Dependencies + Mitigate Log4j

Dec 22 2021

Good news! We have added additional functionality to the Cloudsmith API and CLI to enable you to search for dependencies (such as the ever-dreaded log4j) across packages stored within Cloudsmith repositories.

The syntax is dependency:<name>, so to search for log4j dependencies, you specify dependency:log4j. The functionality is available via the UI, the API and the CLI.

For example, you can search via the CLI using:

The above only tells you which packages have a direct/non-transitive dependency on log4j. However, suppose you're utilising Cloudsmith as a proper Single Source of Truth and store all packages that your applications utilise. In that case, it is possible to detect all uses of log4j (because all software packages will be in one place).

Using the new package dependencies API, you can then confirm the versions of those dependencies. The functionality is also available via the latest Cloudsmith CLI release, 0.31.1 or above, which includes a new dependencies sub-command that can list dependencies for a package.

For example, using the "identifier" for the package from above:

In addition, we have added a feature to block downloads (i.e. prevent installation) for impacted versions of log4j. You can enable the block in any Cloudsmith repository on the settings page.

It looks like:

The above will automatically block log4j-related downloads unless they meet a specific version constraint. The blocking applies to both local (cached) and upstream packages. A package is considered related to log4j if the GroupID is org.apache.logging.log4j and the ArtifactID contains log4j (e.g. log4j-core).

You can find additional information and examples in our related blog post, and if you have any questions, please just reach out and contact us.

Keep up to date with our monthly product bulletin

By submitting this form, you agree to our privacy policy