-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
Add ability to disable Remote #17825
base: master
Are you sure you want to change the base?
Conversation
Hi. I am a quite concerned by this approach. If correctly set up by an IT admin, the secure mode should be associated with a right restriction on the user's config folder, i.e. do not allow to write this folder. This use case is very restrictive and am not sure that it feets the needs of so many people. Indeed for a user, the possibility to modify their settings and save them all along there use of NVDA is very important. Though, I expect that more IT admins would like to disable remote connection possibility completely, but let the users change their configuration. Wouldn't it be possible to:
Maybe this is too broad for 2025.1 but IMO, the possibility to disable remote access offered in this PR will only be used by a very little subset of people that would need it, due to associated restrictions. |
Also, has anybody really tested to restrict write rights on nvda config folder? @SaschaCowley, in addition to the tests you did, you should probably test a real use case, i.e. with NVDA settings folder restrictions, so that the user cannot enable Remote access manually writing in their config file. |
I strongly agree that a registry or similar system-wide flag is the right approach here, and that the feature should be enabled by default. |
I tend to agree as well here. |
presumably, a portable copy will be able to honor this? Also, I'm unsure whether the registry can be locked down by sysadmins. If both answers are yes, this sounds like a good approach. Otherwise I can learn what the registry key is and change it. We need to know whether registry can be locked though. Does that require a deep freeze and or is there a legit situation where the sysadmin won't want to or cannot lock it down that much but still does want to be able to disable NVDA remote. |
Cyrille wrote:
I think that this is applicable to the secure mode in general. Perhaps in this mode should be possible to save certain settings not dangerous, like settings available for profiles, not global like remote, general, etc. |
@valiant8086, the registry key in HKLM are only modifiable by people with admin rights. Thus, a user with no admin right cannot modify it. That's how forcing secure mode is already implemented in NVDA. @nvdaes that's true that my remark also applies to secure mode in general. The reg key setting is already the way to force secure mode in NVDA. Maybe we can imagine a GUI to set admin params such as start in secure mode or disable remote; this GUI would just control the corresponding reg keys. But this can be handled in a subsequent work IMO. |
@CyrilleB79 we are well aware of the limitations of Secure Mode, and have an issue open to address them by adding a "Corporate Mode" (see #16599). Unfortunately, any setting that we add to prevent Remote can be bypassed from the Python Console, so the only way to effectively fully disable Remote is to disable Remote and run NVDA in Secure Mode. |
I can't reproduce that with NVDA alpha-35670,a71589de . Steps:
In order for this setting not to be bypassed, secure mode must be enabled, and |
I guess that anybody can check/uncheck the read-only checkbox, can't they? On my side, I have tested through the "Security" tab in the Properties dialog, what would probably be more similar to what an admin would do. But I should do further tests with two distinct accounts (admin and non admin) to be really representative of the real-life situation. I'll let you know when I have time to do so. |
Presumably, yes.
I don't think this should make a difference. At the end of the day, they're both just preventing writing to the directory, but I'll try that route here and report back. |
I was able to replicate your finding with NVDA freezing if "Disable write" was checked for my account in the security properties on |
As always, thanks for all the great feedback on the PR. After reviewing the discussion, I want to take a second to clarify NV Access's position on this implementation. The primary goal of this PR is to address the security needs in #17791, allowing organisations to disable Remote Access. There has been some discussions on implementation consistency and on having a registry-based approach. I'd like to share our reasoning for proceeding with the current implementation:
I understand this may not fully satisfy those advocating for a registry-based approach, but we believe this implementation balances immediate security needs with our longer-term architectural plans. Orgs that require strict enforcement can still achieve it through the combination of this setting with secure mode and appropriate folder permissions. As always, happy to continue the discussion if you feel that we have not considered a particular use case / user need. |
Which means, to disable remote, we're now in a situation where the user can't persist things like TTS settings, which is extremely not ideal. |
@codeofdusk as an intermediate measure, Remote can effectively be disabled by configuring the firewall to block requests from NVDA, optionally except to endpoints like api.nvaccess.org if NVDA's update check is still desired (though it likely isn't, given users in such scenarios likely don't have the appropriate permissions to install same). |
@@ -347,6 +347,7 @@ | |||
|
|||
# Remote Settings | |||
[remote] | |||
enabled = boolean(default=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see why remote is disabled by default, but for former add-on users, may be we can fix the profile upgrade in such a way that it will set it to enabled when:
- remote.ini exists and is therefore imported into NVDA's config
- The add-on is installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's the plan :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanbudd any idea how we can check if Remote is installed and enabled in the profile upgrade step? I tried
from addonHandler import getAvailableAddons
profile["remote"]["enabled"] = any(a.name == 'remote' and a.isEnabled for a in getAvailableAddons(refresh=True))
but this fails because localisation hasn't yet been initialised. I know I could just check for addons\remote\
in the user config directory, and presumably look at addonsState.pickle
to see if it's enabled, but I'd rather not reinvent the wheel here
Link to issue number:
Closes #17791
Blocked by #17853
Summary of the issue:
In some cases, it may be desireable to disable NVDA's Remote Access functionality entirely. Before this PR, this was not possible.
Description of user facing changes
A checkbox has been added in Remote settings to enable/disable Remote. When remote is disabled, the entire feature is unavailable.
As users cannot access the Remote settings panel in secure mode, sysadmins can prevent users from using this feature in secure environments by ensuring the feature is disabled, and forcing secure mode.
Remote is disabled by default.
Description of development approach
Added a boolean config item,
config.conf["remote"]["enabled"]
, which sets whether or not Remote is enabled. When initialising NVDA, check this item isTrue
before callingremoteClient.initialize
.Added a new function,
remoteRunning
, toremoteClient
. When terminating NVDA, ifremoteClient.remoteRunning
returnsTrue
, callremoteClient.terminate()
.Added a checkbox to
RemoteSettingsPanel
to enable/disable remote. When saving settings, if the value of `config.conf["remote"]["enabled"] has changed, initialize or terminate Remote, as appropriate.Updated
remoteClient.client.RemoteClient.terminate
toterminate
itsmenu
, if it has one.Added a
gui.blockAction.Context
member,REMOTE_ACCESS_DISABLED
, to block performing gestures when Remote is disabled. Decorated Remote's gestures with this block action.Remaining questions:
Testing strategy:
Started and quit NVDA with Remote enabled and disabled.
Started NVDA with Remote enabled, disabled it through settings, and attempted to use Remote.
Started NVDA with Remote disabled, enabled Remote, and established a connection.
Known issues with pull request:
None known.
Code Review Checklist:
@coderabbitai summary