OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 23.1 Legacy Series »
  • Secure NTP
« previous next »
  • Print
Pages: [1]

Author Topic: Secure NTP  (Read 6636 times)

ks98330q

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Secure NTP
« on: April 27, 2023, 05:27:27 am »
Just checking to see if secure NTP can be configured on OPNSense.
If not, could it be enabled?

Logged

CJ

  • Hero Member
  • *****
  • Posts: 832
  • Karma: 30
    • View Profile
    • Have Answer, Will Blog
Re: Secure NTP
« Reply #1 on: April 27, 2023, 01:49:38 pm »
Interesting.  I hadn't realized there was an effort to do secure NTP.

Is your concern interception between the internet and the OPNSense machine, OPNSense and your LAN clients, or your LAN clients to the internet?
Logged
Have Answer, Will Blog

lilsense

  • Hero Member
  • *****
  • Posts: 600
  • Karma: 19
    • View Profile
Re: Secure NTP
« Reply #2 on: April 27, 2023, 02:11:26 pm »
you can install Chrony and use NTS.
Logged

abulafia

  • Full Member
  • ***
  • Posts: 156
  • Karma: 8
    • View Profile
Re: Secure NTP
« Reply #3 on: April 27, 2023, 10:44:27 pm »
Quote from: lilsense on April 27, 2023, 02:11:26 pm
you can install Chrony and use NTS.
Yep. Here's a list of NTS servers:
- https://gist.github.com/jauderho/2ad0d441760fc5ed69d8d4e2d6b35f8d
- https://gitlab.com/-/snippets/2481323

I use:
time.cloudflare.com,ptbtime1.ptb.de,ptbtime2.ptb.de,ptbtime3.ptb.de,ntp2.glypnod.com,nts.sth1.ntp.se,nts.sth2.ntp.se,ntp.3eck.net,ntp.trifence.ch,ntp.zeitgitter.net,nts1.adopo.net,www.jabber-germany.de,www.masters-of-cloud.de,ntppool1.time.nl,ntppool2.time.nl,ptbtime4.ptb.de,paris.time.system76.com,ntp3.fau.de
Logged

ks98330q

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Secure NTP
« Reply #4 on: April 28, 2023, 04:06:37 pm »
Quote from: CJRoss on April 27, 2023, 01:49:38 pm
Interesting.  I hadn't realized there was an effort to do secure NTP.

Is your concern interception between the internet and the OPNSense machine, OPNSense and your LAN clients, or your LAN clients to the internet?

Yes.  It obviously isnt well known, or most dont reallly give $.02 about it.  Anyway, NIST in the US offers an authenticated NTP service. Its free, and renews every september. 
Logged

ks98330q

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Secure NTP
« Reply #5 on: April 28, 2023, 04:07:10 pm »
Quote from: abulafia on April 27, 2023, 10:44:27 pm
Quote from: lilsense on April 27, 2023, 02:11:26 pm
you can install Chrony and use NTS.
Yep. Here's a list of NTS servers:
- https://gist.github.com/jauderho/2ad0d441760fc5ed69d8d4e2d6b35f8d
- https://gitlab.com/-/snippets/2481323

I use:
time.cloudflare.com,ptbtime1.ptb.de,ptbtime2.ptb.de,ptbtime3.ptb.de,ntp2.glypnod.com,nts.sth1.ntp.se,nts.sth2.ntp.se,ntp.3eck.net,ntp.trifence.ch,ntp.zeitgitter.net,nts1.adopo.net,www.jabber-germany.de,www.masters-of-cloud.de,ntppool1.time.nl,ntppool2.time.nl,ptbtime4.ptb.de,paris.time.system76.com,ntp3.fau.de

Ill give it a try....
Logged

depc80

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
    • View Profile
Re: Secure NTP
« Reply #6 on: April 29, 2023, 11:18:22 pm »
Quote from: abulafia on April 27, 2023, 10:44:27 pm
Quote from: lilsense on April 27, 2023, 02:11:26 pm
you can install Chrony and use NTS.
Yep. Here's a list of NTS servers:
- https://gist.github.com/jauderho/2ad0d441760fc5ed69d8d4e2d6b35f8d
- https://gitlab.com/-/snippets/2481323

