aws-samples / aws-samples/amazon-elasticsearch-lambda-samples
Suggested IAM Policy for Lambda functions is too broad.
- Dominant language
- JavaScript
- Stars
- 386
- Forks
- 170
- PR merge metrics
- No merged PRs in 30d
Description
The docs suggest a policy for ElasticSearch for the Lambda function that is too broad: i.e. it allows all actions on ElasticSearch, including deleting the domain:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"es:*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
```
I suggest scoping this down to just the POST action on a specific index in the domain:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"es:ESHttpPost"
],
"Effect": "Allow",
"Resource": "arn:aws:es:region:aws-account-id:domain/domain-name/test-index"
}
]
}
```
Contributor guide
Assessment
This issue has not been assessed yet.