Просмотр и изменение групп безопасности

Просмотр и изменение групп безопасности#

Предварительные требования

Как просмотреть сведения о группе безопасности

Перейдите на экран Вычисления → Сеть → Группы безопасности и щелкните по имени группы безопасности. На правой панели будут отображены сведения об этой группе.

Используйте следующую команду:

vinfra service compute security-group show <security-group>
<security-group>

Имя или идентификатор группы безопасности

Например, чтобы вывести сведения о группе безопасности mygroup, выполните:

# vinfra service compute security-group show mygroup
+----------------------+---------------------------------------------------+
| Field                | Value                                             |
+----------------------+---------------------------------------------------+
| description          |                                                   |
| id                   | 12e6b260-0b61-4551-8168-3e59602a2433              |
| name                 | mygroup                                           |
| project_id           | e215189c0472482f93e71d10e1245253                  |
| security_group_rules | - description: null                               |
|                      |   direction: egress                               |
|                      |   ethertype: IPv4                                 |
|                      |   id: ce854e2b-537f-4618-bea9-e9ec3d8616ac        |
|                      |   port_range_max: null                            |
|                      |   port_range_min: null                            |
|                      |   project_id: e215189c0472482f93e71d10e1245253    |
|                      |   protocol: null                                  |
|                      |   remote_group_id: null                           |
|                      |   remote_ip_prefix: null                          |
|                      |   security_group_id: 12e6b260-0b61-4551-8168<...> |
|                      | - description: null                               |
|                      |   direction: egress                               |
|                      |   ethertype: IPv6                                 |
|                      |   id: a7c65861-df3d-47f2-bec3-089747141936        |
|                      |   port_range_max: null                            |
|                      |   port_range_min: null                            |
|                      |   project_id: e215189c0472482f93e71d10e1245253    |
|                      |   protocol: null                                  |
|                      |   remote_group_id: null                           |
|                      |   remote_ip_prefix: null                          |
|                      |   security_group_id: 12e6b260-0b61-4551-8168<...> |
| tags                 | []                                                |
+----------------------+---------------------------------------------------+

Как изменить группу безопасности

  1. Перейдите на экран Вычисления → Сеть → Группы безопасности и щелкните по имени группы безопасности.

  2. В правой панели перейдите на вкладку Свойства и нажмите Изменить.

  3. В окне Изменить группу безопасности укажите новое имя и описание группы безопасности, а затем нажмите Сохранить.

Используйте следующую команду:

vinfra service compute security-group set [--name <name>]
                                          [--description <description>]
                                          <security-group>
--name <name>

Имя группы безопасности

--description <description>

Описание группы безопасности

<security-group>

Имя или идентификатор группы безопасности

Например, чтобы изменить описание группы безопасности mygroup, выполните:

# vinfra service compute security-group set mygroup \
--description "A new security group"
+----------------------+---------------------------------------------------+
| Field                | Value                                             |
+----------------------+---------------------------------------------------+
| description          | A new security group                              |
| id                   | 12e6b260-0b61-4551-8168-3e59602a2433              |
| name                 | mygroup                                           |
| project_id           | e215189c0472482f93e71d10e1245253                  |
| security_group_rules | - description: null                               |
|                      |   direction: egress                               |
|                      |   ethertype: IPv4                                 |
|                      |   id: ce854e2b-537f-4618-bea9-e9ec3d8616ac        |
|                      |   port_range_max: null                            |
|                      |   port_range_min: null                            |
|                      |   project_id: e215189c0472482f93e71d10e1245253    |
|                      |   protocol: null                                  |
|                      |   remote_group_id: null                           |
|                      |   remote_ip_prefix: null                          |
|                      |   security_group_id: 12e6b260-0b61-4551-8168<...> |
|                      | - description: null                               |
|                      |   direction: egress                               |
|                      |   ethertype: IPv6                                 |
|                      |   id: a7c65861-df3d-47f2-bec3-089747141936        |
|                      |   port_range_max: null                            |
|                      |   port_range_min: null                            |
|                      |   project_id: e215189c0472482f93e71d10e1245253    |
|                      |   protocol: null                                  |
|                      |   remote_group_id: null                           |
|                      |   remote_ip_prefix: null                          |
|                      |   security_group_id: 12e6b260-0b61-4551-8168<...> |
| tags                 | []                                                |
+----------------------+---------------------------------------------------+