Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Introduction to Safe Programming l Producing Safe Code l Source code audits l Software Forensics –Black Box, White Box Techniques l Improvements outside.

Similar presentations


Presentation on theme: "1 Introduction to Safe Programming l Producing Safe Code l Source code audits l Software Forensics –Black Box, White Box Techniques l Improvements outside."— Presentation transcript:

1 1 Introduction to Safe Programming l Producing Safe Code l Source code audits l Software Forensics –Black Box, White Box Techniques l Improvements outside the language –Compiler –OS –Kernel –Application Controls

2 2 Safe Code as an issue of Assurance l What is safe code? l What is Assurance?

3 3 Topics in Safe Programming l Compiler Design l Operating Systems Programming »C/C++, shell, OS design l Network Programming »RPC, Sockets, Socks, MPI, etc. l Applications Programming »Kerberos, DCE, extending applications, PKI l Mobile Code »Java, Active-X, Javascript, CGI l Database Programming l Software Life Cycle Development and Management

4 4 How does one write safe code? l We use the C programming language as our example l General Design Principles (Jerome Saltzer) –Least Privilege –Economy of Mechanism –Ease of Use –Modularity –Input Checking

5 5 System Libraries l C System Libraries l General Use and vulnerabilities »gets( ) streadd( ) »printf()strecpy( ) »strcpy()strtns( ) »strcat( ) »scanf( ) »sscanf( ) »vsprintf ( ) »realpath( ) »getopt( ) »getpas( )

6 6 General C Syntax Errors

7 7 General Logic Errors l Haste l Ignorance l Carelessness/Laziness l Race Conditions l Faulty Random Generators (Internally generated) l Dependence on system clock l Use of ethernet and hw serial numbers

8 8 Poor Design l No bounds checking l Trusting Input (Argument length, type & number) l Not checking argument passed to system functions l Not having programs exit or die cleanly l Not checking return codes l Obfuscated Code l No documentation l No logging l Bad design or lack of a design l Poor nomenclature

9 9 Spafford’s Recommendation l See Spafford’s Security Checklist for a good list of common ports and usage l Check general principles provided for safe programming l Learn to keep good programming principles during program inception l Use Code checking and Peer review l Use Saltzer’s Seven Rules to analyze your code


Download ppt "1 Introduction to Safe Programming l Producing Safe Code l Source code audits l Software Forensics –Black Box, White Box Techniques l Improvements outside."

Similar presentations


Ads by Google