Encrypting passwords in micro gateway ( Docker)
chashikajw opened this issue · 0 comments
chashikajw commented
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
- First, go to the /lib/platform/bin folder and execute the following command
./ballerina encrypt
- Enter the value which you need to encrypt with a secret.
- After entering both values, you will get an encryption key as below.
<key>="@encrypted:{hQJverd9yJi7iF98/gyTkuIjY75gXdcEqmUeEleKRJ4=}"
- Open the [PROJECT_HOME]/conf/deployment-config.toml file.
- 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
- Then change the CMD parameter.
cmd = 'CMD gateway --b7a.config.secret=/home/ballerina/secret.txt'
- 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