Encrypt Passwords using Red Hat CodeReady Workspaces

Use the running z/OS® Connect Designer container within your Red Hat CodeReady Workspaces to encrypt a password.

Before you begin

The following tasks must be completed:
  1. Downloading the z/OS Connect Designer image.
  2. Setting up Db2 native REST services.
  3. Fork the z/OS Connect Designer Db2 sample project.
  4. Creating the Db2 tutorial workspace in Red Hat CodeReady Workspaces.

About this task

This topic is applicable to: Content applicable to
application developers

Important: Ensure your Red Hat CodeReady Workspaces is running before following these steps.

Procedure

  1. Open a terminal in the running z/OS Connect Designer container.
    1. Click the My Workspace button in the right hand navigation.
      Figure 1. The My Workspace button.
      The My Workspace button.

      This opens the right hand navigation containing information about the running containers that make up your workspace.

    2. Click the New terminal button under the zosconnect drop down.
      Figure 2. The New terminal button.
      The New terminal button.

      This will reveal a terminal from the zosconnect container.

      Within the running z/OS Connect Designer container we have access to the securityUtility feature. Using this we can encrypt the password within the workspace.

  2. Enter the following command within the terminal ensuring you replace <myPassword> with your own password:
    securityUtility encode <myPassword> --encoding=aes
    Figure 3. Entering the command to encrypt password.
    Entering the command to encrypt password.

    The output looks something like this:

    {aes}APu1HaGpBzYbH+g8xVbuqUgJPz1ydNS9VbpAq1hstGdF
  3. Copy the encrypted password output from the terminal.
    Figure 4. Encrypted password output.
    Encrypted password output.
  4. Click on the Stop Workspace button.

    Updates to the devfile.yaml will only take effect when the workspace is restarted. To do this we need to stop the running workspace.

    Figure 5. Stopping the workspace.
    Stopping the workspace.
  5. Update the DB2_PASSWORD variable in the Devfile.yaml.

    Navigate to your workspace tab and update the DB2_PASSWORD environment variables with the output from Step 3.

    Figure 6. Updating the DB2_PASSWORD variable.
    Updating the DB2_PASSWORD variable.
    Figure 7. Updated DB2_PASSWORD variable with output.
    Updated DB2_PASSWORD variable with output.
  6. Click on the workspace name to start it.

    This will restart with the updated password.

    Red Hat CodeReady Workspaces creating a workspace
  7. Verify the environment variables have successfully been passed to the workspace.

    Click on the My Workspace button on the right hand side navigation to reveal the env directory shown under the zosconnect drop down. Within are the environment variables defined in your devfile.yaml.

    Figure 8. Viewing environmental variables.
    Viewing environmental variables.

Results

You have successfully encrypted a password using the running z/OS Connect Designer container in Red Hat CodeReady Workspaces.

What to do next

Configuring your Db2 connection with Basic Authentication in Red Hat CodeReady Workspaces.