gpt4 book ai didi

amazon-web-services - 如何从 Amazon elasticsearch 服务访问 Kibana?

转载 作者:行者123 更新时间:2023-11-29 02:43:00 25 4
gpt4 key购买 nike

我创建了 Amazon elasticsearch 服务并使用已安装在 EC2 实例上的 logstash 将数据填充到其中。在Amazon elasticservice控制台页面,会有访问Kibana的链接。

search-cluster_name-XXXXXXXXXXXXXXXXXXX.region_name.es.amazonaws.com/_plugin/kibana/

当我点击链接时,浏览器抛出以下错误。

{"Message":"User: anonymous is not authorized to perform: es:ESHttpGet on resource: arn:aws:es:region_name:account_id:domain/cluster_name/_plugin/kibana/"}

我确定这与 ES 域的访问策略有关。我应该如何修改我的访问策略,以便我可以通过单击指定的链接访问 Kibana?

最佳答案

您可以使用基于 IAM 和 IP 地址的访问设置访问策略。 See my answer here .简而言之:

  • EC2 实例需要具有 arn:aws:iam::aws:policy/AmazonESFullAccess 策略的配置文件
  • 策略应包括两个声明:第一个列出 IAM 访问权限,第二个列出 IP 访问权限。

这是一个示例策略(语句顺序很重要!)

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxxxxxxxxxxx:root"
},
"Action": "es:*",
"Resource": "arn:aws:es:us-west-2:xxxxxxxxxxxx:domain/my-elasticsearch-domain/*"
},
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "es:*",
"Resource": "arn:aws:es:us-west-2:xxxxxxxxxxxx:domain/my-elasticsearch-domain/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"192.168.1.0",
"192.168.1.1"
]
}
}
}
]
}

关于amazon-web-services - 如何从 Amazon elasticsearch 服务访问 Kibana?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33751580/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com