Secure Design James Walden Northern Kentucky University.

Slides:



Advertisements
Similar presentations
November 1, 2004Introduction to Computer Security ©2004 Matt Bishop Slide #12-1 Chapter 12: Design Principles Overview Principles –Least Privilege –Fail-Safe.
Advertisements

Understand Database Security Concepts
VM: Chapter 5 Guiding Principles for Software Security.
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.
19.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 19: Security The Security Problem Authentication Program Threats.
Design Principles Overview Principles Least Privilege Fail-Safe Defaults Economy of Mechanism Complete Mediation Open Design Separation of Privilege Least.
CS-550 (M.Soneru): Protection and Security - 1 [SaS] 1 Protection and Security.
(Breather)‏ Principles of Secure Design by Matt Bishop (augmented by Michael Rothstein)‏
Silberschatz, Galvin and Gagne  Operating System Concepts Module 19: Security The Security Problem Authentication Program Threats System Threats.
April 1, 2004ECS 235Slide #1 Chapter 1: Introduction Components of computer security Threats Policies and mechanisms The role of trust Assurance Operational.
1 cs691 chow C. Edward Chow Design Principles for Secure Mechanisms CS591 – Chapter 5.4 Trusted OS Design CS691 – Chapter 13 of Matt Bishop.
C. Edward Chow Presented by Mousa Alhazzazi C. Edward Chow Presented by Mousa Alhazzazi Design Principles for Secure.
Operating Systems.
FIREWALL TECHNOLOGIES Tahani al jehani. Firewall benefits  A firewall functions as a choke point – all traffic in and out must pass through this single.
Intranet, Extranet, Firewall. Intranet and Extranet.
Lecture 18 Page 1 CS 111 Online Design Principles for Secure Systems Economy Complete mediation Open design Separation of privileges Least privilege Least.
Secure Design Principles CSC 482/582: Computer SecuritySlide #1.
1 Group Account Administration Introduction to Groups Planning a Group Strategy Creating Groups Understanding Default Groups Groups for Administrators.
Secure Design James Walden Northern Kentucky University.
CMSC 414 Computer (and Network) Security Lecture 14 Jonathan Katz.
The Protection of Information in Computer Systems Part I. Basic Principles of Information Protection Jerome Saltzer & Michael Schroeder Presented by Bert.
Cryptography, Authentication and Digital Signatures
Software Security and Security Engineering (Part 2)
 Chapter 14 – Security Engineering 1 Chapter 12 Dependability and Security Specification 1.
Network Security. 2 SECURITY REQUIREMENTS Privacy (Confidentiality) Data only be accessible by authorized parties Authenticity A host or service be able.
Week 10-11c Attacks and Malware III. Remote Control Facility distinguishes a bot from a worm distinguishes a bot from a worm worm propagates itself and.
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,
1 Network Firewalls CSCI Web Security Spring 2003 Presented By Yasir Zahur.
Security and Firewalls Ref: Keeping Your Site Comfortably Secure: An Introduction to Firewalls John P. Wack and Lisa J. Carnahan NIST Special Publication.
Chap1: Is there a Security Problem in Computing?.
Security fundamentals Topic 10 Securing the network perimeter.
Security fundamentals Topic 2 Establishing and maintaining baseline security.
CSC 382: Computer SecuritySlide #1 CSC 382: Computer Security Secure Design Principles.
Security Architecture of qmail and Postfix Authors: Munawar Hafiz Ralph E. Johnson Prepared by Geoffrey Foote CSC 593 Secure Software Engineering Seminar.
(Breather)‏ Principles of Secure Design by Matt Bishop (augmented by Michael Rothstein)‏
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.
Role Of Network IDS in Network Perimeter Defense.
LINUX Presented By Parvathy Subramanian. April 23, 2008LINUX, By Parvathy Subramanian2 Agenda ► Introduction ► Standard design for security systems ►
Computer Security Sample security policy Dr Alexei Vernitski.
1 Chapter 12: Design Principles Overview –There are principles for many kinds of design Generally, a design should consider: Balance, Rhythm, Proportion,
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.
1 Design Principles CS461 / ECE422 Spring Overview Simplicity  Less to go wrong  Fewer possible inconsistencies  Easy to understand Restriction.
By: Brett Belin. Used to be only tackled by highly trained professionals As the internet grew, more and more people became familiar with securing a network.
Lecture 19 Page 1 CS 236 Online 6. Application Software Security Why it’s important: –Security flaws in applications are increasingly the attacker’s entry.
Security fundamentals
Securing Network Servers
CSC 482/582: Computer Security
Protecting Memory What is there to protect in memory?
Critical Security Controls
Security+ All-In-One Edition Chapter 1 – General Security Concepts
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
CIT 480: Securing Computer Systems
Firewalls.
Outline What does the OS protect? Authentication for operating systems
Chapter 13: Design Principles
How to Mitigate the Consequences What are the Countermeasures?
Computer Security: Art and Science, 2nd Edition
Security.
Chapter 13: Design Principles
Operating System Concepts
Designing IIS Security (IIS – Internet Information Service)
Preventing Privilege Escalation
6. Application Software Security
Design Principles Thanks to Matt Bishop 2006 CS 395: Computer Security.
Presentation transcript:

