+ All Categories
Home > Technology > 3.Secure Design Principles And Process

3.Secure Design Principles And Process

Date post: 19-Nov-2014
Category:
Upload: phanleson
View: 732 times
Download: 2 times
Share this document with a friend
Description:
 
Popular Tags:
60
Course 1: Overview of Secure Programming, Section 3 Pascal Meunier, Ph.D., M.Sc., CISSP May 2004; updated August 12, 2004 Developed thanks to support and contributions from Symantec Corporation, support from the NSF SFS Capacity Building Program (Award Number 0113725) and the Purdue e-Enterprise Center Copyright (2004) Purdue Research Foundation. All rights reserved.
Transcript
Page 1: 3.Secure Design Principles And Process

Course 1: Overview of Secure Programming, Section 3Pascal Meunier, Ph.D., M.Sc., CISSPMay 2004; updated August 12, 2004Developed thanks to support and contributions from Symantec Corporation, support from the NSF SFS Capacity Building Program (Award Number 0113725) and the Purdue e-Enterprise CenterCopyright (2004) Purdue Research Foundation. All rights reserved.

Page 2: 3.Secure Design Principles And Process

Course 1 Learning Plan

Security overview and patching Public vulnerability databases and resources Secure software engineering Security assessment and testing Shell and environment Resource management Trust management

Page 3: 3.Secure Design Principles And Process

Secure Software Engineering: Learning Objectives

Understand and apply secure design principles Understand and specify security requirements Understand how internal processes affect security

and code quality

Page 4: 3.Secure Design Principles And Process

Secure Software Engineering: Parts

Art or Science? Assurance Design Principles Requirements Processes Role of Cryptography

Page 5: 3.Secure Design Principles And Process

Secure Programming: Art or Science?

Artisanal work – Individual work– Completely dependent on individual’s skills and

organization

Engineering Science– Objective

Independent from one individual’s perception Does not require truly unique skills

– Reproducible– Predictable– Systematic

Page 6: 3.Secure Design Principles And Process

Software Engineering

Aims to be a science, but is most often ad-hoc– Uses reproducible processes to provide guarantees,

controls, measurements

Capability Maturity Models: – Characterize an organization’s processes– Levels of maturity

Level 1: Ad-hoc, individual effort and heroics (Art) Level 2: Repeatable Level 3: Defined Level 4: Managed Level 5: Optimizing (Science)

Page 7: 3.Secure Design Principles And Process

Results from Current Software Engineering Methods

>1000 new vulnerabilities reported every year

About 50% of vulnerabilities are commonly repeated mistakes

About 25% could be avoided by considering secure design principles

Need new methods “We can't solve problems by using the same kind of

thinking we used when we created them.” (Albert Einstein)

Page 8: 3.Secure Design Principles And Process

Exercise

Discuss whether you see secure programming as an art or a science.

Are both possible?

– Maybe neither is done if qualified people can't be found!

Which is easier?

Which is preferable– As a customer– As a project manager– As a developer

Page 9: 3.Secure Design Principles And Process

Secure Software Engineering: Parts

Art or Science Assurance Design Principles Requirements Processes Role of Cryptography

Page 10: 3.Secure Design Principles And Process

Assurance

Axiom: It is impossible to demonstrate with absolute certainty that a moderately complex application doesn't have any vulnerabilities.

Second Best: We can provide assurance that an application was designed, implemented, tested in rigorous ways (and by skilled people) that decrease the chances of having vulnerabilities and other defects.– e.g., training in secure programming provides assurance– software engineering processes designed for assurance

Page 11: 3.Secure Design Principles And Process

How do you measure assurance?

International Standard: Common Criteria Defines Evaluation Assurance Levels (EALs) 1-7 EALs 3-4 commonly requested by governments and

security-demanding organizations EAL 4 evaluation typically costs $1 million High assurance (EALs 5-7) is out of the scope of

this tutorial This section provides an overview of selected topics

related to assurance

Page 12: 3.Secure Design Principles And Process

Question

What role does assurance play in computer security?

a) It protects vendors that get sued

b) It's how you deal with customers afraid of the latest vulnerability

c) It describes how the application of specific software engineering practices lowers risks

Page 13: 3.Secure Design Principles And Process

Question

What role does assurance play in computer security?

a) It protects vendors that get sued

b) It's how you deal with customers afraid of the latest vulnerability

c) It describes how the application of specific software engineering practices lowers risks

Page 14: 3.Secure Design Principles And Process

Question

What is the name of the international standard that specifies assurance levels?

a) Common Criteria

b) Frequent Criteria

c) The EAL

