我目前有一个 Elasticsearch 域的访问策略,如下所示:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "es:*",
"Resource": "arn:aws:es:ES_DOMAIN_HERE/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"**.**.***.***",
"**.***.***.***",
"**.***.***.**",
"***.***.***.**",
...
]
}
}
}
]
}
记住每个白名单 IP 的用途是很痛苦的,如果我可以用 IP 描述注释策略,维护 IP 列表会容易得多。我想像下面这样:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "es:*",
"Resource": "arn:aws:es:ES_DOMAIN_HERE/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"**.**.***.***",
"**.***.***.***",
"**.***.***.**",
"***.***.***.**",
...
]
}
},
"meta": {
"IpAddress": {
"**.**.***.***" : "INACTIVE - Test Server",
"**.***.***.***" : "General Server",
"**.***.***.**" : "Main Office",
"***.***.***.**" : "Remote Server",
...
}
}
}
]
}
如何将注释或元数据添加到我的访问策略?