Skip to content

Commit 0f8a003

Browse files
committed
adapted 5x FIPS documentation for 4.4
1 parent 1a2b073 commit 0f8a003

File tree

2 files changed

+208
-45
lines changed

2 files changed

+208
-45
lines changed

modules/ROOT/pages/security/ssl-fips-compatibility.adoc

Lines changed: 206 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,101 +8,263 @@
88
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.
99
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.
1010

11-
Neo4j 4.4 officially supports FIPS 140-2 compliance.
12-
1311
This guide helps configure Neo4j to use TLS/SSL encryption in a FIPS-compliant way.
1412
It is supplementary to the xref:security/ssl-framework.adoc[SSL framework documentation], as many of the configuration processes and requirements are the same.
1513

1614

17-
[[fips-prerequisites]]
15+
[[ssl-fips-prerequisites]]
1816
== Prerequisites
1917

2018
* Verify that the machine running Neo4j has FIPS-compatible hardware and operating system.
2119
Only xref:installation/requirements.adoc#deployment-requirements-software[Linux operating systems] are supported for Neo4j FIPS compatibility.
22-
* Deploy OpenSSL 3.0.8/3.0.9 in the FIPS mode.
20+
* Use Neo4j Enterprise 4.4.36 or later.
2321
* Install and configure a non-native authentication provider, for example LDAP or SSO.
2422
See xref:authentication-authorization/index.adoc[].
2523

2624

27-
[[fips-ssl-providers]]
25+
[[fips-ssl-provider]]
2826
== Enable FIPS SSL provider
2927

30-
Set SSL policies on Bolt and HTTPS in the _neo4j.conf_ file.
31-
See xref:security/ssl-framework.adoc#ssl-configuration[SSL framework -> Configuration] for detailed instructions.
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].
3230

33-
=== Set SSL provider to OpenSSL
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.
3433

