Docsity

Program Security: A Comprehensive Overview of Computer Security and Information Assurance, Summaries of Information Technology

Toggle sidebar
bg1
CS 5950/6030 –
Computer Security and Information
Assurance
Section 3: Program Security
Dr. Leszek Lilien
Department of Computer Science
Western Michigan University
Slides based on Security in Computing. Third Edition by Pfleeger and Pfleeger.
Using some slides courtesy of:
Prof. Aaron Striegel — course taught at U. of Notre Dame
Prof. Barbara Endicott-Popovsky and Prof. Deborah Frincke (U. Idaho) — taught at U.
Washington
Prof. Jussipekka Leiwo — taught at Vrije Universiteit (Free U.), Amsterdam, The Netherlands
Slides not created by the above authors are © 2006 by Leszek T. Lilien
Requests to use original slides for non-profit purposes will be gladly granted upon a written request.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Program Security: A Comprehensive Overview of Computer Security and Information Assurance and more Summaries Information Technology in PDF only on Docsity!

CS 5950/6030 –

Computer Security and Information

Assurance

Section 3 : Program Security

Dr. Leszek Lilien Department of Computer Science Western Michigan University Slides based on Security in Computing. Third Edition by Pfleeger and Pfleeger. Using some slides courtesy of: Prof. Aaron Striegel — course taught at U. of Notre Dame Prof. Barbara Endicott-Popovsky and Prof. Deborah Frincke (U. Idaho) — taught at U. Washington Prof. Jussipekka Leiwo — taught at Vrije Universiteit (Free U.), Amsterdam, The Netherlands Slides not created by the above authors are © 2006 by Leszek T. Lilien Requests to use original slides for non-profit purposes will be gladly granted upon a written request.

Program Security – Outline (1)

3.1. Secure Programs – Defining & Testing a. Introduction b. Judging S/w Security by Fixing Faults c. Judging S/w Security by Testing Pgm Behavior d. Judging S/w Security by Pgm Security Analysis e. Types of Pgm Flaws 3.2. Nonmalicious Program Errors a. Buffer overflows b. Incomplete mediation c. Time-of-check to time-of-use errors d. Combinations of nonmalicious program flaws

Program Security – Outline (3)

3.4. Controls for Security a. Introduction b. Developmental controls for security c. Operating System controls for security d. Administratrive controls for security e. Conclusions

3. Program Security (1)

 Program security – Our first step on how to apply security to computing  Protecting programs is the heart of computer security  (^) All kinds of programs, from apps via OS, DBMS, networks  Issues:  How to keep pgms free from flaws  How to protect computing resources from pgms with flaws  Issues of trust not considered:  How trustworthy is a pgm you buy?  How to use it in its most secure way?  (^) Partial answers:  (^) Third-party evaluations  (^) Liability and s/w warranties

3.1. Secure Programs - Defining & Testing  Outline a. Introduction b. Judging S/w Security by Fixing Faults c. Judging S/w Security by Testing Pgm Behavior d. Judging S/w Security by Pgm Security Analysis e. Types of Pgm Flaws [cf. B. Endicott-Popovsky]

a. Introduction (1)

 Pgm is secure if we trust that it provides/enforces:  Confidentiality  Integrity  Availability  What is „Program security?” Depends on who you ask  user - fit for his task  programmer - passes all „her” tests  manager - conformance to all specs  Developmental criteria for program security include:  Correctness of security & other requirements  Correctness of implementation  Correctness of testing

b. Judging S/w Security by Fixing Faults  An approach to judge s/w security: penetrate and patch  Red Team / Tiger Team tries to crack s/w  If you withstand the attack => security is good  Is this true? Rarely.  Too often developers try to quick-fix problems discovered by Tiger Team Quick patches often introduce new faults due to:  Pressure – causing narrow focus on fault, not context  Non-obvious side effects  System performance requirements not allowing for security overhead [cf. A. Striegel]

c. Judging S/w Security by Testing Pgm Behavior (1)  (^) Better approach to judging s/w security: testing pgm behavior  Compare behavior vs. requirements (think testing/SW eng)  Program security flaw = = inappropriate behavior caused by a pgm fault or failure  Flaw detected as a fault or a failure  (^) Important: If flaw detected as a failure (an effect), look for the underlying fault (the cause) Recall: fault seen by insiders, failure – by outsiders  If possible, detect faults before they become failures Note: Texbook defines flaw-vulnerability-flaw in a circular way

  • a terminology soup!

Judging S/w Security by Testing Pgm Behavior (3)  Problems with pgm behavior testing  Limitations of testing  Can’t test exhaustively  Testing checks what the pgm should do  Can’t test what the pgm should not do  (^) i.e., can’t make sure that pgm does only what it should do – nothing more  Complexity – malicious attacker’s best friend  (^) Too complex to model / to test  (^) Exponential # of pgm states / data combinations  (^) a faulty line hiding in 1 0 million lines of code  Evolving technology  New s/w technologies appear  Security techniques catching up with s/w technologies [cf. A. Striegel]

d. Judging S/w Security by Pgm Security Analysis  Best approach to judging s/w security: pgm security analysis  Analyze what can go wrong  At every stage of program development!  (^) From requirement definition to testing  After deployment  (^) Configurations / policies / practices  Protect against security flaws  Specialized security methods and techniques  Specialized security tools  (^) E.g., specialized security meth/tech/tools for switching s/w [cf. B. Endicott-

3.2. Nonmalicious Program Errors

 Outline a. Buffer overflows b. Incomplete mediation c. Time-of-check to time-of-use errors d. Combinations of nonmalicious program flaws

a. Buffer Overflows (1)

 Buffer overflow flaw — often inadvertent (=>nonmalicious) but with serious security consequences  Many languages require buffer size declaration  C language statement: char sample[10];  Execute statement: sample[i] = ‘A’; where i=  Out of bounds (0-9) subscript – buffer overflow occurs  Some compilers don’t check for exceeding bounds  C does not perform array bounds checking.  Similar problem caused by pointers  (^) No reasonable way to define limits for pointers [cf. B. Endicott-Popovsky]

Buffer Overflows (3)  Implications of buffer overflow:  Attacker can insert malicious data values/instruction codes into „overflow space”  Supp. buffer overflow affects OS code area  Attacker code executed as if it were OS code  Attacker might need to experiment to see what happens when he inserts A into OS code area  Can raise attacker’s privileges (to OS privilege level)  When A is an appropriate instruction  Attacker can gain full control of OS [cf. B. Endicott-Popovsky]

Buffer Overflows (4)  Supp. buffer overflow affects a call stack area A scenario:  Stack: [data][data][...]  Pgm executes a subroutine => return address pushed onto stack (so subroutine knows where to return control to when finished) Stack: [ret_addr][data][data][...]  Subroutine allocates dynamic buffer char sample[10] => buffer (10 empty spaces) pushed onto stack Stack: [..........][ret_addr][data][data][...]  Subroutine executes: sample[i] = ‘A’ for i = 10 Stack: [..........][A][data][data][...] Note: ret_address overwritten by A! (Assumed: size of ret_address is 1 char)