Questo contenuto non è disponibile nella lingua selezionata.
Chapter 21. Setting user permissions for a Pacemaker cluster
You can grant permission for specific users other than user hacluster to manage a Pacemaker cluster. There are two sets of permissions that you can grant to individual users:
-
Permissions that allow individual users to manage the cluster through the Web UI and to run
pcscommands that connect to nodes over a network. Commands that connect to nodes over a network include commands to set up a cluster, or to add or remove nodes from a cluster. - Permissions for local users to allow read-only or read-write access to the cluster configuration. Commands that do not require connecting over a network include commands that edit the cluster configuration, such as those that create resources and configure constraints.
In situations where both sets of permissions have been assigned, the permissions for commands that connect over a network are applied first, and then permissions for editing the cluster configuration on the local node are applied. Most pcs commands do not require network access and in those cases the network permissions will not apply.
21.1. Setting permissions for node access over a network Copia collegamentoCollegamento copiato negli appunti!
To grant permission for specific users to manage the cluster through the Web UI and to run pcs commands that connect to nodes over a network, add those users to the group haclient. This must be done on every node in the cluster.
21.2. Setting local permissions using ACLs Copia collegamentoCollegamento copiato negli appunti!
You can use the pcs acl command to set permissions for local users to allow read-only or read-write access to the cluster configuration by using access control lists (ACLs).
By default, ACLs are not enabled. When ACLs are not enabled, any user who is a member of the group haclient on all nodes has full local read/write access to the cluster configuration while users who are not members of haclient have no access. When ACLs are enabled, however, even users who are members of the haclient group have access only to what has been granted to that user by the ACLs. The root and hacluster user accounts always have full access to the cluster configuration, even when ACLs are enabled.
Setting permissions for local users is a two step process:
-
Execute the
pcs acl role create…command to create a role which defines the permissions for that role. -
Assign the role you created to a user with the
pcs acl user createcommand. If you assign multiple roles to the same user, anydenypermission takes precedence, thenwrite, thenread.
Procedure
The following example procedure provides read-only access for a cluster configuration to a local user named rouser. Note that it is also possible to restrict access to certain portions of the configuration only.
It is important to perform this procedure as root or to save all of the configuration updates to a working file which you can then push to the active CIB when you are finished. Otherwise, you can lock yourself out of making any further changes. For information on saving configuration updates to a working file, see Saving a configuration change to a working file.
This procedure requires that the user
rouserexists on the local system and that the userrouseris a member of the grouphaclient.adduser rouser usermod -a -G haclient rouser
# adduser rouser # usermod -a -G haclient rouserCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable Pacemaker ACLs with the
pcs acl enablecommand.pcs acl enable
# pcs acl enableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a role named
read-onlywith read-only permissions for the cib.pcs acl role create read-only description="Read access to cluster" read xpath /cib
# pcs acl role create read-only description="Read access to cluster" read xpath /cibCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the user
rouserin the pcs ACL system and assign that user theread-onlyrole.pcs acl user create rouser read-only
# pcs acl user create rouser read-onlyCopy to Clipboard Copied! Toggle word wrap Toggle overflow View the current ACLs.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On each node where
rouserwill runpcscommands, log in asrouserand authenticate to the localpcsdservice. This is required in order to run certainpcscommands, such aspcs status, as the ACL user.pcs client local-auth
[rouser ~]$ pcs client local-authCopy to Clipboard Copied! Toggle word wrap Toggle overflow