Page 15: 3.Secure Design Principles And Process

Question

What is the name of the international standard that specifies assurance levels?

a) Common Criteria

b) Frequent Criteria

c) The EAL

Page 16: 3.Secure Design Principles And Process

Secure Software Engineering: Parts

Art or Science Assurance Design Principles Requirements Processes Capability Maturity Models

– Change Control– Vulnerability Response

Role of Cryptography

Page 17: 3.Secure Design Principles And Process

List of 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

Reference: Saltzer and Schroeder (1974) http://www.cs.virginia.edu/~evans/cs551/saltzer/

Page 18: 3.Secure Design Principles And Process

1. Least Privilege

"A subject should only be given those privileges it needs in order to complete its task."

Access control problem: how closely can (role-based, etc...) access control or capabilities match the needed privileges? At what cost?

Weakness of some Microsoft Applications: IIS 5 runs under the Local System account, equivalent to root privileges. Apache may run as “nobody” under UNIX; under Windows the equivalent procedure is possible but convoluted (and rarely done).

Page 19: 3.Secure Design Principles And Process

Compartmentalization

Technique to separate the code in different parts, so that each part runs with least privilege.– if a part is compromised, others are still OK– Example: Separating a user interface from the program

running with special privileges (e.g., root) Good implementation examples in Linux Bad idea: Windows task bar tray icons running with Local

System privileges– Secunia advisory SA10949, Dell TrueMobile WLAN card utility

» tray icon launches help with SYSTEM privileges» can be exploited to execute arbitrary code with SYSTEM

privileges

Page 20: 3.Secure Design Principles And Process

2. Fail-Safe Defaults

"Unless a subject is given explicit access to an object, it should be denied access to that object"

Apache access control through .htaccess:first (default) rule: deny from allallow from ...

Tied with the issue of failing “safe” vs failing “functional”– Switches that fail open as hubs under unusual

circumstances– “Brittle” or catastrophic failures vs graceful

Page 21: 3.Secure Design Principles And Process

3. Economy of Mechanism

“Security mechanisms should be as simple as possible”

Complex mechanisms may not be correctly:

– understood

– modeled

– configured

– implemented

– used

Complex mechanisms may engender partial implementations and compatibility

Page 22: 3.Secure Design Principles And Process

Example Failed Economy of Mechanism

IPSEC: Can do almost everything to secure TCP/IP but is monstrously complex– Sub-protocols with their own headers, which may be

nested...– Every vendor’s implementation is slightly different and

often incompatible with the others– Design by political committee tries to be everything to

everyone

People switch to SSL VPNs– Proven, robust– Much more simple– Compatible

Page 23: 3.Secure Design Principles And Process

4. Complete Mediation

“All accesses to objects must be checked to ensure that they are allowed”

Performance vs security issue– Results of access check are often cached– What if permissions have changed since the last check?– Mechanisms to invalidate or flush caches after a change

are often missing

Architecture issue– Capability granting and management

How did a capability given to Alice end up in Malory's hands?

Page 24: 3.Secure Design Principles And Process

Example Failure of Complete Mediation

Access is checked only when opening a file, which returns a file descriptor

UNIX: forked and exec’ed processes inherit file descriptors

Even if processes call setuid to relinquish access to a high privilege, there may remain open files that stay open even if the process should now not be able to access them.

Emacs used to have this problem

Page 25: 3.Secure Design Principles And Process

Another example: CAN-2002-0871

xinetd 2.3.4 leaks file descriptors for the signal pipe to services that are launched by xinetd, which could allow those services cause a denial of service via the pipe.

Page 26: 3.Secure Design Principles And Process

5. Open Design

“The security of a mechanism should not depend on the secrecy of its design or implementation.”

If the details of the mechanism leaks (through reverse engineering, dumpster diving or social engineering), then it is a catastrophic failure for all the users at once.

If the secrets are abstracted from the mechanism, e.g., inside a key, then leakage of a key only affects one user.

This does not mean you should reveal source code!

Page 27: 3.Secure Design Principles And Process

Example Failure of Open Design

Electronic voting machines! Diebold voting machines source code analysis:– Passwords embedded in the source code.– Unauthorized privilege escalation and other vulnerabilities– Incorrect use of cryptography– Undetected, unlimited votes by voters– Insider threats - company workers or election officials can

alter voters' ballot choices without their knowledge – (source: Kohno, Stubblefield, Rubin and Wallach, 2003

Johns Hopkins University)

Page 28: 3.Secure Design Principles And Process

Notes on Open Design

Some hackers would rather have the binary than the source code when designing exploits

