Skip to main content

Integrate Passbolt into Saltstack to manage secrets in the infrastructure of your organization

Project description

About

This Python module allows you to manage secrets for Saltstack via Passbolt. This makes managing secrets easier than manually encrypting them and storing the encrpyted password in the Saltstack repository.

Additionally, it is possible to only have one source of truth for passwords for users and IT infrastructure while being able to manage access for each password. That means that all users can contribute to the Saltack configuration and manage (view/add/change) secrets within their responsibility.

License

MIT

Setup

  1. Clone this repo

  2. Go to directory, run (requires python3-setuptools)

    python3 setup.py install
    

    This will install this module and its dependencies.

  3. Create an Passbolt account for the Salt master.

  4. Copy the private and public PGP key files to /etc/salt.

  5. Import the private key with

    gpg --import /etc/salt/passbolt_private.asc
    
  6. Create a /etc/salt/passbolt.ini file with the following content:

    [PASSBOLT]
    SERVER = https://passbolt.example.com
    #SERVER_PUBLIC_KEY_FILE = <optional: server_public.asc>
    USER_FINGERPRINT = [REPLACE WITH GPG KEY FINGERPRINT]
    USER_PUBLIC_KEY_FILE = /etc/salt/passbolt_public.asc
    USER_PRIVATE_KEY_FILE = /etc/salt/passbolt_private.asc
    PASSPHRASE = [REPLACE WITH PASSBOLT USER PASSWORD]
    
  7. Change file permissions:

    chown salt /etc/salt/passbolt*
    chmod 600 /etc/salt/passbolt*
    

Use Passwords of Passbolt Group in Pillar

Look into the example directory to see how the integration is done.

  1. Create Pillar sls files for the different Salt minions, insert the content below and replace the group UUID.
    #!py
    def run():
        from salt_passbolt import fetch_passbolt_passwords
        return fetch_passbolt_passwords("27b9abd4-af9b-4c9e-9af1-cf8cb963680c")
    

Hint: you can find the group UUID in the URL of the Passbolt admin interface when editing a group.

  1. In a state, reference secrets with their UUID. See the example/salt/important_secrets/files/secret.conf.
    password={{ pillar['passbolt']['3ec2a739-8e51-4c67-89fb-4bbfe9147e17'] }}
    

Hint: you can find the secret UUID in the URL of your browser by clicking on the checkbox of a secret.

Performance

All passwords are decrypted with a single process (gpg-agent). If many minions need to access their Pillar at the same time, the gpg-agent becomes a bottleneck. To avoid this bottleneck, the Pillar cache can be enabled for the Salt master with pillar_cache: True. The following crontab entry updates the Pillar cache twice a day:

0 */12 * * * rm -rf /var/cache/salt/master/pillar_cache/* && salt '*' -b1 pillar.items

YAML Replacement Structure

If the Passbolt server is not available, for example during local development, a file with the following format can replace the Python code mentioned in step 8:

passbolt:
  3ec2a739-8e51-4c67-89fb-4bbfe9147e17: MY_SECRET

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

passbolt-salt-1.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

passbolt_salt-1.0.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file passbolt-salt-1.0.2.tar.gz.

File metadata

  • Download URL: passbolt-salt-1.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for passbolt-salt-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4c83eb5ec4b234ac4c43864b03c7ae961366e76f296155e7f795bf9869d46182
MD5 b5775149de7bb128a2f82c0432aca5c3
BLAKE2b-256 aadae624e284d8105acf62c771f2bdb669ce1f84bf818c8406968cec8608be64

See more details on using hashes here.

File details

Details for the file passbolt_salt-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: passbolt_salt-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for passbolt_salt-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03044af62d8b3323798edbd2427cc47f2af28e2a79936f9413617f869c558c09
MD5 1e4b2fea58a2eec5616b53ecfc2e1f45
BLAKE2b-256 6ebe7e7315b87bdc18741c2f7bf2dfde328d9e5c6f024bfd43246d59ac4452b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page