You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can be configured to enable mTLS based authentication for incoming connections. If enabled with default options (by setting to `true`), the client certificate will be checked against the certificate authority specified with `tls.certificateAuthority`. And if the certificate can be properly verified, the connection will authenticate users where the user's id/username is specified by the `CN` (common name) from the client certificate's `subject`, by default.
136
136
@@ -142,20 +142,46 @@ This configures a specific username to authenticate as for mTLS connections. If
142
142
143
143
`required` - _Type_: boolean; _Default_: false
144
144
145
-
This can be enabled to require client certificates (mTLS) for all incoming MQTT connections. If enabled, any connection that doesn't provide an authorized certificate will be rejected/closed. By default, this is disabled, and authentication can take place with mTLS _or_ standard credential authentication.
145
+
This can be enabled to require client certificates (mTLS) for all incoming connections. If enabled, any connection that doesn't provide an authorized certificate will be rejected/closed. By default, this is disabled, and authentication can take place with mTLS _or_ standard credential authentication.
When mTLS is enabled, Harper verifies the revocation status of client certificates using OCSP (Online Certificate Status Protocol). This ensures that revoked certificates cannot be used for authentication.
150
+
151
+
Set to `false` to disable certificate verification, or configure with an object:
152
+
153
+
- `timeout` - _Type_: number; _Default_: 5000 - Maximum milliseconds to wait for OCSP response
- `'fail-open'`: Allow connection on verification failure (logs warning)
157
+
- `'fail-closed'`: Reject connection on verification failure
158
+
159
+
Example configurations:
146
160
147
161
```yaml
162
+
# Basic mTLS with default certificate verification
148
163
http:
149
164
mtls: true
150
165
```
151
166
152
-
or
153
-
154
167
```yaml
168
+
# mTLS with certificate verification disabled (not recommended for production)
155
169
http:
156
170
mtls:
157
171
required: true
158
172
user: user-name
173
+
certificateVerification: false
174
+
```
175
+
176
+
```yaml
177
+
# mTLS with custom verification settings for high-security environments
178
+
http:
179
+
mtls:
180
+
required: true
181
+
certificateVerification:
182
+
timeout: 10000 # 10 seconds for OCSP response
183
+
cacheTtl: 7200000 # Cache results for 2 hours
184
+
failureMode: fail-closed # Reject if OCSP check fails
159
185
```
160
186
161
187
---
@@ -683,6 +709,7 @@ Harper's logger supports defining multiple logging configurations for different
683
709
`logging.external`
684
710
685
711
The `logging.external` section can be used to define logging for all external components that use the [`logger` API](../technical-details/reference/globals.md). For example:
712
+
686
713
```yaml
687
714
logging:
688
715
external:
@@ -693,15 +720,16 @@ logging:
693
720
`http.logging`
694
721
695
722
This section defines log configuration for HTTP logging. By default, HTTP requests are not logged, but defining this section will enable HTTP logging. Note that there can be substantive overhead to logging all HTTP requests. In addition to the standard logging configuration, the `http.logging` section also allows the following configuration properties to be set:
696
-
* `timing` - This will log timing information
697
-
* `headers` - This will log the headers in each request (which can be very verbose)
698
-
* `id` - This will assign a unique id to each request and log it in the entry for each request. This is assigned as the `request.requestId` property and can be used to by other logging to track a request.
723
+
-`timing`- This will log timing information
724
+
-`headers`- This will log the headers in each request (which can be very verbose)
725
+
-`id`- This will assign a unique id to each request and log it in the entry for each request. This is assigned as the `request.requestId` property and can be used to by other logging to track a request.
699
726
Note that the `level` will determine which HTTP requests are logged:
700
-
* `info` (or more verbose) - All HTTP requests
701
-
* `warn` - HTTP requests with a status code of 400 or above
702
-
* `error` - HTTP requests with a status code of 500
727
+
-`info`(or more verbose) - All HTTP requests
728
+
-`warn`- HTTP requests with a status code of 400 or above
729
+
-`error`- HTTP requests with a status code of 500
703
730
704
731
For example:
732
+
705
733
```yaml
706
734
http:
707
735
logging:
@@ -739,7 +767,7 @@ This section defines log configuration for setting up and reading the database f
739
767
740
768
This section defines log configuration for analytics. This takes the standard logging configuration options of `path` (or `root`), `level`, `tag`, and flag to enable/disable logging to `stdStreams`.
741
769
742
-
***
770
+
---
743
771
744
772
### `authentication`
745
773
@@ -1080,7 +1108,7 @@ This enables access to MQTT through WebSockets. This will handle WebSocket conne
1080
1108
1081
1109
This indicates if authentication should be required for establishing an MQTT connection (whether through MQTT connection credentials or mTLS). Disabling this allows unauthenticated connections, which are then subject to authorization for publishing and subscribing (and by default tables/resources do not authorize such access, but that can be enabled at the resource level).
This can be configured to enable mTLS based authentication for incoming connections. If enabled with default options (by setting to `true`), the client certificate will be checked against the certificate authority specified in the `tls` section. And if the certificate can be properly verified, the connection will authenticate users where the user's id/username is specified by the `CN` (common name) from the client certificate's `subject`, by default.
1086
1114
@@ -1098,6 +1126,18 @@ This can be enabled to require client certificates (mTLS) for all incoming MQTT
1098
1126
1099
1127
This can define a specific path to use for the certificate authority. By default, certificate authorization checks against the CA specified at `tls.certificateAuthority`, but if you need a specific/distinct CA for MQTT, you can set this.
When mTLS is enabled, Harper verifies the revocation status of client certificates using OCSP (Online Certificate Status Protocol). This ensures that revoked certificates cannot be used for authentication.
1132
+
1133
+
Set to `false` to disable certificate verification, or configure with an object:
1134
+
1135
+
- `timeout` - _Type_: number; _Default_: 5000 - Maximum milliseconds to wait for OCSP response
Copy file name to clipboardExpand all lines: docs/developers/clustering/certificate-management.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,18 @@ Once you generate new certificates, to make Harper start using them you can eith
28
28
29
29
Since these new certificates can be issued with correct CNs, you should set `insecure` to `false` so that nodes will do full validation of the certificates of the other nodes.
30
30
31
+
### Certificate Revocation Checking
32
+
33
+
Harper automatically performs certificate revocation checking using OCSP (Online Certificate Status Protocol) for all cluster connections. This critical security feature ensures that:
34
+
35
+
- Revoked certificates cannot be used for cluster communication
36
+
- Compromised nodes can be quickly isolated by revoking their certificates
37
+
- Certificate status is verified in real-time with the Certificate Authority
38
+
39
+
Certificate verification is enabled by default for cluster connections and follows the same configuration as HTTP mTLS connections. The verification settings can be customized in the HTTP configuration section to balance security requirements with performance considerations.
40
+
41
+
For production clusters, consider using `failureMode: fail-closed` to ensure maximum security by rejecting connections when OCSP verification cannot be completed.
42
+
31
43
### Certificate Requirements
32
44
33
45
- Certificates must have an `Extended Key Usage` that defines both `TLS Web Server Authentication` and `TLS Web Client Authentication` as these certificates will be used to accept connections from other Harper nodes and to make requests to other Harper nodes. Example:
Copy file name to clipboardExpand all lines: docs/developers/real-time.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,9 @@ mqtt:
36
36
requireAuthentication: true
37
37
```
38
38
39
-
Note that if you are using WebSockets for MQTT, the sub-protocol should be set to "mqtt" (this is required by the MQTT specification, and should be included by any conformant client): `Sec-WebSocket-Protocol: mqtt`. mTLS is also supported by enabling it in the configuration and using the certificate authority from the TLS section of the configuration. See the [configuration documentation for more information](../deployments/configuration.md).
39
+
Note that if you are using WebSockets for MQTT, the sub-protocol should be set to "mqtt" (this is required by the MQTT specification, and should be included by any conformant client): `Sec-WebSocket-Protocol: mqtt`.
40
+
41
+
mTLS is also supported by enabling it in the configuration and using the certificate authority from the TLS section of the configuration. When mTLS is enabled for MQTT, Harper automatically performs certificate revocation checking using OCSP (Online Certificate Status Protocol) to ensure that revoked certificates cannot be used for authentication. See the [configuration documentation for more information](../deployments/configuration.md).
Copy file name to clipboardExpand all lines: docs/developers/replication/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,8 @@ replication:
73
73
74
74
Harper supports the highest levels of security through public key infrastructure based security and authorization. Depending on your security configuration, you can configure Harper in several different ways to build a connected cluster.
75
75
76
+
When using certificate-based authentication, Harper automatically performs OCSP (Online Certificate Status Protocol) verification to check if certificates have been revoked. This ensures that compromised certificates cannot be used for replication connections. Certificate verification settings follow the same configuration as HTTP mTLS connections (see [certificate verification configuration](../../deployments/configuration.md#http)).
77
+
76
78
#### Provide your own certificates
77
79
78
80
If you want to secure your Harper connections with your own signed certificates, you can easily do so. Whether you have certificates from a public authority (like Let's Encrypt or Digicert) or a corporate certificate authority, you can use them to authenticate nodes securely. You can then allow nodes to authorize each other by checking the certificate against the standard list of root certificate authorities by enabling the `enableRootCAs` option in the config:
Copy file name to clipboardExpand all lines: docs/developers/security/README.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,14 @@
2
2
3
3
Harper uses role-based, attribute-level security to ensure that users can only gain access to the data they’re supposed to be able to access. Our granular permissions allow for unparalleled flexibility and control, and can actually lower the total cost of ownership compared to other database solutions, since you no longer have to replicate subsets of your data to isolate use cases.
4
4
5
-
-[JWT Authentication](jwt-auth.md)
6
-
-[Basic Authentication](basic-auth.md)
7
-
-[mTLS Authentication](mtls-auth.md)
8
-
-[Configuration](configuration.md)
9
-
-[Users and Roles](users-and-roles.md)
5
+
## Authentication Methods
6
+
7
+
-[JWT Authentication](jwt-auth.md) - JSON Web Token based authentication
Harper supports mTLS authentication for incoming connections. When enabled in the [HTTP config settings](../../deployments/configuration.md#http) the client certificate will be checked against the certificate authority specified with `tls.certificateAuthority`. If the certificate can be properly verified, the connection will authenticate users where the user's id/username is specified by the `CN` (common name) from the client certificate's `subject`, by default. The [HTTP config settings](../../deployments/configuration.md#http) allow you to determine if mTLS is required for all connections or optional.
3
+
Harper supports mTLS (mutual TLS) authentication for incoming connections, providing certificate-based authentication for enhanced security. When enabled in the [HTTP config settings](../../deployments/configuration.md#http), the client certificate will be checked against the certificate authority specified with `tls.certificateAuthority`. If the certificate can be properly verified, the connection will authenticate users where the user's id/username is specified by the `CN` (common name) from the client certificate's `subject`, by default. The [HTTP config settings](../../deployments/configuration.md#http) allow you to determine if mTLS is required for all connections or optional.
4
+
5
+
## Certificate Verification
6
+
7
+
When mTLS is enabled, Harper automatically performs certificate revocation checking using OCSP (Online Certificate Status Protocol). OCSP provides real-time verification that certificates have not been revoked by the Certificate Authority, ensuring that compromised or invalidated certificates cannot be used for authentication.
8
+
9
+
### How It Works
10
+
11
+
When a client presents a certificate:
12
+
13
+
1. Harper validates the certificate against the configured Certificate Authority
14
+
2. If validation succeeds, Harper queries the CA's OCSP responder to check revocation status
15
+
3. The verification result is cached to minimize performance impact on subsequent connections
16
+
4. Based on the configuration, the connection is either allowed or rejected
17
+
18
+
### Key Features
19
+
20
+
-**Enabled by default** when mTLS is configured
21
+
-**Real-time verification** with the Certificate Authority's OCSP responder
22
+
-**Intelligent caching** of verification results (default: 1 hour)
23
+
-**Configurable timeout** for OCSP responses (default: 5 seconds)
24
+
-**Flexible failure handling** with fail-open or fail-closed modes
25
+
-**Unified across all protocols** - HTTP, MQTT, and replication connections
26
+
27
+
### Configuration
28
+
29
+
Certificate verification can be disabled or customized through the `certificateVerification` setting. See the [HTTP configuration](../../deployments/configuration.md#http) and [MQTT configuration](../../deployments/configuration.md#mqtt) sections for detailed options.
0 commit comments