Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial draft for ROS 2 Security Contexts #1

Closed
wants to merge 24 commits into from

Conversation

ruffsl
Copy link
Owner

@ruffsl ruffsl commented Feb 22, 2020

No description provided.

Copy link
Collaborator

@mikaelarguedas mikaelarguedas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing on this first version.
Some comments and mostly questions inline as this diverges from my understanding of our offline discussion.

articles/ros2_security_contexts.md Outdated Show resolved Hide resolved
articles/ros2_security_contexts.md Outdated Show resolved Hide resolved
articles/ros2_security_contexts.md Outdated Show resolved Hide resolved
articles/ros2_security_contexts.md Outdated Show resolved Hide resolved
articles/ros2_security_contexts.md Outdated Show resolved Hide resolved
articles/ros2_security_contexts.md Outdated Show resolved Hide resolved

### Context path orthogonal to namespace

An alternative to reusing namespaces to hint the context path could be to completely disassociate the two entirely, treating the context path as it's own unique identifier. However, having to book keep both identifier spaces simulations may introduce to many degrees of freedom that a human could groc or easily introspect via tooling.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC this is the approach we settled for offline because ROS namespaces have a very lose correlation to the process/context they will be running in. Could you clarify why this PR is now using node namespaces and not context namespaces?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the offline notes, we visited the idea of forcing users to manually specify context namespaces, as to be comely orthogonal to node namespaces, but concluded that tracking two orthogonal namespaces would be a large mental overhead for users, as well as require much more boilerplate.

In the case of launchfiles: how to specify what gets in what context?
Could force people to provide context attributes everywhere ?
Inconvenient and can duplicate info. Would need "namespace context" but it gets hairy and duality with nodes name and namespaces

Thus we iterated further on the idea of allowing the existing namespace elements in lauchfiles to hint/push the relative context path. However, the user could still override the relative context path using a absolute context path for the node element's context attribute, just like with topics/services/actions:

If context specified use context-prefix/context otherwise can be overridden using absolute context

Perhaps we could also add these additional observations to the alternative section.

articles/ros2_security_contexts.md Outdated Show resolved Hide resolved

### Multiple contexts per process

As before the use of contexts, multiple nodes composed into a single process where each mapped to a septate participant. Each participant subsequently load an security identity and access control credential prevalent to it's respective node. This composition however would inevitably mean that code compiled to node `foo` could access credentials/permissions only trusted only to node `bar`. This consequence of composition could unintendedly subvert the minimal spanning policy as architected by the designer or measured/generated via ROS 2 tooling/IDL.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As before the use of contexts, multiple nodes composed into a single process where each mapped to a septate participant. Each participant subsequently load an security identity and access control credential prevalent to it's respective node. This composition however would inevitably mean that code compiled to node `foo` could access credentials/permissions only trusted only to node `bar`. This consequence of composition could unintendedly subvert the minimal spanning policy as architected by the designer or measured/generated via ROS 2 tooling/IDL.
Before the use of contexts, multiple nodes composed into a single process where each mapped to a separate participant.
Each participant subsequently load an security identity and access control credential prevalent to its' respective node.
The composition of multiple nodes per context however, inevitably means that code compiled to node `foo` could access credentials/permissions only trusted to node `bar`.
This consequence of composition could unintendedly subvert the minimal spanning policy as architected by the designer or measured/generated via ROS 2 tooling/IDL.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph seems unrelated to the number of context per process. It is true and a drwaback in the case of single context per process as well

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've extended this section with a summarizing clarification in a461e4c
Feel free to suggest additional wording.


As before the use of contexts, multiple nodes composed into a single process where each mapped to a septate participant. Each participant subsequently load an security identity and access control credential prevalent to it's respective node. This composition however would inevitably mean that code compiled to node `foo` could access credentials/permissions only trusted only to node `bar`. This consequence of composition could unintendedly subvert the minimal spanning policy as architected by the designer or measured/generated via ROS 2 tooling/IDL.

With the introduction of contexts, it becomes possible to describe the union of access control permission by defining a collection of SROS 2 policy profiles as element within a specific context. This would allow for formal analysis tooling to check for potential violations in information flow control given the composing of nodes at runtime. However, should multiple contexts be used per process, then such security guaranties are again lost. Thus it should be asked whether if multiple contexts per process should even be supported.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I got this part. Why would the security guaranties be lost if there are multiple contexts per process?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please comment on a461e4c .

ruffsl and others added 18 commits February 22, 2020 10:12
Signed-off-by: Mikael Arguedas <[email protected]>
Signed-off-by: Mikael Arguedas <[email protected]>
Signed-off-by: Mikael Arguedas <[email protected]>
Signed-off-by: Mikael Arguedas <[email protected]>
@mikaelarguedas
Copy link
Collaborator

Opened #2 with some suggestions.

This design doc will conflict with https://github.com/ros2/design/blob/gh-pages/articles/ros2_dds_security.md and we'll need to merge or deconflict those before merging.
If I'm to add details about how ROS_SECURITY_DIRECTORY_OVERRIDE does this belong in this PR ?

@ruffsl
Copy link
Owner Author

ruffsl commented Feb 25, 2020

Migrating discussion upstream to ros2#274

@ruffsl ruffsl closed this Feb 25, 2020
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.

2 participants