Product Documentation

Configuring Users, User Groups, and Command Policies

Oct 06, 2016

You must define your users by configuring accounts for them. To simplify the management of user accounts, you can organize them into groups. You can create command policies, or use built-in command policies, to regulate user access to commands.

You can also customize the command-line prompt for a user. Prompts can be defined in a user’s configuration, in a user-group configuration, and in the global system configuration settings. The prompt displayed for a given user is determined by the following order of precedence:

  1. Display the prompt as defined in the user's configuration.
  2. Display the prompt as defined in the group configuration for the user’s group.
  3. Display the prompt as defined in the system global configuration settings.

You can now specify a timeout value for inactive CLI sessions for a system user. If a user's CLI session is idle for a time that exceeds the timeout value, the NetScaler appliance terminates the connection. The timeout can be defined in a user’s configuration, in a user-group configuration, and in the global system configuration settings. The timeout for inactive CLI sessions for a user is determined by the following order of precedence:

  1. Timeout value as defined in the user's configuration.
  2. Timeout  value as defined in the group configuration for the user’s group.
  3. Timeout value as defined in the global system configuration settings.

A NetScaler root administrator can configure the maximum concurrent session limit for system users. By restricting the limit, you can reduce the number of open connections and improve server performance. As long as the CLI count is within the configured limit, concurrent users can log on the configuration utility any number of times. However, if the number of CLI sessions reaches the configured limit, users can no longer log on to the configuration utility. For example, if the number of concurrent session is configured to 20, concurrent users can log on to 19 CLI sessions. But if the user is logged on to the 20th CLI session, any attempt to log on to the configuration utility, CLI or NITRO results in an error message ((ERROR: Connection limit to CFE exceeded).

Note: The default the number of concurrent sessions is configured to 20 and the maximum number of concurrent sessions is configured to 40.

This document includes the following details:

Configuring User Accounts

Updated: 2014-08-07

To configure user accounts, you simply specify user names and passwords. You can change passwords and remove user accounts at any time.

To create a user account by using the command line interface

At the command prompt, type the following commands to create a user account and verify the configuration:

  • add system user <username> [-externalAuth ( ENABLED | DISABLED )] [-promptString <string>] [-timeout <secs>] [-logging ( ENABLED | DISABLED )] [-maxsession <positive_integer>]
  • show system user <userName> 

Example

> add system user johnd -promptString user-%u-at-%T

Enter password:

Confirm password:

> show system user johnd

user name: john

     Timeout:900 Timeout Inherited From: Global

     External Authentication: ENABLED

     Logging: DISABLED

     Maximum Client Sessions: 20

To configure a user account by using the configuration utility

Navigate to System > User Administration > Users, and create the user.

Configuring User Groups

Updated: 2014-08-07

After configuring a user group, you can easily grant the same access rights to everyone in the group. To configure a group, you create the group and bind users to the group. You can bind each user account to more than one group. Binding user accounts to multiple groups might allow more flexibility when applying command policies.

To create a user group by using the command line interface

At the command prompt, type the following commands to create a user group and verify the configuration:

  • add system group <groupName> [-promptString <string>] [-timeout <secs>] 
  • show system group <groupName>

Example

> add system group Managers -promptString Group-Managers-at-%h

To bind a user to a group by using the command line interface

At the command prompt, type the following commands to bind a user account to a group and verify the configuration:

  • bind system group <groupName> -userName <userName> 
  • show system group <groupName>

Example

> bind system group Managers -userName user1

To configure a user group by using the configuration utility

Navigate to System > User Administration > Groups, and create the user group.

Note: To add members to the group, in the Members section, click Add. Select users from the Available list and add them to the Configured list.

Configuring Command Policies

 

 

Command policies regulate which commands, command groups, virtual servers, and other entities that users and user groups are permitted to use.

The appliance provides a set of built-in command policies, and you can configure custom policies. To apply the policies, you bind them to users and/or groups.

Here are the key points to keep in mind when defining and applying command policies.

 

  • You cannot create global command policies. Command policies must be bound directly to the users and groups on the appliance.
  • Users or groups with no associated command policies are subject to the default (DENY-ALL) command policy, and are therefore unable to execute any configuration commands until the proper command policies are bound to their accounts.
  • All users inherit the policies of the groups to which they belong.
  • You must assign a priority to a command policy when you bind it to a user account or group account. This enables the appliance to determine which policy has priority when two or more conflicting policies apply to the same user or group.
  • The following commands are available by default to any user and are unaffected by any command you specify:

    help, show cli attribute, set cli prompt, clear cli prompt, show cli prompt, alias, unalias, history, quit, exit,whoami, config, set cli mode, unset cli mode, and show cli mode.

 

 

 

 

Built-in Command Policies

Updated: 2015-06-15

 

 

The following table describes the built-in policies.

 

Table 1. Built-in Command Policies

Policy name Allows
read-only Read-only access to all show commands except show ns runningConfig, show ns ns.conf, and the show commands for the NetScaler command group.
operator Read-only access and access to commands to enable and disable services and servers.
network Full access, except to the set and unset SSL commands, show ns ns.conf, show ns runningConfig, and show gslb runningConfig commands.
sysadmin [Included in NetScaler 11.0 and later] A sysadmin is lower than a superuser is terms of access allowed on the appliance. A sysadmin user can perform all NetScaler operations with the following exceptions: no access to the NetScaler shell, cannot perform user configurations, cannot perform partition configurations, and some other configurations as stated in the sysadmin command policy.
superuser Full access. Same privileges as the nsroot user.

 

 

 

 

 

Creating Custom Command Policies

Updated: 2015-06-15

 

 

Regular expression support is offered for users with the resources to maintain more customized expressions, and for those deployments that require the flexibility that regular expressions offer. For most users, the built-in command policies are sufficient. Users who need additional levels of control but are unfamiliar with regular expressions might want to use only simple expressions, such as those in the examples provided in this section, to maintain policy readability.

When you use a regular expression to create a command policy, keep the following in mind.

 

  • When you use regular expressions to define commands that will be affected by a command policy, you must enclose the commands in double quotation marks. For example, to create a command policy that includes all commands that begin with show, type the following:

    "^show .*$"

    To create a command policy that includes all commands that begin with rm, type the following:

    "^rm .*$"

  • Regular expressions used in command policies are not case sensitive.

 

The following table lists examples of regular expressions:

 

Table 2. Examples of Regular Expressions for Command Policies

Command specification Matches these commands
"^rm\s+.*$" All remove actions, because all remove actions begin with the rm string, followed by a space and additional parameters such as command groups, command object types and arguments.
"^show\s+.*$" All show commands, because all show actions begin with the show string, followed by a space and additional parameters such as command groups, command object types and arguments.
"^shell$" The shell command alone, but not combined with any other additional parameters such as command groups, command object types and arguments.
"^add\s+vserver\s+.*$" All create virtual server actions, which consist of the add virtual server command followed by a space and additional parameters such as command groups, command object types and arguments.
"^add\s+(lb\s+vserver)\s+.*" All create lb virtual server actions, which consist of the add lb virtual server command followed by a space and additional parameters such as command groups, command object types and arguments.

 

The following table shows the command specifications for each of the built-in command policies.

 

Table 3. Expressions Used in the Built-in Command Policies

Policy name Command specification regular expression
read-only

(^man.*)|(^show\s+(?!system)(?!configstatus)(?!ns ns\.conf)(?!ns savedconfig)(?!ns runningConfig)(?!gslb runningConfig)(?!audit messages)(?!techsupport).*)|(^stat.*)

operator

(^man.*)|(^show\s+(?!system)(?!configstatus)(?!ns ns\.conf)(?!ns savedconfig)(?!ns runningConfig)(?!gslb runningConfig)(?!audit messages)(?!techsupport).*)|(^stat.*)|(^(enable|disable) (server|service).*)

network

^(?!clear ns config.*)(?!scp.*)(?!set ssl fips)(?!reset ssl fips)(?!diff ns config)(?!shell)(?!reboot)(?!batch)\S+\s+(?!system)(?!configstatus)(?!ns ns\.conf)(?!ns savedconfig)(?!ns runningConfig)(?!gslb runningConfig)(?!techsupport).*

sysadmin

[From NetScaler 11 onwards] ^(?!shell)(?!sftp)(?!scp)(?!batch)(?!source)(?!.*superuser)(?!.*nsroot)(?!show\s+system\s+(user|cmdPolicy))(?!(set|add|rm|create|export|kill)\s+system)(?!(unbind|bind)\s+system\s+(user|group))(?!diff\s+ns\s+config)(?!\S+\s+ns\s+partition).*

superuser .*

 

 

 

 

To create a command policy by using the command line interface

 

At the command prompt, type the following commands to create a command policy and verify the configuration:

  • add system cmdPolicy <policyname> <action> <cmdspec> 
  • show system cmdPolicy <policyName>

Example

 

> add system cmdPolicy read_all ALLOW (^show\s+(!system)(!ns ns.conf)(!ns runningConfig).*)|(^stat.*)

 

 

 

 

 

To configure a command policy by using the configuration utility

 

Navigate to System > User Administration > Command Policies, and create the command policy.

 

 

 

 

Binding Command Policies to Users and Groups

Updated: 2014-08-07

 

 

Once you have defined your command policies, you must bind them to the appropriate user accounts and groups. When you bind a policy, you must assign it a priority so that the appliance can determine which command policy to follow when two or more applicable command policies are in conflict.

Command policies are evaluated in the following order:

 

  • Command policies bound directly to users and the corresponding groups are evaluated according to priority number. A command policy with a lower priority number is evaluated before one with a higher priority number. Therefore, any privileges the lower-numbered command policy explicitly grants or denies are not overridden by a higher-numbered command policy.
  • When two command policies, one bound to a user account and other to a group, have the same priority number, the command policy bound directly to the user account is evaluated first.

 

 

 

 

To bind command policies to a user by using the command line interface

 

 

At the command prompt, type the following commands to bind a command policy to a user and verify the configuration:

 

  • bind system user <userName> -policyName <policyName> <priority> 
  • show system user <userName>

Example

 

> bind system user user1 -policyName read_all 1

 

 

 

 

 

To bind command policies to a user by using the configuration utility

 

Navigate to System > User Administration > Users, select the user and bind command policies.

Optionally, you can modify the default priority to ensure that the policy is evaluated in the proper order.

 

 

 

 

To bind command policies to a group by using the command line interface

 

 

At the command prompt, type the following commands to bind a command policy to a user group and verify the configuration:

 

  • bind system group <groupName> -policyName <policyName> <priority> 
  • show system group <groupName>

Example

 

> bind system group Managers -policyName read_all 1

 

 

 

 

 

To bind command policies to a group by using the configuration utility

 

Navigate to System > User Administration > Groups, select the group and bind command policies.

Optionally, you can modify the default priority to ensure that the policy is evaluated in the proper order.