SLIDE 1 Software Security: Principles
CS 161: Computer Security
TAs: Jethro Beekman, Mobin Javed, Antonio Lupher, Paul Pearce & Matthias Vallentin
http://inst.eecs.berkeley.edu/~cs161/
January 31, 2013
SLIDE 2
TL-‑15
SLIDE 3
TL-‑30
SLIDE 4
TRTL-‑30
SLIDE 5
TXTL-‑60
SLIDE 6
“Security is economics.”
SLIDE 7
What ¡does ¡this ¡program ¡do?
SLIDE 8 What ¡can ¡this ¡program ¡do? Can ¡it ¡delete ¡all ¡of ¡your ¡files?
SLIDE 9
“Least privilege.”
SLIDE 10 Touchstones for Least Privilege
- When assessing the security of a system’s design,
identify the Trusted Computing Base (TCB).
– What components does security rely upon?
- Security requires that the TCB:
– Is correct – Is complete (can’t be bypassed) – Is itself secure (can’t be tampered with)
- Best way to be assured of correctness and its security?
– KISS = Keep It Simple, Stupid! – Generally, Simple = Small
- One powerful design approach: privilege separation
– Isolate privileged operations to as small a component as possible – (See lecture notes for more discussion)
SLIDE 11
SLIDE 12
“Ensure complete mediation.”
SLIDE 13 Ensuring Complete Mediation
- To secure access to some capability/resource,
construct a reference monitor
- Single point through which all access must occur
– E.g.: a network firewall
– Un-bypassable (“complete mediation”) – Tamper-proof – Verifiable – (Note, just restatements of what we want for TCBs)
- One subtle form of reference monitor flaw
concerns race conditions …
SLIDE 14
¡procedure ¡withdrawal(w) ¡ ¡ ¡ ¡// ¡contact ¡central ¡server ¡to ¡get ¡balance ¡ ¡ ¡ ¡1. ¡let ¡b ¡:= ¡balance ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡2. ¡if ¡b ¡< ¡w, ¡abort ¡ ¡ ¡ ¡// ¡contact ¡server ¡to ¡set ¡balance ¡ ¡ ¡ ¡3. ¡set ¡balance ¡:= ¡b ¡-‑ ¡w ¡ ¡ ¡ ¡4. ¡dispense ¡$w ¡to ¡user
TOCTTOU Vulnerability
TOCTTOU = Time of Check To Time of Use
SLIDE 15
¡public ¡void ¡buyItem(Account ¡buyer, ¡Item ¡item) ¡{ ¡ ¡ ¡ ¡if ¡(item.cost ¡> ¡buyer.balance) ¡ ¡ ¡ ¡ ¡ ¡return; ¡ ¡ ¡ ¡buyer.possessions.put(item); ¡ ¡ ¡ ¡buyer.possessionsUpdated(); ¡ ¡ ¡ ¡buyer.balance ¡-‑= ¡item.cost; ¡ ¡ ¡ ¡buyer.balanceUpdated(); ¡ ¡}
SLIDE 16
SLIDE 17
SLIDE 18
SLIDE 19
“Separation of responsibility.”
SLIDE 20
5 Minute Break
Questions Before We Proceed?
SLIDE 21
SLIDE 22
SLIDE 23
“Defense in depth.”
SLIDE 24
“Company ¡policy: ¡passwords ¡must ¡be ¡at ¡least ¡10 characters ¡long, ¡contain ¡at ¡least ¡2 ¡digits, ¡1 uppercase ¡character, ¡ ¡1 ¡lowercase ¡character, ¡and 1 ¡special ¡character.”
SLIDE 25
SLIDE 26
TC-‑0
SLIDE 27 What a piece of work is a man! how Noble in Reason! how infinite in faculty! in form and moving how express and admirable! in Action, how like an Angel! in apprehension, how like a God!
- - Hamlet Act II, Scene II
“Humans are incapable of securely storing high-quality cryptographic keys, and they have unacceptable speed and accuracy when performing cryptographic operations. (They are also large, expensive to maintain, difficult to manage, and they pollute the environment. It is astonishing that these devices continue to be manufactured and deployed. But they are sufficiently pervasive that we must design our protocols around their limitations.)”
- - Network Security: Private Communication in a Public World,
Charlie Kaufman, Radia Perlman, & Mike Speciner, 1995
SLIDE 28
“Psychological acceptability.”
SLIDE 29
SLIDE 30
SLIDE 31
SLIDE 32
SLIDE 33
“Consider human factors.”
SLIDE 34
SLIDE 35
SLIDE 36
SLIDE 37
SLIDE 38
SLIDE 39
“Threat models change.”
SLIDE 40
SLIDE 41
SLIDE 42
“Threat models change.” “Design security in from the start.” (Beware bolt-on security.)
SLIDE 43
SLIDE 44
SLIDE 45
SLIDE 46
SLIDE 47
SLIDE 48
SLIDE 49 “Don’t rely on security through
SLIDE 50
SLIDE 51
SLIDE 52
SLIDE 53
SLIDE 54
SLIDE 55
SLIDE 56
“Trusted path.”
SLIDE 57
Soda ¡Hall ¡wiring ¡closet
SLIDE 58
SLIDE 59
Protection?
SLIDE 60
SLIDE 61
“Use fail-safe defaults.”