-
Notifications
You must be signed in to change notification settings - Fork 0
Add initial draft for ROS 2 Security Contexts #1
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
Changes from 1 commit
a299714
85f1e96
5f4a64b
b43e4d3
39c5aac
f5e07e7
77a21f4
4c13826
ffe489f
95f75b6
5995840
a461e4c
97ae7e1
70b59f7
19e6004
b3f50fb
b17032a
226bc24
24ef462
0c04706
d50c3d8
20ccb00
2ac697c
a972685
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,234 @@ | ||||||||||||
| --- | ||||||||||||
| layout: default | ||||||||||||
| title: ROS 2 Security Contexts | ||||||||||||
| permalink: articles/ros2_access_control_policies.html | ||||||||||||
| abstract: | ||||||||||||
| This article specifies the integration between security and contexts. | ||||||||||||
| author: > | ||||||||||||
| [Ruffin White](https://github.com/ruffsl), | ||||||||||||
| [Mikael Arguedas](https://github.com/mikaelarguedas) | ||||||||||||
|
|
||||||||||||
| published: false | ||||||||||||
| categories: Security | ||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| {:toc} | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| # {{ page.title }} | ||||||||||||
|
|
||||||||||||
| <div class="abstract" markdown="1"> | ||||||||||||
| {{ page.abstract }} | ||||||||||||
| </div> | ||||||||||||
|
|
||||||||||||
| Original Author: {{ page.author }} | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| TODO: Some concise overview introduction here | ||||||||||||
|
|
||||||||||||
| ## Concepts | ||||||||||||
|
|
||||||||||||
| Before detailing the SROS 2 integration of the contexts, the following concepts are introduced. | ||||||||||||
|
|
||||||||||||
| ### Namespaces | ||||||||||||
|
|
||||||||||||
| Namespaces are a fundamental design pattern in ROS and are wildly used to organize and differentiate many types of resource as to be uniquely identifiable; i.e. for topics, services, actions, and node names. As such, the concept of namespaceing is well know and understood by current users, as well as strongly supported with the existing tooling. Namespaces are often configurable at runtime via command line arguments or statically/programmatically via launch file decelerations. | ||||||||||||
ruffsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| Previously, the Fully Qualified Namespace (FQN) of a node was used directly by a selected security directory lookup strategy to load the necessary key material. However, with the advent of contexts, such a direct mapping of FQN to security artifacts may no longer suffice. | ||||||||||||
ruffsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| ### Contexts | ||||||||||||
|
|
||||||||||||
| With the advent of ROS 2, multiple nodes may now be composed into one process for improved performance. Previously however, each node would retain it's one to one mapping to a septate middleware participant. Given the non-negligible overhead incurred of multiple participants per process, a concept of contexts was introduced. Contexts permit a many-to-one mapping of nodes to participant by grouping many nodes per context, and one context per participant. | ||||||||||||
ruffsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| Currently, DDS participants can only utilise a single security identity; consequently the access control permissions applicable to every node mapped to a given context must be consolidated and combined into a single set of security artifacts. As such, additional tooling and extensions to SROS 2 are necessary to support this new paradigm. | ||||||||||||
ruffsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ## Keystore | ||||||||||||
|
|
||||||||||||
| With the additional structure of contexts, it’s perhaps best to take the opportunity to restructure the keystore layout as well. Rather than a flat directory of namespaced node security directories, we can push all such security directories down into a designated `contexts` sub-folder. Similarly, private and public keystore materials can also be pushed down into their own respective sub-folders within the root keystore directory. This is reminiscent of the pattern used earlier Keymint [1]. | ||||||||||||
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ``` | ||||||||||||
| $ tree keystore/ | ||||||||||||
| keystore | ||||||||||||
| ├── contexts | ||||||||||||
| │ └── ... | ||||||||||||
| │ └── ... | ||||||||||||
| ├── private | ||||||||||||
| │ ├── ca.csr.pem | ||||||||||||
| │ └── ca.key.pem | ||||||||||||
| └── public | ||||||||||||
| ├── ca.cert.pem | ||||||||||||
| ├── identity_ca.cert.pem -> ca.cert.pem | ||||||||||||
| └── permissions_ca.cert.pem -> ca.cert.pem | ||||||||||||
ruffsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ### `private` | ||||||||||||
ruffsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| The `public` directory contains anything permissable as public, such as public certificates for the identity or permissions certificate authorities. As such, this can be given read access to all node executables. Note that in this default case, both the identity_ca and permissions_ca points to the same CA certificate. | ||||||||||||
ruffsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| ### `public` | ||||||||||||
ruffsl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| The `private` directory contains anything permissable as private, such as private key material for aforementioned certificate authorities. This directory should be redacted before deploying the keystore onto the target device/robot. | ||||||||||||
|
|
||||||||||||
| ### `contexts` | ||||||||||||
|
|
||||||||||||
| The `contexts` directory contains the security artifacts associated with individual contexts, and thus node directories are no longer relevant. Similar to node directories however, the `contexts` folder may still recursively nest sub-paths for organizing separate contexts. | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ## Runtime | ||||||||||||
|
|
||||||||||||
| TODO: Some transition paragraph here about ros launch | ||||||||||||
|
|
||||||||||||
| ### Unqualified context path | ||||||||||||
|
|
||||||||||||
| For nodes with unqualified context paths, the context directory will subsequently default to the root level context. | ||||||||||||
|
|
||||||||||||
| ``` xml | ||||||||||||
| <launch> | ||||||||||||
| <node pkg="demo_nodes_cpp" exec="talker"/> | ||||||||||||
| <node pkg="demo_nodes_cpp" exec="listener"/> | ||||||||||||
| </launch> | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ``` | ||||||||||||
| $ tree contexts/ | ||||||||||||
| contexts/ | ||||||||||||
| ├── cert.pem | ||||||||||||
| ├── governance.p7s | ||||||||||||
| ├── identity_ca.cert.pem -> ../public/identity_ca.cert.pem | ||||||||||||
| ├── key.pem | ||||||||||||
| ├── permissions_ca.cert.pem -> ../public/permissions_ca.cert.pem | ||||||||||||
| └── permissions.p7s | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ### Pushed unqualified context path | ||||||||||||
|
|
||||||||||||
| For nodes with unqualified context paths pushed by a namespace, the context directory will subsequently be pushed to the relative sub-folder. | ||||||||||||
|
|
||||||||||||
| ``` xml | ||||||||||||
| <launch> | ||||||||||||
| <node pkg="demo_nodes_cpp" exec="talker"/> | ||||||||||||
| <group> | ||||||||||||
| <push_ros_namespace namespace="foo"/> | ||||||||||||
| <node pkg="demo_nodes_cpp" exec="listener"/> | ||||||||||||
| </group> | ||||||||||||
| </launch> | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ``` | ||||||||||||
| $ tree --dirsfirst contexts/ | ||||||||||||
| contexts/ | ||||||||||||
| ├── foo | ||||||||||||
| │ ├── cert.pem | ||||||||||||
| │ ├── governance.p7s | ||||||||||||
| │ ├── identity_ca.cert.pem | ||||||||||||
| │ ├── key.pem | ||||||||||||
| │ ├── permissions_ca.cert.pem | ||||||||||||
| │ └── permissions.p7s | ||||||||||||
| ├── cert.pem | ||||||||||||
| ├── governance.p7s | ||||||||||||
| ├── identity_ca.cert.pem | ||||||||||||
| ├── key.pem | ||||||||||||
| ├── permissions_ca.cert.pem | ||||||||||||
| └── permissions.p7s | ||||||||||||
| ``` | ||||||||||||
| > Symbolic links suppressed for readability | ||||||||||||
|
|
||||||||||||
| ### Relatively pushed qualified context path | ||||||||||||
|
|
||||||||||||
| For nodes with qualified context paths pushed by a namespace, the qualified context directory will subsequently be pushed to the relative sub-folder. | ||||||||||||
|
|
||||||||||||
| ``` xml | ||||||||||||
| <launch> | ||||||||||||
| <group> | ||||||||||||
| <push_ros_namespace namespace="foo"/> | ||||||||||||
| <node pkg="demo_nodes_cpp" exec="listener" context="bar"/> | ||||||||||||
| </group> | ||||||||||||
| </launch> | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ``` | ||||||||||||
| $ tree --dirsfirst contexts/ | ||||||||||||
| contexts/ | ||||||||||||
| └── foo | ||||||||||||
| └── bar | ||||||||||||
| ├── cert.pem | ||||||||||||
| ├── governance.p7s | ||||||||||||
| ├── identity_ca.cert.pem | ||||||||||||
| ├── key.pem | ||||||||||||
| ├── permissions_ca.cert.pem | ||||||||||||
| └── permissions.p7s | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ### Fully qualified context path | ||||||||||||
|
|
||||||||||||
| For nodes with fully qualified context paths, namespacs do not subsequently push the relative sub-folder. | ||||||||||||
|
|
||||||||||||
| ``` xml | ||||||||||||
| <launch> | ||||||||||||
| <group> | ||||||||||||
| <push_ros_namespace namespace="foo"/> | ||||||||||||
| <node pkg="demo_nodes_cpp" exec="listener" context="/bar"/> | ||||||||||||
| </group> | ||||||||||||
| </launch> | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ``` | ||||||||||||
| $ tree --dirsfirst contexts/ | ||||||||||||
| contexts/ | ||||||||||||
| └── bar | ||||||||||||
| ├── cert.pem | ||||||||||||
| ├── governance.p7s | ||||||||||||
| ├── identity_ca.cert.pem | ||||||||||||
| ├── key.pem | ||||||||||||
| ├── permissions_ca.cert.pem | ||||||||||||
| └── permissions.p7s | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ## Alternatives | ||||||||||||
|
|
||||||||||||
| ### 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. | ||||||||||||
|
||||||||||||
|
|
||||||||||||
| #### `<push_ros_namespace namespace="..." context="foo"/>` | ||||||||||||
|
|
||||||||||||
| TODO: Describe added `context` attribute to `push_ros_namespace` element. | ||||||||||||
| Keeps pushing contexts close/readable to pushing of namespaces. | ||||||||||||
|
|
||||||||||||
| #### `<push_ros_context context="foo"/>` | ||||||||||||
|
|
||||||||||||
| TODO: Describe added `push_ros_context` element. | ||||||||||||
| Keeps pushing context path independent/flexable from namespaces. | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ## Concerns | ||||||||||||
|
|
||||||||||||
| ### Multiple namespaces per context | ||||||||||||
|
|
||||||||||||
| For circumstances where users may compose multiple nodes of dissimilar namespaces into a single context, the user must subsequently specify a common fully qualified context path for each node to compose, as the varying different namespaces would not push to a common context. For circumstances where the context path is orthogonal to node namespace, the use of fully qualifying all relevant nodes is could be tedious, but could perhaps could still be parametrized via the use of `<var/>`, and `<arg/>` substation and expansion. | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ### 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. | ||||||||||||
|
||||||||||||
| 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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Outdated
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment on a461e4c .
Uh oh!
There was an error while loading. Please reload this page.