Repository navigation
KC-1547: Prevent Service Mode command history disclosure - #2554
Merged
sshrushanth-ks merged 2 commits intoNov 26, 2026
Merged
Conversation
Block history/h in Service Mode, exclude shell-only commands from provisioning, and keep Service Mode requests out of the global CLI history. Signed-off-by: sshrushanth-ks <sshrushanth@keepersecurity.com>
sshrushanth-ks
marked this pull request as ready for review
November 20, 2026 05:11
sshrushanth-ks
requested review from
adeshmukh-ks,
amangalampalli-ks,
pvagare-ks and
sali-ks
November 20, 2026 05:11
adeshmukh-ks
approved these changes
Nov 20, 2026
amangalampalli-ks
approved these changes
Nov 25, 2026
pvagare-ks
approved these changes
Nov 25, 2026
Keep shell commands visible in CLI help while excluding them from Service Mode grants. Apply the shared command set and aliases at provisioning and runtime, including server controls, and document the upgrade behavior. Signed-off-by: sshrushanth-ks <sshrushanth@keepersecurity.com>
craiglurey
pushed a commit
that referenced
this pull request
Nov 26, 2026
* Prevent command history disclosure Block history/h in Service Mode, exclude shell-only commands from provisioning, and keep Service Mode requests out of the global CLI history. * align shell command restrictions Keep shell commands visible in CLI help while excluding them from Service Mode grants. Apply the shared command set and aliases at provisioning and runtime, including server controls, and document the upgrade behavior. --------- (cherry picked from commit 387150e) Signed-off-by: sshrushanth-ks <sshrushanth@keepersecurity.com>
ajaiswal-ks
pushed a commit
that referenced
this pull request
Nov 27, 2026
* Prevent command history disclosure Block history/h in Service Mode, exclude shell-only commands from provisioning, and keep Service Mode requests out of the global CLI history. * align shell command restrictions Keep shell commands visible in CLI help while excluding them from Service Mode grants. Apply the shared command set and aliases at provisioning and runtime, including server controls, and document the upgrade behavior. --------- (cherry picked from commit 387150e) Signed-off-by: sshrushanth-ks <sshrushanth@keepersecurity.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent Service Mode API keys from accessing the interactive command history or adding raw commands to the process-global CLI history. Keep shell commands visible in normal CLI help while excluding them from Service Mode grants.
Changes
keepercommander/cli.py: Define shell/session commands and derive their aliases centrally. Block these commands in Service Mode and prevent Service Mode requests from entering global CLI history.keepercommander/service/config/service_config.py: Exclude shell/session commands and aliases from Service Mode provisioning without changing normal CLI help output.keepercommander/service/util/verified_command.py: Apply the shared command set at runtime, including for existing grants.keepercommander/service/README.md: Document the restricted commands and upgrade considerations.unit-tests/service/test_command.py: Verify the executor returns 403 forhistory,h, andserver host --insecure.unit-tests/service/test_service_config.py: Verify provisioning rejects shell/session commands and aliases.unit-tests/service/test_verified_command.py: Verify runtime restrictions cover the shared command set and aliases.unit-tests/test_cli.py: Verify shell commands remain listed in CLI help and Service Mode cannot use them or access global history.