35-
Instructions on how to build and install a FIPS-compatible OpenSSL are out of scope for this document.
36-
Installation steps can differ depending on operating system, and other security requirements you might have for OpenSSL.
34+
The dynamically linked library requires the following dependencies to be installedfootnote:[https://netty.io/wiki/forked-tomcat-native.html]:
3735

38-
* For a list of FIPS certified OpenSSL versions, see link:https://openssl-library.org/source/[].
39-
* A FIPS provider must be installed into OpenSSL.
40-
* OpenSSL must be configured to use the FIPS provider by default.
36+
* Apache Portable Runtime Library
37+
* A FIPS certified version of OpenSSL, with a FIPS provider installed and set as default.
4138

42-
=== Use the correct version of the `netty-tcnative` library
39+
Refer to https://netty.io/wiki/forked-tomcat-native.html[Forked Tomcat Native] for more information.
4340

44-
To achieve FIPS compliance, you must use the dynamically linked version of `netty-tcnative` alongside a FIPS-compatible installation of OpenSSL.
4541

46-
. The dynamically linked library requires the Apache Portable Runtime Library also to be installed.
47-
To install it, use the operating system’s package manager.
48-
+
49-
In Debian/Ubuntu this package is usually called `libapr1`.
50-
+
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`
5155
[source, console, subs="attributes"]
5256
.Install Apache Portable Runtime Library in Debian or Ubuntu
5357
----
5458
apt install -y libapr1
5559
----
56-
+
60+
5761
In RedHat Enterprise Linux, the package is usually called `apr`:
58-
+
62+
5963
[source, console, subs="attributes"]
6064
.Install Apache Portable Runtime Library in RedHat
6165
----
6266
dnf install -y apr
6367
----
64-
+
65-
. Neo4j compatible JAR files can be found at:
66-
https://assets.neo4j.com/netty-tcnative/2.0.65.Final/simplified/netty-tcnative-2.0.65.Final-all.tar
6768

68-
=== Locate the Neo4j `lib` directory.
69+
[[install-openssl]]
70+
=== Install OpenSSL
6971

70-
[NOTE]
71-
====
72-
The location of the `lib` directory is dependent on the installation and your operating system.
73-
Default file locations are documented in the xref:configuration/file-locations.adoc[Configuration -> Default file locations].
74-
====
72+
Instructions on how to build and install a FIPS-compatible OpenSSL are out of scope for this document. Installation steps can differ depending on operating system, and other security requirements you might have for OpenSSL.
7573

76-
. Make sure there are no `netty-tcnative-boringssl` libraries present in the `lib` folder.
74+
In general:
75+
76+
* For a list of FIPS certified OpenSSL versions, see https://openssl-library.org/source/[].
77+
* A FIPS provider must be installed into OpenSSL.
78+
* OpenSSL must be configured to use the FIPS provider by default.
79+
80+
81+
[[install-netty-tcnative-lib]]
82+
=== Install `netty-tcnative` library
83+
84+
85+
// TODO
86+
87+
// download files, but which files? have a table maybe?
88+
// put files in lib folder. Can recycle the 5x documentation.
89+
90+
// from 4.4.36 neo4j has used 2.0.65.Final
91+
// before that it used 2.0.61.Final
92+
// this needs to be a table, but that doesn't make sense until we have to provide more than one version of netty tcnative
93+
94+
. Locate the Neo4j `lib` directory.
7795
+
96+
The location of the `lib` directory is different depending on the method used to install Neo4j.
97+
Check the xref:configuration/file-locations.adoc#neo4j-lib[file locations] documentation for the correct location.
98+
+
99+
This location will be referred to as _<NEO4J_LIB>_.
100+
. Make sure there are no `netty-tcnative-boringssl` libraries present in the _<NEO4J_LIB>_ folder.
101+
+
102+
[source, console]
78103
----
79104
find <NEO4J_LIB> -name "netty-tcnative-boringssl*.jar" -delete
80105
----
81106
+
82-
. Check which `netty-tcnative` libraries are available:
107+
. Download netty-tcnative dynamic library.
108+
+
109+
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.
110+
+
111+
To get around this, we have re-compiled `netty-tcnative` to make OpenSSL 3 compatible netty-tcnative JAR files for use with Neo4j.
112+
These can be downloaded from https://assets.neo4j.com/netty-tcnative/2.0.65.Final/simplified/netty-tcnative-2.0.65.Final-all.tar[]
113+
+
114+
// This is commented out because we only have one compatible version of tcnative so far.
115+
// when we have more versions to be compatible with then it makes sense to use a table instead of a direct link.
116+
// However it looks a bit weird to use a table when we only have one row in the table.
117+
//
118+
// To download the correct `netty-tcnative` version for your Neo4j installation, check the table for a download link:
119+
// [options="header", cols="1,1,3"]
120+
// |===
121+
// | Neo4j version
122+
// | netty-tcnative version
123+
// | Direct link
124+
//
125+
// | 4.4.36
126+
// | 2.0.65.Final
127+
// | https://assets.neo4j.com/netty-tcnative/2.0.65.Final/simplified/netty-tcnative-2.0.65.Final-all.tar[]
128+
// |===
129+
// [TIP]
130+
// ====
131+
// If a Neo4j version is not listed, use the table entry for the next earliest Neo4j version listed.
132+
//
133+
// 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`.
134+
// ====
83135
+
136+
There are Linux and Fedora Linux variants available in the tar, compiled for both x86_64 and ARM 64 architectures. Select the one matching the local machine's operating system and architecture.
137+
+
138+
. Copy the downloaded `netty-tcnative` JAR file into _<NEO4J_LIB>_.
139+
+
140+
. Verify the `netty-tcnative` dependencies are correctly installed using https://www.man7.org/linux/man-pages/man1/ldd.1.html[`ldd`]:
141+
+
142+
[source, console]
143+
.Verify netty-tcnative dependencies are installed
84144
----
85-
ls -l <NEO4J_LIB>/netty-tcnative
145+
unzip -d /tmp <NEO4J_LIB>/netty-tcnative-*-linux-$(arch).jar
146+
ldd /tmp/META-INF/native/libnetty_tcnative_linux_*.so
147+
rm -rf /tmp/META-INF
86148
----
87149
+
88-
. Configure paths to the `netty-tcnnative` library using the Neo4j `lib` directory.
89-
+
150+
[source, console]
151+
.Verify Fedora variant of netty-tcnative dependencies are installed
90152
----
91-
export LD_LIBRARY_PATH=/usr/local/openssl/lib64:/home/ec2-user/{neo4j-version-exact}/lib
92-
export PATH=/home/ec2-user/{neo4j-version-exact}/:$PATH
153+
unzip -d /tmp <NEO4J_LIB>/netty-tcnative-*-linux-$(arch)-fedora.jar
154+
ldd /tmp/META-INF/native/libnetty_tcnative_linux_$(arch).so
155+
rm -rf /tmp/META-INF
93156
----
157+
The `ldd` command shows a list of library dependencies and where they are loaded from on the local machine.
158+
** If any dependencies are missing, they must be installed, or Neo4j will fail to run.
159+
** The `libssl.so` and `libcrypto.so` libraries listed must be the ones installed with OpenSSL in the previous steps.
94160

95-
=== Generate SSL certificate and private key
161+
[NOTE]
162+
====
163+
Only copy *one* of the JAR files. Otherwise Neo4j will not be able to resolve dependencies at runtime.
164+
In case of this error, you will get a message like:
165+
[source]
166+
----
167+
"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]".
168+
----
169+
====
170+
171+
[[generate-ssl-cert-private-key]]
172+
== Generate SSL certificate and private key
173+
174+
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.
96175

97176
[IMPORTANT]
98177
====
99178
For FIPS compatibility, the private key must be secured with a password.
100179
====
180+
101181
Refer to the xref:security/ssl-framework.adoc#ssl-certificates[SSL certificate and key instructions] for more information.
102182

103-
=== Configure _neo4j.conf_
104183

105-
At last, you have to configure the _neo4j.conf_ file to use FIPS 140-2 approved ciphers.
184+
[[configure-neo4j-ssl-encryption]]
185+
== Configure Neo4j to use SSL encryption
186+
187+
SSL configuration is described in detail in xref:security/ssl-framework.adoc#ssl-configuration[SSL framework configuration].
188+
189+
This section describes configuration that must be done *in addition to* standard non-FIPS compliant SSL configuration.
190+
191+
[[bolt-ssl-fips]]
192+
=== Bolt
193+
194+
. Set `xref:configuration/configuration-settings.adoc#config_dbms.netty.ssl.provider[dbms.netty.ssl.provider]=OPENSSL`
195+
. Set `xref:configuration/configuration-settings.adoc#config_server.bolt.tls_level[dbms.connector.bolt.tls_level]=REQUIRED`
196+
. Follow instructions on how to xref:security/ssl-framework.adoc#ssl-bolt-config[Configure SSL over Bolt].
197+
. Set additional Bolt configurations:
198+
+
199+
[source, properties]
200+
----
201+
dbms.ssl.policy.bolt.trust_all=false
202+
dbms.ssl.policy.bolt.tls_level=REQUIRED
203+
dbms.ssl.policy.bolt.tls_versions=TLSv1.2,TLSv1.3
204+
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
205+
----
206+
. 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.
207+
The password must *not* be set in plain text.
208+
209+
210+
[[https-ssl-fips]]
211+
=== HTTPS
212+
213+
This section is only applicable if HTTPS is enabled.
214+
215+
. Follow instructions on how to xref:security/ssl-framework.adoc#ssl-https-config[Configure SSL over HTTPS].
216+
+
217+
. Set additional HTTPS configurations:
218+
+
219+
[source, properties]
220+
----
221+
dbms.ssl.policy.https.trust_all=false
222+
dbms.ssl.policy.https.tls_level=REQUIRED
223+
dbms.ssl.policy.https.tls_versions=TLSv1.2,TLSv1.3
224+
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
225+
----
226+
. 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. The password must NOT be set in plain text.
227+
228+
[[intra-cluster-encryption-ssl-fips]]
229+
=== Intra-cluster encryption
230+
231+
For FIPS compatbility, intra-cluster encryption must be enabled if you are running a Neo4j cluster.
232+
233+
. Follow instructions to xref:security/ssl-framework.adoc#ssl-cluster-config[configure SSL for intra-cluster communication].
234+
. Set additional cluster configurations:
235+
+
236+
[source, properties]
237+
----
238+
dbms.ssl.policy.cluster.enabled=true
239+
dbms.ssl.policy.cluster.tls_level=REQUIRED
240+
dbms.ssl.policy.cluster.client_auth=REQUIRED
241+
dbms.ssl.policy.cluster.tls_versions=TLSv1.2,TLSv1.3
242+
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
243+
----
244+
. 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.
245+
The password must *not* be set in plain text.
246+
247+
248+
[[backup-ssl-fips]]
249+
=== Backup
250+
251+
This section is applicable on instances or cluster members used for taking backups.
252+
253+
. Follow instructions on how to xref:security/ssl-framework.adoc#ssl-backup-config[Configure SSL for backup communication].
254+
. Set additional backup configurations:
255+
+
256+
[source, properties]
257+
----
258+
dbms.ssl.policy.backup.enabled=true
259+
dbms.ssl.policy.backup.client_auth=REQUIRED
260+
dbms.ssl.policy.backup.trust_all=false
261+
dbms.ssl.policy.backup.tls_versions=TLSv1.2,TLSv1.3
262+
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
263+
----
264+
. 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.
265+
The password must *not* be set in plain text.
266+
267+
== Example SSL configurations
106268

107269
.Example Bolt SSL configuration
108270
[source, shell]
@@ -112,19 +274,19 @@ dbms.ssl.policy.bolt.base_directory=certificates/https
112274
dbms.ssl.policy.bolt.private_key=private.key
113275
dbms.ssl.policy.bolt.public_certificate=public.crt
114276
dbms.ssl.policy.bolt.client_auth=NONE
115-
dbms.ssl.policy.bolt.ciphers=TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_DSS_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA
277+
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
116278
----
117279

118280
.Example HTTPS SSL configuration
119281
[source, shell]
120282
----
283+
dbms.netty.ssl.provider=OPENSSL
121284
dbms.ssl.policy.https.enabled=true
122285
dbms.ssl.policy.https.base_directory=certificates/https
123286
dbms.ssl.policy.https.private_key=private.key
124287
dbms.ssl.policy.https.public_certificate=public.crt
125288
dbms.ssl.policy.https.client_auth=NONE
126-
dbms.ssl.policy.https.ciphers=TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_DSS_WITH_AES_256_CBC_SHA,TLS_RS A_WITH_AES_128_CBC_SHA
127-
dbms.netty.ssl.provider=OPENSSL
289+
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
128290
----
129291

130292

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)