Skip to main content

Restrict sign-in by address (CIDR) and virtual host

Restrict access when an account may be used only from the company network or only through a specific virtual host. Center checks the restrictions on every request from the user and rejects requests that do not meet them.

Before you begin​

  • You need the Cluster master role.
  • The user page has the Restrict by CIDR and Restrict by vHost sections. Each section appears when its feature is enabled on the cluster: Center installation enables both. If a section is missing, contact vStack support.
  • You know the networks the user works from, for example 192.0.2.0/24, or the virtual host names, for example center.example.com. A virtual host name is the name from the address at which the user opens the web interface or calls the API, without the port; if the web interface is opened by IP address, it is that address.

A restriction takes effect immediately, including for the user's open sessions. If you restrict your own account, first add the network you are working from now and the host through which you opened the web interface: otherwise Center stops accepting your requests.

1. Restrict addresses​

  1. In the left menu, select Provider Data Center → Users & Roles.

  2. Click the user row in the table on the Users tab. The user page opens.

  3. Open the Restrict by CIDR section.

  4. Enter a network in the CIDR field, for example 192.0.2.0/24 or 2001:db8::/32. An IPv4 address without a mask means a single address; an IPv4 mask is from /8 to /32. Enter an IPv6 network only with a prefix, from /16 to /128.

  5. Click the + button to the right of the field. The web interface shows User <name> (id: <number>) got new remote <network>, and the network appears in the list under the field.

  6. Repeat steps 4–5 for each network. Center accepts a request if the user's address is in at least one network from the list.

2. Restrict virtual hosts​

  1. On the user page, open the Restrict by vHost section.
  2. Enter a name in the Vhost name field, for example center.example.com. The name is from 5 to 512 characters long. Center compares it exactly, case-sensitively, and the name from the address arrives in lowercase: enter the name in lowercase and without the port.
  3. Click the + button to the right of the field. The web interface shows Add <host> for user <name> (id: <number>), and the host appears in the list under the field.
  4. Repeat steps 2–3 for each host. Center accepts a request only if it came through one of the hosts in the list.

Check the result​

The section heading shows the number of entries, and the list of networks or hosts is under the field.

Center rejects requests that do not meet the restrictions. What the user sees:

  • while working — the notification Invalid endpoint (error code: -94) for every action;
  • when opening the web interface with a session that is already open — the notification Access to app not allowed: attempt to enter from forbidden address and the sign-in form.

Sign-in from a forbidden address fails. If the user cannot sign in with the correct name and password, check that their network and host are in the lists.

More​

  • The delete button in the row of a network or host deletes the entry. Confirm the deletion with the Remove button in the Are you sure want to remove remote <network>? window (for a host — Are you sure want to remove <host>?). When the list is empty, the restriction is lifted.

  • Address and host restrictions apply together: a request must meet both.

Next​

API methods: user-remote-add, user-remote-delete, user-vhost-add, user-vhost-delete — in the API reference.