How to store and encrypt credentials while making them accessible to scripts

At times it is necessary to store encrypted credentials, which might be used by scripts and hooks within CloudBolt. 

These objects can be defined in CloudBolt under Admin > Connection Info (under Resources & Networks). By clicking the 'New Connection Info' button you can create your own instances that are encrypted and stored in the database.

Screen_Shot_2017-05-23_at_1.49.03_PM.png

Once you've created a Connection Info object, you can get it in your script with something like:

```

from utilities.models import ConnectionInfo

conn = ConnectionInfo.objects.get(name="THE NAME OF YOUR INSTANCE HERE")

```

Connection Info consists of IP/hostname, port, protocol, username, password and SSH Key (if it resides in CB) as details for connections to systems outside of CloudBolt. It might be used to securely store credentials for custom actions. Also used internally by CloudBolt for a number of connections, such as load balancers and accessing remote action source code.

Have more questions? Submit a request

1 Comments

  • 2
    Avatar
    Paul Houghton

    Hi Aaron,

    I presume this is just for CB Hooks?

    Is there a way to do this with remote hooks as well?

     

    Paul

Please sign in to leave a comment.