feat(examples): ROS2 transport-level non-bypass hardening demo#174
Open
ExpertVagabond wants to merge 1 commit intosint-ai:mainfrom
Open
feat(examples): ROS2 transport-level non-bypass hardening demo#174ExpertVagabond wants to merge 1 commit intosint-ai:mainfrom
ExpertVagabond wants to merge 1 commit intosint-ai:mainfrom
Conversation
…sint-ai#161) The existing examples/ros2-lifecycle-guard is explicitly application-level: code outside the guarded node can still publish to /cmd_vel directly. This adds the transport-level counterpart so the enforcement story is non-bypassable at the DDS boundary, not just inside the guarded process. New examples/ros2-transport-hardening/: - keystore-init.sh: builds an SROS2 keystore, creates per-identity enclaves (/guarded_talker publish rt/cmd_vel, /guarded_camera subscribe rt/camera/front), overlays custom permissions.xml, and re-signs with the permissions CA. - guarded_talker.py: reference defender. Calls PolicyGateway.intercept() before every publish AND runs under ROS_SECURITY_ENABLE=true ROS_SECURITY_STRATEGY=Enforce with a matching enclave. - attacker.py: reference bypass attempt. Same network + ROS_DOMAIN_ID, Enforce mode, but no keystore — DDS Secure refuses participant creation or subscriber matching. Exit codes 2/3 indicate blocked, 0 indicates a regression. - conformance-check.sh: CI-friendly orchestrator that asserts the attacker is blocked (exits 2 or 3) and fails if a bypass publish reaches the guarded topic. - docker-compose.yml / Dockerfile: gateway + postgres + redis + keystore-init one-shot + guarded-talker + attacker (profile-gated so conformance-check runs it explicitly via 'docker compose run'). - README.md: layered-model table (application vs transport), manual keystore recipe, optional defense-in-depth (ROS_DOMAIN_ID separation, network policies, gateway-side endpoint allowlist), explicit limitations. Also updates examples/ros2-lifecycle-guard/README.md to cross-link this demo so the two can be read together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #161.
Context
The existing
examples/ros2-lifecycle-guardis explicitly application-level: a node voluntarily callsPolicyGateway.intercept()before acting. The demo's README already calls this out — any other process on the same DDS domain can still publish directly to/cmd_velbecause nothing at the transport layer stops it.This PR adds the transport-layer counterpart so the two demos together cover both rows of the enforcement matrix:
PolicyGateway.intercept()New directory:
examples/ros2-transport-hardening/keystore-init.sh— one-shot that builds an SROS2 keystore and two per-identity enclaves (`/guarded_talker` → publish `rt/cmd_vel`; `/guarded_camera` → subscribe `rt/camera/front`), overlays custom `permissions.xml`, and re-signs with the permissions CA using `openssl smime`.Also updates `examples/ros2-lifecycle-guard/README.md` to cross-link the new demo so the two are read as a pair.
Acceptance-criteria mapping (from #161)
Test plan
```bash
cd examples/ros2-transport-hardening
./conformance-check.sh
```
Expected: `[conformance] PASS: attacker blocked at transport (exit 2|3)`.
Non-goals honored
A full ROS 2 middleware interceptor (a hard MITM the node cannot route around) is out of scope per the issue; this PR only covers the SROS2/DDS-Security recipe and conformance test.