Secure Design James Walden Northern Kentucky University

CSC 666: Secure Software Engineering Topics 1.Risk Analysis 2.Design Principles 3.Design By Contract 4.Legacy Issues

Risk Analysis Fix design flaws, not implementation bugs. Risk analysis steps 1.Develop an architecture model. 2.Identify threats and possible vulnerabilities. 3.Develop attack scenarios. 4.Rank risks based on probability and impact. 5.Develop mitigation strategy. 6.Report findings

CSC 666: Secure Software Engineering Meta Principles 1.Simplicity  Fewer components and cases to fail.  Fewer possible inconsistencies.  Easy to understand. 2.Restriction  Minimize access.  Inhibit communication.

CSC 666: Secure Software Engineering Security Design Principles 1.Least Privilege 2.Fail-Safe Defaults 3.Economy of Mechanism 4.Complete Mediation 5.Open Design 6.Separation of Privilege 7.Least Common Mechanism 8.Psychological Acceptability

CSC 666: Secure Software Engineering Least Privilege  A subject should be given only those privileges necessary to complete its task.  Function, not identity, controls.  Rights added as needed, discarded after use.  Minimal protection domain.  Most common violation:  Running as administrator or root.  Use runas or sudo instead.

CSC 666: Secure Software Engineering Least Privilege Example  Problem: A web server.  Serves files under /usr/local/http.  Logs connections under /usr/local/http/log.  HTTP uses port 80 by default.  Only root can open ports <  Solution:  Web server runs as root user.  How does this solution violate the Principle of Least Privilege and how could we fix it?

CSC 666: Secure Software Engineering How do we run with least privilege?  List required resources and special tasks  Files  Network connections  Change user account  Backup data  Determine what access you need to resources  Access Control model  Do you need create, read, write, append, &c?

CSC 666: Secure Software Engineering Fail-Safe Defaults  Default action is to deny access.  When an action fails, system must be restored to a state as secure as the state it was in when it started the action.

CSC 666: Secure Software Engineering Fail Safe Defaults Example  Problem: Retail credit card transaction.  Card looked up in vendor database to check for stolen cards or suspicious transaction pattern.  What happens if system cannot contact vendor?  Solution  No authentication, but transaction is logged.  How does this system violate the Principle of Fail-Safe Defaults?

CSC 666: Secure Software Engineering Fail Safe Defaults Example  Problem: MS Office Macro Viruses.  MS office files can contain Visual Basic code (macros.)  MS Office automatically executes certain macros when opening a MS Office file.  Users can turn off automatic execution.  Don’t mix code and data!  Solution  MS Office XP has automatic execution of macros turned off by default.  While the solution is a fail-safe default, does it follow least privilege too?

CSC 666: Secure Software Engineering Economy of Mechanism  Keep it as simple as possible (KISS).  Use the simplest solution that works.  Fewer cases and components to fail.  Reuse known secure solutions  i.e., don’t write your own cryptography.

CSC 666: Secure Software Engineering Economy of Mechanism Example  Problem: SMB File Sharing Protocol.  Used since late 1980s.  Newer protocol version protects data integrity by employing packet signing technique.  What do you do about computers with older versions of protocol?  Solution:  Let client negotiate SMB version to use.  How does this solution violate economy of mechanism?

