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

Help command should only list commands the user is allowed to run #195

Open
blag opened this issue Aug 16, 2019 · 0 comments
Open

Help command should only list commands the user is allowed to run #195

blag opened this issue Aug 16, 2019 · 0 comments

Comments

@blag
Copy link
Contributor

blag commented Aug 16, 2019

A customer asked for this feature.

The !help command currently just dumps every command that is loaded by st2chatops. This is due to how hubot commands are loaded (into robot.commands) and how the hubot-help plugin works.

It would be helpful if the bot only dumped out commands that the authenticated ChatOps user can run. This would reduce confusion, because the situation right now amounts to:

  1. User chats !help
  2. Hubot dumps all loaded ST2 commands
  3. User starts trying to run listed commands
  4. ST2 RBAC returns authorization errors
  5. User has to iterate through entire list to figure out what they can run

A few additional notes:

  • SECURITY: If results are dumped back into a public channel and that channel history is accessible to all users, it would allow a malicious user or an attacker to target users that can run commands the attacker is interested in.
  • ChatOps RBAC extensions to only allow certain commands to only be run in certain channels/by certain users (#2481, #4559) will have different results depending on which channel the !help is run from, or it would require a complete listing of the allowed commands on a per-channel basis. This listing can grow very quickly, so this feature would greatly complicate that feature.
    Example:
    !help
    
    #public-channel
    ---------------
    * do_thing_1
    * do_thing_2
    
    #private-channel-aaylmao
    ------------------------
    * do_thing_1
    * do_thing_3
    * do_thing_4
    
    #private-channel-omgstahp
    -------------------------
    * do_thing_2
    * do_thing_5
    
  • ChatOps RBAC extensions to only allow certain users to run some commands with only certain parameters (eg: restrictions on hostname parameter) will similarly be complicated by this feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants