Skip to content

Add tests for SROS2 access control policies (Issue #238) - #604

Open
Aaravanand00 wants to merge 1 commit into
ros2:rollingfrom
Aaravanand00:fix-issue-238-access-control
Open

Add tests for SROS2 access control policies (Issue #238)#604
Aaravanand00 wants to merge 1 commit into
ros2:rollingfrom
Aaravanand00:fix-issue-238-access-control

Conversation

@Aaravanand00

Copy link
Copy Markdown
Contributor

Description

This PR adds negative testing for SROS2 access control policies by ensuring that nodes configured with restricted security policies (DENY rules) correctly fail to communicate.

Key changes include :-

  • Created two new security policies (policy_publisher_denied.xml and policy_subscriber_denied.xml) that restrict publishing and subscribing on the chatter topic.
  • Updated sros_artifacts.cmake to generate cryptographic artifacts for the new /publisher_denied and /subscriber_denied enclaves.
  • Refactored test_secure_publisher.cpp and test_secure_subscriber.cpp to dynamically parse their enclave names from argv rather than hardcoding them.
  • Updated test_secure_publisher_subscriber.py.in to explicitly pass --ros-args --enclave to both nodes.
  • Added a new access_control_tests matrix in CMakeLists.txt that pairs authorized nodes with denied nodes and asserts that the subscriber gracefully times out.

Fixes #238

Is this user-facing behavior change?

No, these changes are strictly related to internal testing.

Did you use Generative AI?

Yes ai agent was used to assist in scaffolding the test implementations and CMake loops.

Additional Information

The tests have been verified locally (with SECURITY=ON) and all security/access-control related test timeouts function correctly, ensuring that invalid access attempts are blocked at the middleware level.

@mergify

mergify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Signed-off-by: Aaravanand <aaravanand@gmail.com>
@Aaravanand00
Aaravanand00 force-pushed the fix-issue-238-access-control branch from 2cdd195 to 07e29f2 Compare August 2, 2026 07:24
@Aaravanand00

Copy link
Copy Markdown
Contributor Author

@fujitatomoya ptal

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.

[test_security] test access control policies

1 participant