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
docker compose -f docker/docker-compose.yml up --build -d
172
173
```
@@ -182,6 +183,60 @@ The pipeline starts immediately and listens for DICOM C-STORE requests on port `
182
183
183
184
---
184
185
186
+
## Security
187
+
188
+
This project supports **ROS 2 Security (SROS2)** to protect sensitive patient data transmitted over the network. When enabled, SROS2 provides authentication, encryption, and access control for all internal topics, including the raw `/dicom_interfaces/Dicom` message and the derived `/dicom_study_info` topic.
189
+
190
+
### Enabling Security
191
+
192
+
Security is enabled by default in the provided `docker-compose.yml` file via environment variables. On the first run, a script generates a security keystore containing the necessary keys and certificates for all pipeline nodes. This keystore is persisted in a Docker volume named `keystore`.
193
+
194
+
> **Note:** The initial key generation is a one-time process. If the container is stopped during this first run, the security volume may be left in a corrupted state. If this happens, you will need to manually remove the Docker volume (`docker volume rm <project>_keystore`) before restarting the container.
195
+
196
+
### Accessing Secured Topics from Your Application
197
+
198
+
By default, only the internal `dicom_to_ros` nodes can communicate. To grant your own ROS 2 node access to a secured topic (e.g., `/dicom_study_info`):
199
+
200
+
1.**Add a Profile to the Policy:** Open `dicom_to_ros/dicom_to_ros/security/permissions.xml` and add a new `<profile>` for your node inside the `<profiles>` block. You must grant it permissions to the system topics (`/rosout`, `/parameter_events`) and services (`~/*`) in addition to any data topics.
201
+
202
+
*Example for a node named `my_subscriber` that needs to read study info:*
203
+
```xml
204
+
<profilens="/dicom_to_ros"node="my_subscriber">
205
+
<topicssubscribe="ALLOW">
206
+
<topic>/dicom_to_ros/dicom_study_info</topic>
207
+
<topic>/parameter_events</topic>
208
+
</topics>
209
+
<topicspublish="ALLOW">
210
+
<topic>/rosout</topic>
211
+
<topic>/parameter_events</topic>
212
+
</topics>
213
+
<servicesreply="ALLOW">
214
+
<service>~/*</service>
215
+
</services>
216
+
</profile>
217
+
```
218
+
2. **Regenerate the Keystore:** The security artifacts must be regenerated to include your new node. Bring down the pipeline and remove the old keystore volume.
219
+
```bash
220
+
docker compose -f docker/docker-compose.yml down -v
221
+
```
222
+
3. **Restart the Pipeline:** The entrypoint script will automatically generate a new keystore that includes keys and permissions for your node.
223
+
```bash
224
+
docker compose -f docker/docker-compose.yml up -d
225
+
```
226
+
4. **Launch Your Node:** When you launch your application, ensure it joins the correct namespace and enclave.
227
+
```python
228
+
# Example in a Python launch file
229
+
Node(
230
+
package='my_package',
231
+
executable='my_subscriber_node',
232
+
name='my_subscriber',
233
+
namespace='/dicom_to_ros',
234
+
ros_arguments=['--enclave', '/dicom_to_ros']
235
+
)
236
+
```
237
+
238
+
---
239
+
185
240
## Demo
186
241
187
242
For a more detailed demo, please check the [dicom_to_ros_demo](dicom_to_ros_demo/README.md) folder.
0 commit comments