Design and Implementation Principles for Secure Systems.

Slides:



Advertisements
Similar presentations
Chapter ADCS CS262/0898/V1 Chapter 1 An Introduction To Computer Security TOPICS Introduction Threats to Computer Systems –Threats, Vulnerabilities.
Advertisements

Operating System Security
November 1, 2004Introduction to Computer Security ©2004 Matt Bishop Slide #12-1 Chapter 12: Design Principles Overview Principles –Least Privilege –Fail-Safe.
Chapter 1  Introduction 1 Introduction Chapter 1  Introduction 2 The Cast of Characters  Alice and Bob are the good guys  Trudy is the bad guy 
Chapter 1  Introduction 1 Chapter 1: Introduction.
Chapter 1  Introduction 1 Chapter 1: Introduction “Begin at the beginning,” the King said, very gravely, “and go on till you come to the end: then stop.”
Understand Database Security Concepts
Secure Design Principles  secure the weakest link  reduce the attack surface  practice defense in depth  minimize privilege  compartmentalize  fail.
1 Design Principles CSSE 490 Computer Security Mark Ardis, Rose-Hulman Institute April 13, 2004.
Lecture 2 Page 1 CS 236, Spring 2008 Security Principles and Policies CS 236 On-Line MS Program Networks and Systems Security Peter Reiher Spring, 2008.
19.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 19: Security The Security Problem Authentication Program Threats.
System and Network Security Practices COEN 351 E-Commerce Security.
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
Design Principles Overview Principles Least Privilege Fail-Safe Defaults Economy of Mechanism Complete Mediation Open Design Separation of Privilege Least.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
Building Secure Software Chapter 9 Race Conditions.
Chapter 1  Introduction 1 Chapter 1: Introduction “Begin at the beginning,” the King said, very gravely, “and go on till you come to the end: then stop.”
Assessing the Threat How much money is lost due to cyber crimes? –Estimates range from $100 million to $100s billions –Why the discrepancy? Companies don’t.
1 Security and Software Engineering Steven M. Bellovin AT&T Labs – Research
Designing Security In Web Applications Andrew Tomkowiak 10/8/2013 UW-Platteville Software Engineering Department
D ATABASE S ECURITY Proposed by Abdulrahman Aldekhelallah University of Scranton – CS521 Spring2015.
ISEC0511 Programming for Information System Security
Lecture 18 Page 1 CS 111 Online Design Principles for Secure Systems Economy Complete mediation Open design Separation of privileges Least privilege Least.
A Security Review Process for Existing Software Applications
Computer Security and Penetration Testing
Buffer Overflows Lesson 14. Example of poor programming/errors Buffer Overflows result of poor programming practice use of functions such as gets and.
OSI and TCP/IP Models And Some Vulnerabilities AfNOG th May 2011 – 10 th June 2011 Tanzania By Marcus K. G. Adomey.
The Protection of Information in Computer Systems Part I. Basic Principles of Information Protection Jerome Saltzer & Michael Schroeder Presented by Bert.
Attacking Applications: SQL Injection & Buffer Overflows.
FIREWALLS Vivek Srinivasan. Contents Introduction Need for firewalls Different types of firewalls Conclusion.
SEC835 Practical aspects of security implementation Part 1.
Engineering Secure Software. A Ubiquitous Concern  You can make a security mistake at every step of the development lifecycle  Requirements that allow.
Software Security and Security Engineering (Part 2)
Privilege separation in Condor Bruce Beckles University of Cambridge Computing Service.
Information Security What is Information Security?
Linux Security. Authors:- Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of CodeSourcery LLC published by New Riders Publishing.
Security CS Introduction to Operating Systems.
14.1/21 Part 5: protection and security Protection mechanisms control access to a system by limiting the types of file access permitted to users. In addition,
Database Role Activity. DB Role and Privileges Worksheet.
Security: The Goal Computers are as secure as real world systems, and people believe it. This is hard because: Computers can do a lot of damage fast. There.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
Intro to Computer Security For COP3502, Intro to Computer Science Lecture 1 1.
Computer Security By Duncan Hall.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Protection.
Design Principles and Common Security Related Programming Problems
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.
LINUX Presented By Parvathy Subramanian. April 23, 2008LINUX, By Parvathy Subramanian2 Agenda ► Introduction ► Standard design for security systems ►
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.
Security Principles.
1 Design Principles CS461 / ECE422 Spring Overview Simplicity  Less to go wrong  Fewer possible inconsistencies  Easy to understand Restriction.
Chapter 29: Program Security Dr. Wayne Summers Department of Computer Science Columbus State University
NETWORK SECURITY LAB 1170 REHAB ALFALLAJ CT1406. Introduction There are a number of technologies that exist for the sole purpose of ensuring that the.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
Engineering Secure Software. A Ubiquitous Concern  You can make a security mistake at every step of the development lifecycle  Requirements that allow.
CS457 Introduction to Information Security Systems
SE-1021 Software Engineering II
CMSC 345 Defensive Programming Practices from Software Engineering 6th Edition by Ian Sommerville.
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
Outline What does the OS protect? Authentication for operating systems
A Security Review Process for Existing Software Applications
Outline What does the OS protect? Authentication for operating systems
Chapter 29: Program Security
Security Principles and Policies CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Design Principles Thanks to Matt Bishop 2006 CS 395: Computer Security.
Presentation transcript:

Design and Implementation Principles for Secure Systems

Readings Secure Design Principles

Categories of exploitable flaws Design philosophy Design DO’s Design and Implementation DON’T’s

Categories of Exploitable Flaws 1.Architecture and design flaws: things overlooked or not planned for in the original design. 2.Implementation flaws: mistakes in coding. 3.Operational flaws: Procedural problems in how the software is used or administered.

Architecture/Design Attacks Program is used in a new way. Two utilities piped together with unintended consequences. Replay attack. Man-in-the-middle attack / session hijacking Sniffer attack: eavesdropper gathers info over time Race condition (between time of authentication to time of use); incomplete mediation

Implementation Level Attacks Buffer overflow: a fixed length buffer is allocated by the program and at runtime, the attacker fills the buffer with more data than it can hold. Defense: length check all input! Back door attack: many programs have special code that allows access controls to be bypassed for administration or maintenance.

Implementation Level Attacks Parsing error attack: result of an incomplete checking of input. Ex: program allows input of a path (mydir/myfile.txt) but doesn’t protect against./.. (up a level) and various hexadecimal or Unicoded strings.

Operations Level Attacks Denial-of-service (can also be design level): resources get used up Default accounts attack: Many programs are shipped configured with standard accounts and passwords. Guest/guest and field/service are examples. Password cracking

Design Philosophy for high assurance software

Learn From the Real World Real world security decisions based on: –value, locks, and police Need good enough locks so that the "bad guys" can't break in too often. The terms "good enough," "break in" and "too often" are key. Assume that the police and courts work, so "bad guys" are caught and punished. "Police" in this context is any agency that might pursue offenders. Expected gain from committing a crime must be negative. Value is important. Generally we do not protect things of little value.

Locks A constraint on any security mechanism is that it by minimally disruptive. Locks must not be difficult or annoying to use. If they are, people will find ways to circumvent the annoyance and thus nullify the security protections. Risk management allows recovery from a security problem and decreases the need for complex and annoying locks. For example, rather than installing a complicated locking system for automobiles we buy auto insurance to help deal with costs that arise in the event of damage or theft.

Locks and Security The environment also influences the type and strength of the locks being used as well. People pay for security they believe they need. Security is scaled with respect to both the value of the thing being secured and the threat against it.

Application to Computer Security Authentication and authorization along with cryptographic techniques are the locks. Confidentiality, Integrity, Availability is the value to be protected. Audit logs, and computer forensics techniques are added to police.

Design Principles: the Do’s Economy of Mechanism Open Design Principle of Least Privilege Complete Mediation Separation of Privilege Failsafe Defaults Diversity of Mechanism Multiple Lines of Defense

Economy of Mechanism Use simple and straightforward mechanisms wherever possible. Avoid a lot of extra features. Bells and whistles add complication, and that introduces errors. The simplest mechanism that does the job is the best.

Open Design No security through obscurity. The security of a mechanism should not depend on attacker's ignorance of how the mechanism works or is built. This principle is controversial. Showing a design or source code to attackers certainly makes their task easier. NSA, for instance, refused to publish their analysis that the DES encryption algorithm is secure. Does this make you more confident in the security of DES? Publicizing the design give security researchers the opportunity to find and fix the flaws before the attackers do.

Principle of Least Privilege Every program and every user should operate using the minimum set of privileges necessary to complete the job. This limits the damage that can result from an accident or error, and it limits the number of privileged programs (which could be compromised) in the system. It also helps in debugging, is good for increasing assurance, and allows isolation of small critical subsystems.

Complete Mediation Complete Mediation. Every access to every object is checked. Thus, some interfaces must be monitored---the interface might be defined in terms of method calls or it might be defined in terms of individual instructions. Example: process for user A opens a file; user A is terminated revoking all his privileges; process accesses file which has been open for days and user privilege is not verified.

