This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Documentation and deployment scenario for cluster internal ssl #99
Open
eastlondoner
wants to merge
3
commits into
neo4j-contrib:master
Choose a base branch
from
eastlondoner:cluster-internal-ssl
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
deployment-scenarios/cluster-internal-ssl/cluster-internal-ssl-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cluster-internal-ssl-config | ||
data: | ||
NEO4J_unsupported_dbms_ssl_system_ignore__dot__files: "true" | ||
|
||
# Cluster ssl policy | ||
NEO4J_dbms_ssl_policy_cluster_enabled: "true" | ||
NEO4J_dbms_ssl_policy_cluster_client__auth: "REQUIRE" | ||
NEO4J_dbms_ssl_policy_cluster_verify__hostname: "true" | ||
|
||
# Fabric ssl policy | ||
NEO4J_dbms_ssl_policy_fabric_enabled: "true" | ||
NEO4J_dbms_ssl_policy_fabric_client__auth: "REQUIRE" | ||
NEO4J_dbms_ssl_policy_fabric_verify__hostname: "true" | ||
|
||
# Backup ssl policy | ||
NEO4J_dbms_ssl_policy_backup_enabled: "true" | ||
NEO4J_dbms_ssl_policy_backup_client__auth: "REQUIRE" | ||
NEO4J_dbms_ssl_policy_backup_verify__hostname: "false" |
102 changes: 102 additions & 0 deletions
102
deployment-scenarios/cluster-internal-ssl/cluster-internal-ssl-files.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
|
||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: cluster-internal-ssl-cert-and-key | ||
type: Opaque | ||
stringData: | ||
private.key: |- | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIEpAIBAAKCAQEAmE2+K+TO4WwFxeVdc72VOBTLHDt/anuHdgtgZpiXqhsvHlgj | ||
uiWfA7dYcQh4aRI8w0+aup9GfSsPfnpYWuXriVslRcV9NmpuUt+fHYyA4gZT6Unu | ||
dXZnr5W2knE2nAFer9u0X7AtVrwtEn6tdhjgfg4mKWbZyL9MKNMxxBuhU3GaetBH | ||
/YlrbovVEAUZededl7+/ePs8mHSOA/VnAXAoGqQ8kiQtQ8Z+3wwyZs2Gb6VFMcuf | ||
htMTxZJUFePa/YEaoSD5pUJJKVX45oAIkIGHtHoocwDV3ont/YsZB6Tj4G3N8bRu | ||
RD4bpg0By5rvurMPwowUt9lkHh/6PbZkyG6KIwIDAQABAoIBAQCHyskD2b2avvVm | ||
vFnWF/IzTlbJlULFbd4ZIYuR7ftLb3FTXMJ99Y0RgycXoLW6+Me0XAVY3ym57+qg | ||
mfStFtIqZVmWG77IBZzXxwnXDq7a10l5drFliWxo4NMnPkmyToZdxUXNCwdhjeWh | ||
19BQu11tBrB/uXPzyJveym5Uq03rVr6IqWCgetWHgvjC/M0y5avWGSjP2qzAc+Dk | ||
xZjQqWAlUIvTtp5egTXtk5SkhxTdgh64az2gkJqwHBQBBE3dyro0aCUGTD2RS9df | ||
6LeWhQmr0UoaCCl837lzh7FcOk/KhEvlRHwWgu1x6brxOZFdykt/Bt2r3IlLHvBB | ||
R51JcHgBAoGBAMZat/dMm1L+lyUNe+mSTnR9nY95lbTSuMJrfGspNNhtO1zVKM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adk07aYjF6jso8m7+MH0MFIO7d2q4r1gPIOR9ToEkcwg/VO | ||
8qMCtMm7TBpM7uyR9GoirZ4QPsvh3f2qDd0BH/i3/aHJFguo4L3SOHsiNB23GsQ/ | ||
Rqe5DqDbCr3osHoT8E4cDXUxdQO0rbAMsr79ME7oaJBFh0+reH1UI8LK7FWqm5pi | ||
atbTCMXzH650Zc4yNh+m0/lHmii8kKZXuNWZ0su1xA6jfVRViqB2yvLvB78NRUKH | ||
iq/a6qatJorvd6akaxAMupp18BUtLeyshEXkv2EoN3MFgBfl/jif | ||
-----END CERTIFICATE----- | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cluster-internal-ssl-trusted-certs | ||
data: | ||
#Add trusted public certificates as new keys to this configmap | ||
root.crt: |- | ||
-----BEGIN CERTIFICATE----- | ||
MIIDyTCCArGgAwIBAgIJANRHW99Q6S6EMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNV | ||
BAYTAkdCMQswCQYDVQQIDAJHQjEPMA0GA1UEBwwGTG9uZG9uMSEwHwYDVQQKDBhN | ||
eSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxEDAOBgNVBAsMB0RpZ2l0YWwxGTAXBgNV | ||
BAMMEG15X2NhX19yb290X2NlcnQwHhcNMjAwODIwMDkyNTA1WhcNMzAwODE4MDky | ||
NTA1WjB7MQswCQYDVQQGEwJHQjELMAkGA1UECAwCR0IxDzANBgNVBAcMBkxvbmRv | ||
bjEhMB8GA1UECgwYTXkgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRAwDgYDVQQLDAdE | ||
aWdpdGFsMRkwFwYDVQQDDBBteV9jYV9fcm9vdF9jZXJ0MIIBIjANBgkqhkiG9w0B | ||
AQEFAAOCAQ8AMIIBCgKCAQEA3hcl3lVYOoAb6B0ji0DRRfUD2bq/kJveT6V96B1p | ||
ItAeikaVDDrYm4w8mcg/rb/3ny5Sr5p71lBbQAygXDvOwQLon+BQuEfMPmUmmWPC | ||
IVQIQ3wHHmF2vs+oBGamDASlX8dLrm1BCPuiL4XtPOejomHdVucbGhtSUe3APRyz | ||
AGTjj/HiysEHWiTn5PnCSRduYjof9lraosolsW4NrnYiX2f5miC6DREqsnHgUivA | ||
Q/Q3q26fPXGxLIanIU6P1wDlGrm0C//FCNSLlYNlDRzDsW5NHClT1xI047edBsMF | ||
MwGM12cscIqupujcWwdIvApzjeAF7MpRfyQtBIyFR4ebewIDAQABo1AwTjAdBgNV | ||
HQ4EFgQU/6oW29HV8UxJMX7HfipHrhbfDHIwHwYDVR0jBBgwFoAU/6oW29HV8UxJ | ||
MX7HfipHrhbfDHIwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAPGfZ | ||
5/a4Y9/j4TMAqO7VRLNpt8YhIful54cI75srpBdG+AG/XD2uhDT/X5cJo/0c1ssZ | ||
JXzg4Ht5GTrs+LmxgksnLRelF2dd1yPS2aJWLenIrorFkMkf+p4440pXzWf/qMqO | ||
j9dpQsa588mw7+bFrujys/6OTu8ocSiO+EXq9H+D6HAtQMJ0SJpE0/RnAYJ3sxPu | ||
7Eb/AUdzjeIKlZBxsTsrtHEZAhgrJPSxhyYm7ZGyWaurhegiHpFSCrvbIK2IRiaH | ||
YfqOKWO4QP/JSQkldSs1PXNRtSqQ10k+XY+A5Tzy5yTzuCodtVmMLEovull5hg7h | ||
nGwJ+IlGC+Q0z94LUw== | ||
-----END CERTIFICATE----- | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cluster-internal-ssl-revoked-certs | ||
data: | ||
# Add revoked public certificates as new keys to this configmap e.g. `revoked1.crt: |- ...` |
86 changes: 86 additions & 0 deletions
86
deployment-scenarios/cluster-internal-ssl/cluster-internal-ssl.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
imageTag: "4.0.8-enterprise" | ||
|
||
core: | ||
configMap: "cluster-internal-ssl-config" | ||
additionalVolumes: | ||
- name: cluster-internal-cert-and-key | ||
secret: | ||
secretName: cluster-internal-ssl-cert-and-key | ||
- name: cluster-internal-revoked-certs | ||
configMap: | ||
name: cluster-internal-ssl-revoked-certs | ||
- name: cluster-internal-trusted-certs | ||
configMap: | ||
name: cluster-internal-ssl-trusted-certs | ||
additionalVolumeMounts: | ||
- name: cluster-internal-cert-and-key | ||
mountPath: /ssl/cluster | ||
readOnly: true | ||
- name: cluster-internal-revoked-certs | ||
mountPath: /ssl/cluster/revoked | ||
readOnly: true | ||
- name: cluster-internal-trusted-certs | ||
mountPath: /ssl/cluster/trusted | ||
readOnly: true | ||
- name: cluster-internal-cert-and-key | ||
mountPath: /ssl/fabric | ||
readOnly: true | ||
- name: cluster-internal-revoked-certs | ||
mountPath: /ssl/fabric/revoked | ||
readOnly: true | ||
- name: cluster-internal-trusted-certs | ||
mountPath: /ssl/fabric/trusted | ||
readOnly: true | ||
- name: cluster-internal-cert-and-key | ||
mountPath: /ssl/backup | ||
readOnly: true | ||
- name: cluster-internal-revoked-certs | ||
mountPath: /ssl/backup/revoked | ||
readOnly: true | ||
- name: cluster-internal-trusted-certs | ||
mountPath: /ssl/backup/trusted | ||
readOnly: true | ||
|
||
readReplica: | ||
configMap: "cluster-internal-ssl-config" | ||
additionalVolumes: | ||
- name: cluster-internal-cert-and-key | ||
secret: | ||
secretName: cluster-internal-ssl-cert-and-key | ||
- name: cluster-internal-revoked-certs | ||
configMap: | ||
name: cluster-internal-ssl-revoked-certs | ||
- name: cluster-internal-trusted-certs | ||
secret: | ||
secretName: cluster-internal-ssl-trusted-certs | ||
additionalVolumeMounts: | ||
- name: cluster-internal-cert-and-key | ||
mountPath: /ssl/cluster | ||
readOnly: true | ||
- name: cluster-internal-revoked-certs | ||
mountPath: /ssl/cluster/revoked | ||
readOnly: true | ||
- name: cluster-internal-trusted-certs | ||
mountPath: /ssl/cluster/trusted | ||
readOnly: true | ||
- name: cluster-internal-cert-and-key | ||
mountPath: /ssl/fabric | ||
readOnly: true | ||
- name: cluster-internal-revoked-certs | ||
mountPath: /ssl/fabric/revoked | ||
readOnly: true | ||
- name: cluster-internal-trusted-certs | ||
mountPath: /ssl/fabric/trusted | ||
readOnly: true | ||
- name: cluster-internal-cert-and-key | ||
mountPath: /ssl/backup | ||
readOnly: true | ||
- name: cluster-internal-revoked-certs | ||
mountPath: /ssl/backup/revoked | ||
readOnly: true | ||
- name: cluster-internal-trusted-certs | ||
mountPath: /ssl/backup/trusted | ||
readOnly: true | ||
|
||
acceptLicenseAgreement: "yes" | ||
neo4jPassword: mySecretPassword |
17 changes: 17 additions & 0 deletions
17
deployment-scenarios/cluster-internal-ssl/instructions.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
This directory contains quick instructions and an example of how to set up cluster internal ssl | ||
with Neo4j + Helm. | ||
|
||
Step 1: Create custom ConfigMap. | ||
|
||
kubectl apply -f deployment-scenarios/cluster-internal-ssl/cluster-internal-ssl-configmap.yaml | ||
|
||
Step 2: Create ssl certificate ConfigMaps and key Secret. | ||
|
||
This directory is populated with some example keys and certificates. You must use your own securely generated keys and certificates. | ||
|
||
However if you want to use the example credentials FOR TESTING PURPOSES ONLY then you can install them using you can install using: | ||
kubectl apply -f deployment-scenarios/cluster-internal-ssl/cluster-internal-ssl-files.yaml | ||
|
||
Step 3: Install a Neo4j cluster using the provided parameters. | ||
|
||
helm install cluster-internal-ssl-example -f deployment-scenarios/cluster-internal-ssl/cluster-internal-ssl.yaml . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does k8s do something funky with the volume mappings? Or why is this needed? I don't see any dotfiles in what you're mounting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, yes it does, K8s creates the directories for the configmaps/secrets in its own locations and symlinks to them. It stores metadata in dot files which gets included.
The main reason for the wizardry is that they can update the symlink for a whole directory atomically at runtime if the ConfigMap or Secret is changed - obviously that's not relevant to Neo4j but there's no way to turn it off in K8s.