如何使 Bluemix VCAP_ID cookie 安全?

How can I make the Bluemix VCAP_ID cookie secure?

Bluemix 生成一个 VCAP_ID cookie,该 cookie 目前不安全(见下文)。有什么办法可以强制它安全吗?有什么不安全的理由吗?

设置 Cookie:VCAP_ID=[编辑];路径=/;仅 Http

对比

设置 Cookie:VCAP_ID=[编辑];路径=/;仅限HTTP;安全

不,这是由 Bluemix 内部设置的。不过,我们可以将其带回开发团队以确保 cookie 安全。

什么是 __VCAP_ID_ cookie

这是我从 cloudfoundry 文档的 HTTP Sessions Not Persisted or Replicated 部分找到的内容:

Cloud Foundry supports session affinity or sticky sessions for incoming HTTP requests to applications if a jsessionid cookie is used. If multiple instances of an application are running on Cloud Foundry, all requests from a given client will be routed to the same application instance. This allows application containers and frameworks to store session data specific to each user session.

此粘性会话通过名为 __VCAP_ID_ 的 cookie 进行跟踪,参见 cloudfoundry/gorouter/proxy/proxy.go

设置__VCAP_ID_ cookie

结帐cloudfoundry/gorouter/proxy/setupStickySession() 设置这个 cookie 的配置是一个私有方法,这意味着它是在代理内部决定的。唯一的可变部分是 maxAgePath,这意味着它使用 JSESSIONID cookie 的 maxAge/Path 作为 __VCAP_ID_ cookie。

我很好奇为什么 Secure 不是其中的一部分。相反,它是在 gorouter 中创建代理时决定的。我创建了 issue 99 来跟踪它,因为它应该和 JSESSIONID.

一样安全