Information Security 13 min read

01 Background Introduction

The article introduces the concept of an egress gateway, explains why iQIYI’s member‑cooperation services require a unified outbound gateway to handle IP‑whitelisting and external access, critiques the limitations of an Nginx proxy, and describes adopting APISIX with security, traffic‑control plugins and a UI‑driven URL translation layer.

iQIYI Technical Product Team
iQIYI Technical Product Team
iQIYI Technical Product Team
01 Background Introduction

01 Background Introduction

出口网关(Egress Gateway)是一种部署在云或企业网络中的网络组件,它控制着从内部网络(如企业内网、内部微服务网络)流出到外部网络(如公共互联网或其他外部服务)的流量。一般来说,出口网关是内部服务与外界交互的一个流量出口,实现对外请求的协议转换、流控、监控等通用功能。

相比于传统的入口网关(Ingress Gateway),出口网关侧重于对出站流量进行集中管理与安全控制。例如在爱奇艺对外合作业务中,用户通过入口网关访问爱奇艺内部服务,爱奇艺内部服务再通过出口网关去调用第三方的服务接口,来实现对出站流量的统一管理。

1、在爱奇艺会员对外合作业务中,需要访问合作方的 API 接口,随着安全要求的提升,越来越多的合作方对调用方的 IP 地址实行白名单策略,并且爱奇艺的服务都是在爱奇艺云服务平台进行的部署,业务更新比较频繁,每次更新都会更改 IP 地址,不可能在每次更新时让第三方进行 IP 白名单的同步,因此需要实现调用外部接口的统一出口网关。

2、在传统的网络架构下,需为每台应用服务器实例分别申请外网访问权限。实际运维中,这种方法因涉及到服务扩容或迁移操作时的访问权限更新问题,易造成疏漏,从而导致故障,因此需要通过给出口网关配置外网访问权限,内部服务统一通过出口网关访问外网,来规避此问题。

最开始设计出口网关的时候是使用的 Nginx 正向代理来实现此功能,这个方案的问题在于每次新增一个接口都需要调整 Nginx 的路由配置,并且 Nginx 的路由分发只支持静态配置,不能动态增减路由,这就需要在每次配置之后进行 reload,这会增加人工运维的成本,同时 Nginx 正向代理也无法实现流量隔离。

因此,经过调研我们采用 APISIX 作为网关服务的核心,通过 APISIX 插件实现安全防护、流量管控、协议适配等功能,并接入监控系统,同时通过 安全插件 接入安全团队提供的安全 控制系统 ,并且实现了一个界面化的地址转换服务来实现从 Origin URL 到 APISIX URL 的转换,以便开发人员使用。

network architectureSecuritytraffic managementAPISIXegress gateway
iQIYI Technical Product Team
Written by

iQIYI Technical Product Team

The technical product team of iQIYI

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.