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.

736 <strong>Improving</strong> <strong>Web</strong> <strong>Application</strong> <strong>Security</strong>: <strong>Threats</strong> <strong>and</strong> CountermeasuresClass-Level ChecksCheck DescriptionClass <strong>and</strong> member visibility is restricted. The most restrictive access modifier is used(private where possible).Non-base classes are sealed.Input from outside the current trust boundary is validated. Input data is constrained <strong>and</strong>validated for type, length, format, <strong>and</strong> range.Code implements declarative checks where virtual internal methods are used.Access to public classes <strong>and</strong> methods are restricted with principal permission dem<strong>and</strong>s(where appropriate).Fields are private. When necessary, field values are exposed by using read/write or read-onlypublic properties.Read-only properties are used where possible.Types returned from methods that are not designed to be created independently containprivate default constructors.Unsealed public types do not have internal virtual members.Use of event h<strong>and</strong>lers is thoroughly reviewed.Static constructors are private.CryptographyCheck DescriptionCode uses platform-provided cryptography <strong>and</strong> does not use custom implementations.R<strong>and</strong>om keys are generated by using RNGCryptoServiceProvider (<strong>and</strong> not the R<strong>and</strong>om class).PasswordDeriveBytes is used for password-based encryption.DPAPI is used to encrypt configuration secrets to avoid the key management issue.The appropriate key sizes are used for the chosen algorithm, or if they are not, the reasonsare identified <strong>and</strong> understood.Keys are not held in code.Access to persisted keys is restricted.Keys are cycled periodically.Exported private keys are protected.

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

Saved successfully!

Ooh no, something went wrong!