[LetsEncrypt] How To in XG

Hi Guys,

UTM has a LE Support for WAF (since UTM9.6). But on XG you can use LE certificates as well! Seems like many people does not know, you simply need a little Linux server and 5-10 minutes of your time each 3 month. Or you automate this. 

First of all, i want to share the "how it works" page of LE. https://letsencrypt.org/how-it-works/

My Setup. 

Internet - XG - Ubuntu 20.04 LTS
Ubuntu has "certbot" installed. Feel free to use other LE modules.
https://certbot.eff.org/ https://certbot.eff.org/lets-encrypt/ubuntubionic-apache
Follow straight the Guide for your OS. I am relying fully on those apps for the renewal process.  

Next step is, i am choosing the HTTP-01 method for LE, so i need a DNAT for LE to my Ubuntu.

  (V17.5). 

 (V18). 

PS: I am using HTTP DNAT for the renewal process and deactivate those Rules after the process. But you can also use only the LE IPs: 
https://community.letsencrypt.org/t/can-i-get-list-ip-from-letsencrypt/57117
PS2: You could switch to the DNS validation like explained in this Community thread.  

Next steps would be to check your Domain. Your DNS A-Record should point to your WAN IP. Otherwise this process will not work. 
So perform a dig / nslookup of your domain. It should point to your WAN IP, so your DNAT will work and HTTP packets are forwarded to Certbot. 
You can also use the Sophos free DDNS service. https://community.sophos.com/kb/en-us/123126 

Certbot

Lets start certbot and try it. 
My renewal process is straight forward:


(Be careful: LE blocks you after couple of "failed" request for some time. So check everything!).
In the End you will get 4 files on your Linux: Public, Chain, Fullchain, Privatkey Certificates. 

Upload to XG

You will use this Public and Privatkey certificate. 
There are couple of approaches to upload this to XG. 

The first LE Cert can be simply uploaded. 
You should use the Public.pem in "Certificate" and the Privatkey in "Privat key". 
PS: you have to rename the Privatkey.pem to Privatkey.key, otherwise XG will not take this certificate. 

 

Optionally you can upload the other Chain and fullchain Certificate under Certificate Authorities (Without Privat key). 
Now you can use this Certificate for WAF/Webadmin. 

In case of renewal (each 90 Days), you have to choose a process.

Automation 
You can simply upload the new LE certificate with another Name and replace it in WAF/Webadmin. 
Or you can "update" the current LE certificate with new public.pem / privat.key. But for this method, you have to switch to a fallback certificate in WAF/Webadmin, because XG cannot update a certificate, which is currently in use.  

After all, those steps are manual process each 90 Days. 
You can "script" this, if you want to. So basically upload the certificate each 90 Days to XG. 
https://community.sophos.com/kb/en-us/132560
Other member in the community performed already scripts for this.
https://community.sophos.com/products/xg-firewall/f/sophos-xg-firewall-general-discussion/102208/upload-certificate-using-api
https://community.sophos.com/xg-firewall/f/discussions/126295/automatically-renew-let-s-encrypt-ssl-certificates-on-xg-using-powershell
https://github.com/mmccarn/sophos
If you want to script this, this community can help you in case you are struggling with a point! 
So simply open a new thread with your issue with the API, we will try to find a solution. 

Contribution:
 https://zerossl.com/free-ssl/#crt Free alternative to this approach
For the Github script. 



Typo + New Stuff
[bearbeitet von: LuCar Toni um 10:48 AM (GMT -8) am 28 Feb 2021]
Parents Reply
  • As i mentioned earlier: If LetsEncrypt is your only blocker, you can easily workaround this. It would only take some minutes of your time.

    I am not in the position to comment on the roadmap and prioritization. I simply show up a way to workaround this easily. 

    __________________________________________________________________________________________________________________

Children
  • Then please get this forwarded to the engeneers who implement it ASAP.

    We do have a ZERO downtime Policy for our Services hosted behind our UTM WAF atm and such a blatent crappy workaround is an absolut showstopper for us. Either automatic renewal in the WAF itelf or no XG period was the announcement from my bosses.

  • Thanks for your feedback. This feature is on the backlog for future implementation.

    __________________________________________________________________________________________________________________