Skip to content

PR-15: Ecosystems (C#/Rust/Ruby) + Semgrep export (scanner) - #43

Merged
emmanuelgjr merged 1 commit into
mainfrom
improve/pr-15-ecosystems-export
Jul 18, 2026
Merged

PR-15: Ecosystems (C#/Rust/Ruby) + Semgrep export (scanner)#43
emmanuelgjr merged 1 commit into
mainfrom
improve/pr-15-ecosystems-export

Conversation

@emmanuelgjr

Copy link
Copy Markdown
Contributor

Phase 4. Depends on PR-11.

Ecosystem expansion — C# / Rust / Ruby

  • Detection signals: Semantic Kernel / Azure.AI.OpenAI (C#), async-openai (Rust), ruby-openai (Ruby).
  • CVE manifest parsing via OSV: NuGet (*.csproj), crates.io (Cargo.lock), RubyGems (Gemfile.lock).
  • Credential coverage extended to *.cs/*.rs/*.rb/*.csproj on 13 DSGAI02/13 rules — with C#/Rust/Ruby fixture cases so the coverage is actually tested (P02.9 catches the raw tokens). Answer sheet 29 → 32.

Semgrep rule-pack export

  • build/export_semgrep.pydist/dsgai.semgrep.yaml — the 85 STRUCTURAL rules as a Semgrep pack (value-bearing rules excluded by design — their matches must never surface). Generated from the rules YAML; drift is a CI failure (--check). Strategic: incumbent toolchains become carriers of the DSGAI framework.

Verification

  • regen --check → all 32 line-pins match; pytest21 passed.
  • Semgrep pack is valid YAML (85 rules, every one pattern-regex + dsgai_control metadata), clean under the CI yamllint config.
  • The fixture scan now runs --no-cve so CI is deterministic (no network); CVE ecosystem parsing is covered by an offline unit test.

Honest scope note

Coverage here is DSGAI02 (credentials, language-agnostic patterns) + DSGAI04 (supply-chain via CVE). DSGAI17/20 language-specific structural patterns (retry/endpoint shapes in C#/Rust/Ruby) are deferred — writing them without per-language structural fixtures would violate the project's own "no rules without fixture test cases" rule. Tracked as a follow-up.

…-15)

- Detection signals for C# (Semantic Kernel / Azure.AI.OpenAI), Rust
  (async-openai), Ruby (ruby-openai).
- CVE manifest parsing for NuGet (*.csproj), crates.io (Cargo.lock), RubyGems
  (Gemfile.lock) via OSV — supply-chain coverage for the three ecosystems.
- Credential coverage extended to *.cs/*.rs/*.rb/*.csproj on 13 DSGAI02/DSGAI13
  rules, with C#/Rust/Ruby fixture cases (P02.9 catches raw tokens); answer sheet
  29 -> 32.
- build/export_semgrep.py -> dist/dsgai.semgrep.yaml: the 85 STRUCTURAL rules as
  a Semgrep pack (value-bearing excluded by design — their matches must never
  surface). Generated from the rules YAML; drift is a CI failure (--check). Makes
  incumbent toolchains carriers of the DSGAI framework.
- test_runner: the fixture scan now runs --no-cve so CI is deterministic (no
  network); added semgrep-sync and multi-ecosystem-parse tests.

Verified: regen --check (32 pins); pytest 21 passed; semgrep pack valid YAML
(85 rules, all pattern-regex + dsgai metadata); yamllint clean under CI config.
@emmanuelgjr
emmanuelgjr merged commit de81958 into main Jul 18, 2026
9 checks passed
@emmanuelgjr
emmanuelgjr deleted the improve/pr-15-ecosystems-export branch July 18, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant