feat: Enhance SBOM composition with policy findings and update CycloneDX package
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Docs CI / lint-and-preview (push) Has been cancelled
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Docs CI / lint-and-preview (push) Has been cancelled
				
			- Added `PolicyFindings` property to `SbomCompositionRequest` to include policy findings in SBOM. - Implemented `NormalizePolicyFindings` method to process and validate policy findings. - Updated `SbomCompositionRequest.Create` method to accept policy findings as an argument. - Upgraded CycloneDX.Core package from version 5.1.0 to 10.0.1. - Marked several tasks as DONE in TASKS.md, reflecting completion of SBOM-related features. - Introduced telemetry metrics for Go analyzer to track heuristic fallbacks. - Added performance benchmarks for .NET and Go analyzers. - Created new test fixtures for .NET applications, including dependencies and runtime configurations. - Added licenses and nuspec files for logging and toolkit packages used in tests. - Implemented `SbomPolicyFinding` record to encapsulate policy finding details and normalization logic.
This commit is contained in:
		| @@ -4,8 +4,10 @@ using System.Linq; | ||||
| using System.Text.Json; | ||||
| using System.Text.RegularExpressions; | ||||
| using StellaOps.Scanner.Analyzers.Lang; | ||||
| using StellaOps.Scanner.Analyzers.Lang.Go; | ||||
| using StellaOps.Scanner.Analyzers.Lang.Java; | ||||
| using StellaOps.Scanner.Analyzers.Lang.Node; | ||||
| using StellaOps.Scanner.Analyzers.Lang.DotNet; | ||||
|  | ||||
| namespace StellaOps.Bench.ScannerAnalyzers.Scenarios; | ||||
|  | ||||
| @@ -104,7 +106,9 @@ internal sealed class LanguageAnalyzerScenarioRunner : IScenarioRunner | ||||
|         return id switch | ||||
|         { | ||||
|             "java" => static () => new JavaLanguageAnalyzer(), | ||||
|             "go" => static () => new GoLanguageAnalyzer(), | ||||
|             "node" => static () => new NodeLanguageAnalyzer(), | ||||
|             "dotnet" => static () => new DotNetLanguageAnalyzer(), | ||||
|             _ => throw new InvalidOperationException($"Unsupported analyzer '{analyzerId}'."), | ||||
|         }; | ||||
|     } | ||||
|   | ||||
| @@ -10,7 +10,9 @@ | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <ProjectReference Include="..\..\..\src\StellaOps.Scanner.Analyzers.Lang\StellaOps.Scanner.Analyzers.Lang.csproj" /> | ||||
|     <ProjectReference Include="..\..\..\src\StellaOps.Scanner.Analyzers.Lang.Go\StellaOps.Scanner.Analyzers.Lang.Go.csproj" /> | ||||
|     <ProjectReference Include="..\..\..\src\StellaOps.Scanner.Analyzers.Lang.Node\StellaOps.Scanner.Analyzers.Lang.Node.csproj" /> | ||||
|     <ProjectReference Include="..\..\..\src\StellaOps.Scanner.Analyzers.Lang.Java\StellaOps.Scanner.Analyzers.Lang.Java.csproj" /> | ||||
|     <ProjectReference Include="..\..\..\src\StellaOps.Scanner.Analyzers.Lang.DotNet\StellaOps.Scanner.Analyzers.Lang.DotNet.csproj" /> | ||||
|   </ItemGroup> | ||||
| </Project> | ||||
|   | ||||
| @@ -1,4 +1,6 @@ | ||||
| scenario,iterations,sample_count,mean_ms,p95_ms,max_ms | ||||
| node_monorepo_walk,5,4,4.2314,15.3277,18.9984 | ||||
| java_demo_archive,5,1,4.5572,17.3489,21.5472 | ||||
| python_site_packages_walk,5,3,2.0049,6.4230,7.8832 | ||||
| node_monorepo_walk,5,4,9.4303,36.1354,45.0012 | ||||
| java_demo_archive,5,1,20.6964,81.5592,101.7846 | ||||
| go_buildinfo_fixture,5,2,35.0345,136.5466,170.1612 | ||||
| dotnet_multirid_fixture,5,2,29.1862,106.6249,132.3018 | ||||
| python_site_packages_walk,5,3,12.0024,45.0165,56.0003 | ||||
|   | ||||
| 
 | 
| @@ -18,11 +18,27 @@ | ||||
|         "java" | ||||
|       ] | ||||
|     }, | ||||
|     { | ||||
|       "id": "go_buildinfo_fixture", | ||||
|       "label": "Go analyzer on build-info binary", | ||||
|       "root": "src/StellaOps.Scanner.Analyzers.Lang.Go.Tests/Fixtures/lang/go/basic", | ||||
|       "analyzers": [ | ||||
|         "go" | ||||
|       ] | ||||
|     }, | ||||
|     { | ||||
|       "id": "dotnet_multirid_fixture", | ||||
|       "label": ".NET analyzer on multi-RID fixture", | ||||
|       "root": "src/StellaOps.Scanner.Analyzers.Lang.Tests/Fixtures/lang/dotnet/multi", | ||||
|       "analyzers": [ | ||||
|         "dotnet" | ||||
|       ] | ||||
|     }, | ||||
|     { | ||||
|       "id": "python_site_packages_walk", | ||||
|       "label": "Python site-packages dist-info crawl", | ||||
|       "root": "samples/runtime/python-venv/lib/python3.11/site-packages", | ||||
|       "matcher": "**/*.dist-info/METADATA", | ||||
|       "matcher": "**/*.dist-info/METADATA", | ||||
|       "parser": "python" | ||||
|     } | ||||
|   ] | ||||
|   | ||||
| @@ -3,10 +3,23 @@ | ||||
| This directory will capture benchmark results for language analyzers (Node, Python, Go, .NET, Rust). | ||||
|  | ||||
| Pending tasks: | ||||
| - LA1: Node analyzer microbench CSV + flamegraph. | ||||
| - LA2: Python hash throughput CSV. | ||||
| - LA3: Go build info extraction benchmarks. | ||||
| - LA4: .NET RID dedupe performance matrix. | ||||
| - LA5: Rust heuristic coverage comparisons. | ||||
|  | ||||
| Results should be committed as deterministic CSV/JSON outputs with accompanying methodology notes. | ||||
| - LA1: Node analyzer microbench CSV + flamegraph. | ||||
| - LA2: Python hash throughput CSV. | ||||
| - LA3: Go build info extraction benchmarks. | ||||
| - LA4: .NET RID dedupe performance matrix. | ||||
| - LA5: Rust heuristic coverage comparisons. | ||||
|  | ||||
| Results should be committed as deterministic CSV/JSON outputs with accompanying methodology notes. | ||||
|  | ||||
| ## Sprint LA3 — Go Analyzer Benchmark Notes (2025-10-22) | ||||
|  | ||||
| - Scenario `go_buildinfo_fixture` captures our Go analyzer running against the basic build-info fixture. The Oct 23 baseline (`baseline.csv`) shows a mean duration of **35.03 ms** (p95 136.55 ms, max 170.16 ms) over 5 iterations on the current rig; earlier Oct 21 measurement recorded **4.02 ms** mean when the analyzer was profiled on the warm perf runner. | ||||
| - Comparative run against Syft v1.29.1 on the same fixture (captured 2025-10-21) reported a mean of **5.18 ms** (p95 18.64 ms, max 23.51 ms); raw measurements live in `go/syft-comparison-20251021.csv`. | ||||
| - Bench command (from repo root):\ | ||||
|   `dotnet run --project bench/Scanner.Analyzers/StellaOps.Bench.ScannerAnalyzers/StellaOps.Bench.ScannerAnalyzers.csproj -- --config bench/Scanner.Analyzers/config.json --out bench/Scanner.Analyzers/baseline.csv` | ||||
|  | ||||
| ## Sprint LA4 — .NET Analyzer Benchmark Notes (2025-10-23) | ||||
|  | ||||
| - Scenario `dotnet_multirid_fixture` exercises the .NET analyzer against the multi-RID test fixture that merges two applications and four runtime identifiers. Latest baseline run (Release build, 5 iterations) records a mean duration of **29.19 ms** (p95 106.62 ms, max 132.30 ms) with a stable component count of 2. | ||||
| - Syft v1.29.1 scanning the same fixture (`syft scan dir:…`) averaged **1 546 ms** (p95 ≈2 100 ms, max ≈2 100 ms) while also reporting duplicate packages; raw numbers captured in `dotnet/syft-comparison-20251023.csv`. | ||||
| - The new scenario is declared in `bench/Scanner.Analyzers/config.json`; rerun the bench command above after rebuilding analyzers to refresh baselines and comparison data. | ||||
|   | ||||
| @@ -0,0 +1,2 @@ | ||||
| scenario,iterations,sample_count,mean_ms,p95_ms,max_ms | ||||
| syft_dotnet_multirid_fixture,5,2,1546.1609,2099.6870,2099.6870 | ||||
| 
 | 
| @@ -0,0 +1,2 @@ | ||||
| scenario,iterations,sample_count,mean_ms,p95_ms,max_ms | ||||
| syft_go_buildinfo_fixture,5,2,5.1840,18.6375,23.5120 | ||||
| 
 | 
		Reference in New Issue
	
	Block a user