
Second, this file could be compromised using simple attacks. Its name and location were dictated by the architecture of ASP. In past versions of ASP, it was common to place the connection string in the Global.asa.
#Web config sql server connection string full
The application would have to store the connection string in a variable in memory, which means that it would be contained within a full memory dump.ĭeveloping & Deploying … Connection Strings and Security
#Web config sql server connection string windows
For the attacker to get the connection string, the attacker would need to dump the memory for the application, be it a Windows Service, Win32 application, or web-based application, and read through the memory dump looking for the connection string. However, it is much more difficult for the attacker. In either case, troubleshooting the application is made a little bit harder as the connection string is not easily visible without decrypting the connection string to ensure that the connection string is correct, which would require a separate application.Įven with the connection string stored in the configuration file in an encrypted format, there is still a risk of an attacker getting the connection string. This automatic encryption of the connection string is a better method for the systems administrator because it does not require the systems administrator to use a separate application to encrypt the connection string. Securing the connection string could be done through a separate application that the systems administrator could use during the deployment process to encrypt the string, or the application could be configured to automatically encrypt the string the first time the application launches. The application would then load the encrypted value from the config file, decrypt the value, and then use the decrypted value as the connection string to connect to the database. The best way to secure the database connection string is to encrypt the value within the configuration file. In order to protect the database, you have to protect the connection string, so that if an attacker is able to get access to the files on the web server or application server, the attacker is not able to use the connection string to attack the database. When the connection strings are stored in plain text, they provide a wealth of information to an attacker, typically everything that an attacker would need to break into a database. This connection string is typically stored in plain text to make it easy to edit and easy to change as the application is moved from development, to QA, to staging, and to production. Typically, the connection string will be stored in a configuration file somewhere within the application or web server. to use to connect to the SQL Server instance. In the Additional connection parameters field, it is not recommended to define the SqlServerName and DatabaseName settings because they are already defined in the Name of SQL server and Database name fields.Ĭhanges made to the configuration file become effective within one minute.Denny Cherry, in Securing SQL Server (Third Edition), 2015 Protecting Your Connection StringsĪpplications use connection strings to identify the server instance and database to connect to and to determine what driver, login, etc. Use the text editor to make the necessary changes to the SQL server connection settings.įor a description of the SQL server connection string settings, you can refer to the Microsoft website via the following link: connection string settings.When the application is installed, the value of this setting is automatically defined by the application based on the information provided by the administrator. Find the tag named AdditionalConnectionParameters.Open the SQL server configuration file in a text editor.


To change the additional settings of the SQL server connection string:

When the application is installed, data in the SQL server connection string is saved in the following configuration file in XML format: You can change the additional settings of the SQL server connection string. Modifying the additional settings of the SQL server connection string
