使用气流的后gresql合成监测的用户限制

发布于 2025-01-18 01:31:01 字数 513 浏览 2 评论 0原文

我正在尝试使用气流为我的本地PostgreSQL服务编写合成监视。如果可用于创建表,编写和读取数据以及删除表的群集,则监视应返回。

我服务上的集群使用SSL证书进行身份验证,这意味着客户需要提供合适的客户证书以连接到集群。

当前,我已经通过创建一个全局用户来实现监视,该用户将拥有对所有集群的权限证书。用户将仅在一个专门用于此监视的架构上创建,写入和阅读的权限。使用气流,我将与此用户连接每个PostgreSQL群集,然后尝试创建一个表,写入它,读取并删除它。如果其中一个动作失败 - DAG将编写描述故障原因的日志。

我对该解决方案的主要问题无法限制如此强大的用户,并且可以访问所有群集。如果入侵者将获得用户的客户端证书,他将能够通过编写大量数据或过载查询来爆炸DB存储,并使集群失败。

我正在寻找一些限制此用户的想法,以便仅出于目的而采取行动 - 此监视所需的简单操作,并且无法被攻击者利用。另外,我将感谢有关此监视的不同实施的任何建议。

我在PostgreSQL配置中搜索了构建,这将使我能够限制专用监视模式 /限制用户执行的查询量。

I am trying to write a synthetic monitoring for my on-prem postgresql service, using airflow. The monitoring should return if a cluster is available for creating tables, writing and reading data, and deleting tables.

The clusters on my service are using SSL certificates for authentication, which means a client is required to provide a suitable client certificate in order to connect to the cluster.

Currently, I have implemented my monitoring by creating a global user which will have a certificate with permissions to all the cluster. The user will have permissions to create, write and read only on one schema, dedicated to this monitoring. Using airflow, I will connect with this user each of my postgresql clusters and try to create a table, write to it, read, and then delete it. If one of the actions fails - the DAG will write a log describing the reason for failure.

My main problem with this solution it not being able to limit such a powerful user with accessibility to all of my clusters. In case an intruder will get the user's client certificate, he would be able to explode the DB storage by writing huge amount of data or overload queries and fail the cluster.

I am looking for some ideas for limiting this user so it will be able to act only for it's purpose- the simple actions required for this monitoring, and could not be exploit by an attacker. Alternatively, I would appreciate any suggestions for different implementation for this monitoring.

I searched for build in postgresql configurations that will allow me to limit the dedicated monitoring schema / limiting the amount of queries performed by the user.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文