I use:
time.cloudflare.com,ptbtime1.ptb.de,ptbtime2.ptb.de,ptbtime3.ptb.de,ntp2.glypnod.com,nts.sth1.ntp.se,nts.sth2.ntp.se,ntp.3eck.net,ntp.trifence.ch,ntp.zeitgitter.net,nts1.adopo.net,www.jabber-germany.de,www.masters-of-cloud.de,ntppool1.time.nl,ntppool2.time.nl,ptbtime4.ptb.de,paris.time.system76.com,ntp3.fau.de
Awesome. How to create a cron job to get it update everyday?
Logged

lilsense

  • Hero Member
  • *****
  • Posts: 600
  • Karma: 19
    • View Profile
Re: Secure NTP
« Reply #7 on: April 30, 2023, 10:25:16 pm »
chrony/ntp updates itself automagically...
Logged

depc80

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
    • View Profile
Re: Secure NTP
« Reply #8 on: May 03, 2023, 01:18:07 pm »
Thank you.
However I ran into an issue where enabled Chrony crashed OPNsense. Adguard logs see  a lot of queries every couple milliseconds. Took awhile to get to webgui so I could disable it. At first, I thought the issue was the redirect rule so I disabled it and also only added 1 server. Still seeing a lot of queries sending to Adguard. I ended up disabling Chrony for now.
Today I switched to Zenarmor since the latest update is working without problem for my OPNsense. Will try Chrony again later.
Logged

abulafia

  • Full Member
  • ***
  • Posts: 156
  • Karma: 8
    • View Profile
Re: Secure NTP
« Reply #9 on: May 04, 2023, 10:05:59 am »
Running adguard and chrony and never had an issue between those two.

I assume you have disabled the regular NTP server service? (Services -> Network Time -> General -> "Time Servers" empty and "Client Mode" ticked)

And another wild shot in the dark: You have disabled the rate limit in Adguard Home (Settings -> DNS Settings -> Rate Limit set to "0")?
« Last Edit: May 04, 2023, 10:40:07 am by abulafia »
Logged

depc80

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
    • View Profile
Re: Secure NTP
« Reply #10 on: May 05, 2023, 02:22:07 pm »
Quote from: abulafia on May 04, 2023, 10:05:59 am
Running adguard and chrony and never had an issue between those two.

I assume you have disabled the regular NTP server service? (Services -> Network Time -> General -> "Time Servers" empty and "Client Mode" ticked)

And another wild shot in the dark: You have disabled the rate limit in Adguard Home (Settings -> DNS Settings -> Rate Limit set to "0")?
I switch to Zenarmor for now, reduce ~40ms ping but it's a completely different topic. Anyway, would NAT redirect rule like DNS or NTP cause PTR flooding Adguard?
Today I installed Chrony and added a couple servers from here
Code: [Select]
https://gist.github.com/jauderho/2ad0d441760fc5ed69d8d4e2d6b35f8dAfter that I see a buttload of PTR resolve in Unbound logs right away. However, things seem going back to normal after restart or maybe bc I change NAT redirect NTP rule before DNS. Can't re-create the issue.
Logged

SteveK

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Secure NTP
« Reply #11 on: November 28, 2023, 12:20:00 pm »
Just found this topic...while I was about to implement secure NTP, too.

I have a question...setup:
- Install chrony, enable it, check " NTS Client Support", add the appropriate NTP servers in "NTP Peers"
- and for the network time service: remote all entries of time servers and check "Client support"

So far, the network service has provided NTP in all interfaces (set in "Interfaces" accordingly).

What is the "right approach"? Set the chrony "Listen port" to "123" + manually enter the networks in "Allowed Networks", like "10.55.10.0/24; 10.55.160.0/23" in order to provide NTP service?
I mean that by enabling "Client support" for the network time service ends the NTP service.
Logged

lilsense

  • Hero Member
  • *****
  • Posts: 600
  • Karma: 19
    • View Profile
Re: Secure NTP
« Reply #12 on: November 28, 2023, 12:46:17 pm »
You'd want to leave everything as default, but yes you should use the IP subnets and the individual interfaces as you don't want attacks from outside on NTP ports.
Logged

abulafia

  • Full Member
  • ***
  • Posts: 156
  • Karma: 8
    • View Profile
Re: Secure NTP
« Reply #13 on: January 23, 2024, 06:15:47 pm »
I gather the regular approach is to use firewall rules to control whether e.g. NTP is available or not to a given subnet, not limiting the "listen to" interface settings in each service.

Works for me. No WAN rule "pass"ing traffic to port 123 = nobody from outside can access my local NTP server.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 23.1 Legacy Series »
  • Secure NTP
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2