Created
November 17, 2021 10:56
-
-
Save brmzkw/de597da4cdbda4476b62f9019b91242e to your computer and use it in GitHub Desktop.
Decrypt AWX credentials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWX credentials are encrypted with django SECRET_KEY. | |
If you have access to the container `awx_web`, you can follow the following procedure to decrypt secrets. | |
$> docker exec -ti awx_web bash | |
$> source /var/lib/awx/venv/awx/bin/activate | |
$> awx-manage shell | |
$> python | |
>>> CREDENTIAL_ID = xxx # replace me | |
>>> from awx.main.models import Credential | |
>>> cred = Credential.objects.get(id=CREDENTIAL_ID) | |
>>> print('\n'.join(['%s: %s\n' % (key, cred.get_input(key)) for key in [key for key, value in cred.inputs.items() if 'encrypted' in value]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment