Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Let's Encypt support

    Scheduled Pinned Locked Moved ACME
    86 Posts 34 Posters 58.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NOYB
      last edited by

      @johnpoz:

      But why not just get a https for a year from free like start or there are other places they cost a whole $10 a year.

      Let's Encrypt cert is in essence good for as long as the automation runs.

      @johnpoz:

      If your so cheap to not want to pay for your ssl.. Just don't bother doing your captive portal via https - or use self signed and deploy that to your users of your captive portal on the your going to have anyway on the http url for the captive portal.

      It's not always only about the money.  Let's Encrypt cert automation can be very appealing too.

      1 Reply Last reply Reply Quote 0
      • F
        firewalluser
        last edited by

        @David_W:

        @pwnd28:

        Nobody realy knows if the CA you use is trustfull or has a connection to the government or an other party.

        Best practice is to generate the private key you wish to use for a certificate locally on an uncompromised machine with a cryptographically secure random number generator. In this scenario the security of the private key is entirely in your hands because the Certificate Signing Request sent to the CA does not contain the private key.

        Thats the rub, even if you had an uncompromised machine so many zero days make it possible to obtain such things so if you ever get something like this in your bios http://blog.trendmicro.com/trendlabs-security-intelligence/hacking-team-uses-uefi-bios-rootkit-to-keep-rcs-9-agent-in-target-systems/ well you might just as well throw your system in the bin.

        Edit. I'll chuck this link in as its useful which might be of interest. http://www.uefi.org/sites/default/files/resources/UEFI_Secure_Boot_in_Modern_Computer_Security_Solutions_2013.pdf

        @johnpoz:

        I see no point to support of this on pfsense to be honest..  Other than maybe captive portal.  For the webgui to admin pfsense.. Just use CA on pfsense to create a cert and trust it on your machines you will admin pfsense from.  This really should be a really small list of machines!!

        I'm no longer using any encryption to access devices or services lan side as I cant inspect the data, any encryption found can be blocked by snort/suricata and investigated. Things like web access to secure websites now take place on a separate device from a linux live cd with no hard drive or other forms of storage and an easily flashable bios.

        As to accessing pfsense, switches etc, as above but usernames/password are locally stored so no radius servers for convenience, as its all about minimising the risk of unknowns or to use a more popular phrase, zero days.

        If your so cheap to not want to pay for your ssl.. Just don't bother doing your captive portal via https - or use self signed and deploy that to your users of your captive portal on the your going to have anyway on the http url for the captive portal.

        Its not so much about being cheap, but trusting the other entities in the supply chain, as it is we have to trust so many people already, reducing that risk just makes sense, which is why we dont trust some people to do some things for us. Others we have to trust when we are incapable of doing something, but where possible its better to do what you can where possible.

        Capitalism, currently The World's best Entertainment Control System and YOU cant buy it! But you can buy this, or some of this or some of these

        Asch Conformity, mainly the blind leading the blind.

        1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator
          last edited by

          @NOYB:

          Let's Encrypt cert is eventually good for as long as the automation runs.

          And how often does it look to update?  Every day?  What if goes to update day before the cert runs out and fails to update for whatever reason - issue on their end, firewall problem on your end, etc.

          I don't see the automated updating of ssl to be a good thing to be honest.  While I can see this useful on say personal site on some webhost for more users to start using https for their sites.  I just do not really see a need off pfsense.. Its a firewall not a WEB SERVER..  Using some automated process to use https for your webgui just seems silly.  There should be what a handful of people accessing a firewall gui in the first place.. So why not just issue your own self signed and have those machines used to access it trust the CA that is completely under your control.

          Now if you want to use it on your web server behind pfsense - have at it.. I will prob use this on some of my play systems.. Just don't see need/use on my firewall at all.. Especially when that firewall system has a CA..

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          1 Reply Last reply Reply Quote 0
          • N
            NOYB
            last edited by

            John,

            Please go read up on the subject before acting like an expert.

            1 Reply Last reply Reply Quote 0
            • S
              stanthewizard
              last edited by

              I think too a package would be very useful especially when you use squid reverse proxy with Apache and Exchange.

              :)

              1 Reply Last reply Reply Quote 0
              • F
                fourseasons
                last edited by

                I wanted to open a new thread on this but found this one just before posting.  ::)

                –-

                Let's encrypt is a new CA that will begin signing free trusted certificates to the public on 3.12.2015.

                The project is founded by the likes of of Mozilla, Akamai, Cisco and the EFF who work together in the  Internet Security Research Group (ISRG). [1]

                The "catch" is that the certificates have a lifetime of 90 days. Their reasoning behind this is that they want to limit damage from key compromises and they want to encourage automation, which I think makes sense. [2]

                These free certificates would be perfect for some pfsense applications like the captive portal or the pfsense web interface.
                From what I can tell it has already been implemented in python or javascript so it should run on FreeBSD.

                [1] https://en.wikipedia.org/wiki/Internet_Security_Research_Group
                [2] https://letsencrypt.org/2015/11/09/why-90-days.html

                1 Reply Last reply Reply Quote 0
                • P
                  pwnd28
                  last edited by

                  @fourseasons:

                  I wanted to open a new thread on this but found this one just before posting.  ::)

                  –-

                  Let's encrypt is a new CA that will begin signing free trusted certificates to the public on 3.12.2015.

                  The project is founded by the likes of of Mozilla, Akamai, Cisco and the EFF who work together in the  Internet Security Research Group (ISRG). [1]

                  The "catch" is that the certificates have a lifetime of 90 days. Their reasoning behind this is that they want to limit damage from key compromises and they want to encourage automation, which I think makes sense. [2]

                  These free certificates would be perfect for some pfsense applications like the captive portal or the pfsense web interface.
                  From what I can tell it has already been implemented in python or javascript so it should run on FreeBSD.

                  [1] https://en.wikipedia.org/wiki/Internet_Security_Research_Group
                  [2] https://letsencrypt.org/2015/11/09/why-90-days.html

                  That sounds good. I think i will try to chnage my pfsense to the letsencrypt ca in the christmas hollidys.
                  i will post my experiences :)

                  1 Reply Last reply Reply Quote 0
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator
                    last edited by

                    NOYB..  And in what point did I say I was an expert?  And at what point did I sound like one.. Please explain to me why a FIREWALL with limited access to its webgui by only ADMINS that has its own built in CA already would need/want and automated system to install a cert that expires every 90 days if it can not phone home..

                    I just do not get it??  I have a cert on my web gui, took all of 2 seconds to create and trust from my different machines I admin pfsense from..

                    I mentioned already that it might be a good idea for something like captive portal as well.

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.8, 24.11

                    1 Reply Last reply Reply Quote 0
                    • S
                      singerie
                      last edited by

                      The project is now in public beta.

                      It seems to be supported on freebsd :

                      https://letsencrypt.readthedocs.org/en/latest/contributing.html#freebsd

                      https://letsencrypt.readthedocs.org/en/latest/using.html#installation-and-usage

                      1 Reply Last reply Reply Quote 0
                      • F
                        filnko
                        last edited by

                        gonzopancho mentioned on reddit that there will be a let's encrypt package in 2.4  ;D

                        1 Reply Last reply Reply Quote 0
                        • S
                          singerie
                          last edited by

                          Package is there in the nightly, but i don't know how to use it … lol

                          1 Reply Last reply Reply Quote 0
                          • jimpJ
                            jimp Rebel Alliance Developer Netgate
                            last edited by

                            @singerie:

                            Package is there in the nightly, but i don't know how to use it … lol

                            It depends on what you want to do with it. For the GUI:

                            Visit keys tab, make a new entry, click the button to generate a new account key, then click the button to register the key, then save.

                            Visit the certs tab, make a new cert, enter a hostname and setup a challenge/response method in the SAN list (pick a method, click +, enter the details), then save, then click issue/renew.

                            What you can use for the challenge depends on what you have available. If your DNS provider for your domain is listed you can probably use one of the DNS update methods, or if your server supports RFC2136 you could setup keys for the TXT records it wants to make and use the nsupdate option (this is what I prefer to do).

                            I would advise against attempting the webroot method directly on the firewall. You could port forward port 80 on the firewall's WAN address to a local web server and then use the webroot FTP option perhaps if you don't have any other choice.

                            Once you have managed to get a cert issued, go to System > Advanced, pick it for the GUI cert. Edit the cert entry in the ACME package and setup a new action for a shell command to run /etc/rc.restart_webgui, save again. Visit the general settings tab and check the box, then save.

                            If you want to use it for something other than the GUI, repeat the process but pick it wherever you need to use it instead (e.g. haproxy), though your update method may vary for that.

                            I'll write up a more thorough doc on it eventually.

                            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                            Need help fast? Netgate Global Support!

                            Do not Chat/PM for help!

                            1 Reply Last reply Reply Quote 0
                            • M
                              moscato359
                              last edited by

                              @KOM:

                              90 days??  Geez, why waste time with that when you can get a freebie from StartSSL that's good for a year.

                              The let's encrypt script can be put on cron, and automate every 90 days with a new cert.

                              It's done regularly on linux webservers.

                              1 Reply Last reply Reply Quote 0
                              • M
                                mandrekogmail.com
                                last edited by

                                @KOM:

                                90 days??  Geez, why waste time with that when you can get a freebie from StartSSL that's good for a year.

                                One reason may be that the newest version of Google Chrome is no longer trusting StartSSL, due to their parent company doing some shady things.

                                1 Reply Last reply Reply Quote 0
                                • Y
                                  yodaphone
                                  last edited by

                                  @jimp:

                                  @singerie:

                                  Package is there in the nightly, but i don't know how to use it … lol

                                  It depends on what you want to do with it. For the GUI:

                                  Visit keys tab, make a new entry, click the button to generate a new account key, then click the button to register the key, then save.

                                  Visit the certs tab, make a new cert, enter a hostname and setup a challenge/response method in the SAN list (pick a method, click +, enter the details), then save, then click issue/renew.

                                  What you can use for the challenge depends on what you have available. If your DNS provider for your domain is listed you can probably use one of the DNS update methods, or if your server supports RFC2136 you could setup keys for the TXT records it wants to make and use the nsupdate option (this is what I prefer to do).

                                  I would advise against attempting the webroot method directly on the firewall. You could port forward port 80 on the firewall's WAN address to a local web server and then use the webroot FTP option perhaps if you don't have any other choice.

                                  Once you have managed to get a cert issued, go to System > Advanced, pick it for the GUI cert. Edit the cert entry in the ACME package and setup a new action for a shell command to run /etc/rc.restart_webgui, save again. Visit the general settings tab and check the box, then save.

                                  If you want to use it for something other than the GUI, repeat the process but pick it wherever you need to use it instead (e.g. haproxy), though your update method may vary for that.

                                  I'll write up a more thorough doc on it eventually.

                                  awesome.. i had my dns with namecheap & wasnt able to figure out how to do NSUpdate with them. so moved it to cloudflare & it worked.

                                  If you use cloudflare make sure the dns uses cloudflare DNS only & has a grey cloud.  Grey Cloud: Records that display a grey cloud icon will bypass Cloudflare, using only Cloudflare DNS

                                  if you have an orange cloud the auth fails. you can re-enable it after the cert is issued

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    doktornotor Banned
                                    last edited by

                                    If someone really insists on using  a local webroot.

                                    1/ Install HAproxy package.
                                    2/ Put this to  HAProxy > Files (Type - Lua script, Name: acme-http01-webroot.lua)

                                    (or download from here)

                                    
                                    -- ACME http-01 domain validation plugin for Haproxy 1.6+
                                    -- copyright (C) 2015 Jan Broer
                                    --
                                    
                                    acme = {}
                                    acme.version = "0.1.1"
                                    
                                    --
                                    -- Configuration
                                    --
                                    -- When HAProxy is *not* configured with the 'chroot' option you must set an absolute path here and pass 
                                    -- that as 'webroot-path' to the letsencrypt client
                                    
                                    acme.conf = {
                                    	["non_chroot_webroot"] = ""
                                    }
                                    
                                    --
                                    -- Startup
                                    --  
                                    acme.startup = function()
                                    	core.Info("[acme] http-01 plugin v" .. acme.version);
                                    end
                                    
                                    --
                                    -- ACME http-01 validation endpoint
                                    --
                                    acme.http01 = function(applet)
                                    	local response = ""
                                    	local reqPath = applet.path
                                    	local src = applet.sf:src()
                                    	local token = reqPath:match( ".+/(.*)$" )
                                    
                                    	if token then
                                    		token = sanitizeToken(token)
                                    	end
                                    
                                    	if (token == nil or token == '') then
                                    		response = "bad request\n"
                                    		applet:set_status(400)
                                    		core.Warning("[acme] malformed request (client-ip: " .. tostring(src) .. ")")
                                    	else
                                    		auth = getKeyAuth(token)
                                    		if (auth:len() >= 1) then
                                    			response = auth .. "\n"
                                    			applet:set_status(200)
                                    			core.Info("[acme] served http-01 token: " .. token .. " (client-ip: " .. tostring(src) .. ")")
                                    		else
                                    			response = "resource not found\n"
                                    			applet:set_status(404)
                                    			core.Warning("[acme] http-01 token not found: " .. token .. " (client-ip: " .. tostring(src) .. ")")
                                    		end
                                    	end
                                    
                                    	applet:add_header("Server", "haproxy/acme-http01-authenticator")
                                    	applet:add_header("Content-Length", string.len(response))
                                    	applet:add_header("Content-Type", "text/plain")
                                    	applet:start_response()
                                    	applet:send(response)
                                    end
                                    
                                    --
                                    -- strip chars that are not in the URL-safe Base64 alphabet
                                    -- see https://github.com/letsencrypt/acme-spec/blob/master/draft-barnes-acme.md
                                    --
                                    function sanitizeToken(token)
                                    	_strip="[^%a%d%+%-%_=]"
                                    	token = token:gsub(_strip,'')
                                    	return token
                                    end
                                    
                                    --
                                    -- get key auth from token file
                                    --
                                    function getKeyAuth(token)
                                            local keyAuth = ""
                                            local path = acme.conf.non_chroot_webroot .. "/.well-known/acme-challenge/" .. token
                                            local f = io.open(path, "rb")
                                            if f ~= nil then
                                                    keyAuth = f:read("*all")
                                                    f:close()
                                            end
                                            return keyAuth
                                    end
                                    
                                    core.register_init(acme.startup)
                                    core.register_service("acme-http01", "http", acme.http01)
                                    
                                    

                                    3/ Create a very simple http frontend on WAN address, port 80.

                                    4/ Use this for your certificate(s) in ACME package:

                                    [EDIT: The image host originally used in this post is dead. Fixed using cached copies of the images on another host -jimp]

                                    1 Reply Last reply Reply Quote 2
                                    • R
                                      reggie14
                                      last edited by

                                      Is there any chance that this will work with Google Domain's DNS?  It doesn't look Google provides a way to create txt records using their Dynamic DNS API.

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        Tentacruel
                                        last edited by

                                        @jimp:

                                        What you can use for the challenge depends on what you have available. If your DNS provider for your domain is listed you can probably use one of the DNS update methods, or if your server supports RFC2136 you could setup keys for the TXT records it wants to make and use the nsupdate option (this is what I prefer to do)..

                                        I've been trying to get the manual method to work with he.net, but can't figure out how to generate the TXT key - While I know I need to add it manually to my DNS, is the generation of the key included in your package or is there a manual step required here?

                                        /SJ

                                        1 Reply Last reply Reply Quote 0
                                        • jimpJ
                                          jimp Rebel Alliance Developer Netgate
                                          last edited by

                                          @Tentacruel:

                                          @jimp:

                                          What you can use for the challenge depends on what you have available. If your DNS provider for your domain is listed you can probably use one of the DNS update methods, or if your server supports RFC2136 you could setup keys for the TXT records it wants to make and use the nsupdate option (this is what I prefer to do)..

                                          I've been trying to get the manual method to work with he.net, but can't figure out how to generate the TXT key - While I know I need to add it manually to my DNS, is the generation of the key included in your package or is there a manual step required here?

                                          /SJ

                                          That was the first method I tested. Define the domain name entry and then click issue/renew. In the green output it tells you what the content of the record should be. Add it to DNS and then wait 2-3 minutes to be sure the record is available, then click issue/renew again.

                                          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                          Need help fast? Netgate Global Support!

                                          Do not Chat/PM for help!

                                          1 Reply Last reply Reply Quote 0
                                          • E
                                            execcr
                                            last edited by

                                            Hello,
                                            new user here. Fresh pfsense install update to 2.3.2_1
                                            I've installed the acme package but i have some problems with Route 53 Dns validation
                                            The output say that:

                                            [Mon Feb 6 17:24:12 CET 2017] Registering account
                                            [Mon Feb 6 17:24:13 CET 2017] Already registered
                                            [Mon Feb 6 17:24:14 CET 2017] Update success.
                                            [Mon Feb 6 17:24:14 CET 2017] Single domain='test.sanitazedomain.it'
                                            [Mon Feb 6 17:24:14 CET 2017] Getting domain auth token for each domain
                                            [Mon Feb 6 17:24:14 CET 2017] Getting webroot for domain='test.sanitazedomain.it'
                                            [Mon Feb 6 17:24:14 CET 2017] _w='dns_aws'
                                            [Mon Feb 6 17:24:14 CET 2017] Getting new-authz for domain='test.sanitazedomain.it'
                                            [Mon Feb 6 17:24:15 CET 2017] The new-authz request is ok.
                                            [Mon Feb 6 17:24:16 CET 2017] Found domain api file: /usr/local/pkg/acme/dnsapi/dns_aws.sh
                                            [color][Mon Feb 6 17:24:18 CET 2017] Error add txt for domain:_acme-challenge.test.sanitazedomain.it[/color]
                                            [Mon Feb 6 17:24:18 CET 2017] Please check log file for more details: /tmp/acme/test/acme_issuecert.log
                                            

                                            i checked the log and seem to fail at curl command to retriete http.header.
                                            If i open HTTP.HEADER file in the acme domain folder (test in this case) i get:

                                            HTTP/1.1 505 HTTP Version not supported
                                            Date: Mon, 06 Feb 17 16:24:18 GMT
                                            Connection: close
                                            x-amz-id-2: 1rjTvEvOKQpJ5zruKVbddXvS15q4+I1y/+r2qirC9S8MYXm1esOQYwkOscLruZW8zzvK0+WY8BOQiy8GvYMu0rx0Uwq8WqlH
                                            x-amz-request-id: 8B82C340F9CA158D
                                            Content-Length: 0
                                            
                                            

                                            any hint? Aws access ID and secret key seems ok. I've tried also to get full access to this IAM user to Route53

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.