> Source: https://docs.cyberelements.io/bastion/4.7/mt/Usage/Administration/AdminConsole/MainWorkPanel/Vault/Bitwarden/BitwardenVault/

# Bitwarden vault

In **Bitwarden** mode, the secrets stay in a Bitwarden organisation. CyberElements Bastion connects to it with a **service account** (a Bitwarden user account dedicated to the platform) to read the items of the collections shared with it, and presents them to applications; it creates none, edits none and rotates none.

The screen is the one shared by the three external vaults: the synoptic opens it under the name **Vault (Bitwarden)** as soon as this mode is selected in the [general options](https://docs.cyberelements.io/bastion/4.7/mt/Usage/Administration/AdminConsole/ConfigurationWorkPanel/GeneralOptions/). The consequences of the mode change on applications are described in [Vault](https://docs.cyberelements.io/bastion/4.7/mt/Usage/Administration/AdminConsole/MainWorkPanel/Vault/Vault/#changing-mode-is-not-neutral).

![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_AdminConsole_Vault_Bitwarden_Module.png)

## Bitwarden prerequisites

- A **server**: bitwarden.com (United States) or bitwarden.eu (European Union), hosted by Bitwarden, or a **self-hosted** Bitwarden server, designated by its base address.
- A **service account**: a Bitwarden user, member of the organisation, with a **master password** (the platform needs it to open the account's keys) and a **personal API key** (`client_id` of the form `user.…` and `client_secret`).
- The **collections** of the organisation to expose, shared with that account.
- If the server certificate is not signed by an authority the system trusts, the **certificate of that authority**, in Base64-encoded PEM format: the text between the `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----` lines, both lines included, pasted into the **Certificate authority** field. It is checked before any connection.

![](https://docs.cyberelements.io/bastion/4.7/img/cyberelements/CYE_AdminConsole_Vault_Bitwarden_Configuration.png)

> **Refused accounts and servers**
>
> - An account without a master password (unlocked by Key Connector or by a trusted device) is not supported.
> - A self-hosted server older than the version the platform requires, or a server that is not Bitwarden itself (a third-party reimplementation) is refused when the configuration is saved.
> - An account whose master password derivation uses settings other than **PBKDF2-SHA256** or **Argon2id** is refused.

> **Personal API key**
>
> The `client_id` and `client_secret` fields are those of the service account's **personal API key**, not of an organisation key. If Bitwarden demands a second authentication factor, the configuration is refused and the message recommends the personal API key of the service account.

## Connection test

On saving, the console logs in to Bitwarden, opens the account's keys with the master password, then those of the organisation, and checks that at least one shared collection is readable. The configuration is saved only if every step succeeds; otherwise the message gives the reason: rejected credentials, organisation not found or ambiguous, server too old, collection not readable.

> **Master password retention**
>
> The master password is not kept. It is only used during this test, to open the account's keys; the platform keeps the keys, not the password. On reopening, the client secret and the master password are not displayed again: any new save requires entering them again.

> **Organization ID**
>
> The organisation ID is only needed if the account has several. Left empty, the organisation is the one the account belongs to, provided it belongs to only one. Otherwise, the identifier is shown in the address of the Bitwarden admin console, after `organizations/`.

The connection appears in Bitwarden as a device named **Cleanroom**.

## Navigation by collection

The tree on the left shows the **shared collections** of the organisation. Bitwarden nests collections through their name: `Servers/Linux` is shown under `Servers`; a level of that path that is not itself a collection is greyed, as is a collection whose passwords are hidden from the service account. Selecting a greyed folder displays a warning and no item.

> **Members' personal spaces**
>
> The collection Bitwarden creates for each member to hold their own items is not an exposed collection: it never appears in the tree, even if the service account could read it.

The list on the right shows, for the selected collection, the name, the login, the type (`login` or `ssh_key`) and the notes. An item whose password is hidden from the service account appears greyed and cannot be attached to an application.

## Items listed

Only Bitwarden items of the **login** and **SSH key** types are listed; archived or deleted items are set aside.

> **username custom field on SSH keys**
>
> A Bitwarden SSH key item carries no login of its own. To appear, it must have a **custom field named `username`** (whatever its case), which provides the login. Without it, the key is not listed.

The alias type follows from it: a login item becomes an **SSH password** alias, an SSH key item an **SSH key** alias.

## Alias synchronisation

At each **aliases cache renewal period** set in the general options, the platform reads again the items behind its aliases: name, login, description, type. The aliases therefore follow Bitwarden with a delay.

> **Item removed or hidden**
>
> An item deleted, moved out of the shared collections, or whose password has become hidden from the service account has its alias deleted; any [application](https://docs.cyberelements.io/bastion/4.7/mt/Usage/Administration/AdminConsole/MainWorkPanel/Applications/Applications/) left with no alias at all reverts to **Enabled** SSO. If Bitwarden cannot be read at all at that moment, no alias is touched.

## Limits

- The module is read-only: creating, editing or deleting an item is done in Bitwarden.
- No rotation is carried by the platform in this mode, hence no password policy and no history of exposure.
- The configuration holds one single Bitwarden connection: one server, one service account, one organisation.
- Items other than logins and SSH keys are invisible, with nothing to say so, and so are SSH keys without a `username` field.
- A change of the service account's keys in Bitwarden (renewed key, collection no longer shared) prevents the secrets from being opened until the configuration is saved again.
- What is displayed depends on the cache: a change made in Bitwarden is not visible immediately.

---

The detail of the fields and the columns is in the [module reference](https://docs.cyberelements.io/bastion/4.7/mt/Usage/Reference/AdminConsole/PasswordVault/#external-vaults).
