11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4: Design Guidelines for Secure <strong>Web</strong> <strong>Application</strong>s 97Design Guidelines SummaryTable 4.2 summarizes the design guidelines discussed in this chapter <strong>and</strong> organizesthem by application vulnerability category.Table 4.2 Design Guidelines for Your <strong>Application</strong>CategoryGuidelinesInput ValidationDo not trust input; consider centralized input validation. Do not rely onclient-side validation. Be careful with canonicalization issues. Constrain,reject, <strong>and</strong> sanitize input. Validate for type, length, format, <strong>and</strong> range.AuthenticationAuthorizationConfigurationManagementSensitive DataSession ManagementCryptographyParameter ManipulationException ManagementAuditing <strong>and</strong> LoggingPartition site by anonymous, identified, <strong>and</strong> authenticated area. Usestrong passwords. Support password expiration periods <strong>and</strong> accountdisablement. Do not store credentials (use one-way hashes with salt).Encrypt communication channels to protect authentication tokens. PassForms authentication cookies only over HTTPS connections.Use least privileged accounts. Consider authorization granularity. Enforceseparation of privileges. Restrict user access to system-level resources.Use least privileged process <strong>and</strong> service accounts. Do not storecredentials in plaintext. Use strong authentication <strong>and</strong> authorization onadministration interfaces. Do not use the LSA. Secure thecommunication channel for remote administration. Avoid storing sensitivedata in the <strong>Web</strong> space.Avoid storing secrets. Encrypt sensitive data over the wire. Secure thecommunication channel. Provide strong access controls on sensitive datastores. Do not store sensitive data in persistent cookies. Do not passsensitive data using the HTTP-GET protocol.Limit the session lifetime. Secure the channel. Encrypt the contents ofauthentication cookies. Protect session state from unauthorized access.Do not develop your own. Use tried <strong>and</strong> tested platform features. Keepunencrypted data close to the algorithm. Use the right algorithm <strong>and</strong> keysize. Avoid key management (use DPAPI). Cycle your keys periodically.Store keys in a restricted location.Encrypt sensitive cookie state. Do not trust fields that the client canmanipulate (query strings, form fields, cookies, or HTTP headers).Validate all values sent from the client.Use structured exception h<strong>and</strong>ling. Do not reveal sensitive applicationimplementation details. Do not log private data such as passwords.Consider a centralized exception management framework.Identify malicious behavior. Know what good traffic looks like. Audit <strong>and</strong>log activity through all of the application tiers. Secure access to log files.Back up <strong>and</strong> regularly analyze log files.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!