Minimal .NET/C# support for epic #445: stories N1–N5. N6 (tree-sitter graph, lint) is out of scope.
What
N1 detection (pipeline/dotnet/mod.rs, classify/dotnet.rs): finds .sln and .csproj/.vbproj/.fsproj at any depth, tells old from SDK project style, and reads TargetFramework(s)/TargetFrameworkVersion. The target records them as facts: dotnet_runtime (framework / dotnet / standard), each solution as a component (dotnet_solution), and each project with its style and frameworks (dotnet_project). language.rs is untouched; the parallel session owns it.
N2 NuGet SBOM (pipeline/sbom/nuget.rs): reads packages.config, <PackageReference> (version as attribute, child element, VersionOverride or central Directory.Packages.props), packages.lock.json, obj/project.assets.json and packages/<Id>.<Version>/. No build and no restore. Packages get pkg:nuget/<id>@<version> purls, which feed the existing OSV stage. Syft duplicates are skipped. A version range gets no purl and keeps the range as version_requirement.
A <PackageReference> project without a lockfile or assets file raises the #440sbom_dependencies warning, so the CRA view leaves the SBOM requirements not assessed. A packages.config project already lists its transitive packages, so it does not raise it.
A target framework past Microsoft's end of support is a finding (dotnet-lifecycle, CWE-1104, cra-ai-22). The dates come from Microsoft's lifecycle pages, so .NET 8/9 (2026-11-10) and 4.6.2 (2027-01-12) are flagged once those dates pass.
N3-lite C# rules: a new pack rules/cra_semgrep_csharp.yaml with test cases in rules/cra_semgrep_csharp.cs. It covers:
SQL injection (CWE-89), Process.Start with a built command line (CWE-78), BinaryFormatter/NetDataContractSerializer/LosFormatter/SoapFormatter and TypeNameHandling other than None (CWE-502), XXE (CWE-611) and path traversal from Request (CWE-22): cra-ai-20
MD5/SHA-1/DES/3DES/RC2 and ECB mode (CWE-327): cra-ai-13
certificate validation switched off (CWE-295): cra-ai-15
hard-coded credentials (CWE-798): cra-ai-8
We wrote these rules ourselves; nothing comes from a registry or third-party pack. semgrep.rs now runs every bundled pack. A test keeps the list equal to rules/*.yaml. The first pack keeps its staged name, so existing check_ids and fingerprints do not change.
N4 config checks (pipeline/dotnet/config.rs, run in the pattern stage):
*.config (scanner dotnet-config):
clear-text Password=/Pwd= in connection strings and secret-like appSettings, skipping empty values and placeholders such as ***REDACTED*** (CWE-260, cra-ai-9)
compilation debug="true" and customErrors mode="Off", unless a Web.Release.config transform fixes them (cra-ai-1)
httpCookies without requireSSL/httpOnlyCookies (cra-ai-10)
WCF bindings with security mode None/TransportCredentialOnly, and basicHttpBinding without transport security (cra-ai-15)
Committed .pfx/.p12/.jks/.keystore, .snk key pairs, .publishsettings, .pubxml.user and .pubxml with a password are reported as secret-files (cra-ai-16 / cra-ai-9).
All three scanner names count as completed for the #443 auto-resolve.
N5 (vendor.rs, a block added at the end): these are not counted as own code:
bin/ and obj/ next to a project or solution
packages/ holding restored NuGet packages (folder named <Id>.<Version> with a .nupkg or lib/), so a JavaScript monorepo's packages/ stays own code
.vs/, .nuget/, TestResults/
New control-map bindings for each rule. dotnet-lifecycle is treated as a component tool.
Fixture fixtures/dotnet/framework48 (.NET Framework 4.8, old project style, packages.config with Newtonsoft.Json 12.0.1 → GHSA-5crp-9r3c-p9vr, web.config with a clear-text password and WCF security None, C# with 4 rule hits). It is tested in pipeline/dotnet/fixture_tests.rs; the semgrep part runs only when semgrep is installed.
Docs: docs/guide/dotnet.md (DE) and dotnet-en.md (EN), recommending RestorePackagesWithLockFile.
Not in this PR
N6 (tree-sitter C#, lint, C# prompts)
Roslyn / Security Code Scan
DLLs by hash outside packages/, and notes for installers and binaries
Dashboard labels for the new scanner names
A nightly target for the fixture: it needs a blessed baseline
Minimal .NET/C# support for epic #445: stories N1–N5. N6 (tree-sitter graph, lint) is out of scope.
## What
- **N1 detection** (`pipeline/dotnet/mod.rs`, `classify/dotnet.rs`): finds `.sln` and `.csproj`/`.vbproj`/`.fsproj` at any depth, tells old from SDK project style, and reads `TargetFramework(s)`/`TargetFrameworkVersion`. The target records them as facts: `dotnet_runtime` (framework / dotnet / standard), each solution as a component (`dotnet_solution`), and each project with its style and frameworks (`dotnet_project`). `language.rs` is untouched; the parallel session owns it.
- **N2 NuGet SBOM** (`pipeline/sbom/nuget.rs`): reads `packages.config`, `<PackageReference>` (version as attribute, child element, `VersionOverride` or central `Directory.Packages.props`), `packages.lock.json`, `obj/project.assets.json` and `packages/<Id>.<Version>/`. No build and no restore. Packages get `pkg:nuget/<id>@<version>` purls, which feed the existing OSV stage. Syft duplicates are skipped. A version range gets no purl and keeps the range as `version_requirement`.
- A `<PackageReference>` project without a lockfile or assets file raises the #440 `sbom_dependencies` warning, so the CRA view leaves the SBOM requirements not assessed. A `packages.config` project already lists its transitive packages, so it does not raise it.
- A target framework past Microsoft's end of support is a finding (`dotnet-lifecycle`, CWE-1104, cra-ai-22). The dates come from Microsoft's lifecycle pages, so .NET 8/9 (2026-11-10) and 4.6.2 (2027-01-12) are flagged once those dates pass.
- **N3-lite C# rules**: a new pack `rules/cra_semgrep_csharp.yaml` with test cases in `rules/cra_semgrep_csharp.cs`. It covers:
- SQL injection (CWE-89), `Process.Start` with a built command line (CWE-78), `BinaryFormatter`/`NetDataContractSerializer`/`LosFormatter`/`SoapFormatter` and `TypeNameHandling` other than None (CWE-502), XXE (CWE-611) and path traversal from `Request` (CWE-22): cra-ai-20
- MD5/SHA-1/DES/3DES/RC2 and ECB mode (CWE-327): cra-ai-13
- certificate validation switched off (CWE-295): cra-ai-15
- hard-coded credentials (CWE-798): cra-ai-8
We wrote these rules ourselves; nothing comes from a registry or third-party pack. `semgrep.rs` now runs every bundled pack. A test keeps the list equal to `rules/*.yaml`. The first pack keeps its staged name, so existing check_ids and fingerprints do not change.
- **N4 config checks** (`pipeline/dotnet/config.rs`, run in the pattern stage):
- `*.config` (scanner `dotnet-config`):
- clear-text `Password=`/`Pwd=` in connection strings and secret-like `appSettings`, skipping empty values and placeholders such as `***REDACTED***` (CWE-260, cra-ai-9)
- `compilation debug="true"` and `customErrors mode="Off"`, unless a `Web.Release.config` transform fixes them (cra-ai-1)
- `httpCookies` without `requireSSL`/`httpOnlyCookies` (cra-ai-10)
- WCF bindings with security mode `None`/`TransportCredentialOnly`, and `basicHttpBinding` without transport security (cra-ai-15)
- Committed `.pfx`/`.p12`/`.jks`/`.keystore`, `.snk` key pairs, `.publishsettings`, `.pubxml.user` and `.pubxml` with a password are reported as `secret-files` (cra-ai-16 / cra-ai-9).
- All three scanner names count as completed for the #443 auto-resolve.
- **N5** (`vendor.rs`, a block added at the end): these are not counted as own code:
- `bin/` and `obj/` next to a project or solution
- `packages/` holding restored NuGet packages (folder named `<Id>.<Version>` with a `.nupkg` or `lib/`), so a JavaScript monorepo's `packages/` stays own code
- `.vs/`, `.nuget/`, `TestResults/`
- New control-map bindings for each rule. `dotnet-lifecycle` is treated as a component tool.
- Fixture `fixtures/dotnet/framework48` (.NET Framework 4.8, old project style, `packages.config` with Newtonsoft.Json 12.0.1 → GHSA-5crp-9r3c-p9vr, `web.config` with a clear-text password and WCF security None, C# with 4 rule hits). It is tested in `pipeline/dotnet/fixture_tests.rs`; the semgrep part runs only when semgrep is installed.
- Docs: `docs/guide/dotnet.md` (DE) and `dotnet-en.md` (EN), recommending `RestorePackagesWithLockFile`.
## Not in this PR
- N6 (tree-sitter C#, lint, C# prompts)
- Roslyn / Security Code Scan
- DLLs by hash outside `packages/`, and notes for installers and binaries
- Dashboard labels for the new scanner names
- A nightly target for the fixture: it needs a blessed baseline
## Checks
`cargo fmt --check`, clippy `-D warnings` (agent, control-map), `cargo test -p compliance-agent -p control-map --lib`, `semgrep --test compliance-agent/rules` (17/17)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Minimal .NET/C# support for epic #445 (N1-N5; N6 out of scope):
- N1: solutions and .csproj/.vbproj/.fsproj at any depth, old vs SDK
style, TargetFramework(s)/TargetFrameworkVersion; recorded as target
facts (dotnet_runtime, dotnet_solution, dotnet_project).
- N2: NuGet components from packages.config, PackageReference (attribute,
child element, VersionOverride, Directory.Packages.props),
packages.lock.json, obj/project.assets.json and packages/<Id>.<Version>/
with pkg:nuget purls for OSV. PackageReference projects without lockfile
or assets are reported as unresolved (sbom_dependencies). Target
frameworks past Microsoft's end of support are findings (CWE-1104).
- N3-lite: own semgrep rule pack cra_semgrep_csharp.yaml (SQLi, command
injection, deserialization, XXE, path traversal, weak crypto/ECB, TLS
validation off, hard-coded credentials) with semgrep --test cases;
semgrep.rs runs every bundled pack.
- N4: web.config/app.config checks (clear-text passwords, debug,
customErrors, httpCookies, WCF security) and committed key/publish files.
- N5: bin/obj beside projects, NuGet packages/, .vs, .nuget, TestResults
are not own code.
Control map bindings, fixtures/dotnet/framework48 with a test, and docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Minimal .NET/C# support for epic #445: stories N1–N5. N6 (tree-sitter graph, lint) is out of scope.
What
N1 detection (
pipeline/dotnet/mod.rs,classify/dotnet.rs): finds.slnand.csproj/.vbproj/.fsprojat any depth, tells old from SDK project style, and readsTargetFramework(s)/TargetFrameworkVersion. The target records them as facts:dotnet_runtime(framework / dotnet / standard), each solution as a component (dotnet_solution), and each project with its style and frameworks (dotnet_project).language.rsis untouched; the parallel session owns it.N2 NuGet SBOM (
pipeline/sbom/nuget.rs): readspackages.config,<PackageReference>(version as attribute, child element,VersionOverrideor centralDirectory.Packages.props),packages.lock.json,obj/project.assets.jsonandpackages/<Id>.<Version>/. No build and no restore. Packages getpkg:nuget/<id>@<version>purls, which feed the existing OSV stage. Syft duplicates are skipped. A version range gets no purl and keeps the range asversion_requirement.<PackageReference>project without a lockfile or assets file raises the #440sbom_dependencieswarning, so the CRA view leaves the SBOM requirements not assessed. Apackages.configproject already lists its transitive packages, so it does not raise it.dotnet-lifecycle, CWE-1104, cra-ai-22). The dates come from Microsoft's lifecycle pages, so .NET 8/9 (2026-11-10) and 4.6.2 (2027-01-12) are flagged once those dates pass.N3-lite C# rules: a new pack
rules/cra_semgrep_csharp.yamlwith test cases inrules/cra_semgrep_csharp.cs. It covers:Process.Startwith a built command line (CWE-78),BinaryFormatter/NetDataContractSerializer/LosFormatter/SoapFormatterandTypeNameHandlingother than None (CWE-502), XXE (CWE-611) and path traversal fromRequest(CWE-22): cra-ai-20We wrote these rules ourselves; nothing comes from a registry or third-party pack.
semgrep.rsnow runs every bundled pack. A test keeps the list equal torules/*.yaml. The first pack keeps its staged name, so existing check_ids and fingerprints do not change.N4 config checks (
pipeline/dotnet/config.rs, run in the pattern stage):*.config(scannerdotnet-config):Password=/Pwd=in connection strings and secret-likeappSettings, skipping empty values and placeholders such as***REDACTED***(CWE-260, cra-ai-9)compilation debug="true"andcustomErrors mode="Off", unless aWeb.Release.configtransform fixes them (cra-ai-1)httpCookieswithoutrequireSSL/httpOnlyCookies(cra-ai-10)None/TransportCredentialOnly, andbasicHttpBindingwithout transport security (cra-ai-15).pfx/.p12/.jks/.keystore,.snkkey pairs,.publishsettings,.pubxml.userand.pubxmlwith a password are reported assecret-files(cra-ai-16 / cra-ai-9).N5 (
vendor.rs, a block added at the end): these are not counted as own code:bin/andobj/next to a project or solutionpackages/holding restored NuGet packages (folder named<Id>.<Version>with a.nupkgorlib/), so a JavaScript monorepo'spackages/stays own code.vs/,.nuget/,TestResults/New control-map bindings for each rule.
dotnet-lifecycleis treated as a component tool.Fixture
fixtures/dotnet/framework48(.NET Framework 4.8, old project style,packages.configwith Newtonsoft.Json 12.0.1 → GHSA-5crp-9r3c-p9vr,web.configwith a clear-text password and WCF security None, C# with 4 rule hits). It is tested inpipeline/dotnet/fixture_tests.rs; the semgrep part runs only when semgrep is installed.Docs:
docs/guide/dotnet.md(DE) anddotnet-en.md(EN), recommendingRestorePackagesWithLockFile.Not in this PR
packages/, and notes for installers and binariesChecks
cargo fmt --check, clippy-D warnings(agent, control-map),cargo test -p compliance-agent -p control-map --lib,semgrep --test compliance-agent/rules(17/17)🤖 Generated with Claude Code
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
d95f76a0e0to75713d09b675713d09b6tofef7912b29fef7912b29to3f9183e54e3f9183e54eto64ddaf37c1