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.

640 Part V: Assessing Your <strong>Security</strong>Data Access CodeThis section identifies the key review points that you should consider when youreview your data access code. For more information about the issues raised in thissection, see Chapter 14, “Building Secure Data Access.”●●●●●●●Do you prevent SQL injection?Do you use Windows authentication?Do you secure database connection strings?How do you restrict unauthorized code?How do you secure sensitive data in the database?Do you h<strong>and</strong>le ADO .NET exceptions?Do you close database connections?Do You Prevent SQL Injection?Check that your code prevents SQL injection attacks by validating input, using leastprivileged accounts to connect to the database, <strong>and</strong> using parameterized storedprocedures or parameterized SQL comm<strong>and</strong>s. For more information, see “SQLInjection” earlier in this chapter.Do You Use Windows Authentication?By using Windows authentication, you do not pass credentials across the networkto the database server, <strong>and</strong> your connection strings do not contain user names <strong>and</strong>passwords. Windows authentication connection strings either useTrusted_Connection=‘Yes’ or Integrated <strong>Security</strong>=‘SSPI’ as shown in the followingexamples."server='YourServer'; database='YourDatabase' Trusted_Connection='Yes'""server='YourServer'; database='YourDatabase' Integrated <strong>Security</strong>='SSPI'"Do You Secure Database Connection Strings?Review your code for the correct <strong>and</strong> secure use of database connection strings.These strings should not be hard coded or stored in plaintext in configuration files,particularly if the connection strings include user names <strong>and</strong> passwords.

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

Saved successfully!

Ooh no, something went wrong!