fix: 监控时增加只读模式参数, 提升安全性 (#290)
看参考 https://guacamole.apache.org/doc/gug/configuring-guacamole.html read-only参数
This commit is contained in:
parent
320eecdfd1
commit
f87d44d38b
@ -224,6 +224,7 @@ func (api GuacamoleApi) GuacamoleMonitor(c echo.Context) error {
|
||||
configuration.SetParameter("width", strconv.Itoa(s.Width))
|
||||
configuration.SetParameter("height", strconv.Itoa(s.Height))
|
||||
configuration.SetParameter("dpi", "96")
|
||||
configuration.SetReadOnlyMode()
|
||||
|
||||
addr := config.GlobalCfg.Guacd.Hostname + ":" + strconv.Itoa(config.GlobalCfg.Guacd.Port)
|
||||
|
||||
|
@ -52,6 +52,7 @@ const (
|
||||
SwapRedBlue = "swap-red-blue"
|
||||
DestHost = "dest-host"
|
||||
DestPort = "dest-port"
|
||||
ReadOnly = "read-only"
|
||||
|
||||
UsernameRegex = "username-regex"
|
||||
PasswordRegex = "password-regex"
|
||||
@ -83,6 +84,10 @@ func NewConfiguration() (config *Configuration) {
|
||||
return config
|
||||
}
|
||||
|
||||
func (opt *Configuration) SetReadOnlyMode() {
|
||||
opt.Parameters[ReadOnly] = "true"
|
||||
}
|
||||
|
||||
func (opt *Configuration) SetParameter(name, value string) {
|
||||
opt.Parameters[name] = value
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user