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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4: Design Guidelines for Secure <strong>Web</strong> <strong>Application</strong>s 89Sensitive Per User DataSensitive data such as logon credentials <strong>and</strong> application level data such as credit cardnumbers, bank account numbers, <strong>and</strong> so on, must be protected. Privacy throughencryption <strong>and</strong> integrity through message authentication codes (MAC) are the keyelements.The following practices improve your <strong>Web</strong> application’s security of sensitive per userdata:● Retrieve sensitive data on dem<strong>and</strong>.●●●Encrypt the data or secure the communication channel.Do not store sensitive data in persistent cookies.Do not pass sensitive data using the HTTP-GET protocol.Retrieve Sensitive Data on Dem<strong>and</strong>The preferred approach is to retrieve sensitive data on dem<strong>and</strong> when it is neededinstead of persisting or caching it in memory. For example, retrieve the encryptedsecret when it is needed, decrypt it, use it, <strong>and</strong> then clear the memory (variable) usedto hold the plaintext secret. If performance becomes an issue, consider the followingoptions:● Cache the encrypted secret.●Cache the plaintext secret.Cache the Encrypted SecretRetrieve the secret when the application loads <strong>and</strong> then cache the encrypted secret inmemory, decrypting it when the application uses it. Clear the plaintext copy when itis no longer needed. This approach avoids accessing the data store on a per requestbasis.Cache the Plaintext SecretAvoid the overhead of decrypting the secret multiple times <strong>and</strong> store a plaintext copyof the secret in memory. This is the least secure approach but offers the optimumperformance. Benchmark the other approaches before guessing that the additionalperformance gain is worth the added security risk.Encrypt the Data or Secure the Communication ChannelIf you are sending sensitive data over the network to the client, encrypt the data orsecure the channel. A common practice is to use SSL between the client <strong>and</strong> <strong>Web</strong>server. Between servers, an increasingly common approach is to use IPSec. Forsecuring sensitive data that flows through several intermediaries, for example, <strong>Web</strong>service Simple Object Access Protocol (SOAP) messages, use message levelencryption.

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

Saved successfully!

Ooh no, something went wrong!