序列化安全审计

序列化安全审计

Dubbo 支持通过 QoS 命令实时查看当前的配置信息以及可信/不可信类列表。目前共支持两个命令:serializeCheckStatus 查看当前配置信息,serializeWarnedClasses 查看实时的告警列表。

serializeCheckStatus 命令

通过控制台直接访问:

  1. > telnet 127.0.0.1 22222
  2. Trying 127.0.0.1...
  3. Connected to localhost.
  4. Escape character is '^]'.
  5. ___ __ __ ___ ___ ____
  6. / _ \ / / / // _ ) / _ ) / __ \
  7. / // // /_/ // _ |/ _ |/ /_/ /
  8. /____/ \____//____//____/ \____/
  9. dubbo>serializeCheckStatus
  10. CheckStatus: WARN
  11. CheckSerializable: true
  12. AllowedPrefix:
  13. ...
  14. DisAllowedPrefix:
  15. ...
  16. dubbo>

通过 http 请求 json 格式结果:

  1. > curl http://127.0.0.1:22222/serializeCheckStatus
  2. {"checkStatus":"WARN","allowedPrefix":[...],"checkSerializable":true,"disAllowedPrefix":[...]}

serializeWarnedClasses 命令

通过控制台直接访问:

  1. > telnet 127.0.0.1 22222
  2. Trying 127.0.0.1...
  3. Connected to localhost.
  4. Escape character is '^]'.
  5. ___ __ __ ___ ___ ____
  6. / _ \ / / / // _ ) / _ ) / __ \
  7. / // // /_/ // _ |/ _ |/ /_/ /
  8. /____/ \____//____//____/ \____/
  9. dubbo>serializeWarnedClasses
  10. WarnedClasses:
  11. io.dubbo.test.NotSerializable
  12. io.dubbo.test2.NotSerializable
  13. io.dubbo.test2.OthersSerializable
  14. org.apache.dubbo.samples.NotSerializable
  15. dubbo>

通过 http 请求 json 格式结果:

  1. > curl http://127.0.0.1:22222/serializeWarnedClasses
  2. {"warnedClasses":["io.dubbo.test2.NotSerializable","org.apache.dubbo.samples.NotSerializable","io.dubbo.test.NotSerializable","io.dubbo.test2.OthersSerializable"]}

注意

建议及时关注 serializeWarnedClasses 的结果,通过返回结果是否非空来判断是否受到攻击。

Dubbo 类检查机制

最后修改 September 13, 2024: Refactor website structure (#2860) (1a4b998f54b)