wso2/product-microgateway

Encrypting passwords in micro gateway ( Docker)

chashikajw opened this issue · 0 comments

Description

The issue is that the container created using the built image doesn't start up properly when the "ballerinaKeystore" and "ballerinaTruststore" passwords are encrypted for the Docker environment in Microgateway. However, it functions as expected in the VM-based approach.

Steps to Reproduce

  1. First, go to the /lib/platform/bin folder and execute the following command

./ballerina encrypt

  1. Enter the value which you need to encrypt with a secret.
  2. After entering both values, you will get an encryption key as below.

<key>="@encrypted:{hQJverd9yJi7iF98/gyTkuIjY75gXdcEqmUeEleKRJ4=}"

  1. Open the [PROJECT_HOME]/conf/deployment-config.toml file.
  2. Add the below configurations to copy the secret file to the image.
  [docker.dockerCopyFiles]
    enable = true
    [[docker.dockerCopyFiles.files]]
      source = '/Users/niran/Documents/Tickets/INFORMATICASUB-268/wso2am-micro-gw-toolkit-macos-3.2.0/resources/conf/micro-gw.conf'
      target = '/home/ballerina/conf/micro-gw.conf'
        isBallerinaConf = true
    [[docker.dockerCopyFiles.files]]
      source = '/Users/niran/Documents/Tickets/INFORMATICASUB-268/secret.txt'
      target = '/home/ballerina/secret.txt'
        isBallerinaConf = false
  1. Then change the CMD parameter.
cmd = 'CMD gateway  --b7a.config.secret=/home/ballerina/secret.txt'
  1. Build the image.

When trying out the above approach we could see that the image is not starting up properly.

Version

Microgateway 3.2.0

Related Issues

wso2/api-manager#2886