Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Configuring authentication and authorization
Control access to Data Grid clusters by adding credentials and assigning roles with different permissions.
3.1. Default credentials Copiar o linkLink copiado para a área de transferência!
Data Grid adds default credentials in a <helm_release_name>-generated-secret secret.
| Username | Description |
|---|---|
|
|
User that has the |
|
|
Internal user that has the |
3.1.1. Retrieving credentials Copiar o linkLink copiado para a área de transferência!
Get Data Grid credentials from authentication secrets.
Prerequisites
- Install the Data Grid Helm chart.
-
Have an
occlient.
Procedure
Retrieve default credentials from the
<helm_release_name>-generated-secretor custom credentials from another secret with the following command:oc get secret <helm_release_name>-generated-secret \ -o jsonpath="{.data.identities-batch}" | base64 --decode$ oc get secret <helm_release_name>-generated-secret \ -o jsonpath="{.data.identities-batch}" | base64 --decodeCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Adding custom user credentials or credentials store Copiar o linkLink copiado para a área de transferência!
Create Data Grid user credentials and assign roles that grant security authorization for cluster access.
Procedure
Create credentials by specifying the
user createcommand in thedeploy.security.batchfield.User with implicit authorization
deploy: security: batch: 'user create admin -p changeme'deploy: security: batch: 'user create admin -p changeme'Copy to Clipboard Copied! Toggle word wrap Toggle overflow User with a specific role
deploy: security: batch: 'user create personone -p changeme -g deployer'deploy: security: batch: 'user create personone -p changeme -g deployer'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2.1. User roles and permissions Copiar o linkLink copiado para a área de transferência!
Data Grid uses role-based access control to authorize users for access to cluster resources and data. For additional security, you should grant Data Grid users with appropriate roles when you add credentials.
| Role | Permissions | Description |
|---|---|---|
|
| ALL | Superuser with all permissions including control of the Cache Manager lifecycle. |
|
| ALL_READ, ALL_WRITE, LISTEN, EXEC, MONITOR, CREATE |
Can create and delete Data Grid resources in addition to |
|
| ALL_READ, ALL_WRITE, LISTEN, EXEC, MONITOR |
Has read and write access to Data Grid resources in addition to |
|
| ALL_READ, MONITOR |
Has read access to Data Grid resources in addition to |
|
| MONITOR | Can view statistics for Data Grid clusters. |
3.2.2. Adding credentials store Copiar o linkLink copiado para a área de transferência!
Create Data Grid credentials store to avoid exposing passwords in clear text in the server configuration ConfigMap. See Section 4.1, “Enabling TLS encryption” for a use case.
Procedure
Create credentials store by specifying a
credentials addcommand in thedeploy.security.batchfield.Add a password to a store
deploy: security: batch: 'credentials add keystore -c password -p secret --path="credentials.pfx"'deploy: security: batch: 'credentials add keystore -c password -p secret --path="credentials.pfx"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Credentials store needs then to be added to the server configuration.
Configure a credential store
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2.3. Adding multiple credentials with authentication secrets Copiar o linkLink copiado para a área de transferência!
Add multiple credentials to Data Grid clusters with authentication secrets.
Prerequisites
-
Have an
occlient.
Procedure
Create an
identities-batchfile that contains the commands to add your credentials.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an authentication secret from your
identities-batchfile.oc apply -f identities-batch.yaml
$ oc apply -f identities-batch.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the authentication secret in the
deploy.security.SecretNamefield.deploy: security: authentication: true secretName: 'connect-secret'deploy: security: authentication: true secretName: 'connect-secret'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Install or upgrade your Data Grid Helm release.
3.3. Disabling authentication Copiar o linkLink copiado para a área de transferência!
Allow users to access Data Grid clusters and manipulate data without providing credentials.
Do not disable authentication if endpoints are accessible from outside the OpenShift cluster. You should disable authentication for development environments only.
Procedure
-
Remove the
propertiesRealmfields from the "default" security realm. - Install or upgrade your Data Grid Helm release.
3.4. Disabling security authorization Copiar o linkLink copiado para a área de transferência!
Allow Data Grid users to perform any operation regardless of their role.
Procedure
Set
nullas the value for thedeploy.infinispan.cacheContainer.securityfield.TipUse the
--set deploy.infinispan.cacheContainer.security=nullargument with thehelmclient.- Install or upgrade your Data Grid Helm release.