13
1
Fork 0
mirror of https://github.com/netzbegruenung/passbolt-salt synced 2024-05-05 22:03:40 +02:00
passbolt-salt/README.md

62 lines
2 KiB
Markdown
Raw Normal View History

2020-02-01 19:57:50 +01:00
# About
This Python module retrieves passwords for Passbolt groups to make them available in Saltstack Pillar.
2020-02-01 19:55:31 +01:00
2020-02-01 19:57:50 +01:00
# License
MIT
# Setup
2020-02-01 19:55:31 +01:00
1. Clone this repo
2020-03-24 17:03:04 +01:00
2. Go to directory, run (requires `python3-setuptools`)
2020-02-01 19:55:31 +01:00
```
2020-02-01 21:42:45 +01:00
python3 setup.py install
2020-02-01 19:55:31 +01:00
```
3. Create an Passbolt account for the Salt master.
4. Copy the private and public PGP key files to `/etc/salt`.
2020-03-24 17:48:34 +01:00
5. Import the private key with
```
gpg --import /etc/salt/passbolt_private.asc
```
2020-03-24 17:49:10 +01:00
6. Create a `/etc/salt/passbolt.ini` file with the following content:
2020-02-01 19:55:31 +01:00
```
[PASSBOLT]
2020-03-24 17:03:04 +01:00
SERVER = https://passbolt.example.com
2020-02-01 19:55:31 +01:00
#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]
```
2020-03-24 17:49:10 +01:00
7. Change file permissions:
2020-02-01 19:55:31 +01:00
```
chown salt /etc/salt/passbolt*
chmod 600 /etc/salt/passbolt*
```
2021-11-30 14:05:17 +01:00
8. Create Pillar sls files for the different Salt minions. Use the example below as content for the sls files and replace the group UUID. Hint: you can find the group UUID in the URL of the Passbolt admin interface when editing a group.
2020-02-01 19:55:31 +01:00
```
#!py
2020-02-01 22:33:28 +01:00
def run():
from salt_passbolt import fetch_passbolt_passwords
return fetch_passbolt_passwords("27b9abd4-af9b-4c9e-9af1-cf8cb963680c")
2020-02-01 19:55:31 +01:00
```
2021-11-30 14:02:31 +01:00
You can also look into the [example](example) directory.
2020-03-24 17:49:10 +01:00
9. In state, reference secrets with their UUID. See the `example/salt/important_secrets/files/secret.conf`. Hint: you can find the secret UUID in the URL of your browser by clicking on the checkbox of a secret.
2020-02-01 19:55:31 +01:00
```
password={{ pillar['passbolt']['3ec2a739-8e51-4c67-89fb-4bbfe9147e17'] }}
```
2021-05-29 20:11:35 +02:00
# YAML Replacement Structure
2021-11-30 14:08:44 +01:00
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:
2021-05-29 20:11:35 +02:00
```
passbolt:
3ec2a739-8e51-4c67-89fb-4bbfe9147e17: MY_SECRET
```