3.4. Userlists
- It is possible to control access to frontend/backend/listen sections or to
- http stats by allowing only authenticated and authorized users. To do this,
- it is required to create at least one userlist and to define users.
- Creates new userlist with name <listname>. Many independent userlists can be
- used to store authentication & authorization data for independent customers.
group
- Adds group <groupname> to the current userlist. It is also possible to
- attach users to this group by using a comma separated list of names
- proceeded by "users" keyword.
user
- Adds user <username> to the current userlist. Both secure (encrypted) and
- insecure (unencrypted) passwords can be used. Encrypted passwords are
- evaluated using the crypt(3) function, so depending on the system's
- capabilities, different algorithms are supported. For example, modern Glibc
- based Linux systems support MD5, SHA-256, SHA-512, and, of course, the
- classic DES-based method of encrypting passwords.
- Attention: Be aware that using encrypted passwords might cause significantly
- increased CPU usage, depending on the number of requests, and the algorithm
- used. For any of the hashed variants, the password for each request must
- be processed through the chosen algorithm, before it can be compared to the
- value specified in the config file. Most current algorithms are deliberately
- designed to be expensive to compute to achieve resistance against brute
- force attacks. They do not simply salt/hash the clear text password once,
- but thousands of times. This can quickly become a major factor in haproxy's
- overall CPU consumption!
Example:
userlist L1
group G1 users tiger,scott
group G2 users xdb,scott
user tiger password $6$k6y3o.eP$JlKBx9za9667qe4(...)xHSwRv6J.C0/D7cV91
user scott insecure-password elgato
user xdb insecure-password hello
userlist L2
group G1
group G2
user tiger password $6$k6y3o.eP$JlKBx(...)xHSwRv6J.C0/D7cV91 groups G1
user scott insecure-password elgato groups G1,G2
user xdb insecure-password hello groups G2
- Please note that both lists are functionally identical.