Skip to content

Commit 65b581e

Browse files
author
Murilo Marinho
committed
[cybersecurity] Improving the networking section.
1 parent e1c4dce commit 65b581e

2 files changed

Lines changed: 76 additions & 7 deletions

File tree

docs/source/cybersecurity/cryptography.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ Public-key cryptosystems
77

88
This is obviously a simplified discussion of the topic.
99

10+
ROS2 Security
11+
+++++++++++++
12+
13+
.. seealso::
14+
15+
Official information: https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Security.html
16+
17+
There are facilities in :program:`ROS2` to enable secure communication. The communication uses cryptography which
18+
will be shown in the following section. It is important to know that such capability exists. It will have a number
19+
of steps needed to create the necessary certificates to guarantee security among nodes.
20+
21+
After that is set up, nodes and program:`ros2cli` tools can be called with additional security.
22+
23+
.. seealso::
24+
25+
Official information https://docs.ros.org/en/jazzy/Tutorials/Advanced/Security/Introducing-ros2-security.html
26+
27+
Altering these settings can have unwanted side effects to other parts of the tutorial so we will leave this topic
28+
only briefly mentioned. In addition, understanding these topics requires first understanding public-key cryptography, shown below.
29+
30+
Scope of this section
31+
+++++++++++++++++++++
32+
1033
Most of the important infrastructure for software for robotics relies heavily the concept of public-key cryptosystems.
1134
Many attribute this concept to as early as `1977 <https://patents.google.com/patent/US4405829>`_, in one type of encryption
1235
algorithm (`RSA <https://en.wikipedia.org/wiki/RSA_cryptosystem>`_) that is still in use.

docs/source/cybersecurity/network.rst

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,57 @@
1-
Network topologies
2-
==================
1+
Network
2+
=======
33

44
.. include:: ../the_topic_is_under_heavy_construction.rst
55

66
There is plenty of software that can be used to protect your network. One of these is :program:`ufw`, the `uncomplicated
77
firewall <https://en.wikipedia.org/wiki/Uncomplicated_Firewall>`_. These are good to some extent and I suppose will
8-
always be part of the security suite of companies and institutions.
8+
always be part of the security suite of companies and institutions. However, firewalls have a specific role and must
9+
be assisted by other forms of network safety.
910

10-
Also, as part of :program:`ROS2` there is the concept of `ROS_DOMAIN_ID <https://docs.ros.org/en/foxy/Concepts/About-Domain-ID.html>`_.
11+
A brief word on ROS2 networking
12+
+++++++++++++++++++++++++++++++
13+
14+
.. seealso::
15+
16+
Official information https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Domain-ID.html
17+
18+
:program:`ROS2` has the so-called ``ROS_DOMAIN_ID``.
1119
Although this concept exists, it should not be confused with a security measure. Each participant in the network can
1220
easily switch to another ``ROS_DOMAIN_ID`` without authentication or central management. It can be seen as merely a
1321
local filter.
1422

23+
To find :program:`ROS2` nodes, :program:`ROS2` makes use of `multicast <https://en.wikipedia.org/wiki/Multicast>`_. The `port <https://en.wikipedia.org/wiki/Port_(computer_networking)>`_ used
24+
will depend on the ``ROS_DOMAIN_ID``. More tinkering is needed if you want to specify which network interface will be
25+
used by :program:`ROS2`. This could also depend on the `underlying DDS implementation <https://robotics.stackexchange.com/questions/98466/how-to-specify-the-network-interface-ros2-uses-for-communication>`_.
26+
27+
In :program:`ROS2`, nodes communicate peer-to-peer, in the sense that there's no central node as it used to exist in :program:`ROS1`.
28+
Each node will be assigned two ports to communicate. The specific port number will depend on the ``ROS_DOMAIN_ID``. This
29+
is how the domains can be filtered. However, this is not a strict isolation.
30+
31+
.. seealso::
32+
33+
Official information https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Quality-of-Service-Settings.html
34+
35+
Another benefit of :program:`ROS2` is being able to choose connection types. For instance, :program:`ROS1` supported
36+
only `TCP <https://en.wikipedia.org/wiki/Transmission_Control_Protocol>`_ which can be slow. In contrast, :program:`ROS2`
37+
accepts different levels of expectations in transmission protocols, and can suppose `UDP <https://en.wikipedia.org/wiki/User_Datagram_Protocol>`_
38+
which is usually more suitable for streaming information, such as camera images and sensor data.
39+
40+
Given that :program:`ROS2` will also work through properly configured unreliable networks (e.g. Wi-Fi at some distance),
41+
you might be confronted with cases in which your nodes seemingly stop working. In this case, you have to choose the
42+
correct Quality of Service (QoS) settings to make sure your nodes can communicate reliably.
43+
44+
Network Topologies
45+
++++++++++++++++++
46+
47+
.. important::
48+
49+
None of these measures provide full protection on their own. An attacker with an ethernet cable and access to a local
50+
port can easily access the entire robot infrastructure of unsuspecting laboratories. It is important to make sure
51+
that all robot software, whenever possible, is fully security patched. In addition, it's important to make sure
52+
that all user account passwords with a decent level of security. Leaving the robot with the factory password means
53+
an attacker can easily login locally or remotely.
54+
1555
An aspect that is often ignored in robotics labs are the physical network topologies, which are important for safety.
1656
This safety is not only for cybersecurity reasons. Yes, your robot's computer can be attacked if it's exposed. However,
1757
in development environments, you might inadvertently move someone else's robot. In these scenarios it will be much
@@ -22,7 +62,7 @@ This section will be based on my experience with multiple robotic systems. Two r
2262
and :footcite:p:`Marinho2024`.
2363

2464
Case 1 - No isolation
25-
+++++++++++++++++++++
65+
---------------------
2666

2767
A common network architecture in small companies and laboratories is shown below.
2868

@@ -63,7 +103,7 @@ computer, that can easily be the first door into any other resource in the netwo
63103
somehow to a robot it does not make it less of a computer. It just, usually, makes it easier to exploit the computer.
64104

65105
Case 2 - Subnet isolation
66-
+++++++++++++++++++++++++
106+
-------------------------
67107

68108
A somewhat better network architecture is shown below, because there is one extra layer of isolation. The main difference
69109
here is that different parts of the company have their own subnets.
@@ -103,7 +143,7 @@ Although ``ROS_DOMAIN_ID`` can help to filter out unwanted messages, it is too e
103143
it is expected that people with a minimal understanding of networking would isolate their setup further.
104144

105145
Case 3 - Platform isolation
106-
+++++++++++++++++++++++++++
146+
---------------------------
107147

108148
A possibly sufficient setup for most robotic demonstrators that need isolation is shown below.
109149

@@ -134,6 +174,12 @@ In this setup, you can imagine each robotic demonstrator having their own, isola
134174
achieved physically using a `switching hub <https://en.wikipedia.org/wiki/Network_switch>`_. This type of physical isolation
135175
of interfaces tends to be beneficial in development environments where software infrastructure is often changing.
136176

177+
This is also beneficial in terms of bandwidth. In large robotics laboratories when using a shared network the bandwidth
178+
will also be shared. This might be less of a problem when usage is not concentrated. However, it is common for these
179+
laboratories to have open days or engagement sessions with stakeholders. In these sessions, a large number of robots
180+
and sensors might need to share the same network. When the day arrives, it's already late to fix the network topology.
181+
Thence, it is recommended to reflect on situations such as these when assessing demonstrator needs.
182+
137183
.. admonition:: References
138184

139185
.. footbibliography::

0 commit comments

Comments
 (0)