CycloneDX / cyclonedx-dotnet

Creates CycloneDX Software Bill of Materials (SBOM) from .NET Projects
https://cyclonedx.org/
Apache License 2.0
167 stars 78 forks source link

Use a folder path as entry point instead of Project/Solution files #728

Open hornpecom opened 1 year ago

hornpecom commented 1 year ago

Suggestion: Use a folder path as entry point instead of Project/Solution files

recursively search in the folder for the following files

Background: Our MSBuild based build scripts are not in the solution and are not taken into account in the dependency scan. Although they also use NuGet Packages which would be relevant for the SBOM

I'm sure the JSON files approach can simplify the whole process pretty much. Because there is no need for a time-consuming search for the dependencies via the project/solution files or the build for the scan of the dependencies could be omitted entirely. A single requirement of the scan can be the existence of the mentioned json files. It doesn't matter how they come about

rkg-mm commented 1 year ago

Or use a glob statement that can match e.g. */.csproj oder others like some build tools support

hornpecom commented 1 year ago

@rkg-mm The json file approach is a bit better because I could split my build pipeline into Build Job and SBOM Job. These JSON files are created during the build anyway and can be transferred to the SBOM job as artifacts. The SBOM job only creates SBOM based on the JSON files

Bertk commented 10 months ago

Please note: CycloneDX tool is using solution and C# project files to gather meta data e.g. IsTestProject . Generated project.assets.json files are used to identify the dependencies of the C# project files.

Unfortunately, it does not support an array of C# project files. Maybe this would be helpful for you.

mtsfoni commented 6 months ago

Background: Our MSBuild based build scripts are not in the solution and are not taken into account in the dependency scan. Although they also use NuGet Packages which would be relevant for the SBOM

I need some more detailed information here. I don't understand how or why you need to add components at compile time that are not yet known at design time.