Secrets management


One of the challenges of building a microservice architecture is protecting the secrets that are necessary for its successful operation. Unlike in monolithic architectures where credentials are provided from one place, each microservice must have its own set of credentials for accessing resources that it needs, such as databases and other services. As your architecture scales, so does the complexity of maintaining secrets for every single service.

A “secret” can be any sensitive credential, key, or password that would compromise your application/business security if exposed. Some examples:

  • Database credentials
  • Private keys for signing or identity (e.g., SSH keys or API keys)
  • Private certificates for communication (e.g., PGP, SSL)

Walhall provides an interface that lets you define secrets for each of the modules in your app. These secrets are delivered to the container running your app at initialization time. This setup ensures that only the owner of a Walhall app can access the secrets.

How to set secrets for modules

If you have already created an app in Walhall with one or more modules, then you can set the secrets for each module.

  1. Log in to Walhall.
  2. Switch to the app where you want to set the secrets.
  3. Click on the module whose secrets you want to set.
  4. The Details tab will load. Click the Secrets button above the module details.
    Screenshot: Button to click for defining a module's secrets
  5. The Secrets tab will load. Enter the key name for your secret in the left input field, and enter its value in the right input field.
    Screenshot: Filling in a secret
  6. Click Create new secret.
  7. Click Close in the top right corner and then re-deploy your app.

Now the module can access the secret as an environment variable in the Pod where it runs.

Once you create a secret, it will display as hidden by default whenever you load the Secrets tab again.

Note that you must define secrets for each environment separately—secrets are not promoted when you create a new environment.

Best practices

We recommend the following best practices for managing your secrets:

  • Never commit secrets to a source code repository. Anyone with access to the repository will have access to the secrets.
  • Do not store secrets in the module’s configuration (under the “Configuration” tab).
  • Ensure that your secrets are difficult to guess or crack.
  • Do not reuse secrets among modules.