Cybersecurity: Crash Course Computer Science #31
CrashCourse
0:03 Hi, I’m Carrie Anne, and welcome to CrashCourse Computer Science!
0:05 Over the last three episodes,
0:07 we’ve talked about how computers have become interconnected,
0:10 allowing us to communicate near-instantly across the globe.
0:12 But, not everyone who uses these networks is going to play by the rules,
0:16 or have our best interests at heart.
0:18 Just as how we have physical security like locks,
0:20 fences and police officers to minimize crime in the real world,
0:24 we need cybersecurity to minimize crime and harm in the virtual world.
0:27 Computers don’t have ethics.
0:29 Give them a formally specified problem and they’ll
0:31 happily pump out an answer at lightning speed.
0:34 Running code that takes down a hospital’s
0:35 computer systems until a ransom is paid
0:36 is no different to a computer than code that keeps a patient's heart beating.
0:40 Like the Force, computers can be pulled to the light side or the dark side.
0:44 Cybersecurity is like the Jedi Order,
0:46 trying to bring peace and justice to the cyber-verse.
0:48 INTRO The scope of cybersecurity evolves
0:59 as fast as the capabilities of computing,
1:01 but we can think of it as a set of techniques to protect the secrecy,
1:05 integrity and availability of computer systems and data against threats.
1:09 Let’s unpack those three goals: Secrecy, or confidentiality,
1:12 means that only authorized people should be able
1:14 to access or read specific computer systems and data.
1:18 Data breaches, where hackers reveal people’s credit card information,
1:21 is an attack on secrecy.
1:22 Integrity means that only authorized people should have
1:25 the ability to use or modify systems and data.
1:28 Hackers who learn your password and send e-mails masquerading as you,
1:31 is an integrity attack.
1:32 And availability means that authorized people should
1:34 always have access to their systems and data.
1:37 Think of Denial of Service Attacks,
1:39 where hackers overload a website with fake requests
1:42 to make it slow or unreachable for others.
1:44 That’s attacking the service’s availability.
1:46 To achieve these three general goals,
1:48 security experts start with a specification of who your “enemy” is,
1:51 at an abstract level, called a threat model.
1:54 This profiles attackers: their capabilities, goals,
1:56 and probable means of attack– what’s called, awesomely enough, an attack vector.
2:01 Threat models let you prepare against specific threats,
2:03 rather than being overwhelmed by all the ways
2:05 hackers could get to your systems and data.
2:07 And there are many, many ways.
2:08 Let’s say you want to “secure” physical access to your laptop.
2:12 Your threat model is a nosy roommate.
2:14 To preserve the secrecy, integrity and availability of your laptop,
2:17 you could keep it hidden in your dirty laundry hamper.
2:20 But, if your threat model is a mischievous
2:22 younger sibling who knows your hiding spots,
2:24 then you’ll need to do more: maybe lock it in a safe.
2:27 In other words, how a system is secured
2:29 depends heavily on who it’s being secured against.
2:31 Of course, threat models are typically a bit
2:34 more formally defined than just “nosy roommate”.
2:36 Often you’ll see threat models specified in terms of technical capabilities.
2:40 For example, “someone who has physical access
2:42 to your laptop along with unlimited time”.
2:44 With a given threat model,
2:45 security architects need to come up with a solution that keeps
2:48 a system secure– as long as certain assumptions are met,
2:51 like no one reveals their password to the attacker.
2:53 There are many methods for protecting computer systems, networks and data.
2:56 A lot of security boils down to two questions:
2:59 who are you, and what should you have access to?
3:02 Clearly, access should be given to the right people,
3:04 but refused to the wrong people.
3:06 Like, bank employees should be able to open ATMs to restock them,
3:09 but not me… because I’d take it all...
3:11 all of it!
3:12 That ceramic cat collection doesn’t buy itself!
3:14 So, to differentiate between right and wrong people,
3:16 we use authentication- the process by which
3:19 a computer understands who it’s interacting with.
3:22 Generally, there are three types,
3:23 each with their own pros and cons: What you know.
3:26 What you have.
3:26 And what you are.
3:27 What you know authentication is based on knowledge of a secret
3:29 that should be known only by the real user and the computer,
3:33 for example, a username and password.
3:35 This is the most widely used today because it’s the easiest to implement.
3:38 But, it can be compromised if hackers
3:40 guess or otherwise come to know your secret.
3:42 Some passwords are easy for humans to figure out, like 12356 or q-w-e-r-t-y.
3:48 But, there are also ones that are easy for computers.
3:51 Consider the PIN: 2580.
3:53 This seems pretty difficult to guess– and it is– for a human.
3:56 But there are only ten thousand possible combinations of 4-digit PINs.
4:00 A computer can try entering 0000, then try 0001,
4:04 and then 0002, all the way up to 9999...
4:08 in a fraction of a second.
4:10 This is called a brute force attack, because it just tries everything.
4:14 There’s nothing clever to the algorithm.
4:16 Some computer systems lock you out,
4:17 or have you wait a little, after say three wrong attempts.
4:20 That’s a common and reasonable strategy,
4:22 and it does make it harder for less sophisticated attackers.
4:25 But think about what happens if hackers have already
4:27 taken over tens of thousands of computers, forming a botnet.
4:30 Using all these computers, the same pin– 2580– can be tried
4:34 on many tens of thousands of bank accounts simultaneously.
4:37 Even with just a single attempt per account,
4:39 they’ll very likely get into one or more that just happen to use that PIN.
4:43 In fact, we’ve probably guessed the pin of someone watching this video!
4:46 Increasing the length of PINs and passwords can help,
4:48 but even 8 digit PINs are pretty easily cracked.
4:51 This is why so many websites now require you
4:53 to use a mix of upper and lowercase letters, special symbols, and so on– it
4:57 explodes the number of possible password combinations.
5:00 An 8-digit numerical PIN only has a hundred
5:02 million combinations– computers eat that for breakfast!
5:05 But an 8-character password with all those funky
5:08 things mixed in has more than 600 trillion combinations.
5:11 Of course, these passwords are hard for us mere humans to remember,
5:14 so a better approach is for websites to let us pick something more memorable,
5:18 like three words joined together: “green brothers rock” or “pizza tasty yum”.
5:22 English has around 100,000 words in use, so putting three together would give
5:26 you roughly 1 quadrillion possible passwords.
5:28 Good luck trying to guess that!
5:31 I should also note here that using non-dictionary words
5:33 is even better against more sophisticated kinds of attacks,
5:35 but we don’t have time to get into that here.
5:38 Computerphile has a great video on choosing a password- link in the dooblydoo.
5:42 What you have authentication, on the other hand,
5:43 is based on possession of a secret token that only the real user has.
5:47 An example is a physical key and lock.
5:49 You can only unlock the door if you have the key.
5:52 This escapes this problem of being “guessable”.
5:54 And they typically require physical presence,
5:56 so it’s much harder for remote attackers to gain access.
5:59 Someone in another country can’t gain access to your front
6:01 door in Florida without getting to Florida first.
6:03 But, what you have authentication can be
6:06 compromised if an attacker is physically close.
6:08 Keys can be copied, smartphones stolen, and locks picked.
6:11 Finally, what you are authentication is based on...
6:14 you!
6:14 You authenticate by presenting yourself to the computer.
6:17 Biometric authenticators,
6:18 like fingerprint readers and iris scanners are classic examples.
6:22 These can be very secure, but the best technologies are still quite expensive.
6:26 Furthermore, data from sensors varies over time.
6:29 What you know and what you have authentication have
6:31 the nice property of being deterministic– either correct or incorrect.
6:35 If you know the secret, or have the key, you’re granted access 100% of the time.
6:40 If you don’t, you get access zero percent of the time.
6:42 Biometric authentication, however,
6:44 is probabilistic.There’s some chance the system won’t recognize you…
6:48 maybe you’re wearing a hat or the lighting is bad.
6:50 Worse, there’s some chance the system will recognize
6:52 the wrong person as you– like your evil twin!
6:55 Of course, in production systems, these chances are low, but not zero.
6:59 Another issue with biometric authentication is it can’t be reset.
7:02 You only have so many fingers,
7:04 so what happens if an attacker compromises your fingerprint data?
7:07 This could be a big problem for life.
7:09 And, recently, researchers showed it’s possible to forge
7:11 your iris just by capturing a photo of you, so that’s not promising either.
7:15 Basically, all forms of authentication have strengths and weaknesses,
7:18 and all can be compromised in one way or another.
7:21 So, security experts suggest using two
7:23 or more forms of authentication for important accounts.
7:27 This is known as two-factor or multi-factor authentication.
7:29 An attacker may be able to guess your password or steal your phone:
7:32 but it’s much harder to do both.
7:34 After authentication comes Access Control.
7:36 Once a system knows who you are,
7:38 it needs to know what you should be able to access,
7:40 and for that there’s a specification of who should be able to see,
7:44 modify and use what.
7:45 This is done through Permissions or Access Control Lists (ACL),
7:47 which describe what access each user has for every file,
7:50 folder and program on a computer.
7:52 “Read” permission allows a user to see the contents of a file,
7:56 “write” permission allows a user to modify the contents,
7:58 and “execute” permission allows a user to run a file, like a program.
8:02 For organizations with users at different levels
8:04 of access privilege– like a spy agency–
8:06 it’s especially important for Access Control Lists
8:08 to be configured correctly to ensure secrecy, integrity and availability.
8:13 Let’s say we have three levels of access: public, secret and top secret.
8:17 The first general rule of thumb is that people shouldn’t be able to “read up”.
8:20 If a user is only cleared to read secret files,
8:23 they shouldn’t be able to read top secret files,
8:25 but should be able to access secret and public ones.
8:28 The second general rule of thumb is
8:29 that people shouldn’t be able to “write down”.
8:31 If a member has top secret clearance,
8:33 then they should be able to write or modify top secret files,
8:36 but not secret or public files.
8:38 It may seem weird that even with the highest clearance,
8:41 you can’t modify less secret files.
8:42 But, it guarantees that there’s no accidental leakage
8:45 of top secret information into secret or public files.
8:48 This “no read up, no write down” approach is called the Bell-LaPadula model.
8:52 It was formulated for the U.S.
8:55 Department of Defense’s Multi-Level Security policy.
8:57 There are many other models for access control–
8:59 like the Chinese Wall model and Biba model.
9:01 Which model is best depends on your use-case.
9:03 Authentication and access control help a computer determine
9:06 who you are and what you should access,
9:08 but depend on being able to trust the hardware
9:11 and software that run the authentication and access control programs.
9:14 That’s a big dependence.
9:15 If an attacker installs malicious software– called
9:18 malware– compromising the host computer’s operating system,
9:20 how can we be sure security programs
9:23 don’t have a backdoor that let attackers in?
9:25 The short answer is… we can’t.
9:27 We still have no way to guarantee the security of a program or computing system.
9:31 That’s because even while security software might be “secure” in theory,
9:35 implementation bugs can still result in vulnerabilities.
9:37 But, we do have techniques to reduce the likelihood of bugs,
9:40 quickly find and patch bugs when they do occur,
9:43 and mitigate damage when a program is compromised.
9:46 Most security errors come from implementation error.
9:49 To reduce implementation error, reduce implementation.
9:52 One of the holy grails of system level security
9:55 is a “security kernel” or a “trusted computing base”:
9:58 a minimal set of operating system software that’s close to provably secure.
10:02 A challenge in constructing these security kernels
10:04 is deciding what should go into it.
10:06 Remember, the less code, the better!
10:08 Even after minimizing code bloat,
10:09 it would be great to “guarantee” that code as written is secure.
10:13 Formally verifying the security of code is an active area of research.
10:17 The best we have right now is
10:19 a process called Independent Verification and Validation.
10:22 This works by having code audited by a crowd of security-minded developers.
10:26 This is why security code is almost always open-sourced.
10:28 It’s often difficult for people who wrote the original code to find bugs,
10:32 but external developers,
10:33 with fresh eyes and different expertise, can spot problems.
10:36 There are also conferences where like-minded hackers
10:38 and security experts can mingle and share ideas,
10:40 the biggest of which is DEF CON, held annually in Las Vegas.
10:44 Finally, even after reducing code and auditing it,
10:46 clever attackers are bound to find tricks that let them in.
10:49 With this in mind, good developers should take the approach that, not if,
10:52 but when their programs are compromised,
10:54 the damage should be limited and contained,
10:56 and not let it compromise other things running on the computer.
11:00 This principle is called isolation.
11:01 To achieve isolation, we can “sandbox” applications.
11:04 This is like placing an angry kid in a sandbox; when the kid goes ballistic,
11:08 they only destroy the sandcastle in their own box,
11:11 but other kids in the playground continue having fun.
11:14 Operating Systems attempt to sandbox applications by giving each
11:17 their own block of memory that others programs can’t touch.
11:20 It’s also possible for a single computer to run multiple Virtual Machines,
11:24 essentially simulated computers, that each live in their own sandbox.
11:27 If a program goes awry, worst case is that it crashes or compromises
11:31 only the virtual machine on which it’s running.
11:33 All other Virtual Machines running on the computer are isolated and unaffected.
11:37 Ok, that’s a broad overview of some key computer security topics.
11:41 And I didn’t even get to network security, like firewalls.
11:43 Next episode, we’ll discuss some specific example
11:45 methods hackers use to get into computer systems.
11:47 After that, we’ll touch on encryption.
11:49 Until then, make your passwords stronger, turn on 2-factor authentication,
11:53 and NEVER click links in unsolicited emails!
11:56 I’ll see you next week.