authentication - Istio 中的授权策略和请求认证有什么区别?

标签 authentication kubernetes authorization istio

我正在测试 Istio(服务网格)授权和身份验证功能,并一直在进行一些测试以在微服务环境中实现 JWT。并且文档不清楚对象类型“AuthorizationPolicy”和“RequestAuthentication”之间的区别,

最佳答案

不确定您是否检查了那 2 个文档页面:

Authorization PolicyRequestAuthentication .

使用授权策略,您可以允许或拒绝请求,但您无法定义身份验证,因此将接受或不接受请求,但不考虑身份验证方法。

另一方面,RequestAuthentication 将定义用于验证请求的身份验证方法,但它根本不会限制没有身份验证的请求,因此您需要一个与其相关联的授权规则。

RequestAuthentication 文档中的这个短语对此进行了解释:

A request that does not contain any authentication credentials will be accepted but will not have any authenticated identity. To restrict access to authenticated requests only, this should be accompanied by an authorization rule.

因此,在您的授权策略中,您可以定义允许或拒绝请求的策略,并且您可以使用 RequestAuthentication 定义您的身份验证方法。

如果您想将其限制为经过身份验证的请求,那么您将需要两者。 基本上,最佳方法取决于您的用例。

关于authentication - Istio 中的授权策略和请求认证有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62416549/

相关文章:

Windows Azure Portal 登录门户并收到错误 "We are having trouble logging you into the portal"

kubernetes - 如何在 Helm 图表模板中访问当前用户

function - 通过数据库触发器邀请用户的授权

c# - 在 Controller 构造函数中使用 User.Identity.Name 定义用户

http - 浏览器如何存储/重新创建授权 token ?

azure - 如何从 Azure 应用程序注销?

javascript - 使用 AAD MSAL 登录 - 登录已在进行中

kubernetes - 缩容时 Kubernetes 如何知道要杀掉哪个 pod?

.net - .NET 中的 HTTP 身份验证

scala - 如何在 Azure 中的 Kubernetes 中进行 scala 堆转储