Skip to content

Commit 8130ff3

Browse files
committed
apply suggestions from review
1 parent df84034 commit 8130ff3

File tree

1 file changed

+67
-46
lines changed

1 file changed

+67
-46
lines changed

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

Lines changed: 67 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ You can identify them by the line `-----BEGIN RSA PRIVATE KEY-----` at the begin
180180
While Neo4j 5.0 can load and use those keys, they are considered deprecated and will be removed in a future version.
181181
====
182182
183-
183+
[[ssl-validate-certs]]
184184
=== Validate the key and the certificate
185185
186186
If you need, you can validate the key file and the certificate as follows:
@@ -655,22 +655,23 @@ openssl s_client -connect my_domain.com:7473
655655
Intra-cluster encryption is the security solution for the cluster communication.
656656
The Neo4j cluster communicates on 3 ports:
657657
658-
* 6000 - Transactions
659-
* 7000 - Raft communications
660-
* 7688 - Server side routing
658+
* `6000` - Transactions
659+
* `7000` - Raft communications
660+
* `7688` - Server side routing
661+
662+
To configure SSL for intra-cluster communication, create the folder structure and place the key and certificate files under it.
663+
Then, configure the SSL cluster policies in the _neo4j.conf_ file and test that the intra-cluster communication is encrypted.
661664
662-
To set up intra-cluster encryption, on each server create the folder structure and place the key file and the certificates under those.
663-
Then, you need to configure the SSL cluster policies in the _neo4j.conf_ file and test that the intra-cluster communication is encrypted.
665+
==== Set up SSL certificates for intra-cluster communications
664666
665-
. Set up the _cluster_ folder under _certificates_.
666-
.. Create a directory _cluster_ under_<NEO4J_HOME>/certificates_ folder:
667+
. Create a directory _cluster_ under _<NEO4J_HOME>/certificates_ folder:
667668
+
668669
[source, shell]
669670
----
670671
mkdir certificates/cluster
671672
----
672673
673-
.. Create a directory _trusted_ and _revoked_ under _<NEO4J_HOME>/certificates/cluster_ folder:
674+
. Create a directory _trusted_ and _revoked_ under _<NEO4J_HOME>/certificates/cluster_ folder:
674675
+
675676
[source, shell]
676677
----
@@ -703,9 +704,11 @@ Thus, the servers are able to establish trust relationships with each other.
703704
----
704705
cp /path/to/certs/public.crt certificates/cluster/revoked
705706
----
706-
+
707+
708+
==== Verify the folder structure and permissions
709+
707710
The folder structure should look like this with the right file permissions and the groups and ownerships:
708-
+
711+
709712
[options="header", cols="3,1,4*m"]
710713
|===
711714
| Path
@@ -757,21 +760,22 @@ The folder structure should look like this with the right file permissions and t
757760
| 0755
758761
| drwxr-xr-x
759762
|===
760-
+
763+
761764
[TIP]
762765
====
763766
The owner/group should be configured to the user/group that will be running the `neo4j` service.
764767
Default user/group is neo4j/neo4j.
765768
====
766769
767-
. Set the cluster SSL configuration in _neo4j.conf_.
768-
.. Set the cluster SSL policy to `true`:
770+
==== Set the cluster SSL configuration in _neo4j.conf_
771+
772+
. Set the cluster SSL policy to `true`:
769773
+
770774
[source, properties]
771775
----
772776
dbms.ssl.policy.cluster.enabled=true
773777
----
774-
.. Set the appropriate certificates path and the right key and cert files:
778+
. Set the appropriate certificates path and the right key and cert files:
775779
+
776780
[source, properties]
777781
----
@@ -785,7 +789,7 @@ dbms.ssl.policy.cluster.public_certificate=public.crt
785789
If the certificate is a different path outside of NEO4J_HOME, then set the absolute path for the certificates directory.
786790
====
787791
788-
.. Set the cluster client authentication to `REQUIRE` to enable the mutual authentication, which means that both ends of a channel have to authenticate:
792+
. Set the cluster client authentication to `REQUIRE` to enable the mutual authentication, which means that both ends of a channel have to authenticate:
789793
+
790794
[source, properties]
791795
----
@@ -799,14 +803,16 @@ The actual xref:security/ssl-framework.adoc#term-ssl-cryptographic-objects[crypt
799803
The trusted CA certificate will be shared however.
800804
====
801805
802-
.. Verify that the intra-cluster communication is encrypted.
806+
==== Verify that the intra-cluster communication is encrypted
807+
808+
Once the intra-cluster encryption is enabled, you can verify that the communication is encrypted.
803809
You may use an external tooling, such as Nmap (https://nmap.org/download.html):
804-
+
810+
805811
[source, shell]
806812
----
807813
nmap --script ssl-enum-ciphers -p <port> <hostname>
808814
----
809-
+
815+
810816
[NOTE]
811817
====
812818
The hostname and port have to be adjusted according to your configuration.
@@ -823,24 +829,28 @@ For more details on securing the comunication between the cluster servers, see x
823829
[[ssl-backup-config]]
824830
=== Configure SSL for backup communication
825831
826-
In a single instance, by default the backup communication happens on port `6362`.
827-
In a cluster topology, it is possible to take a backup from any server, and each server has two configurable ports capable of serving a backup.
828-
These ports are configured by `dbms.backup.listen.address` (port `6362`) and `server.cluster.listen_address` (port `6000`) respectively.
829-
If the intra-cluster encryption is enabled and the backup communication is using port `6000`, then your communication channels are already encrypted.
830-
The following steps assumes that your backup is set up on a different port.
832+
In a single instance, the backup communication happens on port `6362` by default. +
833+
In a cluster topology, it is possible to take a backup from any server, and each server has two configurable ports capable of serving a backup:
831834
832-
To set up SSL for backup communication, create the folder structure and place the key file and the certificates under those.
833-
Then, you need to configure the SSL backup policies in the _neo4j.conf_ file.
835+
* `dbms.backup.listen.address` (port `6362`)
836+
* `server.cluster.listen_address` (port `6000`)
834837
835-
. Set up the _backup_ folder under _certificates_.
836-
.. Create a directory _backup_ under _<NEO4J_HOME>/certificates_ folder:
838+
If the <<ssl-cluster-config, intra-cluster encryption>> is enabled and the backup communication uses port `6000`, then the communication channels are already encrypted.
839+
The following steps assume that your backup is set up on a different port.
840+
841+
==== Set up SSL certificates for backup
842+
843+
Create the folder structure and place the key and certificate files under it.
844+
Then, configure the SSL backup policies in the _neo4j.conf_ file.
845+
846+
. Create a directory _backup_ under _<NEO4J_HOME>/certificates_ folder:
837847
+
838848
[source, shell]
839849
----
840850
mkdir certificates/backup
841851
----
842852
843-
.. Create a directory _trusted_ and _revoked_ under _<NEO4J_HOME>/certificates/backup_ folder:
853+
. Create a directory _trusted_ and _revoked_ under _<NEO4J_HOME>/certificates/backup_ folder:
844854
+
845855
[source, shell]
846856
----
@@ -867,9 +877,11 @@ cp /path/to/certs/public.crt certificates/backup/trusted
867877
----
868878
cp /path/to/certs/public.crt certificates/backup/revoked
869879
----
870-
+
871-
The folder structure should look like this with the right file permissions and the groups and ownerships:
872-
+
880+
881+
==== Verify the backup folder structure and permissions
882+
883+
The folder structure should look like this with the right file permissions and the groups and ownerships, assuming the `neo4j` user runs the service:
884+
873885
[options="header", cols="3,1,4*m"]
874886
|===
875887
| Path
@@ -921,21 +933,22 @@ The folder structure should look like this with the right file permissions and t
921933
| 0755
922934
| drwxr-xr-x
923935
|===
924-
+
936+
925937
[TIP]
926938
====
927939
The owner/group should be configured to the user/group that will be running the `neo4j` service.
928940
Default user/group is neo4j/neo4j.
929941
====
930942
931-
. Set the backup SSL configuration in the _neo4j.conf_ file.
932-
.. Set the backup SSL policy to `true`:
943+
==== Set the backup SSL configuration in the _neo4j.conf_ file.
944+
945+
. Set the backup SSL policy to `true`:
933946
+
934947
[source, properties]
935948
----
936949
dbms.ssl.policy.backup.enabled=true
937950
----
938-
.. Set the appropriate certificates path and the right key and cert files:
951+
. Set the appropriate certificates path and the right key and cert files:
939952
+
940953
[source, properties]
941954
----
@@ -949,7 +962,7 @@ dbms.ssl.policy.backup.public_certificate=public.crt
949962
If the certificate is a different path outside of NEO4J_HOME, then set the absolute path for the certificates directory.
950963
====
951964
952-
.. Set the backup client authentication to `REQUIRE` to enable the mutual authentication, which means that both ends of a channel have to authenticate:
965+
. Set the backup client authentication to `REQUIRE` to enable the mutual authentication, which means that both ends of a channel have to authenticate:
953966
+
954967
[source, properties]
955968
----
@@ -958,27 +971,35 @@ dbms.ssl.policy.backup.client_auth=REQUIRE
958971
959972
=== Configure the backup client for SSL
960973
961-
When using `neo4j-admin backup` command, you need to specify the SSL policy to be used by the backup client.
962-
You can do this by setting a matching SSL configuration in the _neo4j.conf_ and _neo4j-admin.conf_ files.
963-
This is crucial for the backup to work properly.
974+
When using `neo4j-admin backup` command, the backup client needs to be configured to use SSL as well.
975+
Regardless of which backup port you are targeting (see <<ssl-backup-config>>), the backup client uses the SSL policy specified in `dbms.ssl.policy.backup.*`, given the same SSL policy name matches between server and client.
976+
977+
[NOTE]
978+
====
979+
If the backup client is on a different machine from the Neo4j server, you must install sympathetic SSL certificates and keys on the backup client machine as well, so that the backup client can authenticate the server and vice versa.
980+
If you want mutual TLS with self-signed certificates, the server must have the client's certificate in its _trusted_dir_, and the client must have the server's certificate in its _trusted_dir_.
981+
If you use a certificate authority (CA) to signs both the client's and server's certificates, the _trusted_dir_ must contain only the CA or intermediate certificates.
982+
983+
Furthermore, Neo4j does not validate the certificates.
984+
It is your responsibility to ensure that the certificates are valid.
985+
See <<ssl-certificates>> for details.
986+
====
987+
988+
Configure the SSL backup policies in the _neo4j-admin.conf_ file on the backup client machine.
989+
964990
For example, if you have set up the backup SSL policy described in section <<ssl-backup-config>>, then you need to set the following in the _neo4j-admin.conf_ file:
965991
966992
[source, properties]
967993
----
968994
dbms.ssl.policy.backup.enabled=true
969-
dbms.ssl.policy.backup.base_directory=/path/to/certificates/backup
995+
dbms.ssl.policy.backup.base_directory=certificates/backup
970996
dbms.ssl.policy.backup.private_key=private.key
971997
dbms.ssl.policy.backup.public_certificate=public.crt
972998
dbms.ssl.policy.backup.client_auth=REQUIRE
973999
dbms.ssl.policy.backup.tls_versions=TLSv1.2,TLSv1.3
9741000
dbms.ssl.policy.backup.ciphers=TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
9751001
----
9761002
977-
[NOTE]
978-
====
979-
Keep in mind that if the backup client is on a different machine from the Neo4j server, you must install the same SSL certs and keys on the backup client machine as well, so that the backup client can authenticate the server and vice versa.
980-
====
981-
9821003
[[ssl-other-configs]]
9831004
=== Other configurations for SSL
9841005

0 commit comments

Comments
 (0)