-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user to provide a role to assume #27
Conversation
I've signed the CLA, but it's not showing up here |
Use the assume role credentials provider instead of passing around keys
@patrobinson nice work switching to |
Other than pinging the maintainers (@suyograo and @jordansissel) no |
@suyograo and @jordansissel, What are the next steps for this PR? |
Would be very nice to have! 👍 |
I'm not in a good position to evaluate this PR. I have insufficient experience with AWS IAM, Role delegation, etc. The only review I can offer is to say these things:
Someone testing this and providing feedback on usability would be helpful also. "It works" is cool, but are the setting names sufficient? What other docs could be added? Can we reduce the number of new settings? etc [1] Regarding merging and testing -- Given I (and maybe nobody else on the Logstash dev team) don't have any AWS ARN/IAM experience, and this library is covered transitively (through other plugins) by our commercial support contracts (aka: Someone can page us on the weekend if it breaks), I want to feel confident that it works and stays working -- this means it needs good test coverage. |
I've looked into this, I think the feature would be a great addition but would be made much better by supporting an external ID. My changes are on a work in progress branch, however creating AssumeRoleCredentials actually makes calls to AWS API's so I need to figure out a way of mocking the API for the purposes of tests. This commit message explains why support external ID is so important. ps. I'm away for a couple of weeks now but would be happy if someone picked up my changes, otherwise I'll see about fixing the tests in a couple of weeks. |
I attempted to build this branch (the PR, not @davbo's work in progress). Line 58 is the new capability for role assumption, but it's only called if access_key_id and secret_access_key are not provided in the configuration file. This means that users can assume a role or authenticate, but not both. Is there some other method for authentication other than the configuration file? |
@suyograo and @jordansissel any plans to get this merged, we do a lot of other hacks for assume role and this PR solves a lot of dirty hacks, of its missing something I'm happy to contribute |
I don't have the bandwidth nor desire to get this over the line. It's not something I use any more and the slow progress of it just re-iterates why I don't want to use Logstash anymore. Someone else is free to pick up this code and run with it. |
@jordansissel I've improved the documentation and added integration tests for the assume_role component, which tests a path this plugin had issues with previously (rotating expired keys).
I appreciate that and that's the nature of the mixin though and not something I can control. |
I understand your frustration. I still don't personally have much I can offer in evaluating this PR. I can test it, but I have no idea whether or not it lines up with what the median AWS user would expect, for example. I can take a look at the code/tests, but fundamentally, someone with AWS IAM experience should be also evaluating this before it merges, and that person, at least for today, is not me. |
@frezbo @davbo @morganchristiansson @aboutte @ozacas @lukewaite -- You've all expressed interest in this improvement. Are you able to test this and let us know your experience with this patch? Such feedback would aid in moving this PR along in the review process. |
@jordansissel Awesome, I could test this when I get some time, but last I checked I saw another change that needs to be pulled in to this PR from this #27 (comment), let me see if I can get some spare time to get those changes, I am not working on anything related to logstash now, so If time permits I could take a look. Meanwhile @davbo or @morganchristiansson or @aboutte or @lukewaite could take a look, I feel the need of importance of external ID, thanls @jordansissel for bringing this up. Would be grateful if you can build a gem and send us the link, as I will have to build from scratch. |
FWIW, we've used this plugin in production successfully on and off for the past 12 months. The Travis failures seem unrelated to my PR? The commit that caused the failure just introduced a new test dependency "timecop"
|
The code in this PR works great. I've just deployed it to access an encrypted s3 bucket in a different account. Further the changes don't really affect existing features or codepaths. So as others in this discussion confirm. LGTM! PS. Unrelated to this issue but related to my issues - this PR is ready to merge but nobody is available to review and release it. logstash-plugins/logstash-codec-cloudtrail#18 |
ping @jordansissel |
There's merge conflicts preventing this from being merged. Can someone fix or do we need a new branch to merge from? @patrobinson |
Following this thread with great interest This feature will become more and more needed as AWS usage matures to working with roles instead of static secrets. I am blocked in a similar situation, I will see if I can test with this branch on my side. |
I hotfixed using this in my Dockerfile @m6a-UdS
|
The hotfix works! :-) |
I fixed merge conflict and build is green in https://github.com/morganchristiansson/logstash-mixin-aws/tree/assume-role |
I've fixed the merge conflict now |
rebased, squashed and merged in b98805e, thank you all for the code, testing and patience. The mixin gem will be released soon together with documentation on the elastic.co site |
4.3.0 was released march 29th. https://rubygems.org/gems/logstash-mixin-aws/versions/4.3.0 when @jsvd commented. Thanks all. |
It's a common use case to read ELB logs. But if those ELB logs are written to an s3 bucket in a different account to where Logstash is running, it's impossible to give the third account permission to read them, because ELB logs are not owned by the account they exist in.
This change allows you to specify a role ARN that can be assumed in order to access resources.