Encrypting Sensitive Information (Optional)
You can use the apim_crypto from within the toolkit container to encrypt sensitive information. The utility uses Authenticated Encryption with Associated Data (AEAD) encryption. AEAD uses a user provided 16 character secret and a 16 character nonce to encrypt text. The secret and nonce must be in UTF-8 format only.
Encrypt all sensitive information in one secret using the same AEAD secret and nonce. Refer to Using Local Edition Crypto Utility topic in the Security guide for detailed instructions on using apim_crypto utility.
I have no name!@toolkit:/$ apim_crypto -s <16 character secret> -n <16 character nonce> -t <text to encrypt>
Encrypting Database Access Secret
Boomi Cloud API Management - Local Edition can access the database with or without TLS support. Refer to Securing Connections to an External MySQL 8 compliant database for detailed steps on using Encrypted connections with MySQL.
Example
The sample templates for encrypting database access secret with and without encryption are provided in the following sections.
With Encryption (Optional)
Procedure
-
Encrypt database password using
apim_crypto.# Run the toolkit pod if it is not running
kubectl run --image=<registry/[repository]/apim-le-toolkit:<tag> toolkit
Command: apim_crypto -s '<16 char secret to use>' -n '<16 char AEAD nonce to use while
encrypting>' -t '<text that needs to be encrypted>'
Example
I have no name!@toolkit:/$ apim_crypto -s 'abcdefghijklmnop' -n '1234567890123456' -t
'masheryonprempassword'
YWQ0NTA5NzUxMjNlYzA1YjFjNWYxZWU1ZjdkOGZhMzE3YjcyYjA1M2ViY2M4YTVhMzg
wOGMxZDAxM2QxMDYzMDUxYmE4YTg5NjU2MjMxMzQzMDMzMzIzMDMyMzQzMTMz
MzMzMTM0MzI2NS1AQEA=
$ -
Create a YAML file.
For example, consider an example of this
apim-dbcreds-secret.yamlfile. You can create a copy of this file fromsamples/database/db-secrets-with-encryption-sample.yaml.-
base64encode username. Copy and replace the result value to.apimdbuserkey, and then copy and replace the result value from encryption to.apimdbpasswdkey.$ echo -n '<db username>' | base64
$ echo -n 'masheryonprem' | base64
bWFzaGVyeW9ucHJlbQo= -
base64encode AEAD secret and provide as value for.aeadsecretkey.$ echo -n "abcdefghijklmnop" |base64
YWJjZGVmZ2hpamtsbW5vcA== -
base64encode nonce and provide as value for.aeadnoncekey.$ echo -n "1234567890123456" |base64
MTIzNDU2Nzg5MDEyMzQ1Ng==
Result:
apiVersion: v1
kind: Secret
metadata:
name: apim-db-secret
data:
# $ echo masheryonprem | base64
.apimdbuser: bWFzaGVyeW9ucHJlbQo=
# see using apim_crypto utility in security guide and install guide.
.apimdbpasswd:
YWQ0NTA5NzUxMjNlYzA1YjFjNWYxZWU1ZjdkOGZhMzE3YjcyYjA1M2ViY2M4YTVhMzgwOGM
xZDAxM2QxMDYzMDUxYmE4YTg5NjU2MjMxMzQzMDMzMzIzMDMyMzQzMTMzMzMzMTM0M
zI2NS1AQEA=
# $ echo -n "abcdefghijklmnop" |base64
.aeadsecret: YWJjZGVmZ2hpamtsbW5vcA==
# $ echo -n "1234567890123456" |base64
.aeadnonce: MTIzNDU2Nzg5MDEyMzQ1Ng== -
Without Encryption
Procedure
-
Create a YAML file.
For example, consider an example of this
apim-dbcreds-secret.yamlfile. You can create a copy of this file from<extract location>/samples/database/db-secrets-sample.yaml.-
base64encoded db username. Then, copy and replace the result value to the.apimdbuserkey.$ echo -n '<db username>' | base64
Example
$ echo -n 'masheryonprem' | base64
bWFzaGVyeW9ucHJlbQo= -
base64encoded db password. Then, copy and replace the result value to theapimdbpasswdkey.$ echo -n '<db password>' | base64
Example
$ echo -n 'changeme' |base64
Y2hhbmdlbWU=
Result:
apiVersion: v1
kind: Secret
metadata:
name: apim-db-secret
data:
# $ echo masheryonprem | base64
.apimdbuser: bWFzaGVyeW9ucHJlbQo=
# $ echo <password_text> | base64
.apimdbpasswd: Y2hhbmdlbWU= -