Summary

This is a troubleshooting guide that will demonstrate how to get the Aqua Database password from a Kubernetes Secret. This is useful if you have forgotten or lost the Aqua Database password and you need it to login to debug issues.

Environment


Symptom

You have been tasked to debug the Aqua Database but you are have forgotten or lost the password used to login to the database. You would like to retrieve the database password from a Kubernetes secret


Solution

To retrieve the Aqua Database password from the Kubernetes secret, you will need to use the "kubectl" utility and run the following commands in the cluster where the Aqua Database secret is stored;


# get the name of the aqua database secret first
kubectl get secrets --namespace=aqua

# retrieve the aqua database secret and decode the value
kubectl get secrets/aqua-db --namespace=aqua --template={{.data.password}} | base64 -D ; echo -e


The command above will retrieve the aqua-db secret and decode the value. Below is a screenshot demonstrating the commands above;



Related Information

  1. https://stackoverflow.com/a/56909262
  2. https://kubernetes.io/docs/concepts/configuration/secret/
  3. https://support.aquasec.com/support/solutions/articles/16000114381-how-to-retrieve-the-aqua-scanner-username-and-password-from-a-kubernetes-secret/