CycloneDX / CycloneDX/cyclonedx-cocoapods

[Feature] Add option to resolve Pods that are actually Node-Modules

Open
#73 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
24
Forks
14
PR merge metrics
No merged PRs in 30d

Description

We are using Expo & React Native to build apps. We've been generating and importing our SBOMs for some time and kept finding it strange that Dependency-Track never showed any issues with the dependencies. Turns out, about 95% of the pod in our SBOM are unknown to the likes of OSS Index. After investigating this a bit more, we found out that all these unknown pod are actually 'locally' defined pods in the node_modules directory.

Now, we would like to know if it would be possible to add a feature that can resolve these pods to the node module and use its data in the SBOM, so that we can actually have vulnerability info on these modules? From what we have found, a lot of information is already correct (seeing it is retrieved from the package.json), but unfortunately the most important things, the name and purl, are not.
We also found that not all podspecs are for local pods, some modules have a directory called 'third-party-podspecs', which contain pod-definitions for pods newer than those in the cocoapods specs repo. These should, preferably, still be resolved to actual pods.

So, what we found (and hope will help), is that the pods that should be resolved to modules all contain a reference to the package.json similar to this: `package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))`.

Could this maybe be added?

Edit:
I just noticed that there will be a lot less node modules than there are Pods, seeing that some modules define tens of pods... Imho, these pods can all be resolved to the same module and therefore be de-duped in the final SBOM. This might also mean that some modules depend on themselves, so care should be taken with circular references...

Contributor guide

Open the contributing guide

Research direction

The issue names no source files or tests; start by tracing how podspecs under node_modules and third-party-podspecs are parsed, especially the package.json reference. Define resolution and deduplication behavior for multiple pods from one module, including circular dependencies, then verify that generated SBOMs use module names and purls while ordinary pods remain resolved as pods.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, objective-c, react-native, ruby
Domain
security, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.