Hey There!
AWX does indeed store SSH private keys and passphrases in a PostgreSQL database table, and it encrypts the values using Fernet symmetric encryption. The key used to encrypt these values is composed of the Django `SECRET_KEY` value for your installation (
https://docs.djangoproject.com/en/2.1/ref/settings/#secret-key) and the primary key of the credential being encrypted. The code that implements this in awx is open source and implemented here:
For the reasons Ben mentioned, it's important to practice good key management processes - we recommend that users generate a new private key specific to their awx installation and not use existing/shared keys. We also highly recommend the use of a passphrase.
When a playbook runs in AWX that requires the use of an SSH key and/or passphrase, AWX fetches the encrypted key value from the database, decrypts it using the `SECRET_KEY`, and writes it to a named pipe (FIFO) so the decrypted value doesn't get written to the disk. From here, ssh-agent reads the key from the named pipe, and an ansible-playbook process is forked. When AWX runs ansible-playbook, it does so via a pseudoterminal using the Python library "pexpect". In this way, if we observe an interactive prompt for an SSH key (e.g., "Enter passphrase for ..."), we take the decrypted passphrase value and write it to stdin.