SlideShare a Scribd company logo
1 of 42
Download to read offline
Thema
In brief, the situation.
You develop software.
People use your software.
Coda
The situation, in brief.
You develop software that is certainly broken.
People are going to exploit it.
Bugs Ex Ante
Kristaps Dzonsons
September 27, 2014
Or: how to protect system resources from the weakest link of the
system: the developer.
Coda
write defensive code, use a team of auditors, QA
use up-to-date, audited libraries with a history of attention to
security
use a language with formal underpinnings and construct
proofs of correctness
run on systems supporting your defensive strategy
ride your unicorn to work every day.
Adjustment: Expense
write “defensive” code , use a team of auditors, QA
use up-to-date , audited libraries with a history of attention to
security
use a language with formal underpinnings and construct
proofs of correctness
run on systems supporting your defensive strategy
Adjustment: time
write “defensive” code , use a team of auditors, QA
use up-to-date , audited libraries with a history of attention to
security
use a language with formal underpinnings and construct
proofs of correctness C
run on systems supporting your defensive strategy
Don’t Bring a Dog to a Cat Show
Invariants:
economics
buggy software
Variables:
valuable resources
Minimising the Goal Function
How do we do this?
resources ← software → users
resources → software ← users
Resource constraint:
resources ←software → users
resources →software ← users
Consider how it’s been done to date. In the beginning. . .
A Brief History of Restraint
1961 File Permissions (CTSS)
1964 Segment Permissions (Multics)
1969 Security Kernel (RC-4000)
1971 Access Control Lists (Lampson)
1972 Discretionary Access Controls (Project MAC,
Multics)
1973 Bell-LaPadula Model
1975 Capabilities (Hydra)
1975 Access Isolation Mechanism (Project Guardian,
Multics)
CAP, System/38, MITRE, SRI, KSOS, Secure UNIX, . . .
CTSS (IBM 7094)
Figure : Credit: Wikimedia, ArnoldReinhold
File Permissions (CTSS)
Each U.F.D. contains information about the location
and contents of the various files which the user has
created. The U.F.D. is associated with a problem
number and a programmer number. Also associated
with certain problem numbers are “common files” – file
directories which contain files of common interest and are
directly accessible to all users on the problem number.
Certain of the common files associated with the
system programmers’ problem number (M1416) contain
information of general utility and are accessible to all
users.
–CTSS Programmer’s Guide (AA.2 12/69): October 1965, MIT.
Multics (GE-645)
Figure : Credit: Tom Van Vleck, Multicians
Segment Positions (Multics)
Storage is logically organized in separately named
data storage segments Associated with each segment is
an access control list, an open-ended list of names of
users who are permitted to reference the segment.
. . . Whenever the process attempts to access a segment
or other object cataloged by the storage system, the
principal identifier of the process is compared with those
appearing in the access control list of the object; if no
match is found access is not granted.
–Jerry Saltzer, Protection and the Control of Information Sharing
in Multics: 1974, MIT.
Access Isolation (Multics)
Figure : Credit: Tom Van Vleck, Multicians
–B2 Certification “Orange Book”, 1983.
Hydra (PDP-11)
Figure : Credit: Unknown Author
Capabilities (Hydra)
First, we must assume that any user-level program
contains bugs and may even be malevolent. We therefore
cannot allow any single user or application to
“commandeer” the system to the detriment of others. By
implication, we must prevent programs which define
policies direct access to hardware or data which could be
(mis)used to destroy another program. That is–such
programs must execute in a protected environment.
–R. Levin et al., Policy/Mechanism Separation in Hydra: CMU,
1975.
Unfortunately...
Figure : Paul Karger and Roger Schell, 1984. Credit: Tom Van Vleck
. . . They tried to break Multics security on the MIT
GE-645 that we all used as our timesharing utility and
development build & exposure site.
And break it they did. . . (1972–1974)
What Went Wrong? (Multics)
The large number of programs, as well as the very
high internal intricacy level, frustrates line-by-line
auditing for errors, misimplementation, or intentionally
planted trapdoors.
Economics. . . a function could be implemented more
cheaply [than] in the most protected region.
Rush to get on the air.
Lack of understanding.
–Jerry Saltzer, Protection and the Control of Information Sharing
in Multics: 1974, MIT.
What Went Wrong? (Hydra)
Subsystem construction still suffers from being ad
hoc, there being inadequate software support for
managing the programs, data structures, and
documentation which comprise the subsystem.
–W. Wulf and S. Harbison, Reflections in a pool of processors–An
experience report on C.mmp/Hydra: CMU, 1978.
What about UNIX?
In many ways, UNIX is a very conservative system.
Only a handful of its ideas are genuinely now. In fact, a
good case can be made that it is in essence a modern
implementation of M.I.T.’s CTSS system.
The UNIX system kernel and much of the software
were written in a rather open environment, so the
continuous, careful effort required to maintain a fully
secure system has not always been expended; as a result,
there are several security problems.
–D. M. Ritchie, The UNIX Time-Sharing System: A Retrospective:
1976, AT&T Bell Labs.
Bugs Ex Ante
Kristaps Dzonsons
September 27, 2014
Or,
UNIX: “As Times Goes By”
1971 chmod(2), setuid(2) (V1 UNIX)
1979 chroot(2) (V7 UNIX)
1982 setrlimit(2) (4.1cBSD)
2000 jail(8) (FreeBSD 4.0)
2002 systrace(4) (OpenBSD?)
2003 POSIX.1e (FreeBSD 5.0, Mac OS X 10.4)
2007 kauth(9) (NetBSD 4.0)
2007 sandbox init(3) (Mac OS X 10.4)
2012 Capsicum (FreeBSD 9.0)
Concepts
Labelling: limit access only to labelled environment.
POSIX.1e
chmod(2), setuid(2)
Containers: limit the environment.
chroot(2)
setrlimit(2)
jail(8)
Capabilities: limit access to the environment.
systrace(4)
Capsicum
There’s lots of overlap.
chmod(2), setuid(2)
part of the original UNIX V1
forms the basis of privsep/privdrop (along with fork(2) et
al.)
On privilege separation...
Doable in simple programs
Requires complicated and very detailed programming
–Theo de Raadt: OpenCON, 2005
chroot(2)
chroot()
{
if (suser())
chdirec(&u.u_rdir);
}
1981 BSD commit by Bill Joy. . .
if (dp == u.u_rdir && u.u_dent.d_name[0] == ’.’ &&
u.u_dent.d_name[1] == ’.’ && u.u_dent.d_name[2] == 0)
goto cloop;
setrlimit(2)
Establish limits on resources, originally:
CPU time
data segment size
stack segment size
core file size
physical memory size
Now also (OpenBSD-current):
largest file size
maximum open files
maximum size of locked memory
maximum simultaneous processes for user
These can be set and unset at will, so an attacker with arbitrary
power can simply change the resource limits himself.
jail(8)
System interface by Poul-Henning Kamp in FreeBSD 4.0, further
extended in FreeBSD 5.1 (jail attach(2)) and FreeBSD 8.0
(jail set(2)).
Extends the chroot(2) concept into a constrained view of users,
network, files, etc.
Must be root. Cannot be recursive.
systrace(4)
Developed by Neils Provos (Improving Host Security with System
Call Policies, USENIX Security 2003), now only in OpenBSD.
Found vulnerable by Robert Watson, Exploiting Concurrency
Vulnerabilities in System Call Wrappers, WOOT 2007.
Uses the /dev/systrace device (open(2), ioctl(2), read(2))
to set a resource limitation policy (white-list, black-list) on process
and process children.
Must be root; can only be applied to children or other processes.
(See privsep.)
POSIX.1e: ACL
Organised under TrustedBSD, April 2000, merged into FreeBSD
5.0 and Darwin 10.6.
acl(3) File-system (VFS) access control. FreeBSD, Darwin.
(Slightly differing.)
setfacl(3) POSIX-compliant (not yet?) version.
POSIX.1e: MAC
Derived from TrustedBSD, April 2000, merged into FreeBSD 5.0
and Darwin 10.6 (and indirectly into NetBSD’s kauth(9 and
secmodel(9)).
mac(3), mac(4) FreeBSD interface. Full policy framework for
MLS, Biba, etc. Manuals inspired by the Voynich
manuscript.
sandbox init(3) Darwin 10.6 one-function entry into MAC
sandbox. Manuals inspired by haiku.
kauth(9)
In-kernel authorisation framework (like FreeBSD’s mac(9), etc.).
Inspired by Mac 10.4. Not exposed to user-land, but would enable
a user-land equivalent to mac(4), sandbox init(3), etc.
sandbox init(3)
Mandatory access control interface introduced in Darwin 10.6.
Based on FreeBSD and POSIX.1e.
Almost no documentation. See OpenSSH’s sandbox-darwin.c
for some significant “gotchas”.
Limitation profiles available: kSBXProfileNoInternet,
kSBXProfileNoNetwork, kSBXProfileNoWrite,
kSBXProfileNoWriteExceptTemporary,
kSBXProfilePureComputation.
Capsicum
Recent capabilities (see rights(4)) innovation on FreeBSD,
inherited from TrustedBSD.
Sits between systrace(4) and sandbox init(3) in terms of
complexity: requires consideration of each resource, but (in theory)
doesn’t need a fork(2) for processing children (except for process
limitations, pdfork(2)).
Used in bspatch(1), bsdiff(1), tcpdump(1), fetch(1),
bzip2(1), syslogd(8), . . .
Requires a significant addition of functions: prfork(2), . . .
Case Study: OpenSSH
Designing software resistent to developer bugs is hard. Too hard.
Consider one of the canonical sandboxed applications, OpenSSH
(5.8).
Introduce sandboxing of the pre-auth privsep child
using an optional sshd config(5)
“UsePrivilegeSeparation=sandbox” mode that enables
mandatory restrictions on the syscalls the privsep child
can perform. This intention is to prevent a compromised
privsep child from being used to attack other hosts (by
opening sockets and proxying) or probing local kernel
attack surface.
One Step Ahead, Two Steps Behind
% wc -l *sandbox*
122 sandbox-capsicum.c
98 sandbox-darwin.c
72 sandbox-null.c
97 sandbox-rlimit.c
240 sandbox-seccomp-filter.c
200 sandbox-systrace.c
24 ssh-sandbox.h
853 total
This is ridiculously complicated!
Methodology
Sandbox method for systrace(4):
1. parent fork(2) a child, wait for child to SIGSTOP
2. child emits a SIGSTOP
3. parent prepare systrace(4) policy for child
4. parent sends SIGCONT to child
5. child continues in sandbox
Sandbox method on other platforms:
1. parent fork(2) a child
2. child prepares sandbox environment
3. child continues in sandbox
Case Study: kcgi
% wc -l sandbox*
72 sandbox-darwin.c
249 sandbox-systrace.c
366 sandbox.c
687 total
Methodology
Inherit structure of OpenSSH.
Work around CGI environment: not a root process, already in a
chroot(2, unknown number of file descriptors already open.
Questionable Morals
The moral is obvious. You can’t trust code that you
did not totally create yourself. (Especially code from
companies that employ people like me.) No amount of
source-level verification or scrutiny will protect you from
using untrusted code.
–Ken Thompson, Reflections on Trusting Trust, 1984.
Thank You!
Figure : Credit: unknown author

More Related Content

What's hot

Unikernels, Multikernels, Virtual Machine-based Kernels
Unikernels, Multikernels, Virtual Machine-based KernelsUnikernels, Multikernels, Virtual Machine-based Kernels
Unikernels, Multikernels, Virtual Machine-based KernelsMartin Děcký
 
Malware analysis using volatility
Malware analysis using volatilityMalware analysis using volatility
Malware analysis using volatilityYashashree Gund
 
Exploiting Linux On 32-bit and 64-bit Systems
Exploiting Linux On 32-bit and 64-bit SystemsExploiting Linux On 32-bit and 64-bit Systems
Exploiting Linux On 32-bit and 64-bit SystemsE Hacking
 
44CON London 2015: Old Dog, New Tricks: Forensics with PowerShell
44CON London 2015: Old Dog, New Tricks: Forensics with PowerShell44CON London 2015: Old Dog, New Tricks: Forensics with PowerShell
44CON London 2015: Old Dog, New Tricks: Forensics with PowerShellJared Atkinson
 
Hacking+linux+kernel
Hacking+linux+kernelHacking+linux+kernel
Hacking+linux+kernelrobertsong
 
WinSock Asynchronous Input/Output
WinSock Asynchronous Input/OutputWinSock Asynchronous Input/Output
WinSock Asynchronous Input/Outputcalophatpho
 
Cis 562 week 11 final exam – strayer new
Cis 562 week 11 final exam – strayer newCis 562 week 11 final exam – strayer new
Cis 562 week 11 final exam – strayer newmarysherman2018
 

What's hot (10)

Unikernels, Multikernels, Virtual Machine-based Kernels
Unikernels, Multikernels, Virtual Machine-based KernelsUnikernels, Multikernels, Virtual Machine-based Kernels
Unikernels, Multikernels, Virtual Machine-based Kernels
 
07security
07security07security
07security
 
Malware analysis using volatility
Malware analysis using volatilityMalware analysis using volatility
Malware analysis using volatility
 
Exploiting Linux On 32-bit and 64-bit Systems
Exploiting Linux On 32-bit and 64-bit SystemsExploiting Linux On 32-bit and 64-bit Systems
Exploiting Linux On 32-bit and 64-bit Systems
 
Linux Vulnerabilities
Linux VulnerabilitiesLinux Vulnerabilities
Linux Vulnerabilities
 
44CON London 2015: Old Dog, New Tricks: Forensics with PowerShell
44CON London 2015: Old Dog, New Tricks: Forensics with PowerShell44CON London 2015: Old Dog, New Tricks: Forensics with PowerShell
44CON London 2015: Old Dog, New Tricks: Forensics with PowerShell
 
Hacking+linux+kernel
Hacking+linux+kernelHacking+linux+kernel
Hacking+linux+kernel
 
WinSock Asynchronous Input/Output
WinSock Asynchronous Input/OutputWinSock Asynchronous Input/Output
WinSock Asynchronous Input/Output
 
Seguridad en laptops
Seguridad en laptopsSeguridad en laptops
Seguridad en laptops
 
Cis 562 week 11 final exam – strayer new
Cis 562 week 11 final exam – strayer newCis 562 week 11 final exam – strayer new
Cis 562 week 11 final exam – strayer new
 

Similar to Bugs Ex Ante by Kristaps Dzonsons

2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security OverviewShawn Wells
 
Vulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container EnvironmentsVulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container EnvironmentsFlawCheck
 
Study notes for CompTIA Certified Advanced Security Practitioner (ver2)
Study notes for CompTIA Certified Advanced Security Practitioner  (ver2)Study notes for CompTIA Certified Advanced Security Practitioner  (ver2)
Study notes for CompTIA Certified Advanced Security Practitioner (ver2)David Sweigert
 
powe point presentation on kali linux and ethical hacking
powe point presentation on kali linux and ethical hackingpowe point presentation on kali linux and ethical hacking
powe point presentation on kali linux and ethical hackingdhruvpawar010
 
Forensic Memory Analysis of Android's Dalvik Virtual Machine
Forensic Memory Analysis of Android's Dalvik Virtual MachineForensic Memory Analysis of Android's Dalvik Virtual Machine
Forensic Memory Analysis of Android's Dalvik Virtual MachineSource Conference
 
OpenSolaris Introduction
OpenSolaris IntroductionOpenSolaris Introduction
OpenSolaris Introductionsatyajit_t
 
CarolinaCon 2008 Rootkits Then and Now
CarolinaCon 2008 Rootkits Then and NowCarolinaCon 2008 Rootkits Then and Now
CarolinaCon 2008 Rootkits Then and NowTyler Shields
 
Linux Operating System Vulnerabilities
Linux Operating System VulnerabilitiesLinux Operating System Vulnerabilities
Linux Operating System VulnerabilitiesInformation Technology
 
BSides IR in Heterogeneous Environment
BSides IR in Heterogeneous EnvironmentBSides IR in Heterogeneous Environment
BSides IR in Heterogeneous EnvironmentStefano Maccaglia
 
Lavigne bsdmag-jan2012
Lavigne bsdmag-jan2012Lavigne bsdmag-jan2012
Lavigne bsdmag-jan2012Dru Lavigne
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityJérôme Petazzoni
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriDocker, Inc.
 
Bs it itc questions{imtiaz hussain}
Bs it itc questions{imtiaz hussain}Bs it itc questions{imtiaz hussain}
Bs it itc questions{imtiaz hussain}Imtiaz Husssain
 
Assignment unix & shell programming
Assignment  unix  & shell programmingAssignment  unix  & shell programming
Assignment unix & shell programmingMohit Aggarwal
 
Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?Jérôme Petazzoni
 
Essay About ISS 418 Lab 7 And 8
Essay About ISS 418 Lab 7 And 8Essay About ISS 418 Lab 7 And 8
Essay About ISS 418 Lab 7 And 8Paula Smith
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notificationMahendra M
 
Security Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsSecurity Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsIgor Beliaiev
 
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century ThreatsLinux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century ThreatsJames Morris
 

Similar to Bugs Ex Ante by Kristaps Dzonsons (20)

2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
 
Vulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container EnvironmentsVulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container Environments
 
Study notes for CompTIA Certified Advanced Security Practitioner (ver2)
Study notes for CompTIA Certified Advanced Security Practitioner  (ver2)Study notes for CompTIA Certified Advanced Security Practitioner  (ver2)
Study notes for CompTIA Certified Advanced Security Practitioner (ver2)
 
powe point presentation on kali linux and ethical hacking
powe point presentation on kali linux and ethical hackingpowe point presentation on kali linux and ethical hacking
powe point presentation on kali linux and ethical hacking
 
Forensic Memory Analysis of Android's Dalvik Virtual Machine
Forensic Memory Analysis of Android's Dalvik Virtual MachineForensic Memory Analysis of Android's Dalvik Virtual Machine
Forensic Memory Analysis of Android's Dalvik Virtual Machine
 
OpenSolaris Introduction
OpenSolaris IntroductionOpenSolaris Introduction
OpenSolaris Introduction
 
CarolinaCon 2008 Rootkits Then and Now
CarolinaCon 2008 Rootkits Then and NowCarolinaCon 2008 Rootkits Then and Now
CarolinaCon 2008 Rootkits Then and Now
 
UNIX Operating System ppt
UNIX Operating System pptUNIX Operating System ppt
UNIX Operating System ppt
 
Linux Operating System Vulnerabilities
Linux Operating System VulnerabilitiesLinux Operating System Vulnerabilities
Linux Operating System Vulnerabilities
 
BSides IR in Heterogeneous Environment
BSides IR in Heterogeneous EnvironmentBSides IR in Heterogeneous Environment
BSides IR in Heterogeneous Environment
 
Lavigne bsdmag-jan2012
Lavigne bsdmag-jan2012Lavigne bsdmag-jan2012
Lavigne bsdmag-jan2012
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and security
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
 
Bs it itc questions{imtiaz hussain}
Bs it itc questions{imtiaz hussain}Bs it itc questions{imtiaz hussain}
Bs it itc questions{imtiaz hussain}
 
Assignment unix & shell programming
Assignment  unix  & shell programmingAssignment  unix  & shell programming
Assignment unix & shell programming
 
Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?
 
Essay About ISS 418 Lab 7 And 8
Essay About ISS 418 Lab 7 And 8Essay About ISS 418 Lab 7 And 8
Essay About ISS 418 Lab 7 And 8
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notification
 
Security Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsSecurity Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and Results
 
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century ThreatsLinux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
 

More from eurobsdcon

EuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program FrontEuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program Fronteurobsdcon
 
EuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & FridayEuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & Fridayeurobsdcon
 
EuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia WelcomeEuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia Welcomeeurobsdcon
 
EuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talkEuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talkeurobsdcon
 
Submitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas ChobanovSubmitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas Chobanoveurobsdcon
 
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois TigeotPorting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeoteurobsdcon
 
University of Oslo's TSD service - storing sensitive & restricted data by D...
  University of Oslo's TSD service - storing sensitive & restricted data by D...  University of Oslo's TSD service - storing sensitive & restricted data by D...
University of Oslo's TSD service - storing sensitive & restricted data by D...eurobsdcon
 
secure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenthersecure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenthereurobsdcon
 
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbelleurobsdcon
 
The LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed MasteThe LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed Masteeurobsdcon
 
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao UebayashiPorting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashieurobsdcon
 
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander NasonovMultiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonoveurobsdcon
 
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał DubielOpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał Dubieleurobsdcon
 
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann SionneauPorting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneaueurobsdcon
 
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...eurobsdcon
 
Cross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste DaroussinCross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste Daroussineurobsdcon
 
Building packages through emulation by Sean Bruno
Building packages through emulation by Sean BrunoBuilding packages through emulation by Sean Bruno
Building packages through emulation by Sean Brunoeurobsdcon
 
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul IroftiMaking OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul Iroftieurobsdcon
 
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. TanenbaumA Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaumeurobsdcon
 
Using routing domains / routing tables in a production network by Peter Hessler
Using routing domains / routing tables in a production network by Peter HesslerUsing routing domains / routing tables in a production network by Peter Hessler
Using routing domains / routing tables in a production network by Peter Hesslereurobsdcon
 

More from eurobsdcon (20)

EuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program FrontEuroBSDCon 2014 Program Front
EuroBSDCon 2014 Program Front
 
EuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & FridayEuroBSDCon 2014 tutorials program Thursday & Friday
EuroBSDCon 2014 tutorials program Thursday & Friday
 
EuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia WelcomeEuroBSDCon 2014 Sofia Welcome
EuroBSDCon 2014 Sofia Welcome
 
EuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talkEuroBSDCon 2014 Sofia Closing talk
EuroBSDCon 2014 Sofia Closing talk
 
Submitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas ChobanovSubmitting documents anonymously by Atanas Chobanov
Submitting documents anonymously by Atanas Chobanov
 
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois TigeotPorting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot
Porting the drm/kms graphic drivers to DragonFlyBSD by Francois Tigeot
 
University of Oslo's TSD service - storing sensitive & restricted data by D...
  University of Oslo's TSD service - storing sensitive & restricted data by D...  University of Oslo's TSD service - storing sensitive & restricted data by D...
University of Oslo's TSD service - storing sensitive & restricted data by D...
 
secure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenthersecure lazy binding, and the 64bit time_t development process by Philip Guenther
secure lazy binding, and the 64bit time_t development process by Philip Guenther
 
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell  The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
The entropic principle: /dev/u?random and NetBSD by Taylor R Campbell
 
The LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed MasteThe LLDB Debugger in FreeBSD by Ed Maste
The LLDB Debugger in FreeBSD by Ed Maste
 
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao UebayashiPorting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
 
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander NasonovMultiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
 
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał DubielOpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
 
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann SionneauPorting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
Porting NetBSD to the LatticeMico32 open source CPU by Yann Sionneau
 
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
 
Cross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste DaroussinCross Building the FreeBSD ports tree by Baptiste Daroussin
Cross Building the FreeBSD ports tree by Baptiste Daroussin
 
Building packages through emulation by Sean Bruno
Building packages through emulation by Sean BrunoBuilding packages through emulation by Sean Bruno
Building packages through emulation by Sean Bruno
 
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul IroftiMaking OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
 
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. TanenbaumA Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
 
Using routing domains / routing tables in a production network by Peter Hessler
Using routing domains / routing tables in a production network by Peter HesslerUsing routing domains / routing tables in a production network by Peter Hessler
Using routing domains / routing tables in a production network by Peter Hessler
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Bugs Ex Ante by Kristaps Dzonsons

  • 1. Thema In brief, the situation. You develop software. People use your software.
  • 2. Coda The situation, in brief. You develop software that is certainly broken. People are going to exploit it.
  • 3. Bugs Ex Ante Kristaps Dzonsons September 27, 2014 Or: how to protect system resources from the weakest link of the system: the developer.
  • 4.
  • 5. Coda write defensive code, use a team of auditors, QA use up-to-date, audited libraries with a history of attention to security use a language with formal underpinnings and construct proofs of correctness run on systems supporting your defensive strategy ride your unicorn to work every day.
  • 6. Adjustment: Expense write “defensive” code , use a team of auditors, QA use up-to-date , audited libraries with a history of attention to security use a language with formal underpinnings and construct proofs of correctness run on systems supporting your defensive strategy
  • 7. Adjustment: time write “defensive” code , use a team of auditors, QA use up-to-date , audited libraries with a history of attention to security use a language with formal underpinnings and construct proofs of correctness C run on systems supporting your defensive strategy
  • 8.
  • 9. Don’t Bring a Dog to a Cat Show Invariants: economics buggy software Variables: valuable resources
  • 10. Minimising the Goal Function How do we do this? resources ← software → users resources → software ← users Resource constraint: resources ←software → users resources →software ← users Consider how it’s been done to date. In the beginning. . .
  • 11. A Brief History of Restraint 1961 File Permissions (CTSS) 1964 Segment Permissions (Multics) 1969 Security Kernel (RC-4000) 1971 Access Control Lists (Lampson) 1972 Discretionary Access Controls (Project MAC, Multics) 1973 Bell-LaPadula Model 1975 Capabilities (Hydra) 1975 Access Isolation Mechanism (Project Guardian, Multics) CAP, System/38, MITRE, SRI, KSOS, Secure UNIX, . . .
  • 12. CTSS (IBM 7094) Figure : Credit: Wikimedia, ArnoldReinhold
  • 13. File Permissions (CTSS) Each U.F.D. contains information about the location and contents of the various files which the user has created. The U.F.D. is associated with a problem number and a programmer number. Also associated with certain problem numbers are “common files” – file directories which contain files of common interest and are directly accessible to all users on the problem number. Certain of the common files associated with the system programmers’ problem number (M1416) contain information of general utility and are accessible to all users. –CTSS Programmer’s Guide (AA.2 12/69): October 1965, MIT.
  • 14. Multics (GE-645) Figure : Credit: Tom Van Vleck, Multicians
  • 15. Segment Positions (Multics) Storage is logically organized in separately named data storage segments Associated with each segment is an access control list, an open-ended list of names of users who are permitted to reference the segment. . . . Whenever the process attempts to access a segment or other object cataloged by the storage system, the principal identifier of the process is compared with those appearing in the access control list of the object; if no match is found access is not granted. –Jerry Saltzer, Protection and the Control of Information Sharing in Multics: 1974, MIT.
  • 16. Access Isolation (Multics) Figure : Credit: Tom Van Vleck, Multicians –B2 Certification “Orange Book”, 1983.
  • 17. Hydra (PDP-11) Figure : Credit: Unknown Author
  • 18. Capabilities (Hydra) First, we must assume that any user-level program contains bugs and may even be malevolent. We therefore cannot allow any single user or application to “commandeer” the system to the detriment of others. By implication, we must prevent programs which define policies direct access to hardware or data which could be (mis)used to destroy another program. That is–such programs must execute in a protected environment. –R. Levin et al., Policy/Mechanism Separation in Hydra: CMU, 1975.
  • 19. Unfortunately... Figure : Paul Karger and Roger Schell, 1984. Credit: Tom Van Vleck . . . They tried to break Multics security on the MIT GE-645 that we all used as our timesharing utility and development build & exposure site. And break it they did. . . (1972–1974)
  • 20. What Went Wrong? (Multics) The large number of programs, as well as the very high internal intricacy level, frustrates line-by-line auditing for errors, misimplementation, or intentionally planted trapdoors. Economics. . . a function could be implemented more cheaply [than] in the most protected region. Rush to get on the air. Lack of understanding. –Jerry Saltzer, Protection and the Control of Information Sharing in Multics: 1974, MIT.
  • 21. What Went Wrong? (Hydra) Subsystem construction still suffers from being ad hoc, there being inadequate software support for managing the programs, data structures, and documentation which comprise the subsystem. –W. Wulf and S. Harbison, Reflections in a pool of processors–An experience report on C.mmp/Hydra: CMU, 1978.
  • 22. What about UNIX? In many ways, UNIX is a very conservative system. Only a handful of its ideas are genuinely now. In fact, a good case can be made that it is in essence a modern implementation of M.I.T.’s CTSS system. The UNIX system kernel and much of the software were written in a rather open environment, so the continuous, careful effort required to maintain a fully secure system has not always been expended; as a result, there are several security problems. –D. M. Ritchie, The UNIX Time-Sharing System: A Retrospective: 1976, AT&T Bell Labs.
  • 23. Bugs Ex Ante Kristaps Dzonsons September 27, 2014 Or,
  • 24. UNIX: “As Times Goes By” 1971 chmod(2), setuid(2) (V1 UNIX) 1979 chroot(2) (V7 UNIX) 1982 setrlimit(2) (4.1cBSD) 2000 jail(8) (FreeBSD 4.0) 2002 systrace(4) (OpenBSD?) 2003 POSIX.1e (FreeBSD 5.0, Mac OS X 10.4) 2007 kauth(9) (NetBSD 4.0) 2007 sandbox init(3) (Mac OS X 10.4) 2012 Capsicum (FreeBSD 9.0)
  • 25. Concepts Labelling: limit access only to labelled environment. POSIX.1e chmod(2), setuid(2) Containers: limit the environment. chroot(2) setrlimit(2) jail(8) Capabilities: limit access to the environment. systrace(4) Capsicum There’s lots of overlap.
  • 26. chmod(2), setuid(2) part of the original UNIX V1 forms the basis of privsep/privdrop (along with fork(2) et al.) On privilege separation... Doable in simple programs Requires complicated and very detailed programming –Theo de Raadt: OpenCON, 2005
  • 27. chroot(2) chroot() { if (suser()) chdirec(&u.u_rdir); } 1981 BSD commit by Bill Joy. . . if (dp == u.u_rdir && u.u_dent.d_name[0] == ’.’ && u.u_dent.d_name[1] == ’.’ && u.u_dent.d_name[2] == 0) goto cloop;
  • 28. setrlimit(2) Establish limits on resources, originally: CPU time data segment size stack segment size core file size physical memory size Now also (OpenBSD-current): largest file size maximum open files maximum size of locked memory maximum simultaneous processes for user These can be set and unset at will, so an attacker with arbitrary power can simply change the resource limits himself.
  • 29. jail(8) System interface by Poul-Henning Kamp in FreeBSD 4.0, further extended in FreeBSD 5.1 (jail attach(2)) and FreeBSD 8.0 (jail set(2)). Extends the chroot(2) concept into a constrained view of users, network, files, etc. Must be root. Cannot be recursive.
  • 30. systrace(4) Developed by Neils Provos (Improving Host Security with System Call Policies, USENIX Security 2003), now only in OpenBSD. Found vulnerable by Robert Watson, Exploiting Concurrency Vulnerabilities in System Call Wrappers, WOOT 2007. Uses the /dev/systrace device (open(2), ioctl(2), read(2)) to set a resource limitation policy (white-list, black-list) on process and process children. Must be root; can only be applied to children or other processes. (See privsep.)
  • 31. POSIX.1e: ACL Organised under TrustedBSD, April 2000, merged into FreeBSD 5.0 and Darwin 10.6. acl(3) File-system (VFS) access control. FreeBSD, Darwin. (Slightly differing.) setfacl(3) POSIX-compliant (not yet?) version.
  • 32. POSIX.1e: MAC Derived from TrustedBSD, April 2000, merged into FreeBSD 5.0 and Darwin 10.6 (and indirectly into NetBSD’s kauth(9 and secmodel(9)). mac(3), mac(4) FreeBSD interface. Full policy framework for MLS, Biba, etc. Manuals inspired by the Voynich manuscript. sandbox init(3) Darwin 10.6 one-function entry into MAC sandbox. Manuals inspired by haiku.
  • 33. kauth(9) In-kernel authorisation framework (like FreeBSD’s mac(9), etc.). Inspired by Mac 10.4. Not exposed to user-land, but would enable a user-land equivalent to mac(4), sandbox init(3), etc.
  • 34. sandbox init(3) Mandatory access control interface introduced in Darwin 10.6. Based on FreeBSD and POSIX.1e. Almost no documentation. See OpenSSH’s sandbox-darwin.c for some significant “gotchas”. Limitation profiles available: kSBXProfileNoInternet, kSBXProfileNoNetwork, kSBXProfileNoWrite, kSBXProfileNoWriteExceptTemporary, kSBXProfilePureComputation.
  • 35. Capsicum Recent capabilities (see rights(4)) innovation on FreeBSD, inherited from TrustedBSD. Sits between systrace(4) and sandbox init(3) in terms of complexity: requires consideration of each resource, but (in theory) doesn’t need a fork(2) for processing children (except for process limitations, pdfork(2)). Used in bspatch(1), bsdiff(1), tcpdump(1), fetch(1), bzip2(1), syslogd(8), . . . Requires a significant addition of functions: prfork(2), . . .
  • 36. Case Study: OpenSSH Designing software resistent to developer bugs is hard. Too hard. Consider one of the canonical sandboxed applications, OpenSSH (5.8). Introduce sandboxing of the pre-auth privsep child using an optional sshd config(5) “UsePrivilegeSeparation=sandbox” mode that enables mandatory restrictions on the syscalls the privsep child can perform. This intention is to prevent a compromised privsep child from being used to attack other hosts (by opening sockets and proxying) or probing local kernel attack surface.
  • 37. One Step Ahead, Two Steps Behind % wc -l *sandbox* 122 sandbox-capsicum.c 98 sandbox-darwin.c 72 sandbox-null.c 97 sandbox-rlimit.c 240 sandbox-seccomp-filter.c 200 sandbox-systrace.c 24 ssh-sandbox.h 853 total This is ridiculously complicated!
  • 38. Methodology Sandbox method for systrace(4): 1. parent fork(2) a child, wait for child to SIGSTOP 2. child emits a SIGSTOP 3. parent prepare systrace(4) policy for child 4. parent sends SIGCONT to child 5. child continues in sandbox Sandbox method on other platforms: 1. parent fork(2) a child 2. child prepares sandbox environment 3. child continues in sandbox
  • 39. Case Study: kcgi % wc -l sandbox* 72 sandbox-darwin.c 249 sandbox-systrace.c 366 sandbox.c 687 total
  • 40. Methodology Inherit structure of OpenSSH. Work around CGI environment: not a root process, already in a chroot(2, unknown number of file descriptors already open.
  • 41. Questionable Morals The moral is obvious. You can’t trust code that you did not totally create yourself. (Especially code from companies that employ people like me.) No amount of source-level verification or scrutiny will protect you from using untrusted code. –Ken Thompson, Reflections on Trusting Trust, 1984.
  • 42. Thank You! Figure : Credit: unknown author