You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add and update security designs for Contexts (ros2#274)
* Add initial draft for ROS 2 Security Contexts
Signed-off-by: ruffsl <[email protected]>
Co-Authored-By: Mikael Arguedas <[email protected]>
* Update policy schema for contexts
* Update DDS-Security integration for contexts
* Allow contexts to formalize cross domain bridging
* Update context vocab
* Update design for runtime argument
* Simplify context arg
* Removing shell specific $ from variables
* Restore notes on synlinks
* Remove the use of alternate lookup methods
It's now redundan given context paths can be independent of namespace
ros2#274 (comment)
* Update policy schema to match that currently used
* Update key argument name for security context
* Publish Security Contexts document
* Update context directory overide env name
* Update story for ROS_SECURITY_ROOT_DIRECTORY
* Context -> Enclave
* Rename for enclave terminology change
* Update runtime argument for enclave assignment
* Relegate lunch interrogation to future work
* Disassociate context paths from namespaces
* Update override example of root directory and CLA
* Rename security environment variables
* Update behavor of ROS_SECURITY_ENCLAVE_OVERRIDE
Co-authored-by: Mikael Arguedas <[email protected]>
Co-authored-by: Kyle Fazzari <[email protected]>
Copy file name to clipboardExpand all lines: articles/150_ros_command_line_arguments.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,7 @@ As a quick summary of ROS command line capabilities:
78
78
- to `rosout`, use `--enable-rosout-logs` or `--disable-rosout-logs`
79
79
- to `stdout`, use `--enable-stdout-logs` or `--disable-stdout-logs`
80
80
- to a external logging library, use `--enable-external-lib-logs` or `--disable-external-lib-logs`
81
+
- For enclave assignment, use either `--enclave value` or `-e value` where value is fully qualified enclave path.
81
82
82
83
For name remapping and parameter assignment, specific nodes can be targeted by prepending the option value with the node name followed by a colon `:`, as in `--remap my_node:from:=to` and `--param my_node:name:=value`.
Logging is fully enabled by default, thus `--enable-*` options are usually redundant unless a `--disable-*` option found earlier in the command line is being overridden.
203
204
205
+
#### Enclave assignments
206
+
207
+
Enclave assignment may be achieved using the `--enclave`/`-e` option.
208
+
This option takes a single string `value` assignment statement, where `value` is a fully qualified enclave path used to locate the respective security artifacts within the configured keystore.
209
+
210
+
As an example, to assign an enclave path `/foo/bar` one may execute:
211
+
212
+
```sh
213
+
ros2 run some_package some_ros_executable --ros-args --enclave="/foo/bar"
214
+
```
215
+
216
+
or its shorter equivalent:
217
+
218
+
```sh
219
+
ros2 run some_package some_ros_executable --ros-args -e "/foo/bar"
220
+
```
221
+
222
+
As is, this enclave assignment applies to each and every Domain Participant that `some_ros_executable` spawns unless explicitly ignored in code or overridden via security environment variables.
Copy file name to clipboardExpand all lines: articles/ros2_access_control_policies.md
+40-5Lines changed: 40 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ A policy serves as a high-level abstraction of privileges associated with attrib
32
32
## Concepts
33
33
34
34
Before detailing the SROS 2 policy design of the [access control](https://en.wikipedia.org/wiki/Computer_access_control), by which the system constrains the ability of a subject to access an object, it is important to establish a few concepts useful in formalizing the design approach in terms of security.
35
-
In this context, a subject may be thought of as a participant on a distributed data-bus (e.g. a ROS node in the computation graph), whereas an object may be an instance of a particular subsystem (e.g. a ROS topic), and access is defined as the capability to act upon that object (e.g. publish or subscribe).
35
+
In this setting, a subject may be thought of as a participant on a distributed data-bus (e.g. a ROS node in the computation graph), whereas an object may be an instance of a particular subsystem (e.g. a ROS topic), and access is defined as the capability to act upon that object (e.g. publish or subscribe).
36
36
37
37
### Mandatory Access Control
38
38
@@ -99,11 +99,33 @@ Attributes:
99
99
-**version**: declared version of schema version in use
100
100
- Allows for advancing future revisions of the schema
101
101
102
-
### `<profiles>` Tag
102
+
### `<enclaves>` Tag
103
103
104
-
Encapsulates a sequence of unique profiles.
104
+
Encapsulates a sequence of unique enclaves.
105
105
This method of nesting sequences allows for additional tags to be extended to the `<policy>` root.
106
106
107
+
### `<enclave>` Tag
108
+
109
+
Encapsulates a collection of profiles.
110
+
This is specific to an enclave as determined by associative attributes.
111
+
112
+
Attributes:
113
+
-**path**: Fully qualified enclave path
114
+
115
+
Given that multiple nodes can be composed into a single process, an enclave is used to contain the collection of profiles of all respective nodes.
116
+
An enclave may therefore be considered the union of contained profiles.
117
+
Note that the union of profiles within an enclave will result in denied privileges of any profile to supersede all allowed privileges for every profile.
118
+
E.g. if a profile asks for a permission but a matching permission has been explicitly denied by another profile in the enclave, the deny rule will take precedence.
119
+
See section `<profile>` Tag for more info on how MAC is applied.
120
+
121
+
### `<profiles>` Tag
122
+
123
+
Encapsulates a sequence of unique profiles and designated metadata.
124
+
This method of nesting sequences allows for additional tags to be extended to the `<enclave>` root, as well as associating particular metadata or constraints to the contained profile elements.
125
+
126
+
Attributes:
127
+
-**type**: Specifies the transport type of profiles and metadata
128
+
107
129
### `<profile>` Tag
108
130
109
131
Encapsulates a collection of subject privileges.
@@ -119,6 +141,19 @@ That is to say the priority of denied privileges conservatively supersedes allow
119
141
This method of flatting privileges enables users to provision general access to a larger set of objects, while simultaneously revoking access to a smaller subset of sensitive objects.
120
142
Although recursion of qualifiers is subsequently prevented, transformations are subsequently simplified, preventing potential for unintended access.
121
143
144
+
### `<metadata>` Tag
145
+
146
+
Encapsulates arbitrary metadata or constraints.
147
+
This could include transport specific permission details applicable to sibling profile elements.
148
+
There can only one `metadata` element per `profiles` parent element.
149
+
150
+
Attributes:
151
+
- To be defined
152
+
153
+
Given the use cases for bridge interfaces where an enclave's credentials may be used to interconnect across multiple transports or to transport specific domains, it may be necessary to qualify certain profile sequences with particular constraints, while doing so multiple times for separate profiles per enclave.
154
+
This allows advanced users to holistically control the intersect of permissions across transport domains, while retaining accurate model fidelity of security permissions.
155
+
Given how security sensitive bridge interfaces are and the attack surface they expose, it is vital that information flow control within a bridge remains formally verifiable for safe and secure operation.
156
+
122
157
#### Privileges
123
158
124
159
Privileges are defined as configuration of rules and permissions for object access.
@@ -286,8 +321,8 @@ Yet, if the intended purpose of SROS 2 policy becomes that of an intermediate re
286
321
ROS 2 allows for the remapping of many namespaced subsystems at runtime, such as when reusing launch files to orchestrate larger applications.
287
322
While it is perhaps unreasonable to expect this dynamic flexibility from staticky provisioned permissions without allocating such capabilities prior, it should be made possible to infer the necessary capabilities from composed launch files and similar orchestrations.
288
323
289
-
Static analysis of such remapping in conjunction with the context of the nominal requirements of respective nodes could be used to auto generate the new satisfactory policies.
290
-
However, inferring such context from the source code could be equated to the halting problem.
324
+
Static analysis of such remapping in conjunction with the setting of the nominal requirements of respective nodes could be used to auto generate the new satisfactory policies.
325
+
However, inferring such policies from the source code could be equated to the halting problem.
291
326
Thus, it stands to reason nodes could instead provide a manifest or IDL defining these nominal requirements so that permission may as easily be remapped, at least at design time.
Copy file name to clipboardExpand all lines: articles/ros2_dds_security.md
+43-43Lines changed: 43 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ Let's delve a little further into those first three plugins.
45
45
46
46
## Authentication
47
47
48
-
The **Authentication** plugin (see section 8.3 of the [DDS-Security spec][dds_security]) is central to the entire SPI architecture, as it provides the concept of a confirmed identity without which further enforcement would be impossible (e.g. it would be awfully hard to make sure a given ROS node could only access specific topics if it was impossible to securely determine which node it was).
48
+
The **Authentication** plugin (see section 8.3 of the [DDS-Security spec][dds_security]) is central to the entire SPI architecture, as it provides the concept of a confirmed identity without which further enforcement would be impossible (e.g. it would be awfully hard to make sure a given ROS identity could only access specific topics if it was impossible to securely determine which identity it was).
49
49
50
50
The SPI architecture allows for a number of potential authentication schemes, but ROS 2 uses the builtin authentication plugin (called "DDS:Auth:PKI-DH", see section 9.3 of the [DDS-Security spec][dds_security]), which uses the proven Public Key Infrastructure (PKI).
51
51
It requires a public and private key per domain participant, as well as an x.509 certificate that binds the participant's public key to a specific name.
@@ -114,7 +114,7 @@ Let's discuss each of these in turn.
114
114
### Security files for each domain participant
115
115
116
116
As stated earlier, the DDS-Security plugins require a set of security files (e.g. keys, governance and permissions files, etc.) per domain participant.
117
-
Domain participants map to a specific instance of a node in ROS 2, so each node requires a set of these files.
117
+
Domain participants map to a context within process in ROS 2, so each process requires a set of these files.
118
118
RCL supports being pointed at a directory containing security files in two different ways:
119
119
120
120
- Directory tree of all security files.
@@ -125,72 +125,72 @@ Let's delve further into these.
125
125
126
126
#### Directory tree of all security files
127
127
128
-
RCL supports finding security files in one directory that is the root of a directory structure corresponding to the fully-qualified names of every node instance (i.e. namespace + node name).
129
-
For example, for the `/front/camera`node, the directory structure would look like:
128
+
RCL supports finding security files in one directory that is inside the reserved `enclaves` subfolder, within the root keystore, corresponding to the fully-qualified path of every enclave.
129
+
For example, for the `/front/camera`enclave, the directory structure would look like:
130
130
131
131
<root>
132
-
└── front
133
-
└── camera
134
-
├── cert.pem
135
-
├── key.pem
136
-
├── ...
132
+
├── enclaves
133
+
│ └── front
134
+
│ └── camera
135
+
│ ├── cert.pem
136
+
│ ├── key.pem
137
+
│ ├── ...
138
+
└── public
139
+
├── ...
137
140
138
-
To be clear: this directory structure needs to reflect the state of the running system.
139
-
In other words, it does not contain a set of files per node on disk, but per node instance _in the ROS graph_.
140
-
141
-
The set of files expected within each node instance directory are:
141
+
The set of files expected within each enclave instance directory are:
142
142
143
143
-**identity_ca.cert.pem**: The x.509 certificate of the CA trusted by the **Authentication** plugin (the "Identity" CA).
144
-
-**cert.pem**: The x.509 certificate of this node instance (signed by the Identity CA).
145
-
-**key.pem**: The private key of this node instance.
144
+
-**cert.pem**: The x.509 certificate of this enclave instance (signed by the Identity CA).
145
+
-**key.pem**: The private key of this enclave instance.
146
146
-**permissions_ca.cert.pem**: The x.509 certificate of the CA trusted by the **Access control** plugin (the "Permissions" CA).
147
147
-**governance.p7s**: The XML document that specifies to the **Access control** plugin how the domain should be secured (signed by the Permissions CA).
148
-
-**permissions.p7s**: The XML document that specifies the permissions of this particular node instance to the **Access control** plugin (also signed by the Permissions CA).
149
-
150
-
This can be specified by setting the `$ROS_SECURITY_ROOT_DIRECTORY` environment variable to point to the root of the directory tree.
151
-
152
-
153
-
##### Support security files lookup methods
148
+
-**permissions.p7s**: The XML document that specifies the permissions of this particular enclave instance to the **Access control** plugin (also signed by the Permissions CA).
154
149
155
-
If using the directory tree approach to organize security files, RCL supports two different methods for looking up a given node instance's security files in the tree:
156
-
157
-
-**Exact**: Only load security files from a directory exactly matching the fully-qualified name of the node instance.
158
-
For example, given a node named "baz_123" within the "/foo/bar/" namespace, only load security files from `<root>/foo/bar/baz_123/`.
159
-
This is the default behavior.
160
-
-**Prefix**: Attempt to load the most specific set of security files, but if they can't be found, check for security files under a less-specific node name.
161
-
For example, given a node named "baz_123" within the "/foo/bar/" namespace, load security files from `<root>/foo/bar/baz_123/`.
162
-
However, if that directory doesn't exist, find the most specific (i.e. longest) node name that _does_ have security files within that namespace (e.g. `<root>/foo/bar/baz_12/`, or `<root>/foo/bar/baz/`, etc.).
163
-
Note that it will not search higher in the namespace hierarchy.
164
-
165
-
The desired lookup method can be specified by setting the `$ROS_SECURITY_LOOKUP_TYPE` environment variable to "MATCH_EXACT" (case-sensitive) for the **Exact** method, or "MATCH_PREFIX" (case-sensitive) for the **Prefix** method.
150
+
This can be specified by setting the `ROS_SECURITY_KEYSTORE` environment variable to point to the root of the keystore directory tree, and then specifying the enclave path using the `--ros-args` runtime argument `-e`, `--enclave`, e.g.:
ros2 run <package><executable> --ros-args --enclave="/front/camera"
155
+
```
167
156
168
157
#### Manual specification
169
158
170
-
RCL supports specifying the path to a directory containing the set of security files for the exact node instance that needs to be launched.
171
-
The set of files expected within that directory are the same as outlined in the "Directory tree of all security files" section above for individual node instance directories.
159
+
RCL also supports specifying the enclave path for the process that needs to be launched using an overriding environmental variable.
160
+
This can be done by setting the `ROS_SECURITY_ENCLAVE_OVERRIDE` environment variable to an alternate enclave path within the keystore.
161
+
Note that this setting takes precedence over `ROS_SECURITY_KEYSTORE` with `--enclave`.
162
+
163
+
Note that the following two examples load from the same enclave path as demonstrated prior:
172
164
173
-
This can be specified by setting the `$ROS_SECURITY_NODE_DIRECTORY` environment variable to point to the directory containing the security files.
174
-
Note that this setting takes precedence over `$ROS_SECURITY_ROOT_DIRECTORY`.
ros2 run <package><executable> --ros-args --enclave="/spam"
175
+
```
176
176
177
177
### Support for both permissive and strict enforcement of security
178
178
179
-
Nodes with the security features enabled will not communicate with nodes that don't, but what should RCL do if one tries to launch a node that has no discernable keys/permissions/etc.? It has two options:
179
+
Participants with the security features enabled will not communicate with participants that don't, but what should RCL do if one tries to launch a participant that has no discernable enclave with keys/permissions/etc.? It has two options:
180
180
181
-
-**Permissive mode**: Try to find security files, and if they can't be found, launch the node without enabling any security features.
181
+
-**Permissive mode**: Try to find security files, and if they can't be found, launch the participant without enabling any security features.
182
182
This is the default behavior.
183
-
-**Strict mode**: Try to find security files, and if they can't be found, fail to run the node.
183
+
-**Strict mode**: Try to find security files, and if they can't be found, fail to run the participant.
184
184
185
-
The type of mode desired can be specified by setting the `$ROS_SECURITY_STRATEGY` environment variable to "Enforce" (case-sensitive) for strict mode, and anything else for permissive mode.
185
+
The type of mode desired can be specified by setting the `ROS_SECURITY_STRATEGY` environment variable to "Enforce" (case-sensitive) for strict mode, and anything else for permissive mode.
186
186
187
187
188
188
### Support for a master "on/off" switch for all SROS 2 features
189
189
190
190
In addition to the supported features just discussed, RCL also supports a master shutoff for security features for easy experimentation.
191
191
If it's turned off (the default), none of the above security features will be enabled.
192
192
193
-
In order to enable SROS 2, set the `$ROS_SECURITY_ENABLE` environment variable to "true" (case-sensitive).
193
+
In order to enable SROS 2, set the `ROS_SECURITY_ENABLE` environment variable to "true" (case-sensitive).
194
194
To disable, set to any other value.
195
195
196
196
@@ -202,9 +202,9 @@ However, the [SROS 2 CLI](https://github.com/ros2/sros2) should include a tool `
202
202
203
203
- Create Identity and Permissions CA.
204
204
- Create directory tree containing all security files.
205
-
- Create a new identity for a given node instance, generating a keypair and signing its x.509 certificate using the Identity CA.
205
+
- Create a new identity for a given enclave, generating a keypair and signing its x.509 certificate using the Identity CA.
206
206
- Create a governance file that will encrypt all DDS traffic by default.
207
-
- Support specifying node instance permissions [in familiar ROS terms](/articles/ros2_access_control_policies.html) which are then automatically converted into low-level DDS permissions.
207
+
- Support specifying enclave permissions [in familiar ROS terms](/articles/ros2_access_control_policies.html) which are then automatically converted into low-level DDS permissions.
208
208
- Support automatically discovering required permissions from a running ROS system.
0 commit comments