Http 响应 header 配置在 Kafka 休息代理和架构注册表中不起作用
Http response header configuration is not working in Kafka rest proxy and schema registry
我们使用的是 confluent platform 5.3.1 社区版。
最近,作为安全扫描的一部分,我们发现了 Kafka 休息代理和架构注册服务缺少 http header (X-XSS-Protection,X-Content-Type-Options) 安全漏洞。
根据 confluent 文档,我们可以在配置中添加 response.http.headers.config 属性 到 add/set 所需的 header.
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="添加Cache-Control:no-cache,no-store,must-revalidate",添加X-XSS-Protection:1;模式=块,添加Strict-Transport-Security:max-age=31536000; includeSubDomains,添加 X-Content-Type-Options: nosniff
重新启动服务后,我们希望在响应中收到额外的 HTTP 响应 header,但我们仍然没有收到那些 header。
要求:
获取:http://xxxx:8082/
回应Headers
有什么建议可以让那些缺少的 header 回复。?提前致谢
查看Confluent rest proxy源码后。确定这个属性(response.http.headers.config)是在confluent platform 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.java
我们使用的是 confluent platform 5.3.1 社区版。
最近,作为安全扫描的一部分,我们发现了 Kafka 休息代理和架构注册服务缺少 http header (X-XSS-Protection,X-Content-Type-Options) 安全漏洞。
根据 confluent 文档,我们可以在配置中添加 response.http.headers.config 属性 到 add/set 所需的 header.
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="添加Cache-Control:no-cache,no-store,must-revalidate",添加X-XSS-Protection:1;模式=块,添加Strict-Transport-Security:max-age=31536000; includeSubDomains,添加 X-Content-Type-Options: nosniff
重新启动服务后,我们希望在响应中收到额外的 HTTP 响应 header,但我们仍然没有收到那些 header。
要求: 获取:http://xxxx:8082/
回应Headers
有什么建议可以让那些缺少的 header 回复。?提前致谢
查看Confluent rest proxy源码后。确定这个属性(response.http.headers.config)是在confluent platform 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.java