Skip to content

Commit be479de

Browse files
committed
Minor enhancements
1 parent 2491a54 commit be479de

3 files changed

Lines changed: 86 additions & 101 deletions

File tree

docs/hub/deployment.mdx

Lines changed: 75 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -116,82 +116,6 @@ Before running this deployment
116116

117117
Troubleshooting: If you encounter problems, check the log files in `logs/traffik.log` and `logs/access.log`. Make sure you entered `srv` as `Public Network` in the Setup Wizard of Hub.
118118

119-
## Trusting a Private Certificate Authority {/* #trusting-a-private-certificate-authority */}
120-
121-
If Hub connects to a Keycloak instance whose TLS certificate was not issued by a well-known certificate authority, you have to make the issuing CA known to Hub. Hub runs on the JVM, which uses its own trust store and ignores the certificates trusted by the host system.
122-
123-
Start by preparing a file `rootWithIntermediates.pem` that contains the root certificate and all intermediate certificates that are not publicly available, in PEM format. Then create a PKCS12 trust store from it:
124-
125-
```bash
126-
keytool -importcert \
127-
-alias keycloak-ca-chain \
128-
-file rootWithIntermediates.pem \
129-
-keystore keycloak-truststore.p12 \
130-
-storepass changeit \
131-
-noprompt
132-
```
133-
134-
Replace `changeit` with a password of your own. You can verify the result with `keytool -list -v -keystore keycloak-truststore.p12 -storepass changeit`.
135-
136-
Hub reads the trust store from the Java system properties `javax.net.ssl.trustStore` and `javax.net.ssl.trustStorePassword`, which you pass as arguments to the application command.
137-
138-
In Docker Compose, mount the file into the container and override the command:
139-
140-
```yaml
141-
services:
142-
hub:
143-
image: ghcr.io/cryptomator/hub:latest
144-
command: >
145-
./application
146-
-Djavax.net.ssl.trustStore=/etc/certs/keycloak-truststore.p12
147-
-Djavax.net.ssl.trustStorePassword=changeit
148-
volumes:
149-
- './certs/keycloak-truststore.p12:/etc/certs/keycloak-truststore.p12:ro'
150-
```
151-
152-
In Kubernetes, store the trust store in a secret and mount it as a volume. Encode the file with `base64 -w0 keycloak-truststore.p12` and add the output to a secret:
153-
154-
```yaml
155-
apiVersion: v1
156-
kind: Secret
157-
metadata:
158-
namespace: hub
159-
name: instance-secrets
160-
type: Opaque
161-
data:
162-
keycloak-truststore-p12: BASE64_ENCODED_TRUSTSTORE
163-
```
164-
165-
Then reference it in the deployment:
166-
167-
```yaml
168-
apiVersion: apps/v1
169-
kind: Deployment
170-
metadata:
171-
name: cryptomator-hub
172-
namespace: hub
173-
spec:
174-
template:
175-
spec:
176-
containers:
177-
- name: cryptomator-hub
178-
image: ghcr.io/cryptomator/hub:latest
179-
command: ['./application']
180-
args:
181-
- '-Djavax.net.ssl.trustStore=/etc/certs/keycloak-truststore-p12'
182-
- '-Djavax.net.ssl.trustStorePassword=changeit'
183-
volumeMounts:
184-
- name: keycloak-truststore-p12
185-
mountPath: /etc/certs
186-
readOnly: true
187-
```
188-
189-
:::note
190-
Quarkus also offers the configuration options `QUARKUS_OIDC_CERTIFICATE_CHAIN_TRUST_STORE_FILE` and `QUARKUS_OIDC_CERTIFICATE_CHAIN_TRUST_STORE_PASSWORD`. These do not work for this purpose, so use the Java system properties shown above.
191-
:::
192-
193-
If the Cryptomator desktop app also needs to talk to that Hub instance, the same applies there. Add `java-options=-Djavax.net.ssl.trustStore=/path/to/your/truststore` to the `Cryptomator.cfg` file in the installation directory.
194-
195119
## Backup {/* #backup */}
196120

197121
Cryptomator Hub and Keycloak both write to the connected Postgres database. So the best and easiest way is to backup it cyclically using e.g. a Cron Job. Depending on your deployment, here is a sample command that you can run on the host system to backup the entire databases to a file using the Postgres container, which you than could import in a similar way:
@@ -268,3 +192,78 @@ A successful run prints `Verified OK`.
268192

