aws-samples / aws-samples/amazon-elasticsearch-lambda-samples

Suggested IAM Policy for Lambda functions is too broad.

Open
#24 0 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.