|  | 
| 1 |  | -:description: How to configure Neo4j to use FIPS compatible SSL encryption. | 
| 2 | 1 | [role=enterprise-edition] | 
| 3 | 2 | [[ssl-fips-compatibility]] | 
| 4 | 3 | = Configuring SSL for FIPS 140-2 compatibility | 
|  | 4 | +:description: How to configure Neo4j to use FIPS compatible SSL encryption. | 
|  | 5 | +:keywords: ssl, tls, authentication, encryption, encrypted, security, fips, fips 140, fips 140-2, nist, hipaa | 
| 5 | 6 | 
 | 
| 6 |  | -Federal Information Processing Standards (FIPS) is ... | 
|  | 7 | +Federal Information Processing Standards (FIPS) 140 is a U.S. government standard established by the National Institute of Standards and Technology (NIST) which is used to accredit cryptographic modules such as those used in TLS network encryption.  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. | 
| 7 | 8 | 
 | 
| 8 |  | -https://csrc.nist.gov/pubs/fips/140-2/upd2/final | 
|  | 9 | +For more information see: | 
| 9 | 10 | 
 | 
| 10 |  | -This is a guide to help configure Neo4j to use SSL encryption in a FIPS compatible way. | 
| 11 |  | -It is supplementary to xref:security/ssl-framework.adoc[] as many of the configuration processes and requirements are the same. | 
|  | 11 | +* https://cloudsecurityalliance.org/blog/2023/03/23/what-is-fips-140-and-what-does-it-mean-to-be-fips-compliant | 
|  | 12 | +* https://csrc.nist.gov/pubs/fips/140-2/upd2/final | 
| 12 | 13 | 
 | 
| 13 |  | -. Enable a FIPS certified cryptographic provider | 
| 14 |  | -. Generate SSL certificate and private key xref:security/ssl-framework.adoc#ssl-certificates[instructions] | 
| 15 |  | -. Configure Neo4j to use SSL for all network connections xref:security/ssl-framework.adoc#ssl-configuration[] | 
| 16 |  | -. Setup a non-native authentication provider, for example LDAP or SSO. xref:authentication-authorization/index.adoc[] | 
| 17 |  | -. verify? | 
| 18 |  | -. security checklist? (cross ref) | 
|  | 14 | +This is a guide to help configure Neo4j to use TLS / SSL encryption in a FIPS compatible way. | 
|  | 15 | +It is supplementary to the xref:security/ssl-framework.adoc[] documentation, as many of the configuration processes and requirements are the same. | 
|  | 16 | + | 
|  | 17 | +// . Enable a FIPS certified cryptographic provider | 
|  | 18 | +// . Generate SSL certificate and private key xref:security/ssl-framework.adoc#ssl-certificates[instructions] | 
|  | 19 | +// . Configure Neo4j to use SSL for all network connections xref:security/ssl-framework.adoc#ssl-configuration[] | 
|  | 20 | +// . Setup a non-native authentication provider, for example LDAP or SSO. xref:authentication-authorization/index.adoc[] | 
|  | 21 | +// . verify? | 
| 19 | 22 | 
 | 
| 20 | 23 | 
 | 
| 21 | 24 | == Prerequisites | 
| 22 |  | -TODO | 
| 23 | 25 | 
 | 
| 24 |  | -* FIPS compatible operating system and hardware. Only Linux operating systems are supported for Neo4j FIPS compatibility at this time. | 
|  | 26 | +* Verify that the machine running Neo4j has FIPS compatible hardware and operating system. | 
|  | 27 | +Only xref:installation/requirements.adoc#deployment-requirements-software[Linux operating systems] are supported for Neo4j FIPS compatibility at this time. | 
| 25 | 28 | * Neo4j Enterprise 5.23.0 or later. | 
|  | 29 | +* Install and configure a non-native authentication provider, for example LDAP or SSO. See xref:authentication-authorization/index.adoc[]. | 
|  | 30 | +// * Follow the xref:security/checklist.adoc[] to ensure good security practices. | 
| 26 | 31 | 
 | 
