IdExchange 1.9.1

Secure the web configurations

After IDMS has been installed, the last phase is to encrypt the security configurations. Note: Once the web.config has been encrypted, it cannot be edited using a text editor or IIS manager configuration tool set. If changes need to be made, the web.config will first need to be decrypted (please see decrypt web.config section below).

The steps below provide the instructions for securing the web.config file.

  1. Open a command prompt as an administrator.

  2. Go to the C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 directory.
    image2016-1-9 16:11:43.png

  3. Next, enter aspnet_regiis -pef appSettings "C:\Program Files (x86)\HID Global\IDMS\WebApi" -prov RsaProtectedConfigurationProvider into the command prompt and press Enter.
    image2017-7-26 9:39:12.png

  4. Next, enter aspnet_regiis -pef connectionStrings "C:\Program Files (x86)\HID Global\IDMS\WebApi" -prov RsaProtectedConfigurationProvider into the command prompt and press Enter.
    image2017-7-26 9:39:48.png

  5. After completion, go the c:\IDMS\WebApi and verify the web.config has been encrypted.
    image2016-1-9 16:15:10.png

  6. Open the web.config and verify the contents are encrypted.
    image2016-1-9 16:18:23.png

  7. Restart IIS

 

Batch Script

To create an automated script, copy the text below into a new text file and save the file as "EncryptWebConfig.bat". Open with administrative privileges.

set curr_dir=%cd%

echo ### Encrypting Web Config

chdir /D "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319"

aspnet_regiis -pef "appSettings" "C:\Program Files (x86)\HID Global\IDMS\WebApi" -prov RsaProtectedConfigurationProvider
aspnet_regiis -pef "connectionStrings" "C:\Program Files (x86)\HID Global\IDMS\WebApi" -prov RsaProtectedConfigurationProvider

chdir /D %curr_dir%

echo ### Web Config Encrypted

@pause

 

Decrypting the web.config

If a change needs to be made to the IDMS configurations, the web.config must first be decrypted. This process will require an authorized administrator. The process is as follows:

1

Log into the IDMS server

2

Open a command prompt with administrative privileges

3

In the command prompt, type:

chdir /D "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319"

4

While in the C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 directory, enter the following commands

aspnet_regiis -pdf "appSettings" "C:\Program Files (x86)\HID Global\IDMS\WebApi"
aspnet_regiis -pdf "connectionStrings" "C:\Program Files (x86)\HID Global\IDMS\WebApi"

5

The web.config will be in clear text and can once again be edited.

 

Batch Script

To create an automated script, copy the text below into a new text file and save the file as "DecryptWebConfig.bat". Open with administrative privileges.


set curr_dir=%cd%

echo ### Decrypting Web Config

chdir /D "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319"

aspnet_regiis -pdf "appSettings" "C:\Program Files (x86)\HID Global\IDMS\WebApi"
aspnet_regiis -pdf "connectionStrings" "C:\Program Files (x86)\HID Global\IDMS\WebApi"

chdir /D %curr_dir%

echo ### Web Config Decrypted

@pause