激活集群的config.connect参数能用wss吗

  • Choerodon平台版本:https://choerodon.com.cn/

  • 运行环境:

  • 问题描述:

    激活集群的config.connect参数能用wss协议吗?支持ssl。

    cluster agent与猪齿鱼交互的数据可以采用非对称秘钥签名吗?秘钥和公钥可以每个集群一个。

    由于相互交互通过公网,而且证书采用Let’s Encrypt Authority X3,为了确保安全性,建议连接采用ssl,交互数据采用非对称方式签名数据。

    签名的时候建议加上签名时间,cluster agent需要校验签名时间和签名,才能获取请求数据来处理请求,而服务端类似。

你好,devops-service ingress 配置了采用Let’s Encrypt Authority X3的证书是直接支持 wss 的哈,若devops-service ingress 的证书是自签名证书目前还不支持。

但是看添加集群的配置还是用的ws

你好,在搭建的时候如果你明确并知道你在干什么,你可以将devops-service的AGENT_SERVICEURL变量修改为wss协议

那能把交互的数据签名吗?毕竟"Let’s Encrypt Authority X3"是免费的,不能完全保证不会被破解。

主要是因为agent建立的是长期连接,毕竟不像https短连接而且token也是会过期的,但是cluster agent的token是不会过期的,而且数据交互还是在公网上的。

为了确保安全性,建议连接采用ssl,交互数据采用非对称方式签名数据。

签名的时候建议加上签名时间,cluster agent需要校验签名时间和签名,才能获取请求数据来处理请求,而服务端类似。

还有就是建议 cluster agent在启动的时候在日志里打印一下配置信息。

可以参考pingcap/tidb:

[2019/07/18 11:09:20.463 +08:00] [INFO] [printer.go:40] ["Welcome to TiDB."] ["Release Version"=None] ["Git Commit Hash"=None] ["Git Branch"=None] ["UTC Build Time"=None] [GoVersion=None] ["Race Enabled"=false] ["Check Table Before Drop"=false] ["TiKV Min Version"=2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e]
[2019/07/18 11:09:20.463 +08:00] [INFO] [printer.go:53] ["loaded config"] [config="{\"host\":\"0.0.0.0\",\"advertise-address\":\"\",\"port\":4000,\"cors\":\"\",\"store\":\"mocktikv\",\"path\":\"/tmp/tidb\",\"socket\":\"\",\"lease\":\"45s\",\"run-ddl\":true,\"split-table\":true,\"token-limit\":1000,\"oom-action\":\"log\",\"mem-quota-query\":34359738368,\"enable-streaming\":false,\"txn-local-latches\":{\"enabled\":true,\"capacity\":2048000},\"lower-case-table-names\":2,\"log\":{\"level\":\"info\",\"format\":\"text\",\"disable-timestamp\":false,\"file\":{\"filename\":\"\",\"log-rotate\":true,\"max-size\":300,\"max-days\":0,\"max-backups\":0},\"slow-query-file\":\"tidb-slow.log\",\"slow-threshold\":300,\"expensive-threshold\":10000,\"query-log-max-len\":2048},\"security\":{\"skip-grant-table\":false,\"ssl-ca\":\"\",\"ssl-cert\":\"\",\"ssl-key\":\"\",\"cluster-ssl-ca\":\"\",\"cluster-ssl-cert\":\"\",\"cluster-ssl-key\":\"\"},\"status\":{\"report-status\":true,\"status-host\":\"0.0.0.0\",\"status-port\":10080,\"metrics-addr\":\"\",\"metrics-interval\":15,\"record-db-qps\":false},\"performance\":{\"max-procs\":0,\"max-memory\":0,\"tcp-keep-alive\":true,\"cross-join\":true,\"stats-lease\":\"3s\",\"run-auto-analyze\":true,\"stmt-count-limit\":5000,\"feedback-probability\":0.05,\"query-feedback-limit\":1024,\"pseudo-estimate-ratio\":0.8,\"force-priority\":\"NO_PRIORITY\",\"bind-info-lease\":\"3s\",\"txn-entry-count-limit\":300000,\"txn-total-size-limit\":104857600},\"prepared-plan-cache\":{\"enabled\":false,\"capacity\":100,\"memory-guard-ratio\":0.1},\"opentracing\":{\"enable\":false,\"sampler\":{\"type\":\"const\",\"param\":1,\"sampling-server-url\":\"\",\"max-operations\":0,\"sampling-refresh-interval\":0},\"reporter\":{\"queue-size\":0,\"buffer-flush-interval\":0,\"log-spans\":false,\"local-agent-host-port\":\"\"},\"rpc-metrics\":false},\"proxy-protocol\":{\"networks\":\"\",\"header-timeout\":5},\"tikv-client\":{\"grpc-connection-count\":16,\"grpc-keepalive-time\":10,\"grpc-keepalive-timeout\":3,\"commit-timeout\":\"41s\",\"max-txn-time-use\":590,\"max-batch-size\":128,\"overload-threshold\":200,\"max-batch-wait-time\":0,\"batch-wait-size\":8},\"binlog\":{\"enable\":false,\"write-timeout\":\"15s\",\"ignore-error\":false,\"binlog-socket\":\"\",\"strategy\":\"range\"},\"compatible-kill-query\":false,\"plugin\":{\"dir\":\"\",\"load\":\"\"},\"pessimistic-txn\":{\"enable\":false,\"default\":false,\"max-retry-count\":256,\"ttl\":\"30s\"},\"check-mb4-value-in-utf8\":true,\"treat-old-version-utf8-as-utf8mb4\":true,\"enable-table-lock\":false,\"delay-clean-table-lock\":0}"]

谢谢反馈