Skip to content

Commit 072fcb2

Browse files
committed
Update book and structure
1 parent 7fdc456 commit 072fcb2

30 files changed

+565
-79
lines changed

1_reconnaissance/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
\newpage
2+
3+
# Reconnaissance

1_reconnaissance/robot_footprinting/tutorial1/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Footprinting ROS systems
1+
\newpage
2+
3+
## Footprinting ROS systems
24

35
Footprinting, (also known as *reconnaissance*) is the technique used for gathering information about digital systems and the entities they belong to. To get this information, a security analyst might use various tools and technologies. This information is very useful when performing a series attacks over an specific system.
46

@@ -21,18 +23,22 @@ docker run --privileged -it basic_cybersecurity_footprinting1:latest
2123
### ROS footprinting basics
2224

2325
The first thing we do to test the capabilities of `aztarna` is to get a container with the right dependencies and the tool installed:
26+
2427
~~~smallcontent
2528
```bash
29+
2630
# from this directory:
2731
docker build -t basic_cybersecurity_footprinting1:latest .
2832
...
33+
2934
```
3035
~~~
3136

3237
Let's launch an instance of ROS in the default port and see how `aztarna` can detect it:
3338

3439
~~~smallcontent
3540
```bash
41+
3642
docker run --privileged -it basic_cybersecurity_footprinting1:latest
3743
root@3c22d4bbf4e1:/# roscore -p 11311 &
3844
root@3c22d4bbf4e1:/# roscore -p 11317 &

1_reconnaissance/robot_footprinting/tutorial2/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Footprinting Secure ROS systems
1+
\newpage
2+
3+
## Footprinting Secure ROS systems
24

35
Following from the previous tutorial, in this one we'll analyze secure ROS setups using the SROS package.
46

2_robot_vulnerabilities/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
\newpage
2+
3+
# Robot vulnerabilities

2_robot_vulnerabilities/tutorial1/README.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Robot sanitizers in ROS 2 Dashing
1+
\newpage
2+
3+
## Robot sanitizers in ROS 2 Dashing
24

35
Sanitizers are dynamic bug finding tools[1]. In this tutorial we'll use some common and open source sanitizers over the ROS 2 codebase. In particular, by reproducing previously available results[2,3], we'll review the security status of ROS 2 Dashing Diademata.
46

57
The first few sections provide a walkthrough on the attempt to make things run in OS X. The sections that follow automate the process through a Docker container.
68

7-
## OS X
9+
### OS X
810

911
<details><summary>Setup in OS X, natively</summary>
1012

@@ -58,8 +60,8 @@ touch src/ros2/common_interfaces/trajectory_msgs/COLCON_IGNORE
5860

5961
```
6062

61-
### Compile the code with sanitizers enabled (OS X)
62-
#### AddressSanitizer (ASan)
63+
#### Compile the code with sanitizers enabled (OS X)
64+
##### AddressSanitizer (ASan)
6365
For ASan[6] we compile the ROS 2 Dashing code as follows:
6466
```bash
6567
# Get last version of FastRTPS
@@ -91,7 +93,7 @@ colcon test --build-base=build-asan --install-base=install-asan \
9193
--event-handlers sanitizer_report+ --packages-up-to test_communication
9294
```
9395

94-
#### ThreadSanitizer (TSan)
96+
##### ThreadSanitizer (TSan)
9597
For TSan[7] TODO
9698
```bash
9799
# Build the code with tsan
@@ -108,8 +110,8 @@ colcon test --build-base=build-tsan --install-base=install-tsan \
108110
--event-handlers sanitizer_report+ --packages-up-to test_communication
109111
```
110112

