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

    Authenicated NTP

    Scheduled Pinned Locked Moved General pfSense Questions
    78 Posts 11 Posters 18.3k 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.
    • JonathanLeeJ
      JonathanLee @MatthewA1
      last edited by

      @MatthewA1 I couldn't agree with you more. YES 💯

      Make sure to upvote

      1 Reply Last reply Reply Quote 1
      • M
        marcosm Netgate
        last edited by marcosm

        Are there authenticated NTP servers for public use other than the NIST ones? I wanted to test this and see what the generated ntp conf files look like, but not if the only option is to fax/snailmail a request. To be honest, it seems to me that time would be better spent implementing NTS instead.

        M 1 Reply Last reply Reply Quote 0
        • M
          MatthewA1 @marcosm
          last edited by MatthewA1

          @marcosm NIST actually does it completely by email now, but the website is out of date. I just got a key last week actually, and it was about a 3 day turnaround. You just email internet-time-service@nist.gov with the same information they previously wanted by mail or fax.
          As far as I know, there is not anyone else (aside from one-off NTP servers) that provides authenticated NTP services, or at least not for free. NTP.org does not support it for sure. It looks like Canada's NRC does but for a significant fee.

          1 Reply Last reply Reply Quote 1
          • JonathanLeeJ
            JonathanLee
            last edited by

            Did the GitHub package get merged with the updates? I saw you submitted them this morning. EPIC!!!

            Make sure to upvote

            1 Reply Last reply Reply Quote 0
            • JonathanLeeJ
              JonathanLee
              last edited by

              Did this github ever get merged?

              847e417b5612f28bc1e84ca028a980df9c5c57a7

              I can pull it in patches now

              Make sure to upvote

              M 1 Reply Last reply Reply Quote 0
              • JonathanLeeJ JonathanLee referenced this topic on
              • M
                MatthewA1 @JonathanLee
                last edited by

                @JonathanLee It has not, and I have not seen any further feedback.
                I agree these aren't all the changes that it would be nice if were implemented, but it at least takes it from an almost useless feature (because you are never going to get the key ID 1 from a shared system) to something with some problems.
                I'm willing to add some of the missing pieces (e.g., per server authentication) but I'm not inclined to do so if it isn't going to be reviewed. As I mentioned in the Redmine issue, if someone can tell me what the most important changes needed for this to be accepted are, I'd take care of them.
                @marcosm Sure, I think NTS would be great, but for now, at least as far as I can tell, none of the major time providers support NTS, and I doubt many GPS based time systems will support it for some time (at least the lower-end systems)

                JonathanLeeJ 1 Reply Last reply Reply Quote 0
                • JonathanLeeJ
                  JonathanLee @MatthewA1
                  last edited by

                  @MatthewA1 Netgate I have been told has a very small staff and strict budget, they will get to it eventually. Don't be discouraged.

                  Make sure to upvote

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

                    I made an update where authentication can be enabled or disabled per server/peer (and it actually validates that you didn't enable authentication for a pool).
                    The latest version can be applied using the package patch using this URL if anyone wants to test:
                    https://github.com/pfsense/pfsense/pull/4658.diff

                    Side note: I would like to further improve this by allowing multiple keys to be configured and then have a dropdown for each server to select the key (or no authentication), but I don't see any way to do that without making some significant changes to the config.xml format. I don't think I should go down that road without input from Netgate first though.
                    I think this needs to be done anyways to resolve some other issues such as:

                    1. Like @marcosm pointed out on Redmine, there are two places to configure NTP servers, but they edit the same config option while implying they are separate settings
                    2. Disabling the NTP server from Services > NTP results in ignoring time servers set in System > General Setup, but there is no indication of that on the General Setup page

                    I'll add a couple more notes on this to the Redmine. I'm not sure if this should be a separate ticket or not either, but I think I don't want them in the same branch/PR for now.

                    JonathanLeeJ 3 Replies Last reply Reply Quote 1
                    • JonathanLeeJ
                      JonathanLee @MatthewA1
                      last edited by JonathanLee

                      @MatthewA1 said in Authenicated NTP:

                      Screenshot 2024-03-04 at 14.39.05.png

                      I can see the new radio button options now it looks good

                      Make sure to upvote

                      1 Reply Last reply Reply Quote 1
                      • JonathanLeeJ
                        JonathanLee @MatthewA1
                        last edited by

                        @MatthewA1 Open a redline and put the patch and the GitHub into it, Netgate will see it in 2 seconds after that, I bet it will be added to the development version if you do that route.

                        Make sure to upvote

                        1 Reply Last reply Reply Quote 0
                        • JonathanLeeJ
                          JonathanLee @MatthewA1
                          last edited by JonathanLee

                          @MatthewA1 Only error I see so far..

                          Screenshot 2024-03-04 at 14.48.55.png

                          line 0 column 0 syntax error, unexpected $end

                          Make sure to upvote

                          M 1 Reply Last reply Reply Quote 1
                          • M
                            MatthewA1 @JonathanLee
                            last edited by

                            @JonathanLee Hmm, I'm not sure what is causing that. However, I checked an unmodified pfSense CE 2.7.2 and pfSense Plus 23.09.1 and this shows up in the logs on both of those appliances after a reboot. Also interesting is that it does not occur on a service restart, only on a system reboot.

                            JonathanLeeJ 1 Reply Last reply Reply Quote 1
                            • JonathanLeeJ
                              JonathanLee @MatthewA1
                              last edited by

                              @MatthewA1 when I removed the patch it goes away, I think it has to do with the status page adjustments.

                              Make sure to upvote

                              1 Reply Last reply Reply Quote 0
                              • JonathanLeeJ JonathanLee referenced this topic on
                              • M
                                MaximillianC @LamaZ
                                last edited by

                                Anybody else using authenticated NTP?

                                We got our config info from that very nice gentleman Judah at NIST over a year ago, and I just now--as in, an hour ago- finally found the time to get ours working right with pfSense. :) I try to be a security nut, and, from what I understand, NIST's authenticated NTP service feels like the most secure inexpensive option for time sync.

                                As far as how I got it configured, I really appreciate your work above, @LamaZ, as it helped me quickly find where I needed to make changes in pfSense to get it all working. Ultimately, I just ended up commenting out the code in that system_ntp_configure() function you mentioned that overwrites the NTPD .keys and .conf files, and just populated the files myself, by hand. That seemed like a pretty quick and easy way to get it working.

                                It definitely would be nice if the pfSense UI supported this, but in the meantime, I guess we can just keep hacking the system_ntp_configure() function whenever it's modified, to keep it from overwriting the config files. 😁 I definitely encourage everyone who is using pfSense as their corporate firewall to get their firewall(s) set up as secure/authenticated NTP servers, though. It's just one more way to reduce would-be hackers' attack vectors, right?

                                L 1 Reply Last reply Reply Quote 2
                                • L
                                  LamaZ @LamaZ
                                  last edited by

                                  @LamaZ Folks, just upgraded to pfSense+ 24.03-RELEASE and this still works.

                                  I fumbled and didn't quite get @MatthewA1's sweet patch method working yet. That would of carried over across the upgrade right?

                                  M 1 Reply Last reply Reply Quote 2
                                  • L
                                    LamaZ @MaximillianC
                                    last edited by

                                    @MaximillianC Warms my heart! Make me glad knowing that my efforts helped someone out there.

                                    I just updated and revisited this page to remind myself how to get this working again. :) I had high hopes the changes would have made it in by now.

                                    1 Reply Last reply Reply Quote 1
                                    • JonathanLeeJ
                                      JonathanLee
                                      last edited by

                                      @stephenw10

                                      I am missing my photos here too :( Can you help with a couple of these posts the photos are vanishing ..

                                      Make sure to upvote

                                      1 Reply Last reply Reply Quote 0
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        Probably not those from the begining of March unfortunately. For some period attachments were being uploaded to an invalid storage location and when that was corrected those were effectively lost. But all other attachments (since the move to NodeBB) were restored.

                                        1 Reply Last reply Reply Quote 1
                                        • M
                                          MatthewA1 @LamaZ
                                          last edited by

                                          @LamaZ It looks like the way to get config properties was updated a couple weeks ago (63d6bb4) so at least in current builds off master, the patch will not cleanly apply. I believe it should still apply cleanly for the latest release version.

                                          1 Reply Last reply Reply Quote 2
                                          • M
                                            MatthewA1
                                            last edited by

                                            If anyone wants to test (@JonathanLee ?), I've rebased the work onto the current state of master and updated the config accesses to use the new required functions. Below is the current patch, and the latest version is always available from the GitHub PR diff.
                                            ntp-authentication-feature_20240620.patch
                                            pfsense/pfsense#4658 diff
                                            I don't have my development environment up and running at the moment (getting a new NTP key) so I haven't tested this yet. I think it will work, but the patch may not apply to the current 2.7.0 release. There's also no dev snapshots available at the moment it seems, so if it doesn't apply to 2.7.0 release, and advice on how to test in the absence of dev snapshots would be appreciated.

                                            JonathanLeeJ M 2 Replies Last reply Reply Quote 2
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.