Engineering Secure Software. Key Principles  Principle of Least privilege  Defense in Depth  Obviously No Vulnerabilities (vs. No Obvious)  i.e. Assume.

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

November 1, 2004Introduction to Computer Security ©2004 Matt Bishop Slide #12-1 Chapter 12: Design Principles Overview Principles –Least Privilege –Fail-Safe.
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Resource Containers: A new Facility for Resource Management in Server Systems G. Banga, P. Druschel,
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Reza hooshangi ( ). short history  One of the last major challenges for the web is to enable human communication via voice and video: Real Time.
Chorus Vs Unix Operating Systems Overview Introduction Design Principles Programmer Interface User Interface Process Management Memory Management File.
ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 8: Application Layer Dr. Nghi Tran.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
1 Steve Chenoweth Friday, 10/21/11 Week 7, Day 4 Right – Good or bad policy? – Asking the user what to do next! From malware.net/how-to-remove-protection-system-
1 Design Principles CSSE 490 Computer Security Mark Ardis, Rose-Hulman Institute April 13, 2004.
Design Principles Overview Principles Least Privilege Fail-Safe Defaults Economy of Mechanism Complete Mediation Open Design Separation of Privilege Least.
An Integrated Framework for Dependable Revivable Architectures Using Multi-core Processors Weiding Shi, Hsien-Hsin S. Lee, Laura Falk, and Mrinmoy Ghosh.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
3.5 Interprocess Communication
Networking Support In Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Communication in Distributed Systems –Part 2
CS-3013 & CS-502, Summer 2006 Network Input & Output1 CS-3013 & CS-502, Summer 2006.
1 Security and Software Engineering Steven M. Bellovin AT&T Labs – Research
Basic Networking & Interprocess Communication Vivek Pai Nov 27, 2001.
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
Designing Security In Web Applications Andrew Tomkowiak 10/8/2013 UW-Platteville Software Engineering Department
Operating Systems CSE 411 CPU Management Sept Lecture 11 Instructor: Bhuvan Urgaonkar.
CS252: Systems Programming Ninghui Li Final Exam Review.
Agenda  Terminal Handling in Unix File Descriptors Opening/Assigning & Closing Sockets Types of Sockets – Internal(Local) vs. Network(Internet) Programming.
Chapter 9 Message Passing Copyright © Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere2 Introduction.
1 COMPSCI 110 Operating Systems Who - Introductions How - Policies and Administrative Details Why - Objectives and Expectations What - Our Topic: Operating.
CMSC 414 Computer (and Network) Security Lecture 14 Jonathan Katz.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
Architecting Web Services Unit – II – PART - III.
1 COMPSCI 110 Operating Systems Who - Introductions How - Policies and Administrative Details Why - Objectives and Expectations What - Our Topic: Operating.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
4P13 Week 1 Talking Points. Kernel Organization Basic kernel facilities: timer and system-clock handling, descriptor management, and process Management.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
1 Welcome to CSC 301 Web Programming Charles Frank.
Privilege separation in Condor Bruce Beckles University of Cambridge Computing Service.
The Mach System Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Presentation By: Agnimitra Roy.
CE Operating Systems Lecture 13 Linux/Unix interprocess communication.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
1 COMPSCI 110 Operating Systems Who - Introductions How - Policies and Administrative Details Why - Objectives and Expectations What - Our Topic: Operating.
PwC New Technologies New Risks. PricewaterhouseCoopers Technology and Security Evolution Mainframe Technology –Single host –Limited Trusted users Security.
Lecture 13 Page 1 CS 236 Online Principles for Secure Software Following these doesn’t guarantee security But they touch on the most commonly seen security.
Security Architecture of qmail and Postfix Authors: Munawar Hafiz Ralph E. Johnson Prepared by Geoffrey Foote CSC 593 Secure Software Engineering Seminar.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
1 Isolating Web Programs in Modern Browser Architectures CS6204: Cloud Environment Spring 2011.
4061 Session 13 (2/27). Today Pipes and FIFOs Today’s Objectives Understand the concept of IPC Understand the purpose of anonymous and named pipes Describe.
Lecture 4 Page 1 CS 111 Online Modularity and Virtualization CS 111 On-Line MS Program Operating Systems Peter Reiher.
Fall 2008CS 334: Computer SecuritySlide #1 Design Principles Thanks to Matt Bishop.
June 1, 2004Computer Security: Art and Science © Matt Bishop Slide #13-1 Chapter 13: Design Principles Overview Principles –Least Privilege –Fail-Safe.
Lecture9 Page 1 CS 236 Online Operating System Security, Con’t CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
R Some of these slides are from Prof Frank Lin SJSU. r Minor modifications are made. 1.
June 1, 2004© Matt Bishop [Changed by Hamid R. Shahriari] Slide #13-1 Chapter 13: Design Principles Overview Principles –Least Privilege –Fail-Safe.
Slide #13-1 Design Principles CS461/ECE422 Computer Security I Fall 2008 Based on slides provided by Matt Bishop for use with Computer Security: Art and.
Engineering Secure Software. A Ubiquitous Concern  You can make a security mistake at every step of the development lifecycle  Requirements that allow.
Lecture 14 Page 1 CS 236 Online Secure Programming CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
Distrustful Decomposition
Announcement Project 2 Due Project 3 will be out this weekend.
Prof. Leonardo Mostarda University of Camerino
Distrustful Decomposition
ECE 4450:427/527 - Computer Networks Spring 2017
Operating Systems Structure
Preventing Privilege Escalation
Secure Design Patterns
Design Principles Thanks to Matt Bishop 2006 CS 395: Computer Security.
Presentation transcript:

