Feature request: exclude ProjectReference items from SBOM generation for .NET Framework projects #2379
-
SummaryWhen running cdxgen from the latest master branch against a .NET Framework 4.8 solution, the tool records both assembly Reference entries and ProjectReference entries in the generated SBOM. ProjectReference entries point to projects within our own source tree and are not third-party components. I request an option to exclude ProjectReference items from SBOM generation or to treat them differently from external assembly references. How I ran itpnpm exec cdxgen -r -o x:\bom.json "..\CdxgenExample" Environment
Observed behaviorcdxgen lists internal projects referenced via ProjectReference as components in the SBOM alongside third-party assemblies. This produces SBOM entries for our own projects, which pollutes the bill of materials and complicates supply chain audits. An example excerpt from the generated bom.json showing project components and their SrcFile properties is shown below for clarity. "components": [
{
"name": "ProjectReferenceTwo",
"purl": "pkg:nuget/ProjectReferenceTwo@latest",
"type": "library",
"properties": [
{ "name": "cdx:dotnet:project_guid", "value": "{13DFB5C8-DF54-4D1D-BDC4-B691F59930B2}" },
{ "name": "Namespaces", "value": "ProjectReferenceTwo" },
{ "name": "cdx:dotnet:target_framework", "value": "v4.8" },
{ "name": "SrcFile", "value": "..\\CdxgenExample\\ProjectReferenceTwo\\ProjectReferenceTwo.csproj" }
]
},
{
"name": "ProjectReferenceOne",
"purl": "pkg:nuget/ProjectReferenceOne@latest",
"type": "library",
"properties": [
{ "name": "cdx:dotnet:project_guid", "value": "{588A2416-35BA-46D8-BE34-74E07469AD5E}" },
{ "name": "Namespaces", "value": "ProjectReferenceOne" },
{ "name": "cdx:dotnet:target_framework", "value": "v4.8" },
{ "name": "SrcFile", "value": "..\\CdxgenExample\\ProjectReferenceOne\\ProjectReferenceOne.csproj" }
]
}
] Minimal example csproj fragment used in reproUse this fragment to show the ProjectReference items that appear in the SBOM.
Reproduction steps
Expected behaviorProvide an option to exclude ProjectReference items by default or via an explicit flag so SBOMs list third party and supply chain components without internal project entries unless the user opts in to include them. Proposed solutionAdd a configuration option in the cdxgen config file such as Desired defaults and compatibilityDefault behavior should exclude ProjectReference items to align with typical SBOM expectations. Provide an explicit flag or config option to preserve current behavior for users who wish project links recorded. This preserves backward compatibility while giving clearer semantics for SBOM consumers. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Have you tried the "--filter" argument? You can pass the project name or the guid. |
Beta Was this translation helpful? Give feedback.
Have you tried the "--filter" argument? You can pass the project name or the guid.