Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use utc time in logs to avoid user location getting disclosed #1192

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

chaitanyaprem
Copy link
Collaborator

@chaitanyaprem chaitanyaprem commented Aug 13, 2024

Description

fixes #1191

Changes

  • changed default source to return time in UTC . @richard-ramos i have noticed NTP is not being used in status, but if NTP is used would the timesource provide time in UTC or local tz?
  • changed other places where time is logged to use UTC

waku/v2/peermanager/peer_connector.go Outdated Show resolved Hide resolved
@richard-ramos
Copy link
Member

richard-ramos commented Aug 13, 2024

if NTP is used would the timesource provide time in UTC or local tz?

You would get the local time

@richard-ramos
Copy link
Member

richard-ramos commented Aug 13, 2024

Is this change because of logging? because if so I wonder if we should instead create a logging utils that receives a time and automatically converts it into UTC, instead of modifying the code to use UTC? Something like this in logging/logging.go:

func UTCLogger(key string, t time.Time) zap.Field {
	return zap.Time(key, time.UTC())
}

Then we'd look for all the instances of zap.Time in the code and replace it by logging.UTCTime (which seems to happen only in 4 places)

@chaitanyaprem chaitanyaprem merged commit 3b2cde8 into master Aug 14, 2024
12 checks passed
@chaitanyaprem chaitanyaprem deleted the chore/logs-utc branch August 14, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: go-waku logs zone-sensitive time
4 participants