0

我们使用的是融合平台 5.3.1 社区版。

最近,作为安全扫描的一部分,我们发现 Kafka 休息代理和模式注册服务缺少 http 标头(X-XSS-Protection,X-Content-Type-Options)安全漏洞。

根据 confluent 文档,我们可以在配置中添加 response.http.headers.config 属性来添加/设置所需的标头。

https://docs.confluent.io/platform/current/kafka-rest/production-deployment/rest-proxy/config.html https://docs.confluent.io/platform/current/schema-registry/installation/config .html

我们已经在相应的配置文件中添加了配置并重新启动了服务。

配置中添加的行

休息代理

response.http.headers.config=添加 X-XSS-Protection: 1; mode=block, 添加 X-Content-Type-Options: nosniff

模式注册表

response.http.headers.config="add Cache-Control: no-cache, no-store, must-revalidate", 添加 X-XSS-Protection: 1; 模式=阻止,添加严格传输安全:max-age=31536000;includeSubDomains,添加 X-Content-Type-Options: nosniff

重新启动服务后,我们希望在响应中收到额外的 http 响应标头,但我们仍然没有收到这些标头。

请求:获取:http://xxxx:8082/

响应标头 在此处输入图像描述

有什么建议可以在响应中获取那些缺少的标头。?提前致谢

4

1 回答 1

0

在检查了 Confluent REST 代理的源代码之后。识别出这个属性(response.http.headers.config)是在confluent平台6.0.x中添加的。因此需要更新平台才能使用此属性。

参考: https ://cwiki.apache.org/confluence/display/KAFKA/KIP+577%3A+Allow+HTTP+Response+Headers+to+be+Configured+for+Kafka+Connect https://docs.confluent .io/platform/current/release-notes/changelog.html https://github.com/confluentinc/rest-utils/blob/6.0.x/core/src/main/java/io/confluent/rest/RestConfig。爪哇

于 2021-01-11T21:58:43.697 回答