Skip to content

Gérer les groupes de sécurités⚓︎

Information

Par défaut, plusieurs groupes de sécurité vous seront fourni lors de la creation de votre projet.

$> openstack security group create <secgroup_name>
$> openstack security group rule create --ingress/--egress --protocol <protocol> --dst-port <dst_port> <secgroup>
  • secgroup_name : nom du groupe de sécurité a créer
  • --ingress/--egress : specifier le flag ingress pour des flux entrant, et egress pour les flux sortant
  • protocol : protocol ip des flux a ouvrir
  • dst_port : port ou range de port à ouvrir (nécessaire si le protocol spécifié est tcp ou udp)
  • secgroup : nom ou ID du groupe de sécurité auquel attacher la règle

A noter

Pour récupérer les informations des ressources disponibles sur le projet (flavor, network, image, ...) vous pouvez suivre la documentation ici

Exemple

$> openstack security group create test-secgroup
+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field           | Value                                                                                                                                                |
+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at      | 2026-04-14T21:33:49Z                                                                                                                                 |
| description     | test-secgroup                                                                                                                                        |
| id              | 361566c7-2d28-4c11-99ee-6b9ee9f1798e                                                                                                                 |
| is_shared       | False                                                                                                                                                |
| name            | test-secgroup                                                                                                                                        |
| project_id      | 1eeec6c08e46429aa3e02e7acca8bdcd                                                                                                                     |
| revision_number | 1                                                                                                                                                    |
| rules           | created_at='2026-04-14T21:33:49Z', direction='egress', ethertype='IPv6', id='5ae6bbf9-7ecf-4758-b2b9-2da635cab194', standard_attr_id='122866',       |
|                 | updated_at='2026-04-14T21:33:49Z'                                                                                                                    |
|                 | created_at='2026-04-14T21:33:49Z', direction='egress', ethertype='IPv4', id='b6522030-0830-4cbe-ac24-633d3a1de952', standard_attr_id='122863',       |
|                 | updated_at='2026-04-14T21:33:49Z'                                                                                                                    |
| stateful        | True                                                                                                                                                 |
| tags            | []                                                                                                                                                   |
| updated_at      | 2026-04-14T21:33:49Z                                                                                                                                 |
+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
$> openstack security group rule create --ingress --protocol tcp --dst-port 137:139 test-secgroup
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| created_at              | 2026-04-14T21:36:47Z                 |
| description             |                                      |
| direction               | ingress                              |
| ether_type              | IPv4                                 |
| id                      | 96aa5096-276f-43d2-b1bf-9303bb604610 |
| normalized_cidr         | 0.0.0.0/0                            |
| port_range_max          | 139                                  |
| port_range_min          | 137                                  |
| project_id              | 1eeec6c08e46429aa3e02e7acca8bdcd     |
| protocol                | tcp                                  |
| remote_address_group_id | None                                 |
| remote_group_id         | None                                 |
| remote_ip_prefix        | 0.0.0.0/0                            |
| revision_number         | 0                                    |
| security_group_id       | 361566c7-2d28-4c11-99ee-6b9ee9f1798e |
| updated_at              | 2026-04-14T21:36:47Z                 |
+-------------------------+--------------------------------------+
$> openstack security group show test-secgroup
+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field           | Value                                                                                                                                                |
+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at      | 2026-04-14T21:33:49Z                                                                                                                                 |
| description     | test-secgroup                                                                                                                                        |
| id              | 361566c7-2d28-4c11-99ee-6b9ee9f1798e                                                                                                                 |
| is_shared       | False                                                                                                                                                |
| name            | test-secgroup                                                                                                                                        |
| project_id      | 1eeec6c08e46429aa3e02e7acca8bdcd                                                                                                                     |
| revision_number | 2                                                                                                                                                    |
| rules           | created_at='2026-04-14T21:33:49Z', direction='egress', ethertype='IPv6', id='5ae6bbf9-7ecf-4758-b2b9-2da635cab194', standard_attr_id='122866',       |
|                 | updated_at='2026-04-14T21:33:49Z'                                                                                                                    |
|                 | created_at='2026-04-14T21:36:47Z', direction='ingress', ethertype='IPv4', id='96aa5096-276f-43d2-b1bf-9303bb604610', normalized_cidr='0.0.0.0/0',    |
|                 | port_range_max='139', port_range_min='137', protocol='tcp', remote_ip_prefix='0.0.0.0/0', standard_attr_id='122869',                                 |
|                 | updated_at='2026-04-14T21:36:47Z'                                                                                                                    |
|                 | created_at='2026-04-14T21:33:49Z', direction='egress', ethertype='IPv4', id='b6522030-0830-4cbe-ac24-633d3a1de952', standard_attr_id='122863',       |
|                 | updated_at='2026-04-14T21:33:49Z'                                                                                                                    |
| stateful        | True                                                                                                                                                 |
| tags            | []                                                                                                                                                   |
| updated_at      | 2026-04-14T21:36:47Z                                                                                                                                 |
+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------+