Configure security groups
Configure security groups to control network access to and from instances.
You cannot apply a role-based access control (RBAC)-shared security group directly to an instance during instance creation. To apply an RBAC-shared security group to an instance you must first create the port, apply the shared security group to that port, and then assign that port to the instance.
Security groups are sets of IP filter rules that control network and protocol access to and from instances, such as ICMP to allow you to ping an instance, and SSH to allow you to connect to an instance. Security groups and their rules apply to the ports which they are associated with.
All projects have a default security group called default, which is used when you do not specify a security group for your instances. The default security group allows all outgoing traffic and denies all incoming traffic from any source other than instances in the same security group. You can either add rules to the default security group or create a new security group for your project. You can apply one or more security groups to an instance during instance creation. To apply a security group to a running instance, apply the security group to a port attached to the instance.
When you create a security group, you can choose stateful or stateless.
If you mix stateful and stateless security rules on a network, all security rules become stateful automatically.
Security groups are stateful by default and in most cases stateful security groups provide better control with less administrative resources.
A stateless security group can provide significant performance benefits, because it bypasses connection tracking in the underlying firewall. But stateless security groups require more security group rules than stateful security groups. Stateless security groups also offer less granularity in some cases.
- Stateless security group advantages
-
- Stateless security groups can be faster than stateful security groups
- Stateless security groups are the only viable security group option in applications that offload OpenFlow actions to hardware.
- Stateless security group disadvantages
-
- Stateless security group rules do not automatically allow returning traffic. For example, if you create a rule to allow outgoing TCP traffic from a port that is in a stateless security group, you must also create a rule that allows incoming replies. Stateful security groups automatically allow the incoming replies.
- Control over those incoming replies might not be as granular as the control provided by stateful security groups.
In general, use the default stateful security group type unless your application is highly sensitive to performance or uses hardware offloading of OpenFlow actions.
Create a security group Copy linkLink copied!
Create a security group to define the IP filter rules that control network traffic to your instances and ports, so that you can secure your workloads against unauthorized access.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
Procedure Copy linkLink copied!
Update security group rules Copy linkLink copied!
Update security group rules to configure permitted network traffic for your project instances.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient
Procedure Copy linkLink copied!
Delete security group rules Copy linkLink copied!
Delete rules from a security group to remove outdated filter rules and secure your project configuration.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient
Procedure Copy linkLink copied!
Delete a security group Copy linkLink copied!
Delete a security group that is no longer associated with any ports to remove outdated IP filter rules and keep your project security configuration clean.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.