security - Prometheus Pushgateway 的访问控制
问题描述
我们有一个 Prometheus Pushgateway 正在运行并监听来自我们的 AWS Lambda 函数的指标推送。但是,公众可以访问 Pushgateway 的 URL,这可能会带来一些安全问题。我们想知道是否有任何方法可以为 Pushgateway 添加一层保护,使其不可公开访问?
我发现这个 Github 线程可以回答这个问题: https ://github.com/prometheus/pushgateway/issues/281
它建议在pushgateway前面设置一个反向代理。但是,我仍然对这实际上如何工作感到困惑?我们目前正在使用 Kubernetes 来部署 Prometheus。
解决方案
您可以使用 TLS 机密作为入口规则,在入口控制器中包含身份验证。这是一个示例,显示如何为您的入口生成基本身份验证:
https://kubernetes.github.io/ingress-nginx/examples/auth/basic/
此外,不要忘记在您的客户端中包含 Python 处理程序函数来设置 auth 标头,如下所示:
https://github.com/prometheus/client_python#handlers-for-authentication
推荐阅读
- azure - Azure App Service 将 100% 扩展,我关闭了一切并重新启动
- react-native - 将本机通行证索引反应到道具
- python-3.x - 外键中的外键中是否有一个直通模型,就像在许多字段中一样?
- xamarin - 使用 xamarin.form 的跨平台寻呼机
- selenium - Selenium chrome 驱动程序很慢
- c# - 如何正确从 AuthorizationHandler 返回 404 以防止信息泄露
- asp.net - 像过滤器一样的 Mongodb 上的 Asp.net Core Odata
- node.js - 为什么在使用 express 导出 csv 时,chrome 下载速度很慢并保持“启动”?
- database - 来自 pgadmin4 的 PostgreSQL pg_restore 错误显示角色不存在
- python - ModuleNotFoundError:没有名为“util”的模块