Abstraction: An abstraction is a representation of an object or concept. It could be something such as a door, a speedometer, or a data structure in computer science. Abstraction decouples the design from the implementation. The gauges in an automobile are an abstraction of the performance of a car. A map is an abstraction of the earth.
Data Hiding: Data hiding is the technique that does not allow certain aspects of an object to be observed or accessed. Data and information hiding keeps the programmer from having complete access to data structures. It allows access to only what is necessary.
Least Privilege: One of the ways to protect information is by limiting what people can see and do with your information and resources. The principle of least privilege says to allow the minimum number of privileges necessary to accomplish the task.
Modularization: The concept of modularity is like building blocks. Each block (or module) can be put in or taken out from a bigger project. Each module has its own separate function that is interchangeable with other modules.
Resource Encapsulation: Encapsulation is an object oriented concept where all data and functions required to use the resource are packaged into a single self-contained component. The goal is to only allow access or manipulation of the resource in the way the designer intended. An example, assume a flag pole is the object. There are fixed methods on how the flag pole is to be used. Put the flag on, take the flag off, raise or lower the flag. Nothing else can be done to the flag pole.
Simplicity: Simplicity allows a person to better understand hardware and software. Without the clutter of unnecessarily complicated code and interfaces, the software will be more understandable by people that will update the code when requirements change. It will be easier to understand by the testers and they will be able to spot problems sooner. By keeping software as simple and as focused as possible, the reliability and security is greatly increased.
It seems like unmanned aircraft systems, more commonly called drones, are everywhere. You see them at sporting events, entertainment venues, they are used for search and rescue, to survey disaster damage, even by farmers and ranchers to check on crops and herds. We may even see them soon for package delivery. We also hear a lot about safety flying drones, we don’t want anyone to get hurt. But what about cybersecurity? Is that important with drones? Could someone get hurt from a hacked drone?
The FAA has several rules for the operation of drones. The below rules apply to flying for fun or educational purposes, if you are flying the drone for work (to make money) then there are more stringent rules which must be followed
The drones we are using today are under .55 lbs and since we are flying indoors we do not have to worry about notifying airport authorities. If you use a different drone or fly outdoors you should check the FAA web site for any additional rules you should follow.
In addition to the above the below safety rules apply no matter what type of drone you are flying:
Using the provided battery you will get about 7 or 8 minutes flight time on a charge. Having several batteries available will lengthen your operational time.
We will go through an abbreviated introduction to the commands in this lesson. The Parrot Education playground is a great resource for additional practice or as a stand-alone lesson.
It’s time to create your first program. Select the Parrot Template playground. You will see your programming environment similar to the below.
You will see the screen divided into two sections. The left or top half the screen (depending on the iPad orientation) is where you will write your code. At the top of this section you will see a name for the program you are working on as well as arrows to the left and right. This allows you to cycle through programs on this template. The right or bottom half is where you will see a simulation of the drone’s activity. The simulation is an example of the application of the First Principle of Abstraction. It’s a representation of the more complex drone’s actions.
You can enter code by using a keyboard or by selecting the various commands at the bottom of the screen and providing the proper parameters.
Let’s start with something simple, takeoff and land. Enter the commands into the code window using the keyboard or by selecting the commands from the bottom of the screen. Note that the commands are case sensitive.
takeOff()
wait(4)
Land
The commands are pretty self-explanatory.
Before we go farther let’s talk for a moment about some Cybersecurity First Principles which apply here. It requires many lines of code to make your drone take off and hover, maintaining stable flight. It’s checking multiple sensors and motor rotation. Those inputs change how power is applied to the motors. But all you did was issue the command takeOff(). This is an example of data hiding. As a programmer you are limited from accessing directly all the data and commands that are needed for the command takeOff() to work.
In general, the commands you use to control the drone, provide an example of resource encapsulation. The drone is an object, and there are only certain applicable operations, for example take off and land, which make sense for a drone. There are many actions which make up those commands but by hiding those from the user your make the drone operations safer. If you had direct access to the all the commands which made the drone operate there is a good chance you could cause some harm, either on purpose or by mistake. By encapsulating the resources, in this case the commands which comprise, takeOff() and land(), the user only has access to those commands which are applicable to the authorized operations. If a user weren’t limited by the resource encapsulation of the command takeOff() they could send commands to make half the drone take off and the other half land. This could cause damage to the drone. There are also some commands which won’t work under all conditions. For example you can’t do flips if the claw is attached as the drone’s flight could become unstable. You are also not allowed to take off if the battery is too low. Resource encapsulation ensures that only those operations of the object which are appropriate at the time are allowed. This is also a good example of the principle of simplicity. A user doesn’t need to know all the commands necessary to hover, they just tell the drone to take off.
Are there examples of how the principal of least privilege could be applied to drone operations?
You will only need to do this step when first using your drone, or changing drones.
We are finally ready to fly your drone with your first program.
Hopefully you have been treated to a brief aerial demonstration by your drone. If not check the code against the list above, pay attention to spelling and case.
Believe it or not you already know most of what you need to write longer and more complex programs for drone operations. There are several other commands you can use to perform different maneuvers. Use the below as a references and add them as needed to your drone program.
You can also create functions to group several commands and call them where needed. This is an example of the cybersecurity first principle of Modularity. Functions are the building blocks of larger programs and you can add, remove, and move around functions to change operations as needed.
You now have all the basics you need to program some complex drone operations. Good luck and have fun!
Use kahoot to ask the following questions. Discuss any wrong answers to ensure all understant the material.
For more information, investigate the following.
Nebraska GenCyber
is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Overall content: Copyright (C) 2017-2018 Dr. Matthew L. Hale, Dr. Robin Gandhi, and Doug Rausch.
Lesson content: Copyright (C) Robin Gandhi 2017-2018.
This lesson is licensed by the author under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.