Hello Mikrotik Friends,
For several years, I’ve used a script to renew the Let’s Encrypt certificate that we use for our Hotspot and SSTP VPN. This has worked perfectly. The script basically enables a firewall rule which allows Port 80 on the Input Chain, Enables the WWW service, removes the old certificate, gets a new one, then sets the certificate for SSPT and Hotspot, disables the firewall rule and WWW Service, and does this every 75 days or so on a schedule… worked like a charm.
I see now that there’s a new ACME Client built into RoS 7.22, the commands are different, and of course, my script is now broken.
I’ve just renewed the certificate manually using:
/certificate/add-acme directory-url=https://acme-v02.api.letsencrypt.org/directory domain-names=[DOMAIN_NAME]
[Taken from: Certificates - RouterOS - MikroTik Documentation]
My questions:
- we disable port 80 and WWW service on our firewall for security - how can I make use of the automatic renewal feature of the now built-in ACME client?
Our Firewall setup looks like this:
/ip firewall filter add action=accept chain=input comment=LetsEncrypt disabled=yes dst-port=80 log=yes log-prefix="Lets Encrypt:" protocol=tcp
/ip firewall filter add action=drop chain=input comment="Block all not coming from LAN" in-interface-list=!INTERNAL log-prefix="DROPPED: "
/ip firewall filter add action=drop chain=input comment="Block incoming from internet" in-interface=pppoe-out1
[These are the last 3 rules of the INPUT chain, in the order top-to-bottom as they are applied - the last rule probably a bit redundant, but belts and braces and all that]
It’s been suggested to me to:
- Leave the WWW Service permanently enabled
- Add some firewall rules to allow only new connections for ACME renewals, like this:
/ip firewall filter add chain=input protocol=tcp dst-port=80 connection-state=new action=accept comment="ACME allow"
/ip firewall filter add chain=input protocol=tcp dst-port=80 action=drop comment="ACME drop"
[These rules should be added above the first of the INPUT Chain Drop rules, above, apparently]
I’m extremely nervous about just simply enabling Port 80 and the WWW Service all the while… does anyone have any thoughts/comments/advice here please?
Thank you in advance.