111-
### Known Issues
112-
#### Linking issues in FastRTPS when enabling security
113+
#### Known Issues
114+
##### Linking issues in FastRTPS when enabling security
113115
The following happens with the version included in the Dashing Release:
114116
```bash
115117
--- stderr: fastrtps
@@ -131,7 +133,7 @@ Failed <<< fastrtps [ Exited with code 2 ]
131133

132134
Solution: install latest version of Fast-RTPS
133135

134-
#### Results of the test indicate `Interceptors are not working. This may be because AddressSanitizer is loaded too late ... interceptors not installed`
136+
##### Results of the test indicate `Interceptors are not working. This may be because AddressSanitizer is loaded too late ... interceptors not installed`
135137

136138
```bash
137139
...
@@ -159,7 +161,7 @@ DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Toolchains/Xcod
159161
```
160162
</details>
161163

162-
## Docker
164+
### Docker
163165
```bash
164166
docker build -t basic_cybersecurity_vulnerabilities1:latest .
165167
docker run --privileged -it -v /tmp/log:/opt/ros2_asan_ws/log basic_cybersecurity_vulnerabilities1:latest /bin/bash
@@ -171,8 +173,8 @@ colcon test --build-base=build-asan --install-base=install-asan \
171173
```
172174
results are under `/tmp/log`.
173175

174-
## Analyzing results
175-
### Analyzing example
176+
### Analyzing results
177+
#### Analyzing example
176178
I'll try and analyze here the example provided at https://github.com/colcon/colcon-sanitizer-reports/blob/master/README.rst before jumping into a new one to gain additional understanding:
177179

178180
It appears that ASan detected memory leaks in the `rcpputils` module:
@@ -226,7 +228,7 @@ Direct leak of 4 byte(s) in 1 object(s) allocated from:
226228
Inspecting the dumps, there seems to be an issue in `test_basic` related to `FakeGuarded::FakeGuarded()`. In particular, this [line](https://github.com/ros2/rcpputils/pull/9/files#diff-be1f2d1334d30376c4dec7b53eda0f55L247) wasn't necessary and was replaced by a destructor instead.
227229

228230

229-
### Processing new bugs
231+
#### Processing new bugs
230232
Let's now analyze a new bug and try to reason about it. Let's take the first the `sanitizer_report.csv` generated and from it, the first item (dumped at [sanitizer_report_ros2dashing_asan.csv](sanitizer_report_ros2dashing_asan.csv)):
231233

232234
```bash
@@ -321,7 +323,7 @@ A complete report with all the bugs found is available at [sanitizer_report_ros2
321323

322324
A further discussion into this bug and an analysis with GDB is available at [tutorial3](../tutorial3).
323325

324-
## Looking for bugs and vulnerabilities with ThreadSanitizer (TSan)
326+
### Looking for bugs and vulnerabilities with ThreadSanitizer (TSan)
325327

326328
Similar to ASan, we can use the ThreadSanitizer:
327329

@@ -335,7 +337,7 @@ A complete report with all the bugs found is available at [sanitizer_report_ros2
335337

336338

337339

338-
## Resources
340+
### Resources
339341
- [1] https://arxiv.org/pdf/1806.04355.pdf
340342
- [2] https://discourse.ros.org/t/introducing-ros2-sanitizer-report-and-analysis/9287
341343
- [3] https://github.com/colcon/colcon-sanitizer-reports/blob/master/README.rst

2_robot_vulnerabilities/tutorial2/README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Robot sanitizers in MoveIt 2
1+
\newpage
2+
3+
## Robot sanitizers in MoveIt 2
24

35
In this tutorial we'll apply the robot santizers over the the moveit2 alpha release code and review the results. This tutorial builds on top of [tutorial1](../tutorial1/), originally inspired by [1].
46

5-
## Looking for bugs and vulnerabilities in MoveIt 2 with AddressSanitizer (ASan)
7+
### Looking for bugs and vulnerabilities in MoveIt 2 with AddressSanitizer (ASan)
68
We'll dockerize the process to simplify reproduction of results.
79
Let's compile the moveit2 code with the right flags for dynamic bugs finding:
810

@@ -65,7 +67,7 @@ colcon list --packages-up-to moveit_core --topological-graph-dot | dot -Tpng -o
6567

6668
Both, `geometric_shapes` and `moveit_core` depend on quite a few other packages so one would probably pick `octomap` for starters and try fixing that bug first scaliting into other packages.
6769

68-
### Fixing bugs
70+
#### Fixing bugs
6971
As per the original [report](https://gist.github.com/vmayoral/25b3cff2c954b099eeb4d1471c1830e2) the `moveit_core` related bug detected by ASan is listed below:
7072

7173
```bash
@@ -196,7 +198,7 @@ root@bf916bb1a977:/opt/ros2_moveit2_ws# build-asan/moveit_core/planning_scene/te
196198
[ PASSED ] 6 tests.
197199
```
198200
199-
## Looking for bugs and vulnerabilities in MoveIt 2 with ThreadSanitizer (TSan)
201+
### Looking for bugs and vulnerabilities in MoveIt 2 with ThreadSanitizer (TSan)
200202
201203
To use TSan [3] we rebuild the container (uncommenting and commenting the right sections) access it and manually launch the tests:
202204
@@ -208,7 +210,7 @@ colcon test --build-base=build-tsan --install-base=install-tsan --event-handlers
208210
209211
No issues where found while running TSan (up until `moveit_core`).
210212
211-
## Resources
213+
### Resources
212214
- [1] https://github.com/colcon/colcon-sanitizer-reports/blob/master/README.rst
213215
- [2] https://discourse.ros.org/t/exploring-package-dependencies/4719
214216
- [3] TSan Cpp manual https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual

0 commit comments

Comments
 (0)