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

Support special characters in passwords, redacted logs & debug config #4057

Merged
merged 13 commits into from
Nov 2, 2022

Conversation

NickM-27
Copy link
Sponsor Collaborator

@NickM-27 NickM-27 commented Oct 9, 2022

Redact user:pass from cameras in logs and ffmpeg commands in debug

Example:

[2022-10-09 12:06:45] watchdog.no_cam                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-10-09 12:06:45] ffmpeg.no_cam.detect           ERROR   : [tcp @ 0xaaaace295ba0] Connection to tcp://192.168.50.106:554?timeout=5000000 failed: Connection refused
[2022-10-09 12:06:45] ffmpeg.no_cam.detect           ERROR   : rtsp://*:*@192.168.50.106/live0: Connection refused
[2022-10-09 12:06:45] frigate.video                  ERROR   : no_cam: Unable to read frames from ffmpeg process.
[2022-10-09 12:06:45] frigate.video                  ERROR   : no_cam: ffmpeg process is not running. exiting capture thread...

@NickM-27 NickM-27 linked an issue Oct 9, 2022 that may be closed by this pull request
frigate/const.py Outdated
# Regex Consts

REGEX_CAMERA_NAME = "^[a-zA-Z0-9_-]+$"
REGEX_CAMERA_USER_PASS = "[a-zA-Z0-9_-]+:[a-zA-Z0-9!$_-]+@"
Copy link
Sponsor Collaborator Author

Choose a reason for hiding this comment

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

I know we can't have special characters in password right now but figured might as well filter them out in case that changes.

Copy link
Owner

Choose a reason for hiding this comment

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

I'm sure we can fix that too. Might as well look at doing that here. They probably just need to be properly escaped when opening the subprocess.

@NickM-27 NickM-27 linked an issue Oct 9, 2022 that may be closed by this pull request
@NickM-27 NickM-27 changed the title Redacted logs & debug config Support special characters in passwords, redacted logs & debug config Oct 9, 2022
@blakeblackshear
Copy link
Owner

This one needs a rebase

@netlify
Copy link

netlify bot commented Nov 2, 2022

Deploy Preview for frigate-docs ready!

Name Link
🔨 Latest commit 9c41ce1
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/636259b380afd30008ccc072
😎 Deploy Preview https://deploy-preview-4057--frigate-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@blakeblackshear blakeblackshear merged commit 1bc9efd into blakeblackshear:dev Nov 2, 2022
@NickM-27 NickM-27 deleted the redacted-logs branch November 2, 2022 12:32
herostrat pushed a commit to herostrat/frigate that referenced this pull request Nov 24, 2022
…blakeblackshear#4057)

* Consts for regex

* Add regex for camera username and password

* Redact user:pass from ffmpeg logs

* Redact ffmpeg commands

* Move common function to util

* Add tests

* Formatting

* Remove unused imports

* Fix test

* Add port to test

* Support special characters in passwords

* Add tests for special character handling

* Remove docs about not supporting special characters
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.

Camera input fails with special "#" character in password Passwords are shown in frigate's logs
2 participants