You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print_config is extensively used in the notebooks, and would be great to make sure the output not leaking any user-specific information such as /home/username
Hey @wyli I have noticed there isn't any pull request for this issue and I would like to work on it if it is still open to my knowledge I think I have to replace the code in deviceconfig.py to replace the user's home directory with a generic representation using the os.path.expanduser('~') method.
Thanks @anudeepadi, the goal of the print is to provide diagnostic info about where monai is actually located in user's system, but the usernames in the logs should be masked out. Perhaps you can do it with a simple regex replacing, or if you are interested, feel free to enhance the monai logger to have a generic filter to hide sensitive info.
I've worked on the feature to mask out usernames in the print_config function to prevent leaking user-specific information. I've tested the function for paths in different operating systems, and it looks good. The function now masks the username from paths and retains all other information for diagnostic purposes.
I apologize for the delay in getting to this, and I appreciate your patience.
Could you please review the code and let me know if anything else is needed before I can raise a pull request?
Activity
owais8 commentedon Jul 4, 2023
Heyy @wyli Just wanted to check if this issue is still open?
wyli commentedon Jul 4, 2023
yes @owais8 please feel free to create a pull request.
anudeepadi commentedon Jul 15, 2023
Hey @wyli I have noticed there isn't any pull request for this issue and I would like to work on it if it is still open to my knowledge I think I have to replace the code in deviceconfig.py to replace the user's home directory with a generic representation using the os.path.expanduser('~') method.
wyli commentedon Jul 15, 2023
Thanks @anudeepadi, the goal of the print is to provide diagnostic info about where monai is actually located in user's system, but the usernames in the logs should be masked out. Perhaps you can do it with a simple regex replacing, or if you are interested, feel free to enhance the monai logger to have a generic filter to hide sensitive info.
https://github.com/Project-MONAI/MONAI/blob/3b6b11a815b2de9e2b1bc1f1dbbca4e66189458f/monai/apps/utils.py#L48C1-L48C1
Please have a look at the contrib doc https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md and let me know if you have questions regarding new pull requests.
anudeepadi commentedon Aug 29, 2023
Hello @wyli,
I've worked on the feature to mask out usernames in the
print_configfunction to prevent leaking user-specific information. I've tested the function for paths in different operating systems, and it looks good. The function now masks the username from paths and retains all other information for diagnostic purposes.I apologize for the delay in getting to this, and I appreciate your patience.
Could you please review the code and let me know if anything else is needed before I can raise a pull request?
wyli commentedon Aug 29, 2023
thanks @anudeepadi, that's a nice starting point. please submit a pull request https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md#preparing-pull-requests
Mask usernames in print_config function (#6471) (#6913)
Mask usernames in print_config function (Project-MONAI#6471) (Project…