Security groups#

General information#

Security groups describe rules for traffic filtering on network interfaces of the instances connected to a subnet, thus acting as a virtual firewall.

Billing#

Security groups are free of charge.

Available quotas#

The following default quotas are allocated to security groups:

  • 500 security groups per a VPC;

  • 5 security groups per a network interface;

  • 50 rules in each direction per a security group.

If necessary, you can increase quotas. To do this, contact the support service via the support portal or by email support@k2.cloud.

Default security group#

A default security group is created together with a VPC. It is associated with the network interface when it is created.

Inbound rules for the default security group#

Protocol

Source

Ports

Description

All

The secuity group (sg-XXXXXXXX)

All

Enables inbound traffic from interfaces with the default security group

Outbound rules for the default security group#

Protocol

Destination

Ports

Description

All

0.0.0.0/0

All

Allows all outbound IPv4 traffic

You can change the rules of the default security group or associate your security groups with a network interface. In each security group, you can define rules for both inbound and outbound traffic.

Stateful inspection#

Security Groups perform stateful traffic filtering: for each new allowed network connection, a temporary reverse rule is created automatically. This rule dynamically allows return traffic for this connection.

Note

Suppose, for example, that a web server runs on an instance in the cloud and listens to TCP port 80. The respective network interface has the associated web-sg security group, with an inbound enabling rule tcp/80, 0.0.0.0/0. The list of outbound rules is empty. When a TCP session is established between a client and web server, a temporary outbound enabling rule is created: proto: tcp, source port: 80, destination port: XXXX, destination IP: client IP, where XXXX is an ephemeral port, which the client operating system dynamically selects for the current TCP session. This rule will remain in effect until the connection is closed or the timeout expires. The length of the timeout depends on the protocol.

Operations with security groups#

Create a security group#

  1. В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется создать группу безопасности.

  2. Expand the side menu by clicking .

  3. Перейдите в раздел Виртуальные машины Безопасность Группы безопасности. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.

  4. Click Create.

  5. In the window that opens, set the following parameters:

    • VPC where you need to create a security group;

    • security group name;

    • (опционально) описание.

  6. If you need to set a tag, click Add tag and specify the tag key and value. To assign more tags, click Add tag again.

  7. After setting all the required parameters, click Create.

Assign a security group to an interface#

You can assign a security group to any network interface or remove it from the assigned ones in the Security groups tab on the page of the respective interface. How to change security groups of a network interface is detailed in the respective section of documentation on network interfaces. The list of interfaces to which a specific security group was assigned can be viewed in the Network interfaces tab on the page of the respective group.

Assign tags to a security group#

  1. В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется назначить теги группе безопасности.

  2. Expand the side menu by clicking .

  3. Перейдите в раздел Виртуальные машины Безопасность Группы безопасности. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.

  4. Найдите в таблице ресурсов группу безопасности, у которой необходимо отредактировать теги, и нажмите на её идентификатор для перехода на страницу группы.

  5. Open the Tags tab and click Edit to set tags.

  6. To add a tag, fill in Key and Value fields. To assign the next tag, click Add tag.

    To modify a tag, edit the required fields (Value and/or Key) of the respective tag.

    To delete a tag, click the icon next to the tag you no longer need.

  7. To complete editing, click Save changes.

Edit the description of a security group#

  1. В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется изменить описание группы безопасности.

  2. Expand the side menu by clicking .

  3. Перейдите в раздел Виртуальные машины Безопасность Группы безопасности. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.

  4. Find the security group in the resource table and click its ID to go to the group page.

  5. На вкладке Информация нажмите рядом с полем Описание и внесите требуемые изменения.

  6. Для сохранения изменений нажмите .

Delete a security group#

Important

You can delete a security group only if it meets the following criteria:

  • a security group is not assigned to any network interface;

  • the security group is not the default security group;

  • the security group is not set as a source or a destination in another security group.

  1. В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется удалить группу безопасности.

  2. Expand the side menu by clicking .

  3. Перейдите в раздел Виртуальные машины Безопасность Группы безопасности. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.

  4. Выберите группу в таблице ресурсов и нажмите Удалить на всплывающей панели действий.

  5. In the window that opens, confirm the deletion.

Кроме того, данную операцию можно выполнить на странице группы безопасности. Для этого перейдите на вкладку Информация и нажмите Удалить.

Working with rules#

Add a rule#

The new rule will be automatically applied to all interfaces associated with this security group.

Important

Rules, where the source/destination is a security group, are limited to a single availability zone. If you want to permit traffic between network interfaces located in different availability zones inside a region, specify IP addresses as the sources/destinations in the permitting rules.

Note

If a security group is associated with a network interface, which has disabled sourceDestCheck parameter, you cannot use this security group as a source in either its own or inbound rules in other security groups.

