-
Notifications
You must be signed in to change notification settings - Fork 34
Fix: Support networks not owned by openstack project #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
environments/skeleton/{{cookiecutter.environment}}/tofu/node_group/nodes.tf
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this looks good, in that we ensure, by default, we don't sent any values for port_security, so we don't trigger the policy violation for networks where RBAC allows you to created ports (i.e. its shared) but you are not the owner of that network.
port_security_enabled = lookup(each.value, "port_security_enabled", true) | ||
security_group_ids = lookup(each.value, "port_security_enabled", true) ? var.security_group_ids : [] | ||
port_security_enabled = lookup(each.value, "port_security_enabled", null) | ||
security_group_ids = lookup(each.value, "port_security_enabled", null) != false ? var.security_group_ids : [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this wasn't just:
security_group_ids = lookup(each.value, "port_security_enabled", true) ? var.security_group_ids : []
what am I missing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agh you're right I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit isn't working for me, it still applies the security groups even when port_security_enabled is false. Can you please switch to @sjpb's suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow on for #592.
In projects which don't own their networks, port security cannot be manipulated.
Fix sets
port_security_enabled
default tonull
. Whennull
, security groups are applied.