Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 7. Securing Data Grid Connections
Secure client connections with authentication and encryption to prevent network intrusion and protect your data.
7.1. Configuring Authentication Link kopierenLink in die Zwischenablage kopiert!
Application users need credentials to access Data Grid clusters. You can use default, generated credentials or add your own.
7.1.1. Default Credentials Link kopierenLink in die Zwischenablage kopiert!
Data Grid Operator generates base64-encoded default credentials stored in an authentication secret named example-infinispan-generated-secret
| Username | Description |
|---|---|
|
| Default application user. |
|
| Internal user that interacts with Data Grid clusters. |
7.1.2. Retrieving Credentials Link kopierenLink in die Zwischenablage kopiert!
Get credentials from authentication secrets to access Data Grid clusters.
Procedure
Retrieve credentials from authentication secrets, as in the following example:
oc get secret example-infinispan-generated-secret
$ oc get secret example-infinispan-generated-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow Base64-decode credentials.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.3. Adding Custom Credentials Link kopierenLink in die Zwischenablage kopiert!
Configure access to Data Grid cluster endpoints with custom credentials.
Procedure
Create an
identities.yamlfile with the credentials that you want to add.credentials: - username: testuser password: testpassword - username: operator password: supersecretoperatorpassword
credentials: - username: testuser password: testpassword - username: operator password: supersecretoperatorpasswordCopy to Clipboard Copied! Toggle word wrap Toggle overflow Importantidentities.yamlmust include the operator user.Create an authentication secret from
identities.yaml.oc create secret generic --from-file=identities.yaml connect-secret
$ oc create secret generic --from-file=identities.yaml connect-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the authentication secret with
spec.security.endpointSecretNamein yourInfinispanCR and then apply the changes.spec: ... security: endpointSecretName: connect-secretspec: ... security: endpointSecretName: connect-secret1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specifies the name of the authentication secret that contains your credentials.
Modifying spec.security.endpointSecretName triggers a cluster restart. You can watch the Data Grid cluster as Data Grid Operator applies changes:
oc get pods -w
$ oc get pods -w
7.2. Configuring Encryption Link kopierenLink in die Zwischenablage kopiert!
Encrypt connections between clients and Data Grid nodes with Red Hat OpenShift service certificates or custom TLS certificates.
7.2.1. Encryption with Red Hat OpenShift Service Certificates Link kopierenLink in die Zwischenablage kopiert!
Data Grid Operator automatically generates TLS certificates that are signed by the Red Hat OpenShift service CA. Data Grid Operator then stores the certificates and keys in a secret so you can retrieve them and use with remote clients.
If the Red Hat OpenShift service CA is available, Data Grid Operator adds the following spec.security.endpointEncryption configuration to the Infinispan CR:
Service certificates use the internal DNS name of the Data Grid cluster as the common name (CN), for example:
Subject: CN = example-infinispan.mynamespace.svc
For this reason, service certificates can be fully trusted only inside OpenShift. If you want to encrypt connections with clients running outside OpenShift, you should use custom TLS certificates.
Service certificates are valid for one year and are automatically replaced before they expire.
7.2.2. Retrieving TLS Certificates Link kopierenLink in die Zwischenablage kopiert!
Get TLS certificates from encryption secrets to create client trust stores.
-
Retrieve
tls.crtfrom encryption secrets as follows:
oc get secret example-infinispan-cert-secret \
-o jsonpath='{.data.tls\.crt}' | base64 --decode > tls.crt
$ oc get secret example-infinispan-cert-secret \
-o jsonpath='{.data.tls\.crt}' | base64 --decode > tls.crt
7.2.3. Disabling Encryption Link kopierenLink in die Zwischenablage kopiert!
You can disable encryption so clients do not need TLS certificates to establish connections with Data Grid.
Data Grid does not recommend disabling encryption in production environments where endpoints are exposed outside the OpenShift cluster via spec.expose.type.
Procedure
Set
Noneas the value for thespec.security.endpointEncryption.typefield in yourInfinispanCR and then apply the changes.spec: ... security: endpointEncryption: type: Nonespec: ... security: endpointEncryption: type: None1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Disables encryption for Data Grid endpoints.
7.2.4. Using Custom TLS Certificates Link kopierenLink in die Zwischenablage kopiert!
Use custom PKCS12 keystore or TLS certificate/key pairs to encrypt connections between clients and Data Grid clusters.
Prerequisites
- Create either a keystore or certificate secret. See:
- Certificate Secrets
- Keystore Secrets
Procedure
Add the encryption secret to your OpenShift namespace, for example:
oc apply -f tls_secret.yaml
$ oc apply -f tls_secret.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the encryption secret with
spec.security.endpointEncryptionin yourInfinispanCR and then apply the changes.Copy to Clipboard Copied! Toggle word wrap Toggle overflow