To add an inbound or outbound rule to a particular security group:

  1. В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется добавить правило в группу безопасности.

  2. Expand the side menu by clicking .

  3. Перейдите в раздел Виртуальные машины Безопасность Группы безопасности. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.

  4. Find the security group in the resource table and click its ID to go to the group page.

  5. Откройте нужную вкладку — Входящие правила или Исходящие правила — и нажмите Добавить.

  6. In the window that opens, set the required parameters:

    • (Опционально) Описание правила.

    • Protocol — You can set the rule for all protocols or select a specific protocol from the list. If there is no required protocol on the list, select Other.

      • Protocol number — If the protocol is not on the list, set its number according to IANA.

      • Доступ для портов — Для протоколов TCP и UDP укажите, для каких портов возможен доступ — для всех портов или для диапазона портов.

      • Ports — If you select access to only some ports, specify a comma-separated list of ports and/or port ranges.

        Note

        A separate rule will be created for each port or port range in the list.

    • Разрешить доступ — Вы можете разрешить доступ со всех IP-адресов, из конкретной сети или из группы безопасности для входящих правил и, соответственно, ко всем IP-адресам, конкретной сети или группе безопасности для исходящих правил.

      • Network — If you select From Network, specify the network in CIDR notation.

      • Группа безопасности — При выборе опции Из группы безопасности необходимо выбрать группу безопасности из раскрывающегося списка.

  7. После задания всех параметров нажмите Создать для создания правила.

Modify a rule#

Вы можете изменить любые параметры правила, кроме типа источника (сеть или группа безопасности) для входящих правил и типа адресата (сеть или группа безопасности) для исходящих правил.

Для изменения входящего или исходящего правила в конкретной группе безопасности:

  1. В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется изменить правило в группе безопасности.

  2. Expand the side menu by clicking .

  3. Перейдите в раздел Виртуальные машины Безопасность Группы безопасности. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.

  4. Find the security group in the resource table and click its ID to go to the group page.

  5. Откройте нужную вкладку — Входящие правила или Исходящие правила, — выберите изменяемое правило в списке ресурсов и нажмите Изменить на всплывающей панели действий.

  6. In the window that opens, you can edit the following parameters:

    • Rule description.

    • Protocol — Instead of the protocol in use you can set an arbitrary one or select all protocols. If there is no required protocol on the list, select Other.

      • Protocol number — If the protocol is not on the list, set its number according to IANA.

      • Доступ для портов — Для протоколов TCP и UDP укажите, для каких портов возможен доступ — для всех портов или для диапазона портов.

      • Порты — Если выбран доступ только для некоторых портов, вы можете задать другой порт или диапазон портов.

    • Сеть/Группа безопасности — Если доступ был разрешён из сети или со всех адресов для входящего правила или, соответственно, к сети или ко всем адресам для исходящего, то вы можете указать другую сеть, в том числе предоставить доступ отовсюду (0.0.0.0/0). Если доступ был разрешён из группы безопасности для входящего правила или, соответственно, к группе безопасности для исходящего, то вы можете выбрать другую группу безопасности.

  7. Once the parameters are edited, click Change to save the rule.

Delete a rule#

You can delete several rules simultaneously.

  1. В веб-интерфейсе в верхнем меню выберите проект и регион, где требуется удалить правило из группы безопасности.

  2. Expand the side menu by clicking .

  3. Перейдите в раздел Виртуальные машины Безопасность Группы безопасности. Для быстрого нахождения раздела вы можете воспользоваться поиском по меню.

  4. Find the security group in the resource table and click its ID to go to the group page.

  5. Откройте нужную вкладку — Входящие правила или Исходящие правила, — выберите удаляемое правило или правила в списке ресурсов и нажмите Удалить на всплывающей панели действий.

  6. In the window that opens, confirm the deletion.

Security group information#

For general information about the existing security groups, see the Security groups subsection. To view all security groups in the project, select All VPC in the VPC filter. To display security groups from a particular VPC, select the desired VPC in the filter.

To view detailed information about a particular security group, go to Virtual machines Security Security groups and select the desired security group from the list. To facilitate the group search in the table, select its relevant VPC in the VPC filter or use the table search.

Once you have selected the desired group, click its ID. The security group page will open.

The Information tab displays the main group parameters:

  • security group name and description;

  • number of network interfaces to which the group is assigned;

  • VPC in which the group was created.

Здесь вы можете изменить описание группы или удалить её.

The Inbound rules tab displays a table with details of inbound rules:

  • protocol;

  • source from which access is allowed;

  • ports;

  • description.

You can add or delete a rule, as well as modify its description.

The Outbound rules tab displays a table with details of outbound rules:

  • protocol;

  • destination to which access is allowed;

  • ports;

  • description.

You can add or delete a rule, as well as modify its description.

The Network interfaces tab displays a table with details of the network interfaces to which this group is assigned:

  • ID;

  • description;

  • instance to which the interface is attached;

  • state;

  • сеть, в которой создан интерфейс;

  • associated Elastic IP;

  • назначенный Private IP.

In the Tags tab, you can view tags assigned to the security group. You can add, change and delete tags.