Home > Net >  ConnectionString not encrypted in SSIS integration project
ConnectionString not encrypted in SSIS integration project

Time:11-02

I am building an Integration Services Project in VS 2019.

I have added a Project Connection Manager for an OLE DB/SQL Server.

I have configured the connection string using project parameters. (Project.params file).

Then I changed the project parameter to use "Configurations", in order to apply different values based on the active configuration.

enter image description here

In the Project Property settings, the protection level is set to "EncryptSensitiveWithUserKey".

However, if I examine the .dtproj file, both connection strings (Dev and "Azure") are stored unencrypted. This is a concern, as I want to be able to include the .dtproj file in a repository.

Am I doing something wrong? If it's not possible this way, how else can I securely "save" two connection strings in the project for different configurations?

CodePudding user response:

As the protection level is set to EncryptSensitiveWithUserKey, you should configure the project parameters as Sensitive. To do so, click on the Project.params file in the "Solution Explorer"

enter image description here

Then, set the parameter as sensitive. The parameter value will be masked immediately as shown in the image below:

enter image description here

Also, let us check the project.params file in the solution directory.

enter image description here

If we open the file using a text editor, we can check that the parameter value is encrypted.

enter image description here

Update

As the OP mentioned in the comments, setting the connection string parameter as sensitive led to the following exception:

The expression will not be evaluated because it contains sensitive parameter variable "$Project::ConnectionString". Verify that the expression is used properly and that it protects the sensitive information. ".

Based on the following enter image description here

Helpful links:

  • Related