Secure Programming
Table of Contents
Abstract: In this course, we are discussing Cyber Security narrowed down to software engineering.
1 Improving Cyber Security
- CPU Architecture
- Secure Boot
- Executable Address Space
- Network Protocols
- Redesign of nearly all protocols
- Client/Server Dis-Trust
- Encrypted Packets
- OS Design
- Privileges, Permissions, and Policies
- Process Lineage/ Provenance
- Address Space Layout Randomization
- Control-Flow Integrity
- Detection of Races
- Cryptography
- System Administration
- Software Engineering
- Only SE considered here, all others not
2 Security Architecture Design Flaws
- Cryptography misuse
- Lack of compartmentalization
- More privilege used than necessary
- Relying on secret algorithms
- Sharing resources
- Usability problems
3 Software Without Security Holes
3.1 Bugs v Vulnerabilities v Exploit
- A bug is a behavioral deviation from the functional spec. Read more on this topic: ../Debugging
- A vulnerability is a bug that has "security implications".
- Can you deduce this??
- Know it after the fact.
- An exploit takes a vulnerabilty and builds software with an unexpected behavior.
- 2016 Fact about the State of the Art: No contests to the following claim: No single example exists that is 1000+ SLOC and is bug-free.
3.2 Past Exploits and Their Causes
- Unauthorized Access
- Denial of Service
- Confidential Information leakage
- Hijacking the Flow of Control
- Smashing the stack / Arbitrary Code injection
- Cross-site scripting on wikipedia. Recommended Reading.
- SQL Injection on wikipedia. Recommended Reading.
3.3 Software Security Principles
- (Overview of) Security Principles, 2012, https://www.cs.ucsb.edu/~kemm/courses/cs177/principles.pdf 25 slides, ./principles-ucsb-2012.pdf Required Reading.
- NASA Addressing SW Security, 20+ slides, 2015. Required Reading.
- IEEE Avoiding the Top 10 Software Security Design Flaws,
https://cybersecurity.ieee.org/blog/2015/11/13/avoiding-the-top-10-security-flaws
with my scribbled-in comments ./10-Flaws-2014-IEEE-pmMarked.pdf
- Required Reading.
4 CERT and Other Secure Coding Guidelines
- http://cs.stanford.edu/people/eroberts/cs181/projects/viruses/cert.html The Role of CERT
- https://www.securecoding.cert.org/confluence/display/seccode/SEI+CERT+Coding+Standards CMU SEI CERT Coding Standards. Required Reading – Top Level.
- https://www.securecoding.cert.org/confluence/display/java/SEI+CERT+Oracle+Coding+Standard+for+Java SEI CERT Oracle Coding Standard for Java
- Prabhaker Mateti, Audit of Android Src Code, work-in-progress (not ready for public), {pm-aosp-audit-min.pdf} located on thumb drive. Discuss a couple of CERT rules for Android.
- Secure Java Programming basics by PM. About 2pp. Required Reading.
- Secure Programming in C/ C++ basics by PM. About 1 page. Required Reading.
5 Static Analysis of Source Code
- Static Analysis of Source Code
- Data Flow Analysis
- Control Flow Graph
- Taint Analysis
- Lexical Analysis
- False Positives
- False Negatives
- Well-known "simple" Tools
- splint
- CheckStyle
- FindBugs
- PMD
- Ubuntu/ Debian:
apt install ...
- Commercial Tools
- Advanced Tools
- AutoRefactor Examples
- Security Improvement;
- Misc Open Source Projects;
- Formal Verification Tools
- Spoon
- JTransformer
- Frama-C
6 References
- Several references embedded in the above.
- [Book] Chess, Brian, and Jacob West. Secure Programming with Static Analysis. Pearson Education, 2007. Reference
- [Book] Introduction to Computer Security, Michael Goodrich, University of California, Irvine Roberto Tamassia, Brown University, Addison Wesley, 2011. Reference
- McGraw, Gary, and Ming Chow. "Guest Editors' Introduction: Safeguarding the Future of Software Security." IEEE Security & Privacy, vol 7, no. 3 (2009): 11-12. PDF accessible via WSU Library proxy. Required Reading.
- Prabhaker Mateti, "Software without Security Holes", 2012. Required Reading.
- 2011 CWE/SANS Top 25 Most Dangerous Software Errors Recommended Reading.
- Dawson Engeler, et al., A Few Billion Lines of Code Later: Using Static Analysis to Find Bugs in the Real World, CACM, 10pp, 2010. http://courses.cs.washington.edu/courses/cse484/14au/reading/coverity.pdf. Required Reading.
- Cryptography misuse 95+ slides, Guevara Noubir, Northeastern University. Recommended Reading
- An Empirical Study of Cryptographic Misuse in Android Applications 2013 Recommended Reading.