For the development of drone simulation with attacker modelling using runtime enforcers.
Requirements:
- Python (it is expected that you have an understanding of python too)
- ArduPilot
- Dronekit
Note: this was all done on a Windows 10 PC
ArduPilot is the most advanced, full-featured, and reliable open source autopilot software available. (Quote from the ArduPilot project repo)
We will be using ArduPilot Copter. Wiki link.
Follow these instructions to setup ArduPilot..
I installed on Windows 10, it was a hassle, I do not recommend. The provided powershell script was what got it running in the end. Running random scripts people tell you to is always bad. Read it first, it isn't long.
Then I needed to:
- Clone ArduPilot repo
git clone https://github.com/ardupilot/ardupilot
- (Must be Cygwin from here) Update and clone dependencies
git submodule update --init --recursive
- Navigate to ardupilot/ArduCopter directory.
- Run
../Tools/autotest/sim_vehicle.py --map --console
- At first this complained about some missing python dependencies. Install these
pip install XYZ
- Eventually it started this huge build which took quite a while
- Once complete, the quad-copter simulator opened up
- At first this complained about some missing python dependencies. Install these
Dronekit-Python helps you create powerful apps for UAVs. (Quote from the ArduPilot project repo)
- Can be installed with
pip install dronekit
- I needed to install
wheel
firstpip install wheel
(there was an ungraceful fail without it)
- I needed to install
In our context it is used to communicate with MAVLink and ArduCopter and abstracts a level of detail away for us.
- Open Cygwin terminal. Navigate to ardupilot/ArduCopter directory.
- Run
../Tools/autotest/sim_vehicle.py --map --console
- Open CMD. Navigate to the directory of this repo.
- Run
python dronekit/missions/simple-test.py
- Watch as dronekit controls the simulated drone through a simple take off and land!
Very similar behaviour to the above take off and land but with much more control via simulation of asynch comms.
- Open Cygwin terminal. Navigate to ardupilot/ArduCopter directory.
- Run
../Tools/autotest/sim_vehicle.py --map --console
- Open CMD. Navigate to the directory of this repo.3. Run
python test-base-TOAL.py
- Base station (
test-base-TOAL.py
) communicates with on drone controller (missions/take_off_and_land.py
) which interacts via dronekit with the drone.
- Base station (
Placed between the environment (drone) and controller (base station) the attack enforcers can execute a number of attacks.
Policies in this work are defined as Timed Automata and synthesised into enforcers using easy-rte. Below is an example of an injection attack which inserts the ABORT signal after a specified time (T subscript A).
To demonstrate attack enforcers and the attack manager see the below examples.
Commands assume you have the simulator running
- Mission: take off and land -
python test-base-TOAL.py
- Mission: fly from A to B -
python test-base-A2B.py
- Mission: fly from A to B to A -
python test-base-A2B2A.py
Adds an attack manager to perform enforcer interchange, which dynamically enables and disables (through the use of activate signals) appropriate enforcers to perform more complex attacks.
Uses enforcer interchange to dynamically enable appropriate attack enforcers across a mission that combines the three examples above.
- Combined Missions: all of the above -
python test-base-combined.py
- Assumes you have the simulator running
The policy below illustrates the attack manager policy for the three basic drone attacks used earlier.