Skip to content

Commit 937cbd1

Browse files
Add instructions on how to configure FIPS-compliant SSL (#1843)
Co-authored-by: Jenny <[email protected]>
1 parent 6cd768f commit 937cbd1

File tree

3 files changed

+299
-1
lines changed

3 files changed

+299
-1
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
* xref:security/index.adoc[]
148148
** xref:security/securing-extensions.adoc[]
149149
** xref:security/ssl-framework.adoc[]
150+
*** xref:security/ssl-fips-compatibility.adoc[]
150151
** xref:security/browser.adoc[]
151152
** xref:security/checklist.adoc[]
152153
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
:description: how to configure SSL in Neo4j 4.4 to be FIPS 140-2 compliant.
2+
3+
:page-role: enterprise-edition new-4.4.36
4+
5+
[[neo4j-ssl-fips-compliance]]
6+
= Configure SSL for FIPS 140-2 compatibility
7+
8+
The National Institute of Standards and Technology (NIST) developed the Federal Information Processing Standard (FIPS) Publication 140-2 as a security standard that sets forth requirements for cryptographic modules, including hardware, software, and/or firmware, for U.S. federal agencies.
9+
While FIPS 140 compliance is primarily required for federal agencies and their contractors, it also is used in the healthcare sector under regulations like the Health Insurance Portability and Accountability Act (HIPAA) to protect patient data.
10+
11+
This guide helps configure Neo4j to use TLS/SSL encryption in a FIPS-compliant way.
12+
It is supplementary to the xref:security/ssl-framework.adoc[SSL framework documentation], as many of the configuration processes and requirements are the same.
13+
14+
15+
[[ssl-fips-prerequisites]]
16+
== Prerequisites
17+
18+
* Verify that the machine running Neo4j has FIPS-compatible hardware and operating system.
19+
Only xref:installation/requirements.adoc#deployment-requirements-software[Linux operating systems] are supported for Neo4j FIPS compatibility.
20+
* Use Neo4j Enterprise 4.4.36 or later.
21+
* Install and configure a non-native authentication provider, for example LDAP or SSO.
22+
See xref:authentication-authorization/index.adoc[].
23+
24+
25+
[[fips-ssl-provider]]
26+
== Enable FIPS SSL provider
27+
28+
The secure networking in Neo4j is provided through the Netty library, which supports both the native JDK SSL provider and Netty-supported OpenSSL derivatives.
29+
Specifically Netty's _Forked Tomcat Native_ library called https://github.com/netty/netty-tcnative[netty-tcnative].
30+
31+
The `netty-tcnative` library is provided in several variants.
32+
However, to achieve FIPS compliance, you must use the dynamically linked version of `netty-tcnative` alongside a FIPS-compatible installation of OpenSSL.
33+
34+
The dynamically linked library requires the following dependencies to be installed:
35+
36+
* Apache Portable Runtime Library
37+
* A FIPS certified version of OpenSSL, with a FIPS provider installed and set as default.
38+
39+
Refer to https://netty.io/wiki/forked-tomcat-native.html[Forked Tomcat Native] for more information.
40+
41+
42+
[NOTE]
43+
====
44+
Netty provides a convenient pre-build, statically linked version of `netty-tcnative` using BoringSSL, but this is not FIPS certifiedfootnote:[https://boringssl.googlesource.com/boringssl/+/master/crypto/fipsmodule/FIPS.md].
45+
46+
By using the dynamic `netty-tcnative` library variant combined with a FIPS certified OpenSSL installation, Neo4j's cryptographic operations are delegated by `netty-tcnative` to OpenSSL, transitively giving FIPS compatibility.
47+
====
48+
49+
[[install-apr]]
50+
=== Install Apache portable runtime library
51+
52+
To install https://apr.apache.org[Apache Portable Runtime Library], use the operating system's package manager.
53+
54+
In Debian/Ubuntu this package is usually called `libapr1`
55+
[source, console, subs="attributes"]
56+
.Install Apache Portable Runtime Library in Debian or Ubuntu
57+
----
58+
apt install -y libapr1
59+
----
60+
61+
In RedHat Enterprise Linux, the package is usually called `apr`:
62+
63+
[source, console, subs="attributes"]
64+
.Install Apache Portable Runtime Library in RedHat
65+
----
66+
dnf install -y apr
67+
----
68+
69+
[[install-openssl]]
70+
=== Install OpenSSL
71+
72+
Instructions on how to build and install a FIPS-compatible OpenSSL are out of scope for this document.
73+
Installation steps can differ depending on operating system, and other security requirements you might have for OpenSSL.
74+
75+
In general:
76+
77+
* For a list of FIPS certified OpenSSL versions, see https://openssl-library.org/source/[].
78+
* A FIPS provider must be installed into OpenSSL.
79+
* OpenSSL must be configured to use the FIPS provider by default.
80+
81+
82+
[[install-netty-tcnative-lib]]
83+
=== Install `netty-tcnative` library
84+
85+
86+
// TODO
87+
88+
// download files, but which files? have a table maybe?
89+
// put files in lib folder. Can recycle the 5x documentation.
90+
91+
// from 4.4.36 neo4j has used 2.0.65.Final
92+
// before that it used 2.0.61.Final
93+
// this needs to be a table, but that doesn't make sense until we have to provide more than one version of netty tcnative
94+
95+
. Locate the Neo4j `lib` directory.
96+
+
97+
The location of the `lib` directory is different depending on the method used to install Neo4j.
98+
Check the xref:configuration/file-locations.adoc#neo4j-lib[file locations] documentation for the correct location.
99+
+
100+
This location will be referred to as _<NEO4J_LIB>_.
101+
. Make sure there are no `netty-tcnative-boringssl` libraries present in the _<NEO4J_LIB>_ folder.
102+
+
103+
[source, console]
104+
----
105+
find <NEO4J_LIB> -name "netty-tcnative-boringssl*.jar" -delete
106+
----
107+
+
108+
. Download netty-tcnative dynamic library.
109+
+
110+
The dynamic version of `netty-tcnative` library provided by link:https://netty.io/wiki/forked-tomcat-native.html[netty.io] is not compatible with OpenSSL 3.0.0 or later.
111+
+
112+
To get around this, we have re-compiled `netty-tcnative` to make OpenSSL 3 compatible netty-tcnative JAR files for use with Neo4j.
113+
These can be downloaded from https://assets.neo4j.com/netty-tcnative/2.0.65.Final/simplified/netty-tcnative-2.0.65.Final-all.tar[]
114+
+
115+
// This is commented out because we only have one compatible version of tcnative so far.
116+
// when we have more versions to be compatible with then it makes sense to use a table instead of a direct link.
117+
// However it looks a bit weird to use a table when we only have one row in the table.
118+
//
119+
// To download the correct `netty-tcnative` version for your Neo4j installation, check the table for a download link:
120+
// [options="header", cols="1,1,3"]
121+
// |===
122+
// | Neo4j version
123+
// | netty-tcnative version
124+
// | Direct link
125+
//
126+
// | 4.4.36
127+
// | 2.0.65.Final
128+
// | https://assets.neo4j.com/netty-tcnative/2.0.65.Final/simplified/netty-tcnative-2.0.65.Final-all.tar[]
129+
// |===
130+
// [TIP]
131+
// ====
132+
// If a Neo4j version is not listed, use the table entry for the next earliest Neo4j version listed.
133+
//
134+
// For example: for Neo4j 4.4.38 the next earliest version listed in the table is 4.4.36, so the required `netty-tcnative` version is `2.0.65.Final`.
135+
// ====
136+
+
137+
There are Linux and Fedora Linux variants available in the tar, compiled for both x86_64 and ARM 64 architectures.
138+
Select the one matching the local machine's operating system and architecture.
139+
+
140+
. Copy the downloaded `netty-tcnative` JAR file into _<NEO4J_LIB>_.
141+
+
142+
. Verify the `netty-tcnative` dependencies are correctly installed using https://www.man7.org/linux/man-pages/man1/ldd.1.html[`ldd`]:
143+
+
144+
[source, console]
145+
.Verify netty-tcnative dependencies are installed
146+
----
147+
unzip -d /tmp <NEO4J_LIB>/netty-tcnative-*-linux-$(arch).jar
148+
ldd /tmp/META-INF/native/libnetty_tcnative_linux_*.so
149+
rm -rf /tmp/META-INF
150+
----
151+
+
152+
[source, console]
153+
.Verify Fedora variant of netty-tcnative dependencies are installed
154+
----
155+
unzip -d /tmp <NEO4J_LIB>/netty-tcnative-*-linux-$(arch)-fedora.jar
156+
ldd /tmp/META-INF/native/libnetty_tcnative_linux_$(arch).so
157+
rm -rf /tmp/META-INF
158+
----
159+
The `ldd` command shows a list of library dependencies and where they are loaded from on the local machine.
160+
** If any dependencies are missing, they must be installed, or Neo4j will fail to run.
161+
** The `libssl.so` and `libcrypto.so` libraries listed must be the ones installed with OpenSSL in the previous steps.
162+
163+
[NOTE]
164+
====
165+
Only copy *one* of the JAR files.
166+
Otherwise Neo4j will not be able to resolve dependencies at runtime.
167+
In case of this error, you will get a message like:
168+
[source]
169+
----
170+
"Failed to load any of the given libraries: [netty_tcnative_linux_x86_64, netty_tcnative_linux_x86_64_fedora, netty_tcnative_x86_64, netty_tcnative]".
171+
----
172+
====
173+
174+
[[generate-ssl-cert-private-key]]
175+
== Generate SSL certificate and private key
176+
177+
Neo4j SSL encryption requires a xref:security/ssl-framework.adoc#term-ssl-certificate[certificate] in the X.509 standard and a private key in PKCS #8 format, both encoded in PEM format.
178+
179+
[IMPORTANT]
180+
====
181+
For FIPS compatibility, the private key must be secured with a password.
182+
====
183+
184+
Refer to the xref:security/ssl-framework.adoc#ssl-certificates[SSL certificate and key instructions] for more information.
185+
186+
187+
[[configure-neo4j-ssl-encryption]]
188+
== Configure Neo4j to use SSL encryption
189+
190+
SSL configuration is described in detail in xref:security/ssl-framework.adoc#ssl-configuration[SSL framework configuration].
191+
192+
This section describes configuration that must be done *in addition to* standard non-FIPS compliant SSL configuration.
193+
194+
[[bolt-ssl-fips]]
195+
=== Bolt
196+
197+
. Set `xref:configuration/configuration-settings.adoc#config_dbms.netty.ssl.provider[dbms.netty.ssl.provider]=OPENSSL`
198+
. Set `xref:configuration/configuration-settings.adoc#config_server.bolt.tls_level[dbms.connector.bolt.tls_level]=REQUIRED`
199+
. Follow instructions on how to xref:security/ssl-framework.adoc#ssl-bolt-config[Configure SSL over Bolt].
200+
. Set additional Bolt configurations:
201+
+
202+
[source, properties]
203+
----
204+
dbms.ssl.policy.bolt.trust_all=false
205+
dbms.ssl.policy.bolt.tls_level=REQUIRED
206+
dbms.ssl.policy.bolt.tls_versions=TLSv1.2,TLSv1.3
207+
dbms.ssl.policy.bolt.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_128_CCM_8_SHA256,TLS_AES_128_CCM_SHA256
208+
----
209+
. Follow the instructions in xref:security/ssl-framework.adoc#ssl-config-private-key[SSL Framework -> Using encrypted private key] to configure `dbms.ssl.policy.bolt.private_key_password` to dynamically read the password from an encrypted password file.
210+
The password must *not* be set in plain text.
211+
212+
213+
[[https-ssl-fips]]
214+
=== HTTPS
215+
216+
This section is only applicable if HTTPS is enabled.
217+
218+
. Follow instructions on how to xref:security/ssl-framework.adoc#ssl-https-config[Configure SSL over HTTPS].
219+
+
220+
. Set additional HTTPS configurations:
221+
+
222+
[source, properties]
223+
----
224+
dbms.ssl.policy.https.trust_all=false
225+
dbms.ssl.policy.https.tls_level=REQUIRED
226+
dbms.ssl.policy.https.tls_versions=TLSv1.2,TLSv1.3
227+
dbms.ssl.policy.https.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_128_CCM_8_SHA256,TLS_AES_128_CCM_SHA256
228+
----
229+
. Follow the instructions in xref:security/ssl-framework.adoc#ssl-config-private-key[SSL Framework -> Using encrypted private key] to configure `dbms.ssl.policy.https.private_key_password` to dynamically read the password from an encrypted password file.
230+
The password must *not* be set in plain text.
231+
232+
[[intra-cluster-encryption-ssl-fips]]
233+
=== Intra-cluster encryption
234+
235+
For FIPS compatbility, intra-cluster encryption must be enabled if you are running a Neo4j cluster.
236+
237+
. Follow instructions to xref:security/ssl-framework.adoc#ssl-cluster-config[configure SSL for intra-cluster communication].
238+
. Set additional cluster configurations:
239+
+
240+
[source, properties]
241+
----
242+
dbms.ssl.policy.cluster.enabled=true
243+
dbms.ssl.policy.cluster.tls_level=REQUIRED
244+
dbms.ssl.policy.cluster.client_auth=REQUIRED
245+
dbms.ssl.policy.cluster.tls_versions=TLSv1.2,TLSv1.3
246+
dbms.ssl.policy.cluster.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_128_CCM_8_SHA256,TLS_AES_128_CCM_SHA256
247+
----
248+
. Follow the instructions in xref:security/ssl-framework.adoc#ssl-config-private-key[SSL Framework -> Using encrypted private key] to configure `dbms.ssl.policy.cluster.private_key_password` to dynamically read the password from an encrypted password file.
249+
The password must *not* be set in plain text.
250+
251+
252+
[[backup-ssl-fips]]
253+
=== Backup
254+
255+
This section is applicable on instances or cluster members used for taking backups.
256+
257+
. Follow instructions on how to xref:security/ssl-framework.adoc#ssl-backup-config[Configure SSL for backup communication].
258+
. Set additional backup configurations:
259+
+
260+
[source, properties]
261+
----
262+
dbms.ssl.policy.backup.enabled=true
263+
dbms.ssl.policy.backup.client_auth=REQUIRED
264+
dbms.ssl.policy.backup.trust_all=false
265+
dbms.ssl.policy.backup.tls_versions=TLSv1.2,TLSv1.3
266+
dbms.ssl.policy.backup.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_128_CCM_8_SHA256,TLS_AES_128_CCM_SHA256
267+
----
268+
. Follow the instructions in xref:security/ssl-framework.adoc#ssl-config-private-key[SSL Framework -> Using encrypted private key] to configure `dbms.ssl.policy.backup.private_key_password` to dynamically read the password from an encrypted password file.
269+
The password must *not* be set in plain text.
270+
271+
== Example SSL configurations
272+
273+
.Example Bolt SSL configuration
274+
[source, shell]
275+
----
276+
dbms.ssl.policy.bolt.enabled=true
277+
dbms.ssl.policy.bolt.base_directory=certificates/https
278+
dbms.ssl.policy.bolt.private_key=private.key
279+
dbms.ssl.policy.bolt.public_certificate=public.crt
280+
dbms.ssl.policy.bolt.client_auth=NONE
281+
dbms.ssl.policy.bolt.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_128_CCM_8_SHA256,TLS_AES_128_CCM_SHA256
282+
----
283+
284+
.Example HTTPS SSL configuration
285+
[source, shell]
286+
----
287+
dbms.netty.ssl.provider=OPENSSL
288+
dbms.ssl.policy.https.enabled=true
289+
dbms.ssl.policy.https.base_directory=certificates/https
290+
dbms.ssl.policy.https.private_key=private.key
291+
dbms.ssl.policy.https.public_certificate=public.crt
292+
dbms.ssl.policy.https.client_auth=NONE
293+
dbms.ssl.policy.https.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_128_CCM_8_SHA256,TLS_AES_128_CCM_SHA256
294+
----
295+
296+

modules/ROOT/pages/security/ssl-framework.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ For more details, see the <<table, Netty support per Neo4j version>>.
3434
- Set `xref:reference/configuration-settings.adoc#config_dbms.netty.ssl.provider[dbms.netty.ssl.provider]=OPENSSL`.
3535
- Restart Neo4j.
3636

37-
Most supported versions of Neo4j use Netty 4.1.111.Final, which requires tcnative 2.0.65.
37+
Most supported versions of Neo4j use Netty 4.1.111.Final, which requires tcnative 2.0.65.Final.
3838
Only Neo4j 3.5 still uses older versions of Netty.
3939
See the table below for detailed information:
4040

@@ -936,6 +936,7 @@ dbms.ssl.policy.backup.client_auth=REQUIRE
936936
[[ssl-other-configs]]
937937
=== Other configurations for SSL
938938

939+
[[ssl-config-private-key]]
939940
==== Using encrypted private key
940941

941942
To use an encrypted private key, configure the following settings.

0 commit comments

Comments
 (0)