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

mask download url when there is a password #815

Merged
merged 11 commits into from
Oct 3, 2024
Merged

Conversation

jinxiao
Copy link
Contributor

@jinxiao jinxiao commented Sep 27, 2024

Pull Request

mask download url when there is a password.

Problem

When I use export N_NODE_MIRROR with username and password, I found that the password is a plaintext which cause our security concern.

Solution

I introduce a new variable called masked_url, when called log or something want to output the url, can use this variable.

ChangeLog

mask download url when there is a password. Introduce a new variable called masked_url, to implement this.
@shadowspawn
Copy link
Collaborator

I am open to this. There are quite a log of places an URL gets displayed. One place I am particularly aware of is in show_diagnostics, enough that I put in a warning Note: some output may contain passwords. Redact before sharing..

I suggest move the masking code into a function, say display_masked_url, so it can be used in more places.

@jinxiao
Copy link
Contributor Author

jinxiao commented Sep 28, 2024

I am open to this. There are quite a log of places an URL gets displayed. One place I am particularly aware of is in show_diagnostics, enough that I put in a warning Note: some output may contain passwords. Redact before sharing..

I suggest move the masking code into a function, say display_masked_url, so it can be used in more places.

Good idea, I have changed this. Could you please have a check? I also changed the download URL in diagnostics to avoid any password leakage.

@shadowspawn shadowspawn changed the base branch from master to develop September 29, 2024 19:49
to get rid of passwords with special symbol

Co-authored-by: John Gee <[email protected]>
@shadowspawn
Copy link
Collaborator

The quotes are a bit tricky with the nesting!

@shadowspawn shadowspawn reopened this Sep 30, 2024
@shadowspawn
Copy link
Collaborator

(Closed by mistake.)

jinxiao and others added 4 commits October 1, 2024 04:21
Co-authored-by: John Gee <[email protected]>
Co-authored-by: John Gee <[email protected]>
Co-authored-by: John Gee <[email protected]>
Co-authored-by: John Gee <[email protected]>
@shadowspawn
Copy link
Collaborator

I misunderstood a couple of the uses, so added suggestions to preserve the original style.

@shadowspawn
Copy link
Collaborator

I was worried about spaces in password, but now I remember username and password need to be url-encoded for robustness anyway: https://github.com/tj/n/blob/master/docs/proxy-server.md

However, adding the quotes around the variable expansions fixes warnings from shellcheck so I would have wanted the changes anyway.

jinxiao and others added 2 commits October 3, 2024 07:35
Co-authored-by: John Gee <[email protected]>
Co-authored-by: John Gee <[email protected]>
@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Oct 3, 2024
@shadowspawn
Copy link
Collaborator

Thanks @jinxiao

@shadowspawn shadowspawn merged commit cf40ac5 into tj:develop Oct 3, 2024
@shadowspawn
Copy link
Collaborator

Released in v10.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending release Merged into a branch for a future release, but not released yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants