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
With the updated permissions in place, we can launch the node successfully using the same command used in prior tutorials:
127
127
128
-
.. code-block:: bash
128
+
.. code-block:: console
129
129
130
-
ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker
130
+
$ ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker
131
131
132
132
However, attempting to remap the ``chatter`` topic prevents the node from launching (note that this requires the ``ROS_SECURITY_STRATEGY`` set to ``Enforce``).
133
133
134
-
.. code-block:: bash
134
+
.. code-block:: console
135
135
136
-
ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker \
136
+
$ ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker \
137
137
--remap chatter:=not_chatter
138
138
139
139
@@ -146,39 +146,39 @@ Let's creates a policy for both the ``talker`` and the ``listener`` to only use
146
146
147
147
Begin by downloading the ``sros2`` repository with the sample policy files:
In the same working directory ``~/security_gd_tutorial``, run:
145
+
In the same working directory ``~/security_gd_tutorial``, to start the example run:
149
146
150
-
.. code-block:: bash
147
+
.. code-block:: console
151
148
152
-
# Start the example
153
-
docker compose -f compose.deployment.yaml up
149
+
$ docker compose -f compose.deployment.yaml up
154
150
155
151
This should result in the following output:
156
152
@@ -162,19 +158,22 @@ This should result in the following output:
162
158
Examining the containers
163
159
^^^^^^^^^^^^^^^^^^^^^^^^
164
160
165
-
While having the containers running that simulate the two remote devices for this tutorial, attach to each of them by opening two different terminals and enter:
161
+
While having the containers running that simulate the two remote devices for this tutorial, attach to each of them by opening two different terminals.
162
+
In the first terminal, run:
166
163
167
-
.. code-block:: bash
164
+
.. code-block:: console
168
165
169
-
# Terminal 1
170
-
docker exec -it tutorial-listener-1 bash
171
-
cd keystore
172
-
tree
166
+
$ docker exec -it tutorial-listener-1 bash
167
+
$ cd keystore
168
+
$ tree
173
169
174
-
# Terminal 2
175
-
docker exec -it tutorial-talker-1 bash
176
-
cd keystore
177
-
tree
170
+
In the second terminal, run:
171
+
172
+
.. code-block:: console
173
+
174
+
$ docker exec -it tutorial-talker-1 bash
175
+
$ cd keystore
176
+
$ tree
178
177
179
178
A similar output to the one depicted below should be obtained:
Copy file name to clipboardExpand all lines: source/Tutorials/Advanced/Security/Examine-Traffic.rst
+41-44Lines changed: 41 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -46,10 +46,10 @@ Install ``tcpdump``
46
46
Begin in a new terminal window by installing `tcpdump <https://www.tcpdump.org/manpages/tcpdump.1.html>`_, a command-line tool for capturing and displaying network traffic.
47
47
Although this tutorial describes ``tcpdump`` commands, you can also use `Wireshark <https://www.wireshark.org/>`_, a similar graphical tool for capturing and analyzing traffic.
48
48
49
-
.. code-block:: bash
49
+
.. code-block:: console
50
50
51
-
sudo apt update
52
-
sudo apt install tcpdump
51
+
$ sudo apt update
52
+
$ sudo apt install tcpdump
53
53
54
54
Run following commands on a single machine through multiple ``ssh`` sessions.
55
55
@@ -58,17 +58,19 @@ Start the talker and listener
58
58
59
59
Start both the talker and the listener again, each in its own terminal.
60
60
The security environment variables are not set so security is not enabled for these sessions.
61
+
In one terminal run:
61
62
62
-
.. code-block:: bash
63
+
.. code-block:: console
63
64
64
-
# Disable ROS Security for both terminals
65
-
unset ROS_SECURITY_ENABLE
65
+
$ unset ROS_SECURITY_ENABLE
66
+
$ ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker
66
67
67
-
# In terminal 1:
68
-
ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker
68
+
In another terminal run:
69
69
70
-
# In terminal 2:
71
-
ros2 run demo_nodes_cpp listener --ros-args --enclave /talker_listener/listener
70
+
.. code-block:: console
71
+
72
+
$ unset ROS_SECURITY_ENABLE
73
+
$ ros2 run demo_nodes_cpp listener --ros-args --enclave /talker_listener/listener
72
74
73
75
74
76
Display unencrypted discovery packets
@@ -79,12 +81,9 @@ You need to use ``sudo`` since reading raw network traffic is a privileged opera
79
81
80
82
The command below uses the ``-X`` option to print packet contents, the ``-i`` option to listen for packets on any interface, and captures only `UDP <https://en.wikipedia.org/wiki/User_Datagram_Protocol>`_ port 7400 traffic.
81
83
82
-
.. code-block:: bash
83
-
84
-
sudo tcpdump -X -i any udp port 7400
85
-
86
-
You should see packets like the following::
84
+
.. code-block:: console
87
85
86
+
$ sudo tcpdump -X -i any udp port 7400
88
87
20:18:04.400770 IP 8_xterm.46392 > 239.255.0.1.7400: UDP, length 252
@@ -109,14 +108,12 @@ Some other features of a typical discovery packet:
109
108
Display unencrypted data packets
110
109
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111
110
112
-
Use ``tcpdump`` to capture non-discovery RTPS packets by filtering on UDP ports above 7400:
111
+
Use ``tcpdump`` to capture non-discovery RTPS packets by filtering on UDP ports above 7400.
112
+
You will see few different types of packets, but watch for something like the following which is obviously data being sent from a talker to a listener:
113
113
114
-
.. code-block:: bash
115
-
116
-
sudo tcpdump -i any -X udp portrange 7401-7500
117
-
118
-
You will see few different types of packets, but watch for something like the following which is obviously data being sent from a talker to a listener::
114
+
.. code-block:: console
119
115
116
+
$ sudo tcpdump -i any -X udp portrange 7401-7500
120
117
20:49:17.927303 IP localhost.46392 > localhost.7415: UDP, length 84
0 commit comments