| 27 | 32 | == Enable FIPS SSL Provider (Docker) | 
| 28 | 33 | 
 | 
| @@ -105,8 +110,6 @@ In general: | 
| 105 | 110 | 
 | 
| 106 | 111 | * A list of FIPS certified OpenSSL versions can be found at https://openssl-library.org/source/ | 
| 107 | 112 | * A FIPS provider must be installed into OpenSSL. | 
| 108 |  | -+ | 
| 109 |  | -See: https://github.com/openssl/openssl/blob/master/README-FIPS.md | 
| 110 | 113 | * OpenSSL must be configured to use the FIPS provider by default. | 
| 111 | 114 | + | 
| 112 | 115 | See: https://docs.openssl.org/master/man7/fips_module/ | 
| @@ -135,48 +138,134 @@ The location of the `lib` directory is different depending on the method used to | 
| 135 | 138 | + | 
| 136 | 139 | This location will be referred to as _<NEO4J_LIB>_. | 
| 137 | 140 | + | 
| 138 |  | -. BLAh | 
|  | 141 | +. Check which netty-tcnative libraries are available | 
| 139 | 142 | + | 
| 140 | 143 | [source, shell] | 
| 141 |  | -.Check which netty-tcnative libraries are available | 
| 142 | 144 | ---- | 
| 143 | 145 | ls -l <NEO4J_LIB>/netty-tcnative | 
| 144 | 146 | ---- | 
| 145 |  | -There should be | 
| 146 |  | - | 
| 147 |  | - | 
| 148 |  | -2. verify jar | 
| 149 |  | -3. copy jar to <neo4j_home>/lib | 
| 150 |  | - | 
| 151 |  | - | 
| 152 |  | - | 
| 153 |  | -<home>/lib/netty-tcnative | 
| 154 |  | -copy the jar matching OS and arch to <home>/lib/ | 
| 155 |  | -xref:configuration/file-locations.adoc#neo4j-lib[] | 
| 156 |  | - | 
| 157 |  | - | 
| 158 |  | -Finally, test the library by extracting the jar and using `ldd` to verify all its dependencies are met: | 
| 159 |  | -eg | 
|  | 147 | +There should be linux and fedora linux variants available, compiled for both x86_64 and arm64 architectures. | 
|  | 148 | +Select the one matching the local machine's operating system and architecture. | 
|  | 149 | ++ | 
|  | 150 | +. Verify the dependencies are correctly installed using https://www.man7.org/linux/man-pages/man1/ldd.1.html[`ldd`]: | 
|  | 151 | ++ | 
| 160 | 152 | [source, shell, subs="attributes"] | 
|  | 153 | +.Verify netty-tcnative dependencies are installed | 
| 161 | 154 | ---- | 
| 162 | 155 | unzip -d /tmp /usr/share/neo4j/lib/netty-tcnative/netty-tcnative-*-linux-$(arch).jar | 
| 163 | 156 | ldd /tmp/META-INF/native/libnetty_tcnative_linux_*.so | 
| 164 | 157 | rm -rf /tmp/META-INF | 
| 165 | 158 | ---- | 
| 166 |  | -The `ldd` command will show a list of `netty-tcnative` library dependencies and where they will be loaded from on the local machine. | 
| 167 |  | -If any dependencies are missing, they must be installed or Neo4j will fail to run. | 
|  | 159 | ++ | 
|  | 160 | +[source, shell, subs="attributes"] | 
|  | 161 | +.Verify fedora variant of netty-tcnative dependencies are installed | 
|  | 162 | +---- | 
|  | 163 | +unzip -d /tmp /usr/share/neo4j/lib/netty-tcnative/netty-tcnative-*-linux-$(arch)-fedora.jar | 
|  | 164 | +ldd /tmp/META-INF/native/libnetty_tcnative_linux_$(arch).so | 
|  | 165 | +rm -rf /tmp/META-INF | 
|  | 166 | +---- | 
|  | 167 | +The `ldd` command will show a list of library dependencies and where they will be loaded from on the local machine. | 
|  | 168 | +** If any dependencies are missing, they must be installed or Neo4j will fail to run. | 
|  | 169 | +** The `libssl.so` and `libcrypto.so` libraries listed must be the ones installed with OpenSSL in the previous steps. | 
|  | 170 | ++ | 
|  | 171 | +. Copy the verified jar to _<NEO4J_LIB>_. | 
|  | 172 | ++ | 
|  | 173 | +[NOTE] | 
|  | 174 | +==== | 
|  | 175 | +Only copy *one* of the jars, otherwise Neo4j will not be able to resolve dependencies at runtime. | 
|  | 176 | +The error, if this happens, will contain a message like: | 
|  | 177 | +[source] | 
|  | 178 | +---- | 
|  | 179 | +"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]". | 
|  | 180 | +---- | 
|  | 181 | +==== | 
| 168 | 182 | 
 | 
