You plan to deploy an ASP.NET application over the company intranet. The application uses SQL Server and you want to use SQL Server connection pooling, protect confidential data, and minimize administrative overhead. Which security configuration should you choose?

Difficulty: Medium

Correct Answer: Use Windows authentication in the application and use a single Windows account for all users to access SQL Server.

Explanation:


Introduction / Context:
Intranet ASP.NET applications that connect to SQL Server must balance security, performance, and administrative effort. Connection pooling works best when many requests share the same connection string, including the same security credentials. Using Windows authentication and integrated security is considered a best practice in domain environments, because it avoids storing database passwords in configuration files and allows the operating system to manage credentials securely. This question asks you to choose a configuration that meets performance and security goals while keeping administration manageable.


Given Data / Assumptions:

    The application runs on an intranet where users authenticate to the Windows domain.
    The application retrieves data from SQL Server and should take advantage of connection pooling.
    Confidential data on the server must be protected, so hard coded SQL logins and passwords are undesirable.
    Administrative overhead should be minimized, so maintaining many individual database logins is not ideal.
    Windows authentication between ASP.NET and SQL Server is available in this environment.


Concept / Approach:
SQL Server connection pooling groups connections based on identical connection strings. If each user has a different database login, many pools may be created, which reduces the effectiveness of pooling. Using a single trusted Windows account for the application to access SQL Server centralizes permission management and maximizes pooling. The ASP.NET application can authenticate users with Windows or forms authentication but still use one Windows service account for database connections by configuring Integrated Security and not enabling impersonation. This combination offers good security, strong pooling behavior, and simpler administration, because you manage database permissions for only one account.


Step-by-Step Solution:
1. Choose Windows authentication between ASP.NET and SQL Server by using Integrated Security=SSPI in the connection string and configuring the application pool identity or a dedicated Windows service account. 2. Do not enable per user impersonation for database access. Instead, let all requests execute database operations under the single Windows account associated with the application pool. 3. Grant SQL Server permissions for that single account only to the necessary databases and tables, following the principle of least privilege. 4. Keep user level authentication and authorization logic in ASP.NET, using roles or claims, while database connections remain pooled under the single account. 5. This configuration maximizes connection pooling (one shared connection string), protects credentials (no SQL passwords in configuration), and minimizes administrative effort (only one database login to manage).


Verification / Alternative check:
Monitoring the SQL Server connection pool and SQL Profiler will show that most connections use the same Windows account, which confirms effective pooling behavior. Security audits will show that only one service account has direct database permissions, simplifying permission review. Official ASP.NET and SQL Server guidance recommends this pattern for intranet applications with pooled connections.


Why Other Options Are Wrong:
Using Windows impersonation so that each user connects with their own Windows credentials complicates pooling, as each unique identity can create a separate pool, and greatly increases permission management work in SQL Server.
Using forms authentication with the sa login is insecure, because the sa account is highly privileged and using it from application code is considered a major security risk.
Assigning each user a separate SQL Server login also increases administrative overhead and hurts connection pooling since each login yields a separate pool.


Common Pitfalls:
Developers sometimes misinterpret security requirements and overuse impersonation, causing performance issues and complex permission setups. Another pitfall is embedding SQL authentication credentials in configuration files, which can expose passwords if files are not protected. Using a single, low privilege Windows account for database access in an intranet scenario is a balanced and widely recommended approach.


Final Answer:
You should use Windows authentication with a single Windows account for all database access, which preserves connection pooling, protects credentials, and reduces administrative effort.

More Questions from Microsoft Certification

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion