Disable list of commands from playground repositories
Description
DiceDB Playground is an interactive platform that allows users to experiment with DiceDB commands in a live environment, similar to the Go Playground. Users will be able to submit and execute commands directly through a web interface. The initial implementation will focus on enabling users to search for and trigger commands.
For more details about DiceDB playground you can check here.
To enhance the security of our application, we need to implement a blacklist for certain commands that could potentially lead to data loss or unauthorized access. This blacklist should be enforced in both the backend and frontend components of our application. Add following commands for blacklisting:
FLUSHALLFLUSHDBDUMPABORTAUTHCONFIGSAVEBGSAVEBGREWRITEAOFRESTOREMULTIEXECDISCARDQWATCHQUNWATCHLATENCYCLIENTSLEEPPERSIST
Note: Implementation will be part of both DiceDB playground frontend repo and backend repo.
Tasks
- Backend Implementation:
- Update service to restrict the blacklisted commands.
- Implement middleware or a service layer to intercept and reject requests for blacklisted commands.
- Ensure appropriate error responses are returned when blacklisted commands are attempted.
- Frontend Implementation:
- Block blacklisted commands in frontend, with error message as below:
-(error) ERR unknown command '<COMMAND_NAME>'
- Block blacklisted commands in frontend, with error message as below:
- Test the implementation to ensure that blacklisted commands are correctly rejected with appropriate error messages.
- Document the changes made in the README or relevant documentation files.
- Add sufficient unit and integration test for the same
hey can you assign this to me?
@yashbudhia assigned, thanks for contributing. Please note the changes will be part of both DiceDB playground frontend repo and backend repo.
Thanks for assigning, So i have to open pull requests in those repos right?
Thanks for assigning, So i have to open pull requests in those repos right?
Yes
@lucifercr07 I would like to work on this issue could you please assign it to me
Frontend changes merged as part of https://github.com/DiceDB/playground-web/pull/19
I have also added blacklisted commands in the backend repo - https://github.com/DiceDB/playground-mono/pull/23
Closing, merged as part of https://github.com/DiceDB/playground-mono/pull/23