Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to SUSE Linux Enterprise High Availability Extension 11 SP4

10 Access Control Lists

The cluster administration tools like crm shell (crmsh), Hawk or the Pacemaker GUI can be used by root or any user in the group haclient. By default, these users have full read/write access. To limit access or assign more fine-grained access rights, you can use Access control lists (ACLs).

Access control lists consist of an ordered set of access rules. Each rule allows read or write access or denies access to a part of the cluster configuration. Rules are typically combined to produce a specific role, then users may be assigned to a role that matches their tasks.

Note
Note: CIB Syntax Validation Version and ACL Differences

This ACL documentation only applies if your CIB is validated with the CIB syntax version pacemaker-2.0 or higher. For details on how to check this and upgrade the CIB version, see Note: Upgrading the CIB Syntax Version.

If you have upgraded from SUSE Linux Enterprise High Availability Extension 11 SP3 and kept your former CIB version, refer to the Access Control List chapter in the High Availability Guide for SUSE Linux Enterprise High Availability Extension 11 SP3. It is available from http://documentation.suse.com/.

10.1 Requirements and Prerequisites

Before you start using ACLs on your cluster, make sure the following conditions are fulfilled:

  • Ensure you have the same users on all nodes in your cluster, either by using NIS, Active Directory, or by manually adding the same users to all nodes.

  • All users for whom you want to modify access rights with ACLs must belong to the haclient group.

  • All users need to run crmsh by its absolute path /usr/sbin/crm.

  • If non-privileged users want to run crmsh, their PATH variable needs to be extended with /usr/sbin.

Important
Important: Default Access Rights
  • ACLs are an optional feature. By default, use of ACLs is disabled.

  • If ACLs are not enabled, root and all users belonging to the haclient group have full read/write access to the cluster configuration.

  • Even if ACLs are enabled and configured, both root and the default CRM owner hacluster always have full access to the cluster configuration.

To use ACLs you need some knowledge about XPath. XPath is a language for selecting nodes in an XML document. Refer to http://en.wikipedia.org/wiki/XPath or look into the specification at http://www.w3.org/TR/xpath/.

10.2 Enabling Use of ACLs In Your Cluster

Before you can start configuring ACLs, you need to enable use of ACLs. To do so, use the following command in the crmsh:

root # crm configure property enable-acl=true

Alternatively, use Hawk as described in Procedure 10.1, “Enabling Use of ACLs with Hawk”.

Procedure 10.1: Enabling Use of ACLs with Hawk
  1. Start a Web browser and log in to the cluster as described in Section 5.1.1, “Starting Hawk and Logging In”.

  2. In the left navigation bar, select Cluster Properties.

  3. In the CRM Configuration group, select the enable-acl attribute from the empty drop-down box and click the plus icon to add it.

  4. To set enable-acl=true, activate the check box next to enable-acl and confirm your changes.

10.3 The Basics of ACLs

Access control lists consist of an ordered set of access rules. Each rule allows read or write access or denies access to a part of the cluster configuration. Rules are typically combined to produce a specific role, then users may be assigned to a role that matches their tasks. An ACL role is a set of rules which describe access rights to CIB. A rule consists of the following:

  • an access right like read, write, or deny

  • a specification where to apply the rule. This specification can be a type, an ID reference, or an XPath expression.

Usually, it is convenient to bundle ACLs into roles and assign a specific role to system users (ACL targets). There are two methods to create ACL rules:

10.3.1 Setting ACL Rules via XPath Expressions

To manage ACL rules via XPath, you need to know the structure of the underlying XML. Retrieve the structure with the following command that shows your cluster configuration in XML (see Example 10.1):

root # crm configure show xml
Example 10.1: Excerpt of a Cluster Configuration in XML
<num_updates="59"
      dc-uuid="175704363"
      crm_feature_set="3.0.9"
      validate-with="pacemaker-2.0"
      epoch="96"
      admin_epoch="0"
      cib-last-written="Fri Aug  8 13:47:28 2014"
      have-quorum="1">
  <configuration>
    <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
        <nvpair name="stonith-enabled" value="true" id="cib-bootstrap-options-stonith-enabled"/>
        <nvpair name="no-quorum-policy" value="ignore" id="cib-bootstrap-options-no-quorum-policy"/>
         [...]
      </cluster_property_set>
    </crm_config>
    <nodes>
      <node id="175704363" uname="alice"/>
      <node id="175704619" uname="bob"/>
    </nodes>
    <resources> [...]  </resources>
    <constraints/>
    <rsc_defaults> [...] </rsc_defaults>
    <op_defaults> [...] </op_defaults>
  <configuration>
</cib>

With the XPath language you can locate nodes in this XML document. For example, to select the root node (cib) use the XPath expression /cib. To locate the global cluster configurations, use the XPath expression /cib/configuration/crm_config.

As an example, Table 10.1, “Operator Role—Access Types and XPath Expressions” shows the parameters (access type and XPath expression) to create an operator role. Users with this role can only execute the tasks mentioned in the second column—they cannot reconfigure any resources (for example, change parameters or operations), nor change the configuration of colocation or ordering constraints.

Table 10.1: Operator Role—Access Types and XPath Expressions

Type

XPath/Explanation

Write

//crm_config//nvpair[@name='maintenance-mode']

Turn cluster maintenance mode on or off.

Write

//op_defaults//nvpair[@name='record-pending']

Choose whether pending operations are recorded.

Write

//nodes/node//nvpair[@name='standby']

Set node in online or standby mode.

Write

//resources//nvpair[@name='target-role']

Start, stop, promote or demote any resource.

Write

//resources//nvpair[@name='maintenance']

Select if a resource should be put to maintenance mode or not.

Write

//constraints/rsc_location

Migrate/move resources from one node to another.

Read

/cib

View the status of the cluster.

10.3.2 Setting ACL Rules via Abbreviations

For users who do not want to deal with the XML structure there is an easier method.

For example, consider the following XPath:

//*[@id="rsc1"]

which locates all the XML nodes with the ID rsc1.

The abbreviated syntax is written like this:

ref:"rsc1"

This also works for constraints. Here is the verbose XPath:

//constraints/rsc_location

The abbreviated syntax is written like this:

type:"rsc_location"

The abbreviated syntax can be used in crmsh and Hawk. The CIB daemon knows how to apply the ACL rules to the matching objects.

10.4 Configuring ACLs with the Pacemaker GUI

The following procedure shows how to configure a read-only access to the cluster configuration by defining a monitor role and assigning it to a user. Alternatively, you can use Hawk or crmsh to do so, as described in Section 10.5, “Configuring ACLs with Hawk” and Procedure 10.4, “Adding a Monitor Role and Assigning a User with crmsh”.

Procedure 10.2: Adding a Monitor Role and Assigning a User with the Pacemaker GUI
  1. Start the Pacemaker GUI and log in as described in Section 6.1.1, “Logging in to a Cluster”.

  2. Click the ACLs entry in the Configuration tree.

  3. Click Add. A dialog box appears. Choose between ACL Target and ACL Role.

  4. To define your ACL role(s):

    1. Choose ACL Role. A window opens in which you add your configuration options.

    2. Add a unique identifier in the ID textfield, for example monitor.

    3. Click Add and choose the rights (Read, Write, or Deny). In our example, select Read.

    4. Enter the XPath expression /cib in the Xpath textfield. Proceed with Ok.

      Sidenote: If you have resources or constraints, you can also use the abbreviated syntax as explained in Section 10.3.2, “Setting ACL Rules via Abbreviations”.

    5. If you have other conditions, repeat the steps (Step 4.c and Step 4.d). In our example, this is not the case so your role is finished and you can close the window with Ok.

  5. Assign your role to a user:

    1. Click the Add button. A dialog box appears to choose between ACL Target and ACL Role.

    2. Choose ACL Target. A window opens in which you add your configuration options.

    3. Enter the username in the ID textfield. Make sure this user belongs to the haclient group.

    4. Click and use the role name specified in Step 4.b.

10.5 Configuring ACLs with Hawk

The following procedure shows how to configure a read-only access to the cluster configuration by defining a monitor role and assigning it to a user. Alternatively, you can use crmsh to do so, as described in Procedure 10.4, “Adding a Monitor Role and Assigning a User with crmsh”.

Procedure 10.3: Adding a Monitor Role and Assigning a User with Hawk
  1. Start a Web browser and log in to the cluster as described in Section 5.1.1, “Starting Hawk and Logging In”.

  2. In the left navigation bar, select Access Control Lists. The view shows the Roles and Users that are already defined.

  3. To define your ACL role(s):

    1. Select the Roles category and click the plus icon.

    2. Enter a unique Role ID, for example, monitor.

    3. For our example of defining a monitor role, select read from the Right drop-down box.

    4. In the Xpath text box, enter the Xpath expression /cib and click Create Role.

      This creates a new role with name monitor, sets the read rights and applies it to all elements in the CIB by using the XPath expression/cib.

    5. If necessary, you can add more access rights and XPath arguments by clicking the plus icon and specifying the respective parameters. Confirm your changes.

  4. Assign the role to a user:

    1. Select the Users category and click the plus icon.

      The Create User view shows the available roles. It also contains an additional line for configuring individual ACL rules for that user. The view lets you either assign one or multiple roles to the user or define one or more individual rules for the user. Selecting a role will make the line for individual rules disappear and vice versa. Assigning a role plus individual rules is not possible.

    2. Enter a unique User ID, for example, tux. Make sure this user belongs to the haclient group.

    3. To assign a role to the user, select the respective entries from Roles. In our example, select the monitor role you have created.

      To deselect one or multiple roles, click the respective entries once more. If no role is selected, the line for defining individual rules will appear again.

      Hawk—Assigning a Role or Rule to a User
      Figure 10.1: Hawk—Assigning a Role or Rule to a User
    4. If you want to define individual rules instead, select a Right and enter the respective Xpath parameters for your rule. Click the plus icon to define additional rules.

    5. Confirm your choice and assign the roles or rules to the user by clicking Create User.

To configure access rights for resources or constraints, you can also use the abbreviated syntax as explained in Section 10.3.2, “Setting ACL Rules via Abbreviations”.

10.6 Configuring ACLs with crmsh

The following procedure shows how to configure a read-only access to the cluster configuration by defining a monitor role and assigning it to a user.

Procedure 10.4: Adding a Monitor Role and Assigning a User with crmsh
  1. Log in as root.

  2. Start the interactive mode of crmsh:

    root # crm configure
    crm(live)configure# 
  3. Define your ACL role(s):

    1. Use the role command to define a new role:

      crm(live)configure# role monitor read xpath:"/cib"

      The previous command creates a new role with the name monitor, sets the read rights and applies it to all elements in the CIB by using the XPath expression /cib. If necessary, you can add more access rights and XPath arguments.

    2. Add additional roles as needed.

  4. Assign your roles to one or multiple ACL targets, which are the corresponding system users. Make sure they belong to the haclient group.

    crm(live)configure# acl_target tux monitor
  5. Check your changes:

    crm(live)configure# show
  6. Commit your changes:

    crm(live)configure# commit

To configure access rights for resources or constraints, you can also use the abbreviated syntax as explained in Section 10.3.2, “Setting ACL Rules via Abbreviations”.

Print this page