Open ado2p opened 3 years ago
Goal: Using Logstash to build a cross account pipeline.
Observation/Error/Issue: The logstash-output-amazon_es plugin is unable to fetch credentials from the instance profile and is unable to write to the AES domain in another account.
Steps to replicate:
Requirement: The logstash-output-amazon_es plugin to fetch credentials from the instance profile. Although, this is said to be supported in README, I wasn't able to figure out a way and couldn't find a documentation for the same.
It seems that "amazon_es" output lugin accepts only "aws_access_key_id" and "aws_secret_access_key" , but not session_token.
Thus, temporary credentials rotation is not feasible while logstash is running. The only possible solution seems to restart logstash periodically, before the expiration of the session token.
@giambasten ,
The session token is a temporary credential and can last no more than 36 hours. It may even last less. Because it is temporary and needs to be refreshed, it shouldn't be configured in the file.
This plugin supports using the profile defined in the ~/.aws/credentials
file. I believe it only supports the default
profile. Also, it can use EC2 instance profiles if that helps. Both of these approach are more dynamic and allow the amazon_es plugin to refresh the credentials.
It looks like logstash is unable to rotate the credentials without the restart of the service. This implies that it is mandatory to use long term credentials in the configuration. It would be nice to have the possibility to configure temporary and rotating credentials coming from an assume role to satisfy the security best practices. https://github.com/awslabs/logstash-output-amazon_es/issues/161