feat(controls): the grounded surface check reads C and C++ (#376) #394

Merged
sharang merged 1 commits from feat/surface-c into main 2026-09-25 11:09:02 +00:00
Owner

Closes #376.

The grounded surface check (5d) covers the eight absence-based CRA controls:

  • integrity checks;
  • brute-force protection;
  • authorisation;
  • security logging;
  • log integrity;
  • secure updates;
  • update authenticity;
  • update integrity.

It only read py js ts tsx jsx go java rb php rs cs kt, so on C/C++ firmware those controls were never checked. It now reads C/C++ too.

Changes

  • File types: surface.rs reads c h cc cpp hpp.
  • Vendor code is left out. Without this, the eight-region cap per control would fill with HAL, CMSIS and middleware code (HAL_FLASH_Program, verify, …).
    • The walk uses vendor::walk_outside with the directories from vendor::vendor_dirs, the same detection SAST uses.
    • grounded_surface_findings works them out once per scan, on a blocking thread.
  • Embedded terms in the keyword lists:
    • crc32 for integrity;
    • syslog for logging;
    • bootloader, ota_ and hal_flash for updates;
    • ecdsa and secure_boot for update authenticity.
    • ota_ is written with the underscore so it doesn't match "rotate" or "iota".
  • Control map: the eight grounded bindings list c and cpp. The CRA status therefore counts C/C++ code as checked for them, and "no violation found" there now rests on an actual check.

Nightly

Grounded findings are codereview (LLM output), which the nightly reports but never compares, so the baselines are unaffected.

Checked

  • cargo fmt --all --check.
  • clippy with the CI flags for compliance-agent.
  • Tests: agent 448, control-map 12. A new test has STM32 update code in Core/Src/ota.c retrieved while the HAL's HAL_FLASH_Program under Drivers/ is not.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Closes #376. The grounded surface check (5d) covers the eight absence-based CRA controls: - integrity checks; - brute-force protection; - authorisation; - security logging; - log integrity; - secure updates; - update authenticity; - update integrity. It only read `py js ts tsx jsx go java rb php rs cs kt`, so on C/C++ firmware those controls were never checked. It now reads C/C++ too. ## Changes - **File types:** `surface.rs` reads `c h cc cpp hpp`. - **Vendor code is left out.** Without this, the eight-region cap per control would fill with HAL, CMSIS and middleware code (`HAL_FLASH_Program`, `verify`, …). - The walk uses `vendor::walk_outside` with the directories from `vendor::vendor_dirs`, the same detection SAST uses. - `grounded_surface_findings` works them out once per scan, on a blocking thread. - **Embedded terms** in the keyword lists: - `crc32` for integrity; - `syslog` for logging; - `bootloader`, `ota_` and `hal_flash` for updates; - `ecdsa` and `secure_boot` for update authenticity. - `ota_` is written with the underscore so it doesn't match "rotate" or "iota". - **Control map:** the eight grounded bindings list `c` and `cpp`. The CRA status therefore counts C/C++ code as checked for them, and "no violation found" there now rests on an actual check. ## Nightly Grounded findings are `codereview` (LLM output), which the nightly reports but never compares, so the baselines are unaffected. ## Checked - `cargo fmt --all --check`. - clippy with the CI flags for compliance-agent. - Tests: agent 448, control-map 12. A new test has STM32 update code in `Core/Src/ota.c` retrieved while the HAL's `HAL_FLASH_Program` under `Drivers/` is not. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-09-25 10:58:40 +00:00
feat(controls): the grounded surface check reads C and C++ (#376)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 8m45s
b3da5ece33
The absence-based controls (integrity, updates, logging, access) were
never checked on firmware: the surface check read no C/C++. It now
does, without the vendor SDK, with embedded terms (crc32, ota_,
bootloader, hal_flash, secure_boot, ecdsa, syslog); the control map
counts C/C++ as checked for these controls.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang merged commit a3e0618283 into main 2026-09-25 11:09:02 +00:00
Sign in to join this conversation.