Separation of Privilege Two keys are better than one. Each privilege should require a separate secret. Separate passwords for separate objects. This allows fine-grained control of access to the system, and limits what can be compromised if a single secret is revealed. Can be overly cumbersome for the user.

Failsafe Defaults The default option is to maintain security. If the system fails, it will fail safely. (Because attackers may be able to make it fail) It is much better (and less prone to error) to define who can have access that to directly define who cannot. Problem: user needs a privilege that was not anticipated so his work is delayed while the privilege is authorized.

Diversity of Mechanism Diversity of Mechanism Security mechanisms that have the same design or follow similar logic are likely to fail in similar ways (hence, at the same time or fall to the same trick of an attacker). Diverse mechanisms are unlikely to share vulnerabilities. With diverse mechanisms, the odds are increased that no single vulnerability is common to all.

Multiple Lines of Defense Unfortunately, no security mechanism is totally secure. Plan for something to fail and have a second (and third) line of defense. Example: Try to keep the bad guys out (firewall) but if they do get in, minimize the harm they can do (strict access controls), and if they manage to get access, have good audit logs so you can track them down and prosecute.

A Practical Example It you must use an existing, unsafe application, use it with a wrapper. A wrapper is one way to make an existing application more secure.

Wrappers Make the real application inaccessible Replace the old access with a small program or script that: 1.Checks the command line parameters 2.Prepares a restricted runtime environment for the target app 3.Invokes the target app

Overflow wrapper ftp://ftp.auscert.org.au/pub/auscert/tools/overflow/ overflow_wrapper.c This wrapper is designed to limit exploitation of programs which have command line argument buffer overflow vulnerabilities. The vulnerable program is replaced by this wrapper. The original vulnerable program being moved to another location and its permissions restricted. This wrapper checks each argument's length to ensure it doesn't exceed a given length before executing the original program.

#include main(argc,argv,envp) int argc; char *argv[]; char *envp[]; { int i; for (i=0; i<argc; i++) { if (strlen(argv[i]) > MAXARGLEN) { fprintf(stderr,“exceeded argument length...Exiting\n"); #ifdef SYSLOG /* log error */ #endif exit(1); } execve(REAL_PROG, argv, envp); perror("execve failed"); exit(1); }

Bad Practices: The Don’t’s Using Files and File Names Invoking Other Programs Handling Passwords Storage and Memory Other

Using Files and Filenames Don’t write code that uses relative filenames. Filename references should be fully qualified, that is, start with “/” or “\”. Relative filenames can make it possible to change the file referred to by changing the “current” or “working” directory. Don’t refer to a file twice in the same program by its name. Open the file once by name, then use the file handle from then on. Otherwise, race conditions can occur or an attacker could switch files.

Files and Filenames Don’t rely on operating system level file protection mechanisms to prevent unauthorized file access. It is good practice to use OS provided access control mechanisms, but your application should rely on a separate access control in case the OS is compromised.

Invoking Other Programs Don’t invoke untrusted programs from within trusted ones. It is almost always better to do the work yourself and refrain from taking what looks like a shortcut. You don’t know what the untrusted program might do on your behalf it may invoke a third program with many security flaws. Don’t invoke a shell or command line. If you absolutely must, obscure all state information before the shell escape.

Handling Passwords Don’t keep sensitive data in a database without password protection. Don’t rely on DB access controls. Don’t echo passwords or display them on the screen for any reason. (some web sites do this) Don’t issue passwords via . This common practice reduces the level of protection to the user’s mail folder (not very secure). Don’t code usernames or passwords into an application. If you absolutely must, be sure it can’t be read in the object code.

Storage and Memory Don’t use world-writeable storage, even temporarily. It gives attackers a chance to examine anything you put there. Don’t store passwords or sensitive data on disk (even temporarily) without encryption. Same reason. Don’t trust user-writeable storage not to be tampered with. Assume your user is malicious.

Other Don’t assume that your users are not malicious – even if you are writing for a small set of in- house trusted employees. Check all inputs, especially input from other programs. Don’t “dump core”. This used to be the answer to unfixable problems. Unfortunately, hackers can create unfixable problems and use the core dump. Don’t assume success. After a system call, check the exit conditions and try to handle errors. Not checking can lead to race conditions, file overwrites and other flaws that can be exploited.

Other Don’t confuse “random” with “pseudo- random”. Most random number generators are really pseudo-random. That is, statistically random, but predictable. Predictability is death in cryptography. Don’t authenticate on untrusted data. IP numbers and addresses can be spoofed and hence do not identify a process or user. Don’t transmit passwords or sensitive data without encryption.