Passbolt
Passbolt, is an open source credential platform for modern teams. A versatile, battle-tested solution to manage and collaborate on passwords, accesses, and secrets. All in one.
In this document, we will create passbolt with Docker and external database. You can click link for default contanier based database installation and other methods.
Requirements
- Docker, can install from here.
- Install External Database MariaDB server. Install from digital ocean document or official document. You can choose your Linux OS type both of them.
- SMTP: Need a smtp server for production but you can add from UI after installation. If you don't have smtp server, you can use your gmail or yandex mail as a smtp. For development, can use mailchatcher as a container:
http://localhost:1080 acces to ui. You can test mailcatcher with codes below.
# First connect with telnet after run each command
telnet localhost 1025
HELO example.com
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
Subject: Test Mail
This is a test email.
.
QUIT
Setup External Database
- Check installation. If status is active, there is no problem :)
-
Start secure configuration
- Enter current password for root (enter for none): Press enter as there is no password by default.
- Set root password? [Y/n]: Select Y and enter a new password.
- Remove anonymous users? [Y/n]: Select Y
- Disallow root login remotely? [Y/n]: Enter Y
- Remove the test database and access to it? [Y/n]: Enter Y
- Reload privilege tables now? [Y/n]: Enter Y
- Connect MariaDB
-
Set remote database.
- Open
/etc/mysql/mariadb.conf.d/50-server.cnffile.
- Find
bind-addressin file and change127.0.0.1to0.0.0.0.
- Restart MariaDB
- Open
-
Create
passboltdatabase andpassboltuser for access Passbolt in MariaDB console. Can access MariaDB remotely with passbolt user. -
Try remote connection from other server or local computer.
Setup SSL
- Create
traefikfile.
- Create
traefik.yaml. Change<[email protected]>to your email.
global:
sendAnonymousUsage: false
log:
level: INFO
format: common
providers:
docker:
endpoint: 'unix:///var/run/docker.sock'
watch: true
exposedByDefault: true
swarmMode: false
file:
directory: /etc/traefik/conf/
watch: true
api:
dashboard: false
debug: false
insecure: false
entryPoints:
web:
address: ':80'
http:
redirections:
entryPoint:
to: websecure
scheme: https
permanent: true
websecure:
address: ':443'
certificatesResolvers:
letsencrypt:
acme:
email: <[email protected]>
storage: /shared/acme.json
caServer: 'https://acme-v02.api.letsencrypt.org/directory'
keyType: EC256
httpChallenge:
entryPoint: web
tlsChallenge: {}
-
Create
conffolder in to the traefik folder.- Create
headers.yamlinconf.
conf/headers.yamlhttp: middlewares: SslHeader: headers: FrameDeny: true AccessControlAllowMethods: 'GET,OPTIONS,PUT' AccessControlAllowOriginList: - origin-list-or-null AccessControlMaxAge: 100 AddVaryHeader: true BrowserXssFilter: true ContentTypeNosniff: true ForceSTSHeader: true STSIncludeSubdomains: true STSPreload: true ContentSecurityPolicy: default-src 'self' 'unsafe-inline' CustomFrameOptionsValue: SAMEORIGIN ReferrerPolicy: same-origin PermissionsPolicy: vibrate 'self' STSSeconds: 315360000- Create
tls.yamlinconf.
- Create
-
All file system like this:
Docker Compose Setup
-
Docker Compose file:
APP_FULL_BASE_URL:server ip or domain.DATASOURCES_DEFAULT_HOST:database server ip. In our case, server ip.DATASOURCES_DEFAULT_PASSWORD:database user password. (passbolt user’s password)EMAIL_TRANSPORT_DEFAULT_HOST:e-mail server domain.(smtp.gmail.com , smtp.yandex.ru). For mailcather, your server IP. For local, use internal IP notlocalhost or 127.0.0.1.EMAIL_TRANSPORT_DEFAULT_USERNAMEandEMAIL_TRANSPORT_DEFAULT_PASSWORDare mail authentication information. Mail addres and mail password / app password. Don't use for mailcatcher.EMAIL_TRANSPORT_DEFAULT_PORTmail server port. For mailcatcher, use 1025.
docker-compose.ymlversion: '3.5' services: passbolt: image: passbolt/passbolt:latest-ce restart: unless-stopped environment: APP_FULL_BASE_URL: "https://<your_server_domain_or_ip>" DATASOURCES_DEFAULT_HOST: "<your_server_domain_or_ip>" DATASOURCES_DEFAULT_USERNAME: "passbolt" DATASOURCES_DEFAULT_PASSWORD: "<passbolt_db_user_pass>" DATASOURCES_DEFAULT_DATABASE: "passbolt" EMAIL_TRANSPORT_DEFAULT_HOST: "<mail_server_url><smtp.gmail.com/smtp.yandex.mail.ru>" EMAIL_TRANSPORT_DEFAULT_PORT: 587 EMAIL_TRANSPORT_DEFAULT_USERNAME: "<[email protected]>" EMAIL_TRANSPORT_DEFAULT_PASSWORD: "<email_password>" volumes: - gpg_volume:/etc/passbolt/gpg - jwt_volume:/etc/passbolt/jwt command: ["/usr/bin/wait-for.sh", "-t", "0", "<your_server_domain_or_ip>:3306", "--", "/docker-entrypoint.sh"] labels: traefik.enable: "true" traefik.http.routers.passbolt-http.entrypoints: "web" traefik.http.routers.passbolt-http.rule: "Host(`<your_server_domain_or_ip>`)" traefik.http.routers.passbolt-http.middlewares: "SslHeader@file" traefik.http.routers.passbolt-https.middlewares: "SslHeader@file" traefik.http.routers.passbolt-https.entrypoints: "websecure" traefik.http.routers.passbolt-https.rule: "Host(`<your_server_domain_or_ip>`)" traefik.http.routers.passbolt-https.tls: "true" traefik.http.routers.passbolt-https.tls.certresolver: "letsencrypt" traefik: image: traefik:2.6 restart: always ports: - 80:80 - 443:443 volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - ./traefik/traefik.yaml:/traefik.yaml:ro - ./traefik/conf/:/etc/traefik/conf - ./shared/:/shared volumes: gpg_volume: jwt_volume:
Run run run
-
Change your directory to
docker-compose.yamldirectory. And then, up the system: -
Create first user on other terminal or use
-dparameter indocker compose upcommand. You can choose admin or user end of the command.docker-compose exec passbolt su -m -c "/usr/share/php/passbolt/bin/cake \ passbolt register_user \ -u [email protected] \ -f name \ -l surname \ -r admin/user" -s /bin/sh www-data