Skip to content

Instantly share code, notes, and snippets.

@brmzkw
Created November 17, 2021 10:56
Show Gist options
  • Save brmzkw/de597da4cdbda4476b62f9019b91242e to your computer and use it in GitHub Desktop.
Save brmzkw/de597da4cdbda4476b62f9019b91242e to your computer and use it in GitHub Desktop.
Decrypt AWX credentials
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