Obscurity is OK if the design is secure regardless– If details are leaked, the software is still secure

Page 29: 3.Secure Design Principles And Process

6. Separation of Privilege

“A system should not grant permission based on a single condition.”

Removes a single point of failure Example: two-factor authentication

– Requiring both biometric and token recognition systems reduces risks

Analogous to the separation of duty:– By requiring multiple factors, collusion becomes

necessary, and risks due to bribery (compromise of one factor) are reduced

– Dual-signature checks

Page 30: 3.Secure Design Principles And Process

Successful Example

UNIX: sudo allows the execution of commands with root privileges

Possible only if – user knows the appropriate password and– user is already member of an authorized group (e.g.,

wheel)

– (This example is from Bishop M., "Computer Security: Art and Science")

Page 31: 3.Secure Design Principles And Process

Notes on the Separation of Privilege

Often confused with the principle of least privilege– e.g., OpenSSH has a "UsePrivilegeSeparation" option

which really is an implementation of least privilege, in two parts of the code.

– Compartmentalization is the technique used to separate code so that the principle of least privilege can be applied on these parts.

Page 32: 3.Secure Design Principles And Process

7. Least Common Mechanism

“Mechanisms used to access resources should not be shared”

Concept: You have two different services, of different priorities and value, provided to two different sets of users. The more they share resources, the more likely one can influence the other to:– Transmit forbidden data (covert channels issue)– Limit availability (denial of service)

Page 33: 3.Secure Design Principles And Process

Failed Example of Least Common Mechanism

Microsoft NT architecture: FTP and Web services on the same computer share a common thread poolExhausting the FTP thread pool will cause failed connection requests for the Web service.

CVE-1999-1148IIS processes passive FTP connection requests by assigning a thread to each port waiting for a client to connect

– What if they never connect?

Page 34: 3.Secure Design Principles And Process

8. Psychological Acceptability

Security mechanisms should not make the resource more difficult to access than if the security mechanism were not present.

Example: Commercial where users have become bald and lost (all?) other hair in order to comply with a biometric authentication mechanism requesting hair samples.

Problem: Users looks for ways to defeat the mechanisms and “prop the doors open”

In practice, difficulty proportionate to the value of the protected asset is accepted

Page 35: 3.Secure Design Principles And Process

Example mechanism defeated for convenience's sake

Trusted hosts -- if you’re logged into host 'A', then you automatically have access to host 'B'

.rhosts mechanism bypasses password security check

.rhosts file in / directory allows remote root access without a password

Authentication is based on IP addresses, which can be mapped to a different host through ARP poisonning

Page 36: 3.Secure Design Principles And Process

Recap of 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

Instructor: This list is to help with the exercise on the next slide

Page 37: 3.Secure Design Principles And Process

Exercise

Divide the class into 8 groups Each group will "own" one of the 8 design

principles, and identify a product instance where it applies (not one already presented). The group will present their findings to the class, and whether the principle was applied correctly.

Instructor: Allow 15-20 minutes for the groups to discuss, then have them present their findings in no more than 3 minutes each.

Page 38: 3.Secure Design Principles And Process

Secure Software Engineering: Parts

Art or Science Assurance Design Principles Requirements Processes Role of Cryptography

Page 39: 3.Secure Design Principles And Process

Security Requirements

No requirements == you're done Security functional requirements

– e.g., Security audit data generation – Access controls – Preserve integrity of transaction X– Fail secure – Threat modeling can be used to determine security

functional requirements

Security assurance requirements– e.g., Developer vulnerability analysis (an EAL 2 assurance

component)

Page 40: 3.Secure Design Principles And Process

Exercise

Go to http://csrc.nist.gov/cc/ – Click on the most recent cc version on the left– Download the pdf "Part 2: Security functional

requirements"

Instructions to the class:– Observe that functional requirements are divided into

several different "classes" (11 classes in version 2.2).– Observe that classes are further sub-divided into "families"– Read "Part 1: Scope"; learn the meaning of the

acronyms TOE, ST, PP– What are TSFs? (Hint: look at Figure 1.1)– Pick a functional requirement family you like in the list;

read its definition.

Instructor: Allow 10-15 minutes for students to read the document and let them present a requirement in no more than 2 minutes.

Page 41: 3.Secure Design Principles And Process

Exercise Question

Briefly explain a requirement family to the class.– What is its purpose?– Which threats could it address, if you were performing a

threat modeling exercise?

Page 42: 3.Secure Design Principles And Process

Secure Software Engineering: Parts

Art or Science Assurance Design Principles Requirements Processes Role of Cryptography

Page 43: 3.Secure Design Principles And Process

