-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Higress网关集成安全认证,基于全局配置实现对接自定义鉴权服务 #207
Comments
可以基于ingress annotaion实现到istio envoyfilter的转换,自定义鉴权+路由白名单的envoyfilter示例: apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: ext-authz-test
spec:
configPatches:
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: envoy.http_connection_manager
subFilter:
name: envoy.filters.http.cors
patch:
operation: INSERT_AFTER
value:
name: envoy.filters.http.ext_authz
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz
filter_enabled_metadata:
filter: envoy.filters.http.rbac
path:
- key: shadow_effective_policy_id
value:
string_match:
exact: ext-authz-test
httpService:
authorizationRequest:
allowedHeaders:
patterns:
- exact: x-token
authorizationResponse:
allowedUpstreamHeaders:
patterns:
- exact: x-user-id
pathPrefix: /check
serverUri:
cluster: outbound|8080||auth-server.default.svc.cluster.local
timeout: 10s
uri: auth-server.default.svc.cluster.local
withRequestBody:
maxRequestBytes: 1024000
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: envoy.http_connection_manager
subFilter:
name: envoy.filters.http.ext_authz
patch:
operation: INSERT_BEFORE
value:
name: envoy.filters.http.rbac
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBAC
shadow_rules:
action: ALLOW
policies:
ext-authz-test:
permissions:
- or_rules:
rules:
- and_rules:
rules:
- url_path:
path:
ignore_case: false
prefix: /test
principals:
- any: true 参考配置字段: |
可以给我 |
…r than full use gogotype (alibaba#207)
…ng instead of singal field (alibaba#207)
基于这个PR下的讨论,使用 Ingress 注解实现该功能,无法解决 rbac 下的路径匹配跟 ingress 路径匹配的对应关系,可能导致 ingress 下通过注解配置该功能,导致对其他 ingress 生效。 感谢 @zhangcly 在 #263 上完成的部分 envoyfilter 转换能力,是可以复用的,但目前他没有时间继续做这块工作,欢迎其他有兴趣的同学在他的基础上,继续完成这块工作 |
mark |
Why do you need it?
Is your feature request related to a problem? Please describe in details
Higress网关集成自定义鉴权服务,方便在网关入口处完成鉴权,避免每个后端服务都接入鉴权服务。接入安全认证。
How could it be?
A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.
Higress对接自建的中心化鉴权服务完成鉴权操作,Higress支持配置鉴权API的方式、或者其他便捷配置。
鉴权服务返回HTTP状态码为200,表明Token合法且Token有权限访问该后端资源,网关继续将原始业务请求转发给受保护的后端服务,收到业务响应后再次转发给客户端。
The text was updated successfully, but these errors were encountered: