知识卡片
跨服务传播追踪与身份需分开
服务转发请求时应传递追踪上下文,才能把跨服务调用串成一条链;认证凭证则不能机械照搬,否则可能赋予下游不该有的身份或权限。应分别定义追踪头与身份凭证的传播规则,并验证目标服务所需的权限范围。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
For example, any tracing- or observability-related headers need to be added on to the downstream request to ensure distributed tracing is observed. For authentication and authorization headers, it is important to have an opinion on what can safely be sent downstream. For example, forwarding an authentication header can end up with a service being able to impersonate another service or user, causing issues.
参考来源
- 位置:《Mastering API Architecture》第5章《Deploying and Releasing APIs》之《Application-Level Header Propagation》(源文件:_epub-src/OEBPS/ch05.xhtml)
- 结论依据:原文要求跨服务新请求携带追踪头,同时警告转发认证头可能造成服务或用户冒用;其对 bearer token 的宽泛判断未作为普遍安全结论。
- 原始内容:For example, any tracing- or observability-related headers need to be added on to the downstream request to ensure distributed tracing is observed. For authentication and authorization headers, it is important to have an opinion on what can safely be sent downstream. For example, forwarding an authentication header can end up with a service being able to impersonate another service or user, causing issues.