Setup and Configuration deprecated
Configuring OX Guard on an App Suite 8 deployment
Overview
This article describes the configuration that OX Guard requires on a running OX App Suite 8 deployment. The configuration comprises the properties of OX Guard, the oxguardpass file and the capabilities that enable OX Guard for users.
OX Guard is part of the OX App Suite Middleware image and is deployed together with the OX App Suite Middleware. OX Guard therefore requires no separate installation.
This article does not describe the deployment of OX App Suite or the general topics of the OX App Suite Middleware. The Operations Guide describes the deployment, including the chart, the values of the chart, the databases and the ingress. The documentation of the OX App Suite Middleware describes the general topics of the OX App Suite Middleware as the platform for OX Guard.
This article assumes a deployment with the Helm chart core-mw of the OX App Suite Middleware, as described in the Operations Guide. The term "chart" in the following sections refers to the chart core-mw.
OX Guard as OX App Suite Middleware feature
The OX App Suite Middleware, which serves as the platform for OX Guard, has a modular structure. Single features of the OX App Suite Middleware can be enabled or disabled individually. OX Guard is one of these features, the feature called guard, and is enabled by default. The section Bundle Activation of the Operations Guide describes the concept of features and how a feature is enabled or disabled.
An enabled feature guard does not yet enable OX Guard for users. Users additionally require the capabilities of OX Guard, which are not granted by default. The section Capabilities describes the capabilities.
The following values of the chart disable the feature guard for the whole deployment:
features:
status:
guard: disabled
Components
The feature guard is divided into two parts, which communicate over HTTP in both directions:
- The "Guard Middleware Plugin" integrates OX Guard into the OX App Suite Middleware, for example into the mail module.
- "Guard Core" contains the key management, the encryption and the storage for guests.
In a standard deployment, the Guard Middleware Plugin and Guard Core run together in one pod of the OX App Suite Middleware. Because both parts communicate over HTTP, an operator can optionally separate both parts. The Guard Middleware Plugin then runs in the pods of the OX App Suite Middleware, and Guard Core runs in dedicated pods.
Resolving recipients
For every recipient of an encrypted mail, OX Guard determines whether the recipient address belongs to a local user of the deployment. The result decides whether OX Guard uses the keys of a local user or searches other sources for the key of an external recipient. The article Key and Certificate Discovery describes the sources of keys and certificates.
OX Guard determines local users with a component called "Mail Resolver". OX Guard uses either the Mail Resolver of the OX App Suite Middleware or a custom Mail Resolver. The article Mail Resolver describes both variants and the configuration of both variants.
Before OX Guard is enabled for users, the operator should test whether the Mail Resolver resolves the addresses of the deployment correctly. The command mwctl guard debug resolve in the Toolkit Container resolves a single address and prints the user id, the context, the language and the display name of the resolved user:
mwctl guard debug resolve john@example.com
The section Testing the Mail Resolver of the App Suite Toolkit recipe for OX Guard describes the test.
The legacy command line tool guard provides the same test with the option --test.
Configuration
The properties of OX Guard are set in the same way as every other property of the OX App Suite Middleware. The section Middleware Properties of the Operations Guide describes how the chart sets properties.
Many properties of OX Guard are config-cascade aware and can also be set per context or per user. The documentation of the OX App Suite Middleware describes the config cascade.
The configuration pages of OX Guard list all properties of OX Guard. The following sections describe the properties and files for the setup of OX Guard and for the main functions of OX Guard.
oxguardpass file
The file oxguardpass contains two passwords called master passwords, which OX Guard uses to encrypt its own cryptographic key pairs called master keys in the database. The master keys protect the data for the password recovery of users and other protected data in the database. OX Guard reads the file oxguardpass from /opt/open-xchange/etc/oxguardpass.
At the first start, OX Guard creates the master keys and encrypts the master keys with the master passwords of the available file oxguardpass. All pods of OX Guard therefore require the same file oxguardpass.
If the chart value enableInitialization is set, the chart generates the file oxguardpass as the Secret <release>-guard-secret and mounts the Secret into all pods.
Without enableInitialization, an operator creates the file oxguardpass once with the command line tool guard:
/opt/open-xchange/sbin/guard --init --directory /opt/open-xchange/etc
The operator then provides the file in all pods at /opt/open-xchange/etc/oxguardpass, for example through a Kubernetes Secret.
Important: After OX Guard has created the master keys, the file oxguardpass must not change. With a different file, OX Guard cannot decrypt the master keys and can no longer reset the passwords of users. A file oxguardpass that the chart generates exists only as a Secret inside the cluster. An operator therefore keeps a backup of the file outside the cluster, for example in a secret store. The file oxguardpass and the database together allow the decryption of the recovery data of users. The backup of the file therefore requires the same access restrictions as the database and is stored separately from the backups of the database.
Database
OX Guard stores the keys of the users in the database schemas of the contexts.
In addition, OX Guard has two kinds of schemas of its own. The schema of OX Guard holds data across all contexts, for example the assignment of mail addresses to keys and the stored S/MIME certificates. Guest shards are additional schemas for the keys of guests, which OX Guard creates when needed. The database user of OX Guard therefore requires the permission to create schemas.
For the schemas of the contexts, OX Guard uses the existing database configuration of the OX App Suite Middleware. Only the schemas of OX Guard require the following properties:
com.openexchange.guard.oxGuardDatabaseHostnamespecifies the database host of the schema of OX Guard.com.openexchange.guard.oxGuardShardDatabasespecifies the database host of the guest shards. Both properties can specify the same host.com.openexchange.guard.databaseUsernameandcom.openexchange.guard.databasePasswordspecify the credentials for both database hosts.
HTTP connections
The Guard Middleware Plugin and Guard Core communicate over HTTP in both directions, as the section Components describes. The following sections describe the configuration of both directions.
Guard Core and the OX App Suite Middleware receive HTTP calls through the HTTP listener of the OX App Suite Middleware. HTTPS in either direction therefore requires the TLS listener of the OX App Suite Middleware in the pods that receive the calls. The article Grizzly with TLS describes the configuration of the TLS listener.
Guard Middleware Plugin to Guard Core
The Guard Middleware Plugin calls the HTTP interfaces of Guard Core, for example to encrypt and decrypt mails. The following properties configure the access of the Guard Middleware Plugin to Guard Core:
com.openexchange.guard.endpointspecifies the base URL of Guard Core, for examplehttp://localhost:8009. The scheme of the base URL determines whether the Guard Middleware Plugin uses HTTPS for the calls to Guard Core. With HTTPS, the base URL contains the port of the TLS listener.com.openexchange.guard.endpointTimeoutspecifies the read timeout of the calls to Guard Core.
In a chart deployment, the base URL is preconfigured with the address of Guard Core in the same pod. The operator sets the base URL only to deviate from the preconfiguration, for example if Guard Core runs in dedicated pods. With dedicated pods, the base URL points to a service of Guard Core.
Guard Core to OX App Suite Middleware
Guard Core calls the REST API of the OX App Suite Middleware, for example to look up users and to resolve recipients with the Mail Resolver.
The following properties configure the access of Guard Core to the OX App Suite Middleware:
com.openexchange.guard.restApiHostnameandcom.openexchange.guard.oxBackendPortspecify the host and the port of the OX App Suite Middleware.com.openexchange.guard.restApiUsernameandcom.openexchange.guard.restApiPasswordspecify the credentials for the HTTP basic authentication. The REST API accepts the credentials incom.openexchange.rest.services.basic-auth.loginandcom.openexchange.rest.services.basic-auth.password.com.openexchange.guard.backendSSLspecifies whether Guard Core uses HTTPS for the calls to the OX App Suite Middleware. With HTTPS,com.openexchange.guard.oxBackendPortcontains the port of the TLS listener.
In a chart deployment, the host, the port and the credentials are preconfigured. The host and the port point to the OX App Suite Middleware in the same pod. The OX App Suite Middleware image sets the credentials of Guard Core and the credentials that the REST API accepts to the values basicAuthLogin and basicAuthPassword of the chart. The operator sets the properties only to deviate from the preconfiguration, for example if Guard Core runs in dedicated pods. With dedicated pods, the host and the port point to a service of the OX App Suite Middleware.
SMTP server
The OX App Suite Middleware sends the encrypted mails of users through the mail transport of the OX App Suite Middleware. In contrast, mails that OX Guard creates itself, for example invitations to guests, password resets and the replies of guests, go through a separate SMTP server.
The following properties configure this separate SMTP server:
com.openexchange.guard.guestSMTPServerandcom.openexchange.guard.guestSMTPPortspecify the host and the port of the SMTP server.com.openexchange.guard.guestSMTPUsernameandcom.openexchange.guard.guestSMTPPasswordspecify the credentials for the SMTP server. Without a username, OX Guard connects to the SMTP server without authentication.com.openexchange.guard.useStartTLSspecifies whether OX Guard uses STARTTLS for the connection.com.openexchange.guard.passwordFromAddressandcom.openexchange.guard.passwordFromNamespecify the sender address and the sender name of the password reset mails. OX Guard sends a password reset mail if a user or a guest has forgotten the password and requests a new password.
In a chart deployment, the SMTP server is not preconfigured. The operator sets at least the host of the SMTP server and the sender address.
IPCheck
The OX App Suite Middleware provides a security check on sessions called IPCheck. The IPCheck compares the client IP address of every request with the client IP address of the login request and rejects a request with a different client IP address.
The IPCheck is only active if the property com.openexchange.IPCheck is true.
Guard Core calls the OX App Suite Middleware on behalf of the user and passes the session of the user. The calls come from the pod of Guard Core and not from the client IP address of the user. An active IPCheck therefore rejects the calls of Guard Core, and OX Guard cannot process the requests that depend on these calls.
The IPCheck skips requests from the IP address ranges in the file noipcheck.cnf of the OX App Suite Middleware. The file noipcheck.cnf contains the loopback addresses, through which Guard Core calls the OX App Suite Middleware in a standard deployment. A standard deployment therefore requires no change.
If Guard Core runs in dedicated pods and the IPCheck is active, the file noipcheck.cnf requires the IP address range of the pods of Guard Core. With this entry, the IPCheck stays active for all other requests. Setting com.openexchange.IPCheck to false also allows the calls of Guard Core, but disables the IPCheck for the sessions of all users.
Capabilities
This section describes the capabilities that enable the functions of OX Guard for users. The OX App Suite Middleware grants a capability through a property of the form com.openexchange.capability.<name>. These properties are config-cascade aware. An operator can therefore set the properties for the whole deployment, per context or per user, as the section Configuration describes.
| Capability | Description |
|---|---|
com.openexchange.capability.guard | The capability guard allows a user to read encrypted mails and to reply to the sender with an encrypted mail. A user with only the capability guard cannot start a new encrypted mail. The capabilities guard-mail and guard-drive require the capability guard. |
com.openexchange.capability.guard-mail | The capability guard-mail allows a user to use all PGP functions for mails, including new encrypted and signed mails. |
com.openexchange.capability.guard-drive | The capability guard-drive allows a user to encrypt and decrypt Drive files. The capability guard-drive requires the Drive permission of the user. |
com.openexchange.capability.smime | The capability smime allows a user to encrypt and sign mails with S/MIME. |
Open-Xchange recommends granting the capability guard to all users. With the capability guard, every user can read the encrypted mails that other users send to the user.
Password recovery
The password recovery of OX Guard resets the OX Guard password of a user who has forgotten the password and sends the new password to the user by mail. The password recovery requires data called recovery data, which OX Guard stores for the keys of the user. OX Guard creates the recovery data together with new or imported keys and with every change of the password.
OX Guard does not create recovery data if the property com.openexchange.guard.noRecovery (default false) is true or the user has the capability com.openexchange.capability.guard-norecovery. Recovery data that already exists remains until the user changes the password.
In addition, OX Guard lets a user decide whether the recovery data remains. A user can delete the recovery data in the settings of OX Guard. The option to delete the recovery data is only available if the property com.openexchange.guard.noDeleteRecovery (default false) is false and the user does not have the capability com.openexchange.capability.guard-nodeleterecovery.
Important: Without recovery data, it is not possible to reset the password of a user. As an advantage, the security increases because only the user knows the password. As a disadvantage, the mails and files that are encrypted for the keys of the user can no longer be decrypted if the user forgets the password.
External guest recipients
OX Guard sends encrypted mails also to recipients without a PGP key and without an account in the OX App Suite deployment. For such a recipient, OX Guard creates a guest account through the share service of the OX App Suite Middleware. The recipient reads the encrypted mail with the guest account.
The guest accounts require the following properties of the OX App Suite Middleware:
| Property | Value | Purpose |
|---|---|---|
com.openexchange.share.guestCapabilityMode | static | The mode static grants the capabilities in com.openexchange.share.staticGuestCapabilities to all guests. |
com.openexchange.share.staticGuestCapabilities | guard | The capability guard allows a guest to read encrypted mails. |
com.openexchange.share.transientSessions | false | The value false stores the sessions of guests in the distributed session storage and not only in the pod that created the session. Guard Core thus finds the session of a guest in every pod. |
Guest storage
To store an encrypted copy of every mail to a guest, OX Guard requires a filestore. The supported types of filestores are file, sproxyd and s3.
The configuration of the filestore comprises two steps:
- For the types
sproxydands3, a filestore for OX Guard is declared in the same way as a filestore for the OX App Suite Middleware. The declaration uses a filestore ID, for example in the propertiescom.openexchange.filestore.s3.[filestoreID].*. The OX App Suite Middleware documentation describes the declaration in the article S3 Client Configuration and on the property pages Filestore S3 and Filestore sproxyd. - The property
com.openexchange.guard.storage.file.fileStorageTypeof OX Guard selects the type of the filestore. A further property of OX Guard references the filestore of the selected type:
Value of fileStorageType | Property |
|---|---|
file | com.openexchange.guard.storage.file.uploadDirectory specifies a directory that all pods share and that persists across restarts of the pods. |
sproxyd | com.openexchange.guard.storage.file.sproxydFilestore specifies the filestore ID of an sproxyd filestore. If the property is empty, OX Guard uses the filestore ID guard. |
s3 | com.openexchange.guard.storage.s3.s3FileStore specifies the filestore ID of an S3 filestore. |
Guest cleanup
OX Guard removes the mails and the account of a guest who has not logged in for the number of days in com.openexchange.guard.guestCleanedAfterDaysOfInactivity. With the value 0, OX Guard keeps the mails and the accounts of all guests without time limit, and the cleanup is disabled.
Key publishing
OX Guard publishes the public keys of the users, so that other OX Guard deployments and other PGP clients find the keys.
HKP key server
The publication over HKP requires a DNS SRV record for each mail domain and a route in the ingress from the path /pks to the path /pgp of the OX App Suite Middleware. The section Publishing describes the DNS SRV record and the test of the HKP key server.
Web Key Service
The publication over the Web Key Service requires a route in the ingress from the path /.well-known/openpgpkey/ to the path /openpgpkey/ of the OX App Suite Middleware and, for the advanced method, a DNS record for the subdomain openpgpkey of each mail domain. The section OX Guard as Web Key Service describes both methods.
Support API
The Support API of OX Guard provides administrative functions for support staff, for example the reset of a password or the deletion of a user. The Support API is intended for clients that call the functions over HTTP. The OX Guard HTTP API describes the endpoints of the Support API. For the administration from the command line, the article Command Line Tools describes the command line interfaces of OX Guard.
To use the Support API, the properties com.openexchange.guard.supportApiUsername and com.openexchange.guard.supportApiPassword have to specify the credentials for the HTTP basic authentication. Without both properties, the Support API provides no function.
Important: The Support API is reachable under the path /guardsupport. To protect the administrative functions, access to /guardsupport has to be restricted to the internal network of the deployment.