Explore tens of thousands of sets crafted by our community.
Secure Coding Principles
12
Flashcards
0/12
Fix Security Bugs Promptly
Address security vulnerabilities or bugs as soon as they are discovered. Example: Regularly update and apply patches to software and dependencies.
Minimize Attack Surface Area
Limit how much of your code is exposed to potential attackers, reducing the chance of unauthorized access. Example: Disabling or removing any unused features or services in an application.
Separation of Duties
Divide tasks and privileges among multiple people or systems to reduce the risk of fraud or error. Example: Requiring two administrators to approve sensitive actions.
Principle of Least Privilege
Give users and programs the minimum level of access—or permissions—needed to perform their tasks. Example: A worker only having access to the data necessary for their job.
Defense in Depth
Employ multiple layers of security measures to defend against failures in one component. Example: Combining firewalls, intrusion detection systems, and data encryption.
Avoid Security by Obscurity
Do not rely on secrecy to provide security. Instead, ensure the system is inherently secure, regardless of whether secret details become public. Example: Open-source software still ensuring security despite having publicly visible code.
Keep Security Simple
Complex systems are harder to secure. Aim for simplicity to reduce the chance of errors and increase security. Example: A simple, clear-cut authentication process with fewer steps is less likely to contain vulnerabilities.
Input Validation
Ensure input to a system is valid before using it. Example: Checking that a user's input is a valid email format before accepting it.
Fail Securely
Handle errors or exceptions in a way that does not expose the system to further risks. Example: An application should close connections and log errors without providing stack traces to the user.
Use Trusted Tools and Libraries
Incorporate well-known, maintained, and secure tools and libraries to avoid vulnerabilities that come from untrusted sources. Example: Using a reputable library like OpenSSL for cryptographic functions.
Establish Secure Defaults
Create systems that are secure by default, requiring manual changes to make them less secure. Example: Passwords must meet complexity requirements upon account creation.
Output Encoding
Ensure any output from the system is encoded correctly to prevent unintended execution on the client side. Example: Encoding HTML entities in user-generated content to prevent cross-site scripting (XSS).
© Hypatia.Tech. 2024 All rights reserved.