Userdir Ldap

Channel Revision Published Runs on
latest/stable 35 10 Oct 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
latest/stable 12 14 Feb 2023
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
latest/stable 6 09 Feb 2022
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
latest/stable 2 01 Feb 2021
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
latest/candidate 35 10 Oct 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
latest/candidate 12 11 Jan 2023
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
latest/candidate 7 09 Feb 2022
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
latest/candidate 4 21 Jul 2021
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
latest/edge 39 11 Dec 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 37 27 Nov 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 12 27 Nov 2024
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
juju deploy userdir-ldap
Show information

Platform:

Ubuntu
24.04 22.04 20.04 18.04 16.04

Cryptography

Setup and Dependency installation

During the installation of the userdir-ldap and other dependencies, the charm uses an APT repository key (commonly referred to as a GPG key or public key) for apt-repo-spec to ensure the integrity and authenticity of the software packages downloaded from the repositories.

The charm will also set up the root SSH key for any access related to file synchronization. The key can be provided via the root-id-rsa charm config option (which accepts an OpenSSH-format RSA private key with no passphrase). The charm will then derive the public key using ssh-keygen -f <private_key> -y and write it alongside the private key with 0o644 permissions. If the private key is unavailable, the Charm will generate a new keypair using the 2048-bit RSA algorithm via the ssh-keygen CLI (ssh-keygen docs).

Additionally, during the installation, the charm will try to add entries listed in the userdb-known-hosts charm config option to /root/.ssh/known_hosts to seed the userdb trust. The charm will use ssh-keyscan against userdb.internal host to find and add new entries if no hosts are specified, similar to step two in the Consumer/Client relation setup (see below).

User data rsync

The charm uses rsync over SSH to synchronize user data from a specified remote host to a local host. The key_file option, which defines the path to the private SSH key, is used in the spec for SSH authentication and encryption of the data in motion.

SSH daemon reconfiguration

The charm reconfigures the ssh daemon of the Juju unit in the following ways:

Consumer/Client relation

Every unit provides a public SSH key to a user data producer (server) via the pub_key relation setting. The keypair generated during the setup and dependency installation step is used.

Additionally, when the relation is configured, the charm adds/updates the known SSH host keys of the unit in the /root/.ssh/known_hosts file. The process includes:

  • Removing the old host keys using ssh-keygen -R <hostname> -f /root/.ssh/known_hosts
  • Scanning for and adding new host keys using ssh-keyscan -t rsa <host1> <host2> ... >> /root/.ssh/known_hosts (see ssh-keyscan docs) against userdb.internal.

Producer/Client relation

The charm collects SSH pubkeys of the consumer/client units from the relation data bag to set up the cron jobs for the rsync. Collected keys are then used to configure a custom /etc/ssh/user-authorized-keys/<user> file, which provides limited access to the specified user to pull files via rsync. The configuration is done via a templated command override to prevent shell access and only allow rsync.

Copy of authorized_keys

The charm copies each specified user’s authorized_keys file in the users-to-migrate charm config option to the /etc/ssh/user-authorized-keys directory of the unit with the permissions set to 0o444 and root ownership.


Help improve this document in the forum (guidelines). Last updated 2 months ago.