Keyper is an Open Source SSH Key and Certificate Based Authentication Manager. It standardizes and centralizes the storage of SSH public keys and SSH Certificates for all Linux users in your organization saving significant time and effort it takes to manage SSH public keys and certificates on each Linux Server. Keyper is a lightweight container taking less than 100MB. It is launched either using Docker or Podman. You can be up and running within minutes instead of days.
Run Keyper docker image using docker cli:
$ docker run \ -p 8080:80 \ -p 8443:443 \ --hostname <hostname> \ -it dbsentry/keyper
Run Keyper docker image using podman cli:
$ podman run -p 8080:80 \ -p 8443:443 \ --hostname <hostname> \ -it quay.io/dbsentry/keyper
Either command starts a new container with Keyper processes (OpenLDAP, Gunicorn, Nginx) running inside.
Customary 5 min installation Demo
Keyper is an SSH Key and Certificate Based Authentication Manager
We, as system administrators and developers, regularly use OpenSSH’s public key authentication (aka password-less login) on Linux servers or Certificate based authentication (more secure). The mechanism works based on public-key cryptography. One adds his/her RSA/DSA key to the authorized_keys file on the server. The user with the corresponding private key can login without a password. It works great until the number of servers starts to grow. It becomes a pain to manage the authorized_keys file on all the servers. Account revocation becomes a pain as well. Keyper aims to centralize all such SSH Public Keys within an organization. With Keyper, one can force key rotation, easily revoke keys, and centrally lock accounts.
SSH Key based authentication works great. Certificate based authentication eliminates few limitations associated with Key based authentication. When using certificates, both clients and servers use certificates signed by trusted third party (in this case Keyper). This takes care of long time known issue such as Trust-on-First-Use (TOFU).Instead of X.509 format, SSH uses its own simpler certificate format.
There is one little inconvenience with certificates and that is users cannot sign their keys themselves as they do not have access to CA’s private key. A process must be put in place to sign the keys. Once adminstrator setup a user in the Keyper system, s/he can upload keys to be signed by the CA. Keyper system generates the certificate on the fly based on restrictions (like duration of certificate, and what servers/users any user has access to).
Not yet. However, we are working to get it open-sourced under GPLv2 (pending permission from our corporate overlords).
Yes! We Opensourced Keyper under GPLv3 license. The source repositories are located at keyper-docker and keyper.
Following components of keyper are opensourced:
The above stack can be administored using
The web based administration console for Keyper has not been opensourced.
The above arrangement should satisfy needs of most of our users as smaller commercial customers can continue to use the web based admin console bundled with docker image upto 20 servers. After which they have option to purchase license.
Keyper can be downloaded from the docker registry either using docker or podman.
Thanks in advance. We love suggestions/bug reports. Please drop us a line at firstname.lastname@example.org
All documentation is located here
Yes we do. We have a demo system running on https://sprout.dbsentry.com. And also 4 containers running SSH that can be used for testing. Here are credentials to access the web-console:
In addition, you can test following containers running SSH using above user ids after you add your SSH public key to the web-console:
So, if you want to access server
mavrix4.dbsentry.com as user
frank, you need to add your SSH public key (typically
~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub) to user frank and then connect using ssh:
$ ssh -l frank -p 4022 mavrix4.dbsentry.com
Any issues drop us a line at email@example.com.
Send your question to firstname.lastname@example.org and we’ll try to address it.
Keyper is published as a Docker container which can also be run using podman. The stack include:
Any Linux server running OpenSSH 6.8 or newer should be fine. An SSH server that supports AuthorizedKeysCommand is needed.
Per podman projetct’s website: “Podman is a daemonless, open source, Linux native tool designed to make it easy to find, run, build, share and deploy applications using Open Containers Initiative (OCI) Containers and Container Images. Podman provides a command line interface (CLI) familiar to anyone who has used the Docker Container Engine. Most users can simply alias Docker to Podman (alias docker=podman) without any problems.”
Best thing we liked about podman is that one need not be root to run a container. It comes bundled with RHEL (or any RHEL based distro) by default. If you do not have it install it using yum:
# yum install podman
By default, Keyper creates OpenLDAP database within container under
/etc/openldap/slapd.d. For data to persist after a restart, we need to present local docker volumes as a parameter. Something like this:
$ docker volume create slapd.d $ docker volume create openldap-data $ docker run -p 80:80 -p 443:443 -p 389:389 -p 636:636 --hostname <hostname> --mount source=slapd.d,target=/etc/openldap/slapd.d --mount source=openldap-data,target=/var/lib/openldap/openldap-data -it dbsentry/keyper
For more information about docker data volume, please refer to:
Keyper uses this hostname to generate a self-signed certificate. OpenLDAP and Nginx use this certificate for secure communication. Also, this hostname gets embedded in the auth.sh script which you need to download and deploy on each Linux server.
Great. First find the container id of the running container, and then use
docker exec to connect. Something like this:
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 25b2869f1a71 dbsentry/keyper "/container/tools/run" 21 hours ago Up 21 hours 0.0.0.0:8080->80/tcp, 0.0.0.0:2389->389/tcp, 0.0.0.0:8443->443/tcp, 0.0.0.0:2636->636/tcp peaceful_lewin 66d33bbdd32c jenkinsci/blueocean "/sbin/tini -- /usr/…" 13 days ago Up 13 days 0.0.0.0:50000->50000/tcp, 0.0.0.0:8000->8080/tcp jenkins-blueocean $ docker exec -it 25b2869f1a71 /bin/sh / # ls bin dev home media opt root sbin sys usr container etc lib mnt proc run srv tmp var / #
Following environment variables can be set while starting the container:
|LDAP_PORT||ldap bind port||389|
|LDAPS_PORT||ldaps bind port||636|
|LDAP_ORGANIZATION_NAME||Name of the Organization||Example Inc.|
|LDAP_LDAP_ADMIN_PASSWORD||Admin password on LDAP||superdupersecret|
|LDAP_TLS_CA_CRT_FILENAME||CA Cert File Name||ca.crt|
|LDAP_TLS_CRT_FILENAME||Cert File Name||server.crt|
|LDAP_TLS_KEY_FILENAME||Cert Key File Name||server.key|
|LDAP_TLS_DH_PARAM_FILENAME||DH Param File Name||dhparam.pem|
|LDAP_TLS_CIPHER_SUITE||Default Cipher Suite||TLSv1.2:HIGH:!aNULL:!eNULL|
|FLASK_CONFIG||Flask Config (dev/prod)||prod|
|LDAP_UID||linux ldap user uid||10100|
|LDAP_GID||linux ldap user gid||10100|
|NGINX_UID||linux nginx user uid||10080|
|NGINX_UID||linux nginx user uid||10080|
|SSH_CA_HOST_KEY||CA Host Key||ca_host_key|
|SSH_CA_USER_KEY||CA USER Key||ca_user_key|
Running a container with
FLASK_CONFIG=dev would force Flask REST API to run in debug mode.
/var/log/openldap/auditlog.ldif. It may be a better idea to create docker volume for
/var/log and mount it in the container to persist logs
As far as you have a backup for the OpenLDAP database you are good to go. For the rest, as far as you specify the same cli params things should work fine.
The certificate is used by OpenLDAP and Nginx. You can set custom certificate at run time by mounting a directory containing those files to
/container/service/nginx/assets/certs and adjust their name per the environment variables defined above.