CSC 666: Secure Software Engineering Complete Mediation  Check every access.  Usually checked once, on first access:  UNIX: File ACL checked on open(), but not on subsequent accesses to file.  If permissions change after initial access, unauthorized access may be permitted.  bad example: DNS cache poisoning

CSC 666: Secure Software Engineering Open Design Security should not depend on secrecy of design or implementation.  Popularly misunderstood to mean that source code should be public.  “Security through obscurity”  Refers to security policy and mechanism, not simple user secrets like passwords and cryptographic keys.

CSC 666: Secure Software Engineering Open Design Example:  Problem: MPAA wants control over DVDs.  Region coding, unskippable commercials.  Solution: CSS (Content Scrambling System)  CSS algorithm kept secret.  DVD Players need player key to decrypt disk key on DVD to descript movie for playing. -Encryption uses 40-bit keys. -People w/o keys can copy but not play DVDs.  What happened next?  CSS algorithm reverse engineered.  Weakness in algorithm allows disk key to be recovered in an attack of complexity 2 25, which takes only a few seconds.

CSC 666: Secure Software Engineering Closed Source  Security through obscurity.  Assumes code in binary can’t be read  what about disassemblers?  what about decompilers?  what about debuggers?  what about strings, lsof, truss, /proc?  Reverse engineering.

CSC 666: Secure Software Engineering Open Source  Linus’ Law: Given enough eyeballs, all bugs are shallow.  Not so effective for security  More incentives to add features than security.  Few people have skills to find security holes.  Having source eliminates a barrier to entry for crackers.

CSC 666: Secure Software Engineering Separation of Privilege Require multiple conditions to grant access.  Separation of duty.  Compartmentalization.  Defence in depth.

CSC 666: Secure Software Engineering Separation of Duty  Functions are divided so that one entity does not have control over all parts of a transaction.  Example:  Different persons must initiate a purchase and authorize a purchase.  Two different people may be required to arm and fire a nuclear missile.

CSC 666: Secure Software Engineering Compartmentalization  Problem: A security violation in one process should not affect others.  Solution: Virtual Memory  Each process gets its own address space.  In what ways is this solution flawed? -i.e., how can the compartments communicate?  How could we improve compartmentalization of processes?

CSC 666: Secure Software Engineering Defence in Depth  Diverse defensive strategies  Different types of defences. -Protection -Detection -Reaction  Different implementations of defences.  If one layer pierced, next layer may stop.  Avoid “crunchy on the outside, chewy on the inside” network security.  Contradicts “Economy of Mechanism”  Think hard about more than 2 layers.

CSC 666: Secure Software Engineering Defence in Depth Example  Problem: Bank.  How to secure the money?  Solution: Defence in depth.  Guards inside bank.  Closed-circuit cameras monitor activity.  Tellers do not have access to vault.  Vault has multiple defences: -Time-release. -Walls and lock complexity. -Multiple compartments.

CSC 666: Secure Software Engineering Least Common Mechanism  Mechanisms used to access resources should not be shared.  Information can flow along shared channels.  Covert channels.  Contradicts Economy of Mechanism?

CSC 666: Secure Software Engineering Least Common Mechanism  Problem:  Compromising web server allows attacker access to entire machine.  Solution  Run web server as non-root user.  Attacker still gains “other” access to filesystem.  Run web server in chroot jail.

CSC 666: Secure Software Engineering Psychological Acceptability Security mechanisms should not add to the difficulty of accessing a resource.  Hide complexity introduced by security mechanisms.  Ease of installation, configuration, and use.  Human factors critical here.

CSC 666: Secure Software Engineering Psychological Acceptability  Users will not read documentation.  Make system secure in default configuration.  Users will not read dialog boxes.  Don’t offer complex choices.  example: Mozilla/IE certificate dialogs.  Privacy vs Usability  example: one-click shopping

CSC 666: Secure Software Engineering Acceptability Example  Problem: Your workstation is myws, but you log into green every day to do other tasks and don’t want to type your password.  Solution: Let green trust myws.  Create ~/.rhosts file on green that lists myws as trusted host, then rlogin green will allow access without a password.  Does this solution violate other principles?  Is there a more secure alternative solution?

