1Panel-dev / webkubectl

Run kubectl command in Web Browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to implement kubectl command only

lkxjtu opened this issue · comments

English:
It is difficult to implement by modifying the webkubectl source code, because some functions of TTY ( such as button of 'up' going to last command, 'tab' auto-completion)still need to be used. If you want to use these functions, you have to send characters to TTY (slave) first, so it is difficult to intercept commands in the webkubect source code

There are some methods for TTY interception, such as rbash, but there are still some escape methods

Any better suggestions?

中文:
很难通过修改webkubectl源码实现,因为仍然需要使用tty的一些功能(比如up键表示回到上一条命令,tab自动补全等等)。如果要使用这些功能,就不得不先把字符先发送给tty(slave),所以很难在webkubect源码进行命令拦截

在tty拦截有一些办法,像rbash,但仍然有一些逃逸的方法

有更好的建议吗?

Another difficulty in intercepting the webkubectl source code is kubectl edit. How to judge whether it is in edit state?

通过webkubectl源码拦截还有一个比较难处理的地方,就是kubectl edit,如何判断出是否在edit状态?

没太明白你的意思,想要拦截什么样的命令,是想限制kubectl对k8s集群只能进行只读操作?

的意思,想要拦截什么样的命令,是想限制kubectl对k8s集群只能进行只

希望仅支持kubectl命令,其它命令全都禁止,例如cd,ls等

暂时没想到什么好办法,或者可以把希望禁止的命令的权限改一下,让nobody用户没权限执行?

暂时没想到什么好办法,或者可以把希望禁止的命令的权限改一下,让nobody用户没权限执行?

应该也是可以的,只不过可能得到的响应是没有权限,而不是没有这个命令

我们要关闭这个issue,如果有其他需要可以重新打开或者提交新的issue。
感谢您的建议。