Securing Your Application
To build secure Web applications, a holistic approach to application security is required and security must be applied at all layers.
.gif)
If you were to review and analyze the top security issues across many Web applications, you would see a pattern of problems. By organizing these problems into categories, you can systematically tackle them. These problem areas are your application’s vulnerability categories.
Application Vulnerability Categories
What better way to measure the security of a system than to evaluate its potential weak points? To measure the security resilience of your application, you can evaluate the application vulnerability categories. When you do this, you can create application security profiles, and then use these profiles to determine the security strength of an application.
These categories are used as a framework throughout this guide. Because the categories represent the areas where security mistakes are most frequently made, they are used to illustrate guidance for application developers and architects. The categories are also used as a framework when evaluating the security of a Web application. With these categories, you can focus consistently on the key design and implementation choices that most affect your application’s security. Application vulnerability categories are described in Table 1.0.
Table 1.0: Application Vulnerability Categories
| Category | Description |
|---|---|
| Input Validation | How do you know that the input that your application receives is valid and safe? Input validation refers to how your application filters, scrubs, or rejects input before additional processing. |
| Authentication | “Who are you?” Authentication is the process where an entity proves the identity of another entity, typically through credentials, such as a user name and password. |
| Authorization | “What can you do?” Authorization is how your application provides access controls for resources and operations. |
| Configuration Management | Who does your application run as? Which databases does it connect to? How is your application administered? How are these settings secured? Configuration management refers to how your application handles these operational issues. |
| Sensitive Data | Sensitive data refers to how your application handles any data that must be protected either in memory, over the wire, or in persistent stores. |
| Session Management | A session refers to a series of related interactions between a user and your Web application. Session management refers to how your application handles and protects these interactions. |
| Cryptography | How are you keeping secrets, secret (confidentiality)? How are you tamperproofing your data or libraries (integrity)? How are you providing seeds for random values that must be cryptographically strong? Cryptography refers to how your application enforces confidentiality and integrity. |
| Parameter Manipulation | Form fields, query string arguments, and cookie values are frequently used as parameters for your application. Parameter manipulation refers to both how your application safeguards tampering of these values and how your application processes input parameters. |
| Exception Management | When a method call in your application fails, what does your application do? How much do you reveal? Do you return friendly error information to end users? Do you pass valuable exception information back to the caller? Does your application fail gracefully? |
| Auditing and Logging | Who did what and when? Auditing and logging refer to how your application records security-related events. |
Security Principles
Recommendations used throughout this guide are based on security principles that have proven themselves over time. Security, like many aspects of software engineering, lends itself to a principle-based approach, where core principles can be applied regardless of implementation technology or application scenario. The major security principles used throughout this guide are summarized in Table 2.0
Table 2.0: Summary of Core Security Principles
| Principle | Concepts |
|---|---|
| Compartmentalize | Reduce the surface area of attack. Ask yourself how you will contain a problem. If an attacker takes over your application, what resources can he or she access? Can an attacker access network resources? How are you restricting potential damage? Firewalls, least privileged accounts, and least privileged code are examples of compartmentalizing. |
| Use least privilege | By running processes using accounts with minimal privileges and access rights, you significantly reduce the capabilities of an attacker if the attacker manages to compromise security and run code. |
| Apply defense in depth | Use multiple gatekeepers to keep attackers at bay. Defense in depth means you do not rely on a single layer of security, or you consider that one of your layers may be bypassed or compromised. |
| Do not trust user input | Your application’s user input is the attacker’s primary weapon when targeting your application. Assume all input is malicious until proven otherwise, and apply a defense in depth strategy to input validation, taking particular precautions to make sure that input is validated whenever a trust boundary in your application is crossed. |
| Check at the gate | Authenticate and authorize callers early — at the first gate. |
| Fail securely | If an application fails, do not leave sensitive data accessible. Return friendly errors to end users that do not expose internal system details. Do not include details that may help an attacker exploit vulnerabilities in your application. |
| Secure the weakest link | Is there a vulnerability at the network layer that an attacker can exploit? What about the host? Is your application secure? Any weak link in the chain is an opportunity for breached security. |
| Create secure defaults | Is the default account set up with least privilege? Is the default account disabled by default and then explicitly enabled when required? Does the configuration use a password in plaintext? When an error occurs, does sensitive information leak back to the client to be used potentially against the system? |
| Reduce your attack surface | If you do not use it, remove it or disable it. Reduce the surface area of attack by disabling or removing unused services, protocols, and functionality. Does your server need all those services and ports? Does your application need all those features? |
Summary
An ever-increasing number of attacks target your application. They pass straight through your environment’s front door using HTTP. The conventional fortress model and the reliance on firewall and host defenses are not sufficient when used in isolation. Securing your application involves applying security at three layers: the network layer, host layer, and the application layer. A secure network and host platform infrastructure is a must. Additionally, your applications must be designed and built using secure design and development guidelines following timeworn security principles.
Filed under: Uncategorized | Tagged: Application Vulnerability Categories, Authentication, Authorization, Configuration Management, Cryptography, Exception Management, Parameter Manipulation, Secure Web Application, Security Auditing and Logging, Security Principles, Sensitive Data, Session Management | Leave a Comment »


