Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: remove stream url from info logs #1341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martinohmann
Copy link

@martinohmann martinohmann commented Sep 6, 2024

Updates #238

This solves the most prominent credential leak. With every new connection the passwords were leaked to the logs visible in the UI as well.

With this change only the stream name gets logged here.

There are other places in the codebase where we still log secret embedded in URLs, but a lot of them lack access to the stream name they could be replaced with. Most of these occurances are debug logs (which are not an issue if you're running go2rtc at >= info level), but some are warning level though. I can try to come up with a fix in a followup PR.

This change is a simpler alternative to #1219 to address the issue to rid of the password in the log line emitted whenever a stream is created.

Before:

[streams] create new stream url=rtsp://stream:xxxxxxxxxx@192.168.42.42:554/stream1

After:

[streams] create new stream garage-cam

This solves the most prominent credential leak. With every new
connection the passwords were leaked to the logs visible in the UI as
well.

With this change only the stream name gets logged here.

There are other places in the codebase where we still log secret
embedded in URLs, but a lot of them lack access to the stream name they
could be replaced with. Most of these occurances are debug logs, but
some are warning level though. I can try to come up with a fix in a
followup PR.

This change is a simpler alternative to
AlexxIT#1219 to address the issue to rid
of the password in the log line emitted whenever a stream is created:

    [streams] create new stream url=rtsp://stream:xxxxxxxxxx@192.168.42.42:554/stream1

    [streams] create new stream garage-cam
log zerolog.Logger
streams = map[string]*Stream{}
streamsMu sync.Mutex
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gofmt did this

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant