You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Set of widely used security Groups in OpenStack #473
As a user of IaaS, I want to make my VMs accessable in different but secure ways without having to create security groups for every VM. When using diefferent sets of predefined security groups, I am sure the Firewall-Rules I set, are consistent and reusable.
I want to choose from a preset of defined security groups and maybe add additional self-defined groups to a VM.
Definition of Done:
Discuss a good strategy to handle security groups in a DR
Prepare a standard and/or guide that fulfills the decision of the DR
In contrast to other resources, that either are completely public (like flavors) or can have public visibility and usability (like images), security groups are completely bound to projects1. That is a design decision by OpenStack even though at least some public security groups would be useful. Instead for every project a default security group is created in the same manner and will not be shared.
That behavior has upsides and downsides. On the positive side: every user with at least member role in a project, can adjust the rules of any security groups in that project (except for the default group).
The downside is, that security groups that are widely used (like opening the ingress port for ssh) have to be defined again and again for and in every project. In addition every Project has a Quota for security group, that defaults to 10 and 1 security group is already set: the default security group. So in general project user can add 9 additional security groups.
So even though it makes sense to standardize a set of security groups, that are widely used and should always be present, this standard would have to be applied to every project. This is impractical. The design of OpenStack puts every user in charge over their security groups.
Nevertheless, we can think about having a guide or a documentation about "best practice: how to configure and use security groups". Where we could recommend to create a base set of security groups for a project.
Such a set could include ssh, http, https and maybe one or two more useful groups.
I think it is possible to share security groups via Neutron RBAC rules. This way it is possible to create global default/best practice security groups (e.g. in the admin project) that can be shared wit new projects afterwards.
Thank you for the hint @berendt I looked through it a little bit and found an option to share a security group with ALL projects at once, that also works beyond domains.
As an admin you can use the --target-all-projects flag:
$ source domain-user-a.openrc
$ openstack security group list
+--------------------------------------+-------------+------------------------+----------------------------------+------+
| ID | Name | Description | Project | Tags |
+--------------------------------------+-------------+------------------------+----------------------------------+------+
| 03c51dc9-65c7-4cba-a83e-b8c662c109b5 | default | Default security group | 8c59028a6e5144a78dfee2364d529070 | [] |
| 5f22e42e-95dc-4c0a-8651-57b1dfc8639f | test-group2 | test-group2 | 15f2ab0eaa5b4372b759bde609e86224 | [] |
+--------------------------------------+-------------+------------------------+----------------------------------+------+
The good thing is, the shared security groups will not count into the quota limit for security groups per project. So this would be an easy way to achieve a few more than one "default" security group.
But the downside is that this feature is not security group specific:
As the admin would be the person creating and sharing the security group, there is another issue. They way to discover what a group is shared for is only discoverable within the admin project (a.k.a only for admins). As a user in another project you would have to look into the security group and KNOW what project id belongs to the admin project:
Next point:
Even if everything is configured in a way, that we will not have security issues, there will still be problem with the discoverability. Even as an admin it is not easy to see, what security group is shared and with whom.
You first have to get the shared security groups ID, then list all network rbac items and then show the ones, where the ids match, to see whether they are shared to specific projects or to everyone:
Auditing this is possible only for admins or system-scoped reader (and the system scope is part of the new secure RBAC system which maybe never will be completely implemented).
This leads to the following questions: @bitkeks I would like to talk with you about possible security impacts of this. @fkr@garloff Do we want to make a standard requiring the sharing of security groups in this way? Even it would only be 3 to 5 groups?
I would also like to get the feedback of the CSPs on this way.
We reviewed the security impact of this week's discussed potential sec issue. Recommendation would be to implement the policy patch by @josephineSei into OSISM and document them in SCS IaaS docs.
Maybe @berendt has interest in following up the patch in OSISM?
Conclusion: A security group can be shared with all projects by an admin. But due to the programming of the sharing algorithm, everyone can now edit the security group rules. As this is about the sharing part of the network rbac endpoint, I consider this is wanted by Neutron. From my perspective, I think that using the network rbac sharing would lead to way more harm than good.
I looked over the current state of the DR and the documentation. We only need a decision in the IaaS meeting I think, after that the DR can be finished and merged.
We already have 3 people voting for having a documentation only, as we see no chance for a standard. The way security groups and the network rbac endpoint work simply do not allow a non-violatable standard.
As discussed in the DR I adjusted the guide to fulfill the requirement of having not too explicit examples and focus more on how to build a good security-focused setup of security groups for a users VM.
Activity
josephineSei commentedon Feb 13, 2024
In contrast to other resources, that either are completely public (like flavors) or can have public visibility and usability (like images), security groups are completely bound to projects1. That is a design decision by OpenStack even though at least some public security groups would be useful. Instead for every project a
defaultsecurity group is created in the same manner and will not be shared.That behavior has upsides and downsides. On the positive side: every user with at least
memberrole in a project, can adjust the rules of any security groups in that project (except for thedefaultgroup).The downside is, that security groups that are widely used (like opening the ingress port for ssh) have to be defined again and again for and in every project. In addition every Project has a Quota for security group, that defaults to 10 and 1 security group is already set: the
defaultsecurity group. So in general project user can add 9 additional security groups.So even though it makes sense to standardize a set of security groups, that are widely used and should always be present, this standard would have to be applied to every project. This is impractical. The design of OpenStack puts every user in charge over their security groups.
Nevertheless, we can think about having a guide or a documentation about "best practice: how to configure and use security groups". Where we could recommend to create a base set of security groups for a project.
Such a set could include ssh, http, https and maybe one or two more useful groups.
Footnotes
https://docs.openstack.org/nova/latest/user/security-groups.html ↩
[-]Set of standardized security Groups in OpenStack[/-][+]Set of widely used security Groups in OpenStack[/+]berendt commentedon Feb 19, 2024
I think it is possible to share security groups via Neutron RBAC rules. This way it is possible to create global default/best practice security groups (e.g. in the admin project) that can be shared wit new projects afterwards.
https://docs.openstack.org/neutron/latest/admin/config-rbac.html#sharing-a-security-group-with-specific-projects
berendt commentedon Feb 19, 2024
Test on Cloud in a Box (OpenStack 2023.2):
josephineSei commentedon Feb 20, 2024
Thank you for the hint @berendt I looked through it a little bit and found an option to share a security group with ALL projects at once, that also works beyond domains.
As an admin you can use the
--target-all-projectsflag:In another domain as a simple user:
The good thing is, the shared security groups will not count into the quota limit for security groups per project. So this would be an easy way to achieve a few more than one "default" security group.
But the downside is that this feature is not security group specific:
As the admin would be the person creating and sharing the security group, there is another issue. They way to discover what a group is shared for is only discoverable within the admin project (a.k.a only for admins). As a user in another project you would have to look into the security group and KNOW what project id belongs to the admin project:
Next point:
Even if everything is configured in a way, that we will not have security issues, there will still be problem with the discoverability. Even as an admin it is not easy to see, what security group is shared and with whom.
You first have to get the shared security groups ID, then list all network rbac items and then show the ones, where the ids match, to see whether they are shared to specific projects or to everyone:
Auditing this is possible only for admins or system-scoped reader (and the system scope is part of the new secure RBAC system which maybe never will be completely implemented).
This leads to the following questions:
@bitkeks I would like to talk with you about possible security impacts of this.
@fkr @garloff Do we want to make a standard requiring the sharing of security groups in this way? Even it would only be 3 to 5 groups?
I would also like to get the feedback of the CSPs on this way.
josephineSei commentedon Feb 21, 2024
In todays IaaS meeting I talked about a bug I found while testing this, I am currently reaching out to upstream to check, whether this is wanted or unwanted behavior and prepare a list of commands for people to recreate.
I added a launchpad bug (currently still private) in neutron: https://bugs.launchpad.net/neutron/+bug/2054590
bitkeks commentedon Feb 22, 2024
We reviewed the security impact of this week's discussed potential sec issue. Recommendation would be to implement the policy patch by @josephineSei into OSISM and document them in SCS IaaS docs.
Maybe @berendt has interest in following up the patch in OSISM?
josephineSei commentedon Mar 4, 2024
While trying to find arguments for the decision record I write for this issue, I caught the following:
As an admin I shared a new security group:
As a user I tried editing the rules of the shared group:
As an admin I now see, someone edited the rules of my shared security group:
Conclusion: A security group can be shared with all projects by an admin. But due to the programming of the sharing algorithm, everyone can now edit the security group rules. As this is about the sharing part of the
network rbacendpoint, I consider this is wanted by Neutron. From my perspective, I think that using thenetwork rbacsharing would lead to way more harm than good.josephineSei commentedon Mar 12, 2024
I looked over the current state of the DR and the documentation. We only need a decision in the IaaS meeting I think, after that the DR can be finished and merged.
We already have 3 people voting for having a documentation only, as we see no chance for a standard. The way security groups and the
network rbacendpoint work simply do not allow a non-violatable standard.josephineSei commentedon Mar 25, 2024
As discussed in the DR I adjusted the guide to fulfill the requirement of having not too explicit examples and focus more on how to build a good security-focused setup of security groups for a users VM.
josephineSei commentedon Apr 8, 2024
@artificial-intelligence , @bitkeks the docs guide was merged while i was on vacation, can you both please look over the guide and tell me, whether you think it is security focused enough?
Original PR: https://github.com/SovereignCloudStack/docs/pull/142/files
And I cannot find the guide on the docs pages, maybe a link is missing somewhere.
josephineSei commentedon Apr 22, 2024
@artificial-intelligence and/or @bitkeks could you please hava look at the pull request I added you two as reviewers for and voice your opinion?
artificial-intelligence commentedon Apr 23, 2024
It's mostly okay I would say. I would simplify some of the wording, but that's a nit imho.