269193
The Hub image itself is attested by the `build.yml` workflow of the same repository. To verify it, use the corresponding image name and adjust `--certificate-identity-regexp` to that workflow and the Git reference the release was built from.
270194

195+
## Trusting a Private Certificate Authority {/* #trusting-a-private-certificate-authority */}
196+
197+
If Hub connects to a Keycloak instance whose TLS certificate was not issued by a well-known certificate authority, you have to make the issuing CA known to Hub. Hub runs on the JVM, which uses its own trust store and ignores the certificates trusted by the host system.
198+
199+
Start by preparing a file `rootWithIntermediates.pem` that contains the root certificate and all intermediate certificates that are not publicly available, in PEM format. Then create a PKCS12 trust store from it:
200+
201+
```bash
202+
keytool -importcert \
203+
-alias keycloak-ca-chain \
204+
-file rootWithIntermediates.pem \
205+
-keystore keycloak-truststore.p12 \
206+
-storepass changeit \
207+
-noprompt
208+
```
209+
210+
Replace `changeit` with a password of your own. You can verify the result with `keytool -list -v -keystore keycloak-truststore.p12 -storepass changeit`.
211+
212+
Hub reads the trust store from the Java system properties `javax.net.ssl.trustStore` and `javax.net.ssl.trustStorePassword`, which you pass as arguments to the application command.
213+
214+
In Docker Compose, mount the file into the container and override the command:
215+
216+
```yaml
217+
services:
218+
hub:
219+
image: ghcr.io/cryptomator/hub:latest
220+
command: >
221+
./application
222+
-Djavax.net.ssl.trustStore=/etc/certs/keycloak-truststore.p12
223+
-Djavax.net.ssl.trustStorePassword=changeit
224+
volumes:
225+
- './certs/keycloak-truststore.p12:/etc/certs/keycloak-truststore.p12:ro'
226+
```
227+
228+
In Kubernetes, store the trust store in a secret and mount it as a volume. Encode the file with `base64 -w0 keycloak-truststore.p12` and add the output to a secret:
229+
230+
```yaml
231+
apiVersion: v1
232+
kind: Secret
233+
metadata:
234+
namespace: hub
235+
name: instance-secrets
236+
type: Opaque
237+
data:
238+
keycloak-truststore-p12: BASE64_ENCODED_TRUSTSTORE
239+
```
240+
241+
Then reference it in the deployment:
242+
243+
```yaml
244+
apiVersion: apps/v1
245+
kind: Deployment
246+
metadata:
247+
name: cryptomator-hub
248+
namespace: hub
249+
spec:
250+
template:
251+
spec:
252+
containers:
253+
- name: cryptomator-hub
254+
image: ghcr.io/cryptomator/hub:latest
255+
command: ['./application']
256+
args:
257+
- '-Djavax.net.ssl.trustStore=/etc/certs/keycloak-truststore-p12'
258+
- '-Djavax.net.ssl.trustStorePassword=changeit'
259+
volumeMounts:
260+
- name: keycloak-truststore-p12
261+
mountPath: /etc/certs
262+
readOnly: true
263+
```
264+
265+
:::note
266+
Quarkus also offers the configuration options `QUARKUS_OIDC_CERTIFICATE_CHAIN_TRUST_STORE_FILE` and `QUARKUS_OIDC_CERTIFICATE_CHAIN_TRUST_STORE_PASSWORD`. These do not work for this purpose, so use the Java system properties shown above.
267+
:::
268+
269+
If the Cryptomator desktop app also needs to talk to that Hub instance, the same applies there. Add `java-options=-Djavax.net.ssl.trustStore=/path/to/your/truststore` to the `Cryptomator.cfg` file in the installation directory.

