Skip to content

fix: block Junos command abbreviations from bypassing block.cmd - #33

Open
Venkata-Sai-Vishwanath-robo wants to merge 1 commit into
Juniper:mainfrom
Venkata-Sai-Vishwanath-robo:fix
Open

fix: block Junos command abbreviations from bypassing block.cmd#33
Venkata-Sai-Vishwanath-robo wants to merge 1 commit into
Juniper:mainfrom
Venkata-Sai-Vishwanath-robo:fix

Conversation

@Venkata-Sai-Vishwanath-robo

Copy link
Copy Markdown
Contributor

check_command_blocklist matched the literal spelling of block.cmd patterns via a whole-string regex, but Junos accepts any unambiguous prefix abbreviation of a CLI keyword (and is case-insensitive), so e.g. "req sys reboot" reached the device unblocked while "request system reboot" was rejected. Matching is now token-wise, treating each pattern token as a case-insensitive Junos-style prefix abbreviation.

check_command_blocklist matched the literal spelling of block.cmd
patterns via a whole-string regex, but Junos accepts any unambiguous
prefix abbreviation of a CLI keyword (and is case-insensitive), so
e.g. "req sys reboot" reached the device unblocked while "request
system reboot" was rejected. Matching is now token-wise, treating
each pattern token as a case-insensitive Junos-style prefix
abbreviation.
@Venkata-Sai-Vishwanath-robo
Venkata-Sai-Vishwanath-robo marked this pull request as draft August 10, 2026 21:12
@Venkata-Sai-Vishwanath-robo
Venkata-Sai-Vishwanath-robo marked this pull request as ready for review August 11, 2026 05:10
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.

1 participant