Last active
April 14, 2023 17:17
-
-
Save strongant/164f60ccd83afdeedd18f0663ae04563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+------------------------------+ | |
| EventBridge | | |
+------------------------------+ | |
| + publish(event: Event) | | |
| + subscribe(handler: Handler)| | |
+------------------------------+ | |
^ | |
| | |
+-----------------|----------------+ | |
| Event | | |
+--------------------------------+ | |
| + serialize() | | |
| + deserialize(data: String) | | |
+--------------------------------+ | |
^ | |
| | |
+-----------------|----------------+ | |
| AliyunAdapter | | |
+--------------------------------+ | |
| + authenticate(key: String) | | |
| + publish(event: Event) | | |
| + subscribe(handler: Handler) | | |
+---------------------------------+ | |
^ | |
| | |
+-----------------|----------------+ | |
| AWSAdapter | | |
+--------------------------------+ | |
| + authenticate(key: String) | | |
| + publish(event: Event) | | |
| + subscribe(handler: Handler) | | |
+---------------------------------+ | |
^ | |
| | |
+-----------------|----------------+ | |
| RocketMQAdapter | | |
+--------------------------------+ | |
| + authenticate(key: String) | | |
| + publish(event: Event) | | |
| + subscribe(handler: Handler) | | |
+---------------------------------+ |
Author
strongant
commented
Apr 13, 2023
规则命名空间隔离:为每个租户创建独立的EventBridge规则命名空间,确保每个租户的规则和事件源相互独立。在AWS EventBridge中,可以通过创建不同的Event Bus来实现;在阿里云EventBridge中,可以通过创建不同的事件总线实例来实现。这样,租户之间的事件处理规则和事件源不会相互干扰,实现了规则隔离。
事件源标签:为每个租户的事件源添加特定的标签,以表示该事件源属于哪个租户。在事件处理过程中,可以通过检查事件源的标签来确定事件属于哪个租户,并确保只将事件路由到对应租户的事件处理服务。
事件过滤器:在事件处理规则中添加事件过滤器,基于事件属性(如租户ID)过滤不同租户的事件。这样,在处理事件时,可以确保只处理属于特定租户的事件,并将事件路由到对应租户的事件处理服务。
IAM策略:使用云服务提供商的身份访问管理(IAM)策略对租户的权限进行控制。为每个租户创建独立的IAM角色,并为角色授权访问特定Event Bus或事件总线实例的权限。这样,可以确保租户只能访问和操作自己的事件数据,实现了访问控制。
监控与审计:通过云服务提供商的监控与审计服务(如AWS CloudTrail、阿里云操作审计等)收集和分析租户的操作日志。这样,可以了解租户在EventBridge上的操作情况,为事件处理服务的安全和合规提供保障。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment