Summary
CommandInjectionGuard has no dedicated unit test file — only indirect coverage via
integration tests. Add Rasp.Core.Tests/Guard/CommandInjectionGuardTests.cs covering its
own block/audit/no-threat/no-op branches in isolation.
Background
Every *DetectionEngine has a dedicated test file; most Guard classes don't. This is one
of five identical-shaped issues — see docs/good-first-issues-dotnet.md for the full list
and the shared rationale (this is about naming concrete gaps, not chasing a coverage
percentage).
Pattern to copy
Rasp.Core.Tests/Guard/SqlSinkGuardTaintTests.cs — NoOpRaspMetrics fake, a real
RaspAlertBus, Options.Create(new RaspOptions {...}), NullLogger<T>.Instance.
What to test
AnalyzeProcessExecution(executablePath, arguments, useShellExecute, context)
(src/Rasp.Core/Guard/CommandInjectionGuard.cs), gated by
RaspOptions.BlockOnRuntimePatchingDetection:
Summary
CommandInjectionGuardhas no dedicated unit test file — only indirect coverage viaintegration tests. Add
Rasp.Core.Tests/Guard/CommandInjectionGuardTests.cscovering itsown block/audit/no-threat/no-op branches in isolation.
Background
Every
*DetectionEnginehas a dedicated test file; mostGuardclasses don't. This is oneof five identical-shaped issues — see
docs/good-first-issues-dotnet.mdfor the full listand the shared rationale (this is about naming concrete gaps, not chasing a coverage
percentage).
Pattern to copy
Rasp.Core.Tests/Guard/SqlSinkGuardTaintTests.cs—NoOpRaspMetricsfake, a realRaspAlertBus,Options.Create(new RaspOptions {...}),NullLogger<T>.Instance.What to test
AnalyzeProcessExecution(executablePath, arguments, useShellExecute, context)(
src/Rasp.Core/Guard/CommandInjectionGuard.cs), gated byRaspOptions.BlockOnRuntimePatchingDetection:RaspAlertBus, no exception thrown.RaspSecurityExceptionthrown, alert still pushedbefore the throw.
executablePathnever reaches the engine or calls_metrics.RecordInspection.