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.

338 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sFor <strong>Web</strong> services built using version 1.0 of the .NET Framework, the ASPNET userprofile is not loaded. In this scenario, you have two options.● Run your <strong>Web</strong> service using a custom least privileged account with which youhave previously interactively logged on to the <strong>Web</strong> server to create a user profile.● Store the key in the local machine store <strong>and</strong> grant access to your <strong>Web</strong> serviceprocess account. On Windows 2000, this is the ASPNET account by default. OnWindows Server 2003, it is the Network Service account by default.To grant access, use Windows Explorer to configure an ACL on the followingfolder that grants full control to the <strong>Web</strong> service process account.\Documents <strong>and</strong> Settings\All Users\<strong>Application</strong> Data\Microsoft\Crypto\RSA\MachineKeysFor more information, see the “Managing X.509 Certificates,” “Encrypting a SOAPMessage Using an X.509 Certificate,” <strong>and</strong> “Decrypting a SOAP Message Using anX.509 Certificate” sections in the WSE documentation.Symmetric Encryption Using Shared KeysWith symmetric encryption, the <strong>Web</strong> service <strong>and</strong> its consumer share a secret key toencrypt <strong>and</strong> decrypt the SOAP message. This encryption is faster than asymmetricencryption although the consumer <strong>and</strong> the service provider must use some out-ofb<strong>and</strong>mechanism to share the key.For more information, see the “Encrypting a SOAP Message Using a Shared Key”<strong>and</strong> “Decrypting a SOAP Message Using a Shared Key” sections in the WSEdocumentation.Symmetric Encryption Using Custom Binary TokensYou can also use WSE to define a custom binary token to encapsulate the customsecurity credentials used to encrypt <strong>and</strong> decrypt messages. Your code needs twoclasses. The sender class must be derived from the Binary<strong>Security</strong>Token class toencapsulate the custom security credentials <strong>and</strong> encrypt the message. The recipientclass must be derived from DecryptionkeyProvider class to retrieve the key <strong>and</strong>decrypt the message.For more information, see the “Encrypting a SOAP Message Using a Custom Binary<strong>Security</strong> Token” <strong>and</strong> “Decrypting a SOAP Message Using a Custom Binary <strong>Security</strong>Token” sections in the WSE documentation.Encrypting Parts of a MessageBy default, WSE encrypts the entire SOAP body <strong>and</strong> none of the SOAP headerinformation. However, you can also use WSE to programmatically encrypt <strong>and</strong>decrypt portions of a message.

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

Saved successfully!

Ooh no, something went wrong!