Engineering Secure Software

Key Principles  Principle of Least privilege  Defense in Depth  Obviously No Vulnerabilities (vs. No Obvious)  i.e. Assume they get past that other defenses, how do we: Protect the inner parts of the system? Limit the capabilities of the attacker? Believe our critical subsystems are secure?  Note: in this lecture “process” == “executing program” ©2015 Andrew Meneely

Permissions Challenges  When programs are executed, the code has permissions (via executing user, setuid, setgid, etc.)  Many programs need elevated (root) permissions to function Web servers: listen & respond on HTTP, e.g. port 80 servers: listen & respond on SMTP, e.g. port 25 Mobile apps: listening for text messages vs. displaying previews What permissions are truly needed, and when?  Some programs have entirely separate functions that should not impact each other Browsers: one web page should not impact the others  Solution: design your architecture around your permissions needs

Distrustful Decomposition  Decompose the system into separate processes with separate permissions i.e. fork() NOT threads. Threads still have shared memory.  Communicate via inter-process communication (see next slides)  Each process distrusts the other i.e. validate the input from the other process i.e. re-check credentials and integrity mechanisms  Simplify the root-level subsystems to an extreme extent  Outcomes Complex code gets sandboxed  reduce impact of an exploit More security checks get incorporated throughout the code Incorporate distrust at the architecture level

Inter-Process Communication: Simple Techniques  Files Simplest for most developers Locking on files must be respected (concurrency challenges  complexity!!)  Signals Simple messaging, not for transferring data Pre-defined by OS (Unix has ~30 of these) e.g. SIGINT, SIGTERM, SIGKILL, SIGSEGV, SIGPOLL  Clipboard Can set and get clipboard programmatically Users don’t like you messing with this… …but you see it increasingly used in Web apps today

IPC: Advanced Techniques  Named pipes a.k.a. a FIFO buffer Define a “virtual file” that one process can write to and another process reads from Supported at the OS (file system) level $ mkfifo --mode=0640 /tmp/irc_packets BTW: stdin and stdout are part of using unnamed pipes! Pro: fast!! Con: on the same system  Sockets Write to a traditional networked socket via the OS network interface Sockets can be set to “loop back” to the original machine if needed Pro: scalable to multiple systems! Con: slower  MANY more IPC strategies: message passing, message queues, technology-specific solutions (e.g. Java RMI), memory-mapped files Constantly evolving ecosystem due to security, reliability, simplicity, etc.

e.g. QMail Remote server Root-level SMTP sending VERY SMALL & SIMPLE User-level operations Queue management CLI processing Error handling Configuration Virtual domains Delivery to client etc. Trust & Machine boundaries Trust boundary IPC via files, SIGPOLL Root-level SMTP listening VERY SMALL & SIMPLE IPC via files

e.g. Sorta DD: Google Chrome  Each browser tab is a separate process IPC is accomplished primarily through files via their own IPC subsystem Some IPC OS-specific mechanisms for synchronous message passing Restrict rendering processes to their individual tabs  BUT! Not exactly “Distrustful” OS-level file permissions are not employed Still a lot of threads and shared memory for performance Vulnerabilities can occur where direct file access results in effective IPC

e.g. Gone Wrong: Stage Fright  Stage Fright Android Vulnerability of 2015 Buffer overflow in video transcoding function that produces a preview thumbnail on Android text messages Send a crafted video to a phone  arbitrary code execution No user intervention required (i.e. previews are automatically generated)  BUT! Process listening to text messages requires root privs Process for producing thumbnails also ran as root Arbitrary code execution as root  cover your tracks  Lesson: Separate complex, non-root functionality Avoid buffer overflows, of course.

Design & Project Implications  Distrustful Decomposition is not something you want to do procrastinate Easier to build upon than bolt on Introduces distrust at key points in the system Introduces necessary complexity into your system  IPC abstracted into a subsystem is often the next step after DD Requires input validation and output normalization/sanitization Requires defining the communication protocols Conway’s Law may even help: separate duties among developers along process lines