CSC 666: Secure Software Engineering Design Principles Questions  Many systems disable an account after a small number of failed accesses. Which principle(s) does this follow? Violate?  A system that invokes a shell exposes itself to command injection attacks. What principle does that violate? How could Least Privilege be used to improve security?  When changing your password, you typically have to enter your old password despite being logged in? How does this make the system more secure? Which principle(s) does it follow? 1.Least Privilege 2.Fail-Safe Defaults 3.Economy of Mechanism 4.Complete Mediation 5.Open Design 6.Separation of Privilege 7.Least Common Mechanism 8.Psychological Acceptability

CSC 666: Secure Software Engineering Design By Contract Executable contract btw class and clients.  Client must guarantee certain preconditions before it calls a method.  Class guarantees certain properties will hold after the call. Applications  Static analysis to check contracts.  Dynamic analysis to check at runtime.  Design technique, similar to TDD.  Documentation.

CSC 666: Secure Software Engineering Design by Contract (Eiffel) put (x: ELEMENT; key: STRING) is -- Insert x so that it will be retrievable through key. require count <= capacity not key.empty do... Some insertion algorithm... ensure has (x) item (key) = x count = old count + 1 end

CSC 666: Secure Software Engineering Contract Features Contract  Preconditions (require)  Invariants (invariant 0 <= count)  Postconditions (ensure) Contracts in other languages  assert() in C/C++  Class::Contract in perl  Java Modeling Language (JML)

CSC 666: Secure Software Engineering JML Example requires a != && (\forall int 0 < i && i < a[i-1] <= int binarySearch(int[] a, int x) { //... }

CSC 666: Secure Software Engineering Legacy Issues  How can you design security into legacy applications without source code?  Wrappers  Interposition  What is the best way to fix security flaws in an existing application?  Code Maintenance Techniques

CSC 666: Secure Software Engineering Retrofitting: Wrappers  Move existing application to special location.  Replace old application with wrapper that:  Performs access control check.  Performs input checks.  Secures environment.  Logs invocation of application.  Invokes legacy application from new location.  Example: AusCERT overflow_wrapper 

CSC 666: Secure Software Engineering Retrofitting: Interposition  Interpose software between two programs we cannot control.  Add access control.  Filter communication.  Example: Network proxy  Router blocks direct client/server comm.  Client talks to proxy, who makes connection to remote server on behalf of client. -Access Control: disallow certain clients/servers. -Filtering: scan for viruses, worms, etc. -Auditing: all connections can be logged.

CSC 666: Secure Software Engineering Maintenance: Sun tar flaw  1993: Every tar file produced under Solaris 2.0 contained fragments of /etc/passwd file.  Tar reads and writes fixed size blocks.  Last block written has contents of memory block that were not overwritten by disk read.  Tar reads /etc/passwd to obtain user info.  Immediately before it allocates the block read buffer.  Heap allocation doesn’t zero out memory.  In earlier versions, other memory allocations were between reading passwd and block read alloc.

CSC 666: Secure Software Engineering Legacy Issues: Maintenance  How can you avoid adding new security flaws when performing code maintenance?  Before looking at a code maintenace procedure, what design principles could have prevented the Sun tar flaw?

CSC 666: Secure Software Engineering Legacy Issues: Maintenance 1.Understand security model and mechanisms already in place. 2.Learn how the program actually works. Read design docs, code, and profile the program. 3.When designing and coding the fix: 1.Don’t violate the spirit of the design. 2.Don’t introduce new trust relationships.

CSC 666: Secure Software Engineering References 1.Matt Bishop, Computer Security: Art and Science, Addison- Wesley, Mark Graff and Kenneth van Wyk, Secure Coding: Principles & Practices, O’Reilly, Gary McGraw, Software Security, Addison-Wesley, Gary T. Leavens and Yoonsik Cheon, Design by Contract with JML, 5.Bertrand Meyer, Building bug-free O-O software: An introduction to Design by Contract, Jermone H. Saltzer and Michael D. Schroeder, "The Protection of Information in Computer Systems," Proceedings of the IEEE 63, 9 (September 1975). 7.John Viega and Gary McGraw, Building Secure Software, Addison-Wesley, 2002.