From d3b254b6e0dd394c6029bca6e7ccfa20aec38912 Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Tue, 29 Sep 2026 12:11:22 -0400 Subject: [PATCH] Count Amazon's time servers as time sync Two Ring cameras showed up in Insights as "Started using a new app: Amazon" after they set their clocks from ntp-g7g.amazon.com, the time server Amazon's devices fall back to when their usual pool doesn't answer. The catalog gives every amazon.com name to the Amazon shopping app. ntp-g7g.amazon.com, and AWS's public time.aws.com, now belong to Time sync, which Insights leaves out of new app findings. --- internal/insights/devices/apps_test.go | 1 + internal/insights/services/catalog.go | 2 +- internal/insights/services/services_test.go | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/insights/devices/apps_test.go b/internal/insights/devices/apps_test.go index c7decdac..2189f043 100644 --- a/internal/insights/devices/apps_test.go +++ b/internal/insights/devices/apps_test.go @@ -26,6 +26,7 @@ func TestChangesReportAppsADeviceStartedUsing(t *testing.T) { {Name: "mesu.apple.com", FirstSeen: testNow.Add(-time.Hour)}, // A brand's public time server is time sync, not the brand's app. {Name: "time.facebook.com", FirstSeen: testNow.Add(-time.Hour)}, + {Name: "ntp-g7g.amazon.com", FirstSeen: testNow.Add(-time.Hour)}, // Remote access has a finding of its own. {Name: "region1.v2.argotunnel.com", FirstSeen: testNow.Add(-time.Hour)}, }, diff --git a/internal/insights/services/catalog.go b/internal/insights/services/catalog.go index 074a5815..db430158 100644 --- a/internal/insights/services/catalog.go +++ b/internal/insights/services/catalog.go @@ -211,7 +211,7 @@ var catalog = []catalogEntry{ // Big brands run public time servers under their own domains. Listing them // here keeps a clock sync from counting as the brand's app, as when a smart // switch sets its clock from time.facebook.com. - {Service{"ntp", "Time sync", CategoryPlatform}, []string{"pool.ntp.org", "time.apple.com", "time.windows.com", "time.google.com", "time1.google.com", "time2.google.com", "time3.google.com", "time4.google.com", "time.cloudflare.com", "time.facebook.com", "time1.facebook.com", "time2.facebook.com", "time3.facebook.com", "time4.facebook.com", "time5.facebook.com"}}, + {Service{"ntp", "Time sync", CategoryPlatform}, []string{"pool.ntp.org", "time.apple.com", "time.windows.com", "time.google.com", "time1.google.com", "time2.google.com", "time3.google.com", "time4.google.com", "time.cloudflare.com", "time.facebook.com", "time1.facebook.com", "time2.facebook.com", "time3.facebook.com", "time4.facebook.com", "time5.facebook.com", "ntp-g7g.amazon.com", "time.aws.com"}}, // Finance. {Service{"paypal", "PayPal", CategoryFinance}, []string{"paypal.com", "paypalobjects.com", "venmo.com"}}, diff --git a/internal/insights/services/services_test.go b/internal/insights/services/services_test.go index 8505f724..8a834cd7 100644 --- a/internal/insights/services/services_test.go +++ b/internal/insights/services/services_test.go @@ -39,6 +39,8 @@ func TestLookupPrefersTheMostSpecificOwner(t *testing.T) { {"time.facebook.com", "ntp"}, {"time3.facebook.com", "ntp"}, {"time2.google.com", "ntp"}, + {"ntp-g7g.amazon.com", "ntp"}, + {"www.amazon.com", "amazon"}, {"www.facebook.com", "facebook"}, {"mail.google.com", "gmail"}, {"eu.tectonic.remarkable.com", "remarkable"},