Instituto Tecnológico Y De Estudios Superiores De Monterrey a Unified
Total Page:16
File Type:pdf, Size:1020Kb
Instituto Tecnol´ogico y de Estudios Superiores de Monterrey Monterrey Campus GRADUATE PROGRAM IN MECHATRONICS AND INFORMATION TECHNOLOGIES A Unified Software Security Enhancement Proposal Based on a Thorough Software Security Compendium. THESIS PRESENTED AS A PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF: Master of Science in Information Technology BY: Armando de Anda Gonz´alez Monterrey, N.L., November 2007 Instituto Tecnol´ogico y de Estudios Superiores de Monterrey Monterrey Campus DIVISION OF MECHATRONICS AND INFORMATION TECHNOLOGIES GRADUATE PROGRAM IN MECHATRONICS AND INFORMATION TECHNOLOGIES The members of the thesis committee hereby approve the thesis of Armando de Anda Gonz´alez to be accepted as partial fulfillment of the requirements for the Degree of Master of Science, in: Information Technology Thesis Committee: Arturo Galv´an Rodr´ıguez, Ph. D. Thesis advisor Suku Nair, Ph. D. MSc Alejandro Parra Briones Synodal Synodal Graciano Dieck Assad, Ph. D. Director of the Graduate Programs in Mechatronics and Information Technologies November 2007 A Unified Software Security Enhancement Proposal Based on a Thorough Software Security Compendium. BY: Armando de Anda Gonz´alez THESIS Presented to the Graduate Program in Mechatronics and Information Technologies This Thesis is a partial requirement for the degree of Master of Science in: Information Technology Instituto Tecnol´ogico y de Estudios Superiores de Monterrey Monterrey Campus November 2007 To God, for the wonderful gift of life and with whom anything is possible. To the love of my life, Paola, for being my inspiration, my strength, my everything. To my parents, Armando and Layda, the greatest example of love and sacrifice. To my aunt Martha, for believing in me and keeping this dream alive. To my aunt Sayde, my second mother, for your prayers and guidance. To my brother Juan, and to my sisters Layda and Diana, no matter the distance always united. To my many relatives and friends who are such an important part of my life. vii ix Acknowledgements First of all, I want to thank the members of my dissertation committee. Thanks to my principal advisor, Dr. Arturo Galv´an for his time, guidance, advice, and for believing in my proposal. While at Southern Methodist University, I worked under the supervision of Dr. Suku Nair, and I thank him for introducing me to me this fascinating subject and giving me the freedom to explore it. And to professor Alejandro Parra, whose technical competence is admirable, thank you for being so kind in accepting my invitation to review this work. I must thank Dr. David Garza and Dr. Hesham El-Rewini for making my time at SMU possible; it was such a gratifying and growing experience. Special thanks to Ana Isabel Cerda, whose advice on the little things made a huge difference. Finally, I must thank all the support I have received from professors and fellow students during all these years of graduate and undergraduate school at UAC, SMU, and ITESM. They all contributed to the preparation and development of my skills and values to face all challenges. xi Abstract The research presented is to fulfill the requirements of master degree in Science of Information Technologies of ITESM (Instituto Tecnol´ıgico y de Estudios Superiores de Monterrey). The use of information systems has augmented enormously. Computers have become a widely used tool in all disciplines and a medium to facilitate many aspects of our lives, but at the same time, vulnerabilities that endanger the personal data, reputation of organizations and lives of users are being discovered regularly. This dissertation is a fusion of knowledge which aims to provide a panoramic view at the problem and main countermeasures to developers, testers and end users. It will also serve as a break down of the problem, so the dissertation may be employed as a starting point for interested entities, whether research individuals or organizations, to facilitate the communication, exchange of data, combination and evaluation of information in the subject. This research will be useful in the avoidance of overlapping work and assist in the development of parallel efforts that could easily converge to bring us closer to making software behave. Several techniques and strategies have been proposed to mitigate the threats, but it has been a disseminated effort which makes more difficult the tasks of gathering, exchange and comparison of information, hence making it difficult to identify where we stand. This work is motivated by the current importance of security in software, and the work pretends to be a guide of Software Security Topics being its main contributions a proposed Questionnaire for Security Enhancement in the Software Life-Cycle, the coherent fusion of knowledge in the field, and at the same time break down of the problem of security. Contents 1 Introduction 1 1.1 Problems Behind Software Security . .. 1 1.1.1 Software Security Difficulties . 2 1.1.2 TheTrinityofTrouble . .. .. 4 1.1.3 The Thirteen Security Snares . 4 1.2 ProblemDefinition ............................. 6 1.3 Objectives ................................. 7 1.4 Hypothesis.................................. 8 1.5 Methodology ................................ 8 2 The Software Security Context 9 2.1 FundamentalConcepts ........................... 9 2.1.1 SecurityServices .......................... 10 2.1.2 STRIDE............................... 11 2.2 Whatsoftwareisvulnerable?. 12 2.3 Whyissoftwarevulnerable? . 13 3 Attackers and Motives 15 3.1 LawenforcementEntity .......................... 15 3.2 SecurityAuditors .............................. 16 3.3 UnethicalHackers.............................. 17 3.4 ScriptKiddies................................ 18 3.5 IndustrialSpies ............................... 18 3.6 Insider.................................... 19 3.7 Cyberterrorist................................ 20 4 Top Vulnerabilities 21 4.1 BufferOverflows .............................. 21 4.1.1 Consequences ............................ 23 4.1.2 BufferOverflowTaxonomy. 24 4.1.3 Attacks ............................... 26 4.2 Cross-SiteScripting(XSS) . 28 4.2.1 Consequences ............................ 28 4.2.2 Attacks ............................... 29 xiii xiv CONTENTS 4.2.3 Conclusion.............................. 33 4.3 SQLInjection ................................ 34 4.3.1 Consequences ............................ 35 4.3.2 Attacks ............................... 35 4.3.3 Conclusion.............................. 39 4.4 RaceConditions............................... 40 4.4.1 Attacks ............................... 42 4.4.2 Conclusion.............................. 45 4.5 DesignVulnerabilities. 45 4.6 Deployment Vulnerabilities . .. 46 4.7 Authentication and Password Vulnerabilities . ....... 47 4.8 Encryption Vulnerabilities . .. 48 5 Security in the Software Development Process 51 5.1 Secure Software Development Lifecycle . .... 52 5.2 MicrosoftSDL................................ 56 5.3 CLASP ................................... 59 5.4 iCMMandCMMIsecurity......................... 61 5.5 CorrectnessbyConstruction . 67 6 Standards and Best Practices 71 6.1 ISO/IEC27002 ............................... 71 6.2 CommonCriteria(ISO15408) . 77 6.3 TheStandardofGoodPractice . 81 6.4 MisuseandAbusecases .......................... 85 6.5 ReducingAttackSurface . .. .. 87 6.6 ShadesofAnalysis ............................. 89 6.6.1 WhiteBoxAnalysis. .. .. 89 6.6.2 BlackBoxAnalysis ......................... 90 6.6.3 GrayBoxAnalysis. ......................... 90 6.7 PenetrationTesting............................. 91 6.8 Other Practices and Recommendations . .. 91 6.8.1 KeepitSimple ........................... 91 6.8.2 Acknowledge human imperfection . 92 6.8.3 ValidatedallInput . .. .. 92 6.8.4 InitializeMemory.......................... 92 6.8.5 DesignSafeDefaultConfigurations . 92 6.8.6 Ensure that the Bounds of No Memory Region Are Violated .. 92 6.8.7 UseCorrectAuthentication . 92 6.8.8 Remember it is hard to keep secrets . 93 6.8.9 LeastPrivilege ........................... 93 6.8.10 SecuringtheWeakestLink . 93 6.8.11 FailSecurely............................. 93 6.8.12 SeparationofPrivilege . 93 CONTENTS xv 6.8.13 KeepSystemlogs .......................... 94 6.8.14 CodingPractices . .. .. 94 6.8.15 Firewalls............................... 94 6.8.16 IntrusionDetectionSystems . 95 6.8.17 AntivirusandMalwaredetectors . 95 6.8.18 Detecting and preventing Buffer Overflows . .. 95 7 Tools for Software Security 97 7.1 NISTToolTaxonomy............................ 97 7.2 StaticAnalysis ............................... 100 7.2.1 LexicalTools ............................ 100 7.2.2 SemanticTools ........................... 101 7.3 DynamicAnalysis.............................. 103 7.4 LibraryandCompilerApproaches . 104 7.5 Packet Manipulation and Password Cracking Tools . ..... 105 7.6 Personal Firewalls (software implementations) . ........ 107 7.7 Antivirus and Malware detection Tools . 108 7.8 IntrusionDetectionTools: . 108 7.9 Cryptography ................................ 109 7.9.1 SymmetricCryptography. 110 7.9.2 Asymmetric or Public Key Cryptography . 110 7.9.3 HashandMAC ........................... 110 7.10Protocols .................................. 111 7.11Application ................................. 111 7.12email..................................... 112 8 Security Metrics 113 8.1 AtInceptionPhase ............................. 114 8.1.1 Application Insecurity Index . 114 8.1.2 LegislationandCompliance . 114 8.1.3 HowmuchSecurity? . 117 8.2 AttheDevelopment ...........................