You can use Operator to configure client authentication and client authorization.
Simple authentication
You can enable Hazelcast simple authentication with minimal changes to the original configuration.
To enable simple authentication:
-
Remove
security.enabled. -
Convert kebab case to camel case:
-
client-authentication→clientAuthentication -
client-permissions→clientPermissions
-
-
Add a
permissionsnode toclientPermissionsto wrap permissions other thanall.
For example:
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast
spec:
security:
operatorClientSecretName: user1-secret
realms:
- name: simpleRealm-clients
authentication:
simple:
users:
- secretName: user1-secret
roles:
- admin
- secretName: user2-secret
roles:
- monitor
- application
clientAuthentication:
realm: simpleRealm-clients
clientPermissions:
all:
principal: admin
endpoints:
- 127.0.0.1
permissions:
map:
- name: playground
actions:
- all
- name: accounts
principal: monitor
actions:
- read
- name: accounts
principal: application
endpoints:
- 192.168.1.*
- 192.168.2.*
actions:
- create
- destroy
- put
- read
- remove
- lock
operatorClientSecretName is a mandatory field required for Operator to establish a connection with the Hazelcast cluster. The given user in the operatorClientSecretName field must have a role that has all the client permissions. Otherwise, Operator will fail with a validation error.
|
Configure Management Center
Because Management Center serves as a client of the Hazelcast cluster, it must be properly configured to connect to the cluster. The security.clientSecretName field in the hazelcastClusters section is used for this configuration.
apiVersion: hazelcast.com/v1alpha1
kind: ManagementCenter
metadata:
name: managementcenter-sample
spec:
repository: 'hazelcast/management-center'
version: '5.9.0'
hazelcastClusters:
- address: hazelcast-sample
name: dev
security:
clientSecretName: user1-secret
The given user in the ClientSecretName field must have a role that has all the client permissions. Otherwise, Operator will fail with a validation error.
|