Skip to content

Commit 0c04706

Browse files
authored
Merge pull request #2 from ruffsl/mikael/security-contexts
Mikael/security contexts
2 parents 70b59f7 + 24ef462 commit 0c04706

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

articles/ros2_security_contexts.md

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: default
33
title: ROS 2 Security Contexts
4-
permalink: articles/ros2_access_control_policies.html
4+
permalink: articles/ros2_security_contexts.html
55
abstract:
66
This article specifies the integration between security and contexts.
77
author: >
@@ -30,6 +30,10 @@ TODO: Some concise overview introduction here
3030

3131
Before detailing the SROS 2 integration of the contexts, the following concepts are introduced.
3232

33+
### Participant
34+
35+
Participant is the object representing a single entity on the network, in the case of DDS the ``Participant`` is a DDS DomainParticipant and the object to which a set of access control and security identity apply.
36+
3337
### Namespaces
3438

3539
Namespaces are a fundamental design pattern in ROS and are widely used to organize and differentiate many types of resources as to be uniquely identifiable; i.e. for topics, services, actions, and node names.
@@ -42,11 +46,11 @@ However, with the advent of contexts, such a direct mapping of FQN to security a
4246
### Contexts
4347

4448
With the advent of ROS 2, multiple nodes may now be composed into one process for improved performance.
45-
Previously however, each node would retain it's one to one mapping to a separate middleware participant.
46-
Given the non-negligible overhead incurred of multiple participants per process, a concept of contexts was introduced.
47-
Contexts permit a many-to-one mapping of nodes to participant by grouping many nodes per context, and one participant per context.
49+
Previously however, each node would retain it's one to one mapping to a separate middleware ``Participant``.
50+
Given the non-negligible overhead incurred of multiple ``Participant``s per process, a concept of contexts was introduced.
51+
Contexts permit a many-to-one mapping of nodes to ``Participant`` by grouping many nodes per context, and one ``Participant`` per context.
4852

49-
Based on the DDS Security specification v1.1, 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.
53+
Based on the DDS Security specification v1.1, a ``Participant`` 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.
5054
As such, additional tooling and extensions to SROS 2 are necessary to support this new paradigm.
5155

5256

@@ -74,20 +78,20 @@ keystore
7478
```
7579

7680

77-
### `public`
81+
### ``public``
7882

79-
The `public` directory contains anything permissable as public, such as public certificates for the identity or permissions certificate authorities.
83+
The ``public`` directory contains anything permissable as public, such as public certificates for the identity or permissions certificate authorities.
8084
As such, this can be given read access to all executables.
81-
Note that in the default case, both the identity_ca and permissions_ca are the same CA certificate.
85+
Note that in the default case, both the `identity_ca` and `permissions_ca` are the same CA certificate.
8286

83-
### `private`
87+
### ``private``
8488

85-
The `private` directory contains anything permissable as private, such as private key material for aforementioned certificate authorities.
89+
The ``private`` directory contains anything permissable as private, such as private key material for aforementioned certificate authorities.
8690
This directory should be redacted before deploying the keystore onto the target device/robot.
8791

88-
### `contexts`
92+
### ``contexts``
8993

90-
The `contexts` directory contains the security artifacts associated with individual contexts, and thus node directories are no longer relevant.
94+
The ``contexts`` directory contains the security artifacts associated with individual contexts, and thus node directories are no longer relevant.
9195
Similar to node directories however, the `contexts` folder may still recursively nest sub-paths for organizing separate contexts.
9296

9397

@@ -177,7 +181,7 @@ contexts/
177181

178182
### Fully qualified context path
179183

180-
For nodes with fully qualified context paths, namespacs do not subsequently push the relative sub-folder.
184+
For nodes with absolute context paths, namespaces do not subsequently push the relative sub-folder.
181185

182186
``` xml
183187
<launch>
@@ -224,24 +228,31 @@ Keeps pushing context path independent/flexable from namespaces.
224228
### Multiple namespaces per context
225229

226230
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.
227-
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.
231+
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/>` substitution and expansion.
232+
228233

234+
### Modeling permissions of nodes in a process v.s. permission of the middleware ``Participant``
229235

230-
### Multiple contexts per process
236+
Before the use of contexts, multiple nodes composed into a single process where each mapped to a separate ``Participant``.
237+
Each ``Participant`` subsequently load a security identity and access control credential prevalent to its' respective node.
238+
However, all nodes in that process share the same memory space and can thus access data from other nodes.
239+
There is a mismatch between the middleware credentials/permissions loaded and the resources accessible within the process.
231240

232-
Before the use of contexts, multiple nodes composed into a single process where each mapped to a separate participant.
233-
Each participant subsequently load an security identity and access control credential prevalent to its' respective node.
234-
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`.
241+
By using contexts, all nodes in a context share the same security identity and access control credentials.
242+
This inevitably means that code compiled to node ``foo`` can access credentials/permissions only trusted to node ``bar``.
235243
This consequence of composition could unintendedly subvert the minimal spanning policy as architected by the policy designer or measured/generated via ROS 2 tooling/IDL.
236244

237245
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.
238246
This would allow for formal analysis tooling [2] to check for potential violations in information flow control given the composing of nodes at runtime.
239-
However, should multiple contexts be used per process, then such security guaranties are again lost.
247+
If a process contains a single context, this reconciles the permissions of a ``Participant`` and the ones of the process.
248+
249+
However, should multiple contexts be used per process, then such security guaranties are again lost because both contexts will share the same memory space.
240250
Thus it should be asked whether if multiple contexts per process should even be supported.
241251

242-
In summery, the distinction here is that before, the composition of multiple permissions could not be conveyed to the tooling.
252+
253+
In summary, the distinction here is that before, the composition of multiple permissions could not be conveyed to the tooling.
243254
Whether nodes could gain the permission of others in the same process space is not the hinge point of note; it's the fact that such side effects could not be formally modeled or accounted for by the designer.
244-
Allowing for multiple contexts per process again exacerbates the same modeling inaccuracies
255+
It will now be possible with contexts, however allowing for multiple contexts per process will reintroduce and exacerbates the same modeling inaccuracies.
245256

246257
## References
247258

0 commit comments

Comments
 (0)