https://www.securecoding.cert.org/confluence/display/seccode/Top+10+Secure+Coding+Practices
1
Validate input. Validate input from all untrusted data sources. Proper input validation can eliminate the vast majority of software vulnerabilities. Be suspicious of most external data sources, including command line arguments, network interfaces, environmental variables, and user controlled files [Seacord 05].
2
Heed compiler warnings. Compile code using the highest warning level available for your compiler and eliminate warnings by modifying the code [C MSC00-A, C++ MSC00-A]. Use static and dynamic analysis tools to detect and eliminate additional security flaws.
3
Architect and design for security policies. Create a software architecture and design your software to implement and enforce security policies. For example, if your system requires different privileges at different times, consider dividing the system into distinct intercommunicating subsystems, each with an appropriate privilege set.
4
Keep it simple. Keep the design as simple and small as possible [Saltzer 74, Saltzer 75]. Complex designs increase the likelihood that errors will be made in their implementation, configuration, and use. Additionally, the effort required to achieve an appropriate level of assurance increases dramatically as security mechanisms become more complex.
5
Default deny. Base access decisions on permission rather than exclusion. This means that, by default, access is denied and the protection scheme identifies conditions under which access is permitted [Saltzer 74, Saltzer 75].
6
Adhere to the principle of least privilege. Every process should execute with the the least set of privileges necessary to complete the job. Any elevated permission should be held for a minimum time. This approach reduces the opportunities an attacker has to execute arbitrary code with elevated privileges [Saltzer 74, Saltzer 75].
7
Sanitize data sent to other systems. Sanitize all data passed to complex subsystems [C STR02-A] such as command shells, relational databases, and commercial off-the-shelf (COTS) components. Attackers may be able to invoke unused functionality in these components through the use of SQL, command, or other injection attacks. This is not necessarily an input validation problem because the complex subsystem being invoked does not understand the context in which the call is made. Because the calling process understands the context, it is responsible for sanitizing the data before invoking the subsystem.
8
Practice defense in depth. Manage risk with multiple defensive strategies, so that if one layer of defense turns out to be inadequate, another layer of defense can prevent a security flaw from becoming an exploitable vulnerability and/or limit the consequences of a successful exploit. For example, combining secure programming techniques with secure runtime environments should reduce the likelihood that vulnerabilities remaining in the code at deployment time can be exploited in the operational environment [Seacord 05].
9
Use effective quality assurance techniques. Good quality assurance techniques can be effective in identifying and eliminating vulnerabilities. Fuzz testing, penetration testing, and source code audits should all be incorporated as part of an effective quality assurance program. Independent security reviews can lead to more secure systems. External reviewers bring an independent perspective; for example, in identifying and correcting invalid assumptions [Seacord 05].
10
Adopt a secure coding standard. Develop and/or apply a secure coding standard for your target development language and platform.
分享到:
相关推荐
Secure Coding: Principles & Practices looks at the problem of bad code in a new way. Packed with advice based on the authors' decades of experience in the computer security field, this concise and ...
Secure coding is the practice of writing programs that are resistant to attack by malicious or mischievous people or programs. Secure coding helps protect a user’s data from theft or corruption. In ...
Secure Coding - Principles & Practices
《Secure Coding in C and C++》是一本深入探讨C和C++编程中安全问题的专业书籍。该书聚焦于如何在这些语言中编写安全的代码,防止潜在的安全漏洞,如缓冲区溢出、类型错误、资源管理不当等。C和C++是底层编程的重要...
This document represents a preliminary draft of the CERT C Programming Language Secure Coding Standard. This project was initiated following the 2006 Berlin meeting of WG14 to produce a secure coding ...
these rules is to eliminate insecure coding practices that can lead to exploitable vulnerabili- ties. The application of the secure coding standard leads to higher quality systems that are safe, ...
《Secure Coding in C and C++》第二版是一本专注于在C和C++编程语言中实现安全编码实践的图书。本书由卡内基梅隆大学软件工程研究所(SEI)和Addison-Wesley合作出版,是软件工程系列的一部分。该系列图书旨在提供...
proper coding of the design’s RTL description. Certain seemingly minor decisions made while crafting an RTL-level design can mean the difference between a design operating at less than 100 MHz and ...
Secure Coding in C and C++, Second Edition, presents hundreds of examples of secure code, insecure code, and exploits, implemented for Windows and Linux. If you’re responsible for creating secure C ...
《The CERT Oracle Secure Coding Standard for Java》是由Fred Long、Dhruv Mohindra、Robert C. Seacord、Dean F. Sutherland和David Svoboda编写的一本书籍。该书由Addison Wesley出版社出版于2011年,属于软件...
Secure Coding in C and C++ ,英文原版,chm格式
Secure coding is the practice of writing programs that are resistant to attack by malicious or mischievous people or programs. Secure coding helps protect a user’s data from theft or corruption. In ...
apple secure coding guide
C C++ Security and Cryptography Programming Programming Software Engineering Robert C. Seacord Addison Wesley Professional Secure Coding in C and C++
Network coding is a data transmission technique which allows intermediate nodes in a network to re-code data in transit. In contrast to traditional network communication where a node repeats incoming ...
为了帮助开发者构建更加安全可靠的Android应用,《Android Application Secure Design/Secure Coding Guidebook》应运而生,成为Android开发者的必读之作。 #### 二、指南结构与内容概览 该指南由日本智能手机安全...