docs/hub/keycloak.mdx

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ Connecting external identity and access management (IAM) solutions is available
1616
Visit [cryptomator.org](https://cryptomator.org/hub/) for more information about Enterprise features.
1717
:::
1818

19-
:::warning
20-
Your Hub instance always contains the two system users `admin` and `syncer`. **Do not edit or delete them!** These accounts are required for administration and synchronization tasks.
21-
:::
22-
2319
## Connecting an External Identity Provider {/* #connecting-an-external-identity-provider */}
2420

2521
You can connect Hub to your existing identity provider so that users authenticate with the credentials they already have. Keycloak supports two fundamentally different approaches, and the choice affects when users become visible in Hub.
@@ -28,17 +24,6 @@ With user federation over LDAP or Active Directory, Keycloak reads the directory
2824

2925
With identity brokering over OpenID Connect or SAML, Keycloak redirects users to the external provider. Users only appear in Hub after their first successful login, so you cannot grant vault access to someone who has never signed in.
3026

31-
### LDAP and Active Directory {/* #ldap-and-active-directory */}
32-
33-
To federate users from an LDAP directory, add an LDAP provider under *User federation* in the `cryptomator` realm and enter the connection URL, the bind credentials, and the base DN of your directory. The [Keycloak documentation on LDAP](https://www.keycloak.org/docs/latest/server_admin/#_ldap) describes the individual settings.
34-
35-
Hub additionally requires two mappers on the LDAP provider:
36-
37-
1. Add a *group-ldap-mapper* so that directory groups are imported into Keycloak. Without it, only users are synchronized and you cannot assign vault permissions to groups.
38-
2. Add a *hardcoded-ldap-role-mapper* that assigns the realm role `user` to every imported user. Users without this role cannot log in to Hub.
39-
40-
Once both mappers are in place, run *Sync all users* on the LDAP provider. Afterwards, verify the setup by logging in to Hub — not Keycloak — with one of the imported accounts.
41-
4227
### OpenID Connect {/* #openid-connect */}
4328

4429
To delegate authentication to an OpenID Connect provider such as Microsoft Entra ID, add an OpenID Connect provider under *Identity providers* in the `cryptomator` realm and enter the discovery endpoint, client ID, and client secret issued by your provider.
@@ -55,6 +40,17 @@ In Keycloak, open your identity provider and add one *Claim to Role* mapper per
5540

5641
These mappers are evaluated lazily as well. A role is only assigned when the affected user logs in.
5742

43+
### LDAP and Active Directory {/* #ldap-and-active-directory */}
44+
45+
To federate users from an LDAP directory, add an LDAP provider under *User federation* in the `cryptomator` realm and enter the connection URL, the bind credentials, and the base DN of your directory. The [Keycloak documentation on LDAP](https://www.keycloak.org/docs/latest/server_admin/#_ldap) describes the individual settings.
46+
47+
Hub additionally requires two mappers on the LDAP provider:
48+
49+
1. Add a *group-ldap-mapper* so that directory groups are imported into Keycloak. Without it, only users are synchronized and you cannot assign vault permissions to groups.
50+
2. Add a *hardcoded-ldap-role-mapper* that assigns the realm role `user` to every imported user. Users without this role cannot log in to Hub.
51+
52+
Once both mappers are in place, run *Sync all users* on the LDAP provider. Afterwards, verify the setup by logging in to Hub — not Keycloak — with one of the imported accounts.
53+
5854
### Using the Identity Provider as Default Login {/* #using-the-identity-provider-as-default-login */}
5955

6056
By default, Keycloak shows a login form with the external provider as an additional button. You can skip that screen and redirect users straight to your provider by entering its alias as the default identity provider in the browser authentication flow, as described in the [Keycloak documentation](https://www.keycloak.org/docs/latest/server_admin/index.html#default_identity_provider).
@@ -73,10 +69,6 @@ When a user logs in through an external provider for the first time, Keycloak as
7369
4. Select *Identity providers* in the left panel and open your identity provider.
7470
5. Scroll down to *First login flow*, select the duplicated flow, and save.
7571

76-
:::note
77-
On hosted Hub instances you cannot create authentication flows yourself, but you can select any flow that already exists.
78-
:::
79-
8072
### Customizing the Username {/* #customizing-the-username */}
8173

8274
Keycloak derives the username of brokered accounts from the email address reported by the identity provider. If you need a different scheme, add a *Username Template Importer* mapper to your identity provider and set its target to `LOCAL`.

docs/hub/user-group-management.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,3 @@ Setting up LDAP synchronization is described in the [Keycloak documentation](htt
188188
For OpenID Connect and SAML, the Keycloak documentation provides [general information](https://www.keycloak.org/docs/latest/server_admin/#_identity_broker).
189189

190190
The [Keycloak](keycloak.mdx) page covers the configuration steps that are specific to Hub, such as [connecting an external identity provider](keycloak.mdx#connecting-an-external-identity-provider), [restricting who may access Hub](keycloak.mdx#restricting-access-to-hub), and [migrating to another identity provider](keycloak.mdx#migrating-to-another-identity-provider).
191-
192-
193-
:::warning
194-
Regardless of your IAM setup, your Hub instance always contains two system users: `admin` and `syncer`. **Do not edit or delete them!** These accounts are required for administration and synchronization tasks.
195-
:::
196-

0 commit comments

Comments
 (0)