Add blocks to control firewall state and temporary disable it#14
Add blocks to control firewall state and temporary disable it#14iisat wants to merge 1 commit intow2c:masterfrom
Conversation
|
As acme-tiny uses port 80, instead of completely disabling firewall (which seems wrong, even for a short period), maybe we should selectively enable/disable webAccess rule only when really needed? So first part of your patch could start with: |
|
@adamgolebiowski Great suggestion, very much appreciated. I agree that opening only port 80 inbound is a more targeted approach and should be the preferred way. Although not likely, the renewal job could abort unexpectedly before re-enabling a disabled firewall, leaving the host in a rather undesired state. |
|
It actually uses ports 80 and 443 (Requests to port 80 are forcibly redirected to port 443 on ESXi). If we implement control for ports 80 and 443, the script will become much more complex and less readable. The number of logical checks will increase from 1 to 5:
By the way, I have never examined the risks of renewal job aborts unexpectedly. If this risk is significant, then implementing firewall control should be avoided. However, without firewall control, the script becomes useless for all secured ESXi installations, which I believe is the majority of installations with direct IP to the internet. So, in general, we have three alternatives:
|
If the firewall at ESXi limits connections to only certain IP addresses, then the script may not work as it will not be possible to validate the certificate. Therefore, I added a firewall control block to disable the firewall if it was not already turned off and re-enable it after certificate validation.