| 169 | 183 | 
 | 
| 170 | 184 | == Generate SSL certificate and private key | 
| 171 | 185 | 
 | 
| 172 |  | -Neo4j SSL encryption requires a | 
| 173 |  | -xref:security/ssl-framework.adoc#term-ssl-certificate[certificate] in the xref:security/ssl-framework.adoc#term-ssl-x509[X.509] standard, encoded in PEM format. | 
|  | 186 | +Neo4j SSL encryption requires a xref:security/ssl-framework.adoc#term-ssl-certificate[certificate] in the xref:security/ssl-framework.adoc#term-ssl-x509[X.509] standard, encoded in PEM format. | 
| 174 | 187 | and a private key in xref:security/ssl-framework.adoc#term-ssl-pkcs8[PKCS #8] format, also PEM encoded. | 
|  | 188 | +*For FIPS compatibility, the private key must be secured with a password*. | 
| 175 | 189 | 
 | 
| 176 |  | -For FIPS compatibility, the private key must also be secured with a passphrase. | 
|  | 190 | +Refer to the xref:security/ssl-framework.adoc#ssl-certificates[SSL certificate and key instructions] for more information. | 
| 177 | 191 | 
 | 
| 178 |  | -Refer to the xref:security/ssl-framework.adoc#ssl-certificates[SSL certificate and key instructions] for a detailed setup guide to creating the SSL certificate and key pair. | 
| 179 | 192 | 
 | 
| 180 | 193 | == Configure Neo4j to use SSL encryption | 
| 181 | 194 | 
 | 
| 182 |  | -xxx | 
|  | 195 | +// TODO | 
|  | 196 | + | 
|  | 197 | + | 
|  | 198 | +SSL configuration is described in detail at xref:security/ssl-framework.adoc#ssl-configuration[SSL framework configuration]. | 
|  | 199 | + | 
|  | 200 | +this section describes configuration that must be done *in addition to* standard non-FIPS compliant SSL configuration. | 
|  | 201 | + | 
|  | 202 | +connectors are bolt, https, cluster and backup. | 
|  | 203 | + | 
|  | 204 | +=== Bolt | 
|  | 205 | + | 
|  | 206 | +. Set `xref:configuration/configuration-settings.adoc#config_dbms.netty.ssl.provider[dbms.netty.ssl.provider]=OPENSSL` | 
|  | 207 | +. Set `xref:configuration/configuration-settings.adoc#config_server.bolt.tls_level[server.bolt.tls_level]=REQUIRED` | 
|  | 208 | +. Follow instructions to xref:security/ssl-framework.adoc#ssl-bolt-config[Configure SSL over bolt]. | 
|  | 209 | +. Set additional bolt configurations: | 
|  | 210 | ++ | 
|  | 211 | +[source, properties] | 
|  | 212 | +---- | 
|  | 213 | +dbms.ssl.policy.bolt.trust_all=false | 
|  | 214 | +dbms.ssl.policy.bolt.tls_level=REQUIRED | 
|  | 215 | +dbms.ssl.policy.bolt.tls_versions=TLSv1.2,TLSv1.3 | 
|  | 216 | +dbms.ssl.policy.bolt.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | 
|  | 217 | +---- | 
|  | 218 | +. 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. The password must NOT be set in plain text. | 
|  | 219 | + | 
|  | 220 | + | 
|  | 221 | +=== HTTPS | 
|  | 222 | + | 
|  | 223 | +This section is only applicable if HTTPS is enabled. | 
|  | 224 | + | 
|  | 225 | +. Follow instructions to xref:security/ssl-framework.adoc#ssl-https-config[Configure SSL over HTTPS]. | 
|  | 226 | ++ | 
|  | 227 | +. Set additional HTTPS configurations: | 
|  | 228 | ++ | 
|  | 229 | +[source, properties] | 
|  | 230 | +---- | 
|  | 231 | +dbms.ssl.policy.https.trust_all=false | 
|  | 232 | +dbms.ssl.policy.https.tls_level=REQUIRED | 
|  | 233 | +dbms.ssl.policy.https.tls_versions=TLSv1.2,TLSv1.3 | 
|  | 234 | +dbms.ssl.policy.https.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CCM,TLS_ECDHE_ECDSA_WITH_AES_128_CCM,TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8,TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | 
|  | 235 | +---- | 
|  | 236 | +. 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. | 
|  | 237 | + | 
|  | 238 | +=== Intra-cluster encryption | 
|  | 239 | + | 
|  | 240 | +For FIPS compatbility, intra-cluster encryption must be enabled if you are running a Neo4j cluster. | 
|  | 241 | + | 
|  | 242 | +. Follow instructions to xref:security/ssl-framework.adoc#ssl-cluster-config[configure SSL for intra-cluster communication]. | 
|  | 243 | +. Set additional cluster configurations: | 
|  | 244 | ++ | 
|  | 245 | +[source, properties] | 
|  | 246 | +---- | 
|  | 247 | +dbms.ssl.policy.cluster.enabled=true | 
|  | 248 | +dbms.ssl.policy.cluster.tls_level=REQUIRED | 
|  | 249 | +dbms.ssl.policy.cluster.client_auth=REQUIRED | 
|  | 250 | +dbms.ssl.policy.cluster.tls_versions=TLSv1.2,TLSv1.3 | 
|  | 251 | +dbms.ssl.policy.cluster.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | 
|  | 252 | +---- | 
|  | 253 | +. 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. The password must NOT be set in plain text. | 
|  | 254 | + | 
|  | 255 | + | 
|  | 256 | +=== Backup | 
|  | 257 | + | 
|  | 258 | +This section is applicable on instances or cluster members used for taking backups. | 
|  | 259 | + | 
|  | 260 | +. Follow instructions to xref:security/ssl-framework.adoc#ssl-backup-config[configure SSL for backup communication]. | 
|  | 261 | +. Set additional backup configurations: | 
|  | 262 | ++ | 
|  | 263 | +[source, properties] | 
|  | 264 | +---- | 
|  | 265 | +dbms.ssl.policy.backup.enabled=true | 
|  | 266 | +dbms.ssl.policy.backup.client_auth=REQUIRED | 
|  | 267 | +dbms.ssl.policy.backup.trust_all=false | 
|  | 268 | +dbms.ssl.policy.backup.tls_versions=TLSv1.2,TLSv1.3 | 
|  | 269 | +dbms.ssl.policy.backup.ciphers=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | 
|  | 270 | +---- | 
|  | 271 | +. 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. The password must NOT be set in plain text. | 
0 commit comments