<div dir="ltr"><div dir="ltr">On Thu, May 4, 2023 at 7:14 AM Derek O keeffe <<a href="mailto:derekokeeffe85@yahoo.ie">derekokeeffe85@yahoo.ie</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px"><div dir="ltr">Hi all,</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><span dir="ltr">We're having a problem with renewing letsencrypt certs via certbot in an external Neutron network where a security group is locking down HTTP+HTTPS access to select IP ranges. As far as we know the IP address for the Certbot ACME challenge server is always changing and therefore a static security group can't be set up to allow in traffic from that server. We have experimented with using UFW rules instead thinking we may be able to write a script to open port 80 periodically<br>
to allow the ACME challenge through, then close it back up, but it hasn't worked as we'd hoped either (either all traffic is blocked or the security group immediately takes precedence). Is there any way to programmatically enable + disable a security group as needed using something like OpenstackSDK to achieve the same thing?</span></div><div dir="ltr"><span dir="ltr"><br></span></div><div dir="ltr"><span dir="ltr">Thanks in advance.</span></div><div dir="ltr"><span dir="ltr"><br></span></div><div dir="ltr"><span dir="ltr">Regards,</span></div><div dir="ltr"><span dir="ltr">Derek</span></div><br></div></div></div></blockquote></div><div><br></div>Derek,<br clear="all"><div><div>Instead of thinking about the security group rule being enabled or disabled - maybe think about it existing or not existing. Prior to your certbot run, you add a rule to a security group to allow 80 inbound and then when certbot is done, you delete the rule. </div><div>Personally I like Ansible, but you could use literally anything to accomplish this task - even bash. </div><div><br></div><div dir="ltr"><div><a href="https://docs.ansible.com/ansible/latest/collections/openstack/cloud/security_group_rule_info_module.html#ansible-collections-openstack-cloud-security-group-rule-info-module">https://docs.ansible.com/ansible/latest/collections/openstack/cloud/security_group_rule_info_module.html#ansible-collections-openstack-cloud-security-group-rule-info-module</a><br><br></div></div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>~/DonnyD</div><div>"No mission too difficult. No sacrifice too great. Duty First"</div></div></div></div>