Processes

Provide guarantees Areas using processes:

– Development environment– Vulnerability response– Production network– Engineering network

What assurances do you have about the safety of your code against unwarranted changes?

Who can get control version software accounts? Are the access controls configured for security?

Page 44: 3.Secure Design Principles And Process

Development Environment

Processes that we follow affect the security of the code/applications that we develop. – Security measures in the development environment are an

EAL 3 assurance component– Do we lock our workstations when we leave? – Does the workstation lock automatically? – Do we hire convicted felons to work on our source code? – Is there a change control process?– How are backups handled? Are they secure?

Page 45: 3.Secure Design Principles And Process

Development Tools

Can you trust the compiler? The linker? Perhaps the compiler on your workstation has been

modified to insert a trojan...– See "Reflections on Trusting Trust" by Ken Thompson

Page 46: 3.Secure Design Principles And Process

Change Control

Do we have authentication and access control for who can submit source code?

Is there a QA process for code acceptance? Are changes justified and linked to a mandate

(requirement, specification, bug report)? Is the integrity of the installer guaranteed? Are the source code repository and version control

system secure?– Real life example: trojan in OpenBSD OpenSSH code

(2002)

Page 47: 3.Secure Design Principles And Process

Vulnerability Response Process

Goals– Protect customers– Protect sales– Produce a timely and robust patch– Present a consistent and accurate vendor viewpoint– Respond in a coordinated manner

Actors:– Researcher – Vendor– 3rd Party Coordinator– Arbitrator

Page 48: 3.Secure Design Principles And Process

Vulnerability Lifecycle

Page 49: 3.Secure Design Principles And Process

Researcher

Finds and reports vulnerabilities to:– Vendors– 3rd party coordinators– Public forums

• full-disclosure• Bugtraq lists

May create proof-of-concept code

Page 50: 3.Secure Design Principles And Process

Researcher Motivation

Improving security Career advancement Gratification Curiosity Vendetta Other reasons known only to themselves

Page 51: 3.Secure Design Principles And Process

Vendor

The software provider– Commercial entity (Symantec)– Open Source Software community

Responsible for fixing vulnerabilities

Page 52: 3.Secure Design Principles And Process

3rd Party Coordinator

• Liaison between Vendors and Researchers– CERT

• Alternative to contacting vendor– Vendor is unavailable, unknown or unresponsive

– Existing hostilities between vendor and researcher

– Vulnerability affects multiple vendors• Protocol issues• Common components

Page 53: 3.Secure Design Principles And Process

Arbitrator

Used when Researcher and Vendor cannot agree Acceptable to both parties Independent and impartial

Page 54: 3.Secure Design Principles And Process

Process

1. Vulnerability reported 2. Reported to product(s) primary and

secondary contacts3. Vulnerability is evaluated4. Evaluation results reported to researcher5. Fix timeline identified6. PR / IT / Support notified7. Fix created and distributed8. Advisory written and posted

Page 55: 3.Secure Design Principles And Process

Vulnerability Lifecycle

Page 56: 3.Secure Design Principles And Process

Contact information

NIAC standards for contact points– Public process documents, PGP keys, and advisories

http://www.company.com/security/

– Email contact [email protected]

Page 57: 3.Secure Design Principles And Process

Secure Software Engineering: Parts

Art or Science Assurance Design Principles Requirements Processes Role of Cryptography

Page 58: 3.Secure Design Principles And Process

Role of Cryptography

Cryptography is involved in many design issues to make attacks much more difficult– Man-in-the-middle attacks– Sniffing– Replay attacks– Etc...

Cryptography is not a do-it-yourself task!– 802.11b cryptography fiasco

Cryptography doesn't solve common programming errors or design flaws

Page 59: 3.Secure Design Principles And Process

About These Slides

You are free to copy, distribute, display, and perform the work; and to

make derivative works, under the following conditions.

– You must give the original author and other contributors credit

– The work will be used for personal or non-commercial educational uses

only, and not for commercial activities and purposes

– For any reuse or distribution, you must make clear to others the terms of

use for this work

– Derivative works must retain and be subject to the same conditions, and

contain a note identifying the new contributor(s) and date of modification

– For other uses please contact the Purdue Office of Technology

Commercialization.

Developed thanks to the support of Symantec Corporation

Page 60: 3.Secure Design Principles And Process

Pascal [email protected]:Jared Robinson, Alan Krassowski, Jeremy Bennett, Craig Ozancin, Tim Brown, Wes Higaki, Melissa Dark, Chris Clifton, Gustavo Rodriguez-Rivera


Recommended