-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
required-only means no dependencies? #466
Comments
This issue also applies for JS/TS projects with npm packages. If "--required-only" is set, no dependencies and no devDependencies will be contained in the sbom file. This scope property should somehow be considered when you do the following in the index.js: |
I would like to "plus 1" on this issue. We are building SBOMs using the required only field, and would still like a dependency output to construct a dependency graph. |
@ansonallard @countfnx could you kindly test the PR #634 |
I was able to test the PR and the dependencies output appears to be correct. When I uploaded the resulting CycloneDX 1.4 schema to dependency track, it was not able to generate a dependency graph, so I am actively investigating what is going on there. Dependency track is able to generate a dependency graph for cyclone dx files that do not make use of the |
@ansonallard, does cdxgen print the tree with |
|
btw, if anyone wants to view the tree for an existing sbom use the cdxi repl command. cdxi <bom json>
More docs on the REPL mode here |
Yes, I did test it on two projects and it seems to work correctly! Good job, thanks :)! Is it also somehow possible to have only the top-level references in the SBOM without the transitive ones? |
Could you try the various filters from the docs? https://cyclonedx.github.io/cdxgen/#/ADVANCED?id=filtering-components |
Unfortunately I didn't find any possibility. According to the Advanced.md documentation it says regarding the --required-only flag: "These are usually considered direct dependencies." |
Can you try it? The scope attribute gets set after a usage analysis. |
Yes ,I tried the "--required-only" flag. It gives me all dependencies without the devDependencies, but with all subdependencies. |
@countfnx, this behavior is correct and is what is implemented. You can further refine the SBOM by running evinse, which would then also attach occurrence and call-stack evidence. This way, we are tracking both the direct usages and the dependency tree. |
Ok, then the second sentence in docs "Advanced.md" is misleading: |
…on in #466 Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
* Perform bom-ref decode during creation at source Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> * Bug fix. With yarn v1 packages without integrity wasn't included Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> * Aggressively mark packages as optional in evidence mode. See discussion in #466 Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> --------- Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Discussed in #460
Originally posted by malice00 August 13, 2023
I was working on some issues, when I found the following pieces of code:
cdxgen/index.js
Line 953 in c3c1d95
and
cdxgen/index.js
Lines 1230 to 1236 in c3c1d95
With some testing, it indeed seems that when I run cdxgen with
--required-only
, no dependencies are added to the SBOM, so no dependency-tree will be available in tools like dependency-track...Is this intentional? If so, what is the reason to not generate the dependencies?
I have to admit, for my project it doesn't matter if I use
--required-only
or not, but I would prefer it to work the same either way.The text was updated successfully, but these errors were encountered: