-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support AWS Elasticsearch IAM authentication by signing requests #465
Comments
Can you provide the link to signing requirements? |
|
FYI - I'm using https://github.com/abutaha/aws-es-proxy |
I assume the proxy is stateless so can be scaled up with a load balancer. |
AWS ES now supports VPC endpoints: http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html - It's a much better option than publicly available ES and signing requests. |
Indeed. I am going to close this. |
I think signing requests would make sense even with VPC endpoints. One still might want to protect against tampering with the requests from within the vpc. |
Actually not even sure you can disable request signing even in a VPC. Anyone doing this? |
When using VPC endpoints you assign a security group to ES. You can control access with security group settings. There is no request signing when you place ES in a VPC (I'm not sure if it's possible to have both VPC and request signing). |
@mabn Ah thanks for clarifying. Didn't know that and will try it. |
Hey folks. I was wondering if IAM-based authn for ES was still something that is on the table for Jaeger. Reading back on this conversation it seemed to take a different direction and focus on signed vs VPC endpoints. cc @black-adder |
@mabn Any chance you had some thoughts on this based on the previous conversation here? Appreciate any help you can provide! |
@black-adder et al, any chance I could get an update on this subject? |
I am pretty sure @black-adder doesn't have time to work on this. Need another volunteer. |
Sounds good, just wanted to check that this (IAM-based authn for ES) is something y'all would like to see. I can take a stab at it; any pointers on where to start? Also perhaps a better name for the issue would now be: "Support AWS Elasticsearch IAM authentication". Thanks @yurishkuro! |
something like this: https://github.com/jaegertracing/jaeger/pull/686/files |
Fantastic, thank you! |
So I had a misunderstanding above; signing and using IAM based auth are one and the same. Furthermore, this is possible even with VPC-based access to ESS. More details on Amazon's docs here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html. The go elastic search client that jaeger uses has some docs on signing requests that make the integration seem fairly reasonable: https://github.com/olivere/elastic/wiki/Using-with-AWS-Elasticsearch-Service. I'm taking a stab at integrating with the AWS go SDKs now. |
Allows clients to specify AWS IAM configuration details for their connection to ElasticSearch. We allow this to enable an additional layer of security for those clients running on AWS. More details on connecting to ElasticSearch on AWS here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html Signed-off-by: Wesley Kim <[email protected]>
Allows clients to specify AWS IAM configuration details for their connection to ElasticSearch. We allow this to enable an additional layer of security for those clients running on AWS. More details on connecting to ElasticSearch on AWS here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html Signed-off-by: Wesley Kim <[email protected]>
Allows clients to specify AWS IAM configuration details for their connection to ElasticSearch. We allow this to enable an additional layer of security for those clients running on AWS. More details on connecting to ElasticSearch on AWS here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html Signed-off-by: Wesley Kim <[email protected]>
@wesleyk Creating a session can provide credentials. Something like this: Then retrieve the credentials: Thanks, John |
Allows clients to specify AWS IAM configuration details for their connection to ElasticSearch. We allow this to enable an additional layer of security for those clients running on AWS. More details on connecting to ElasticSearch on AWS here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html Signed-off-by: Wesley Kim <[email protected]>
Ah @jmwaniki good idea; in fact I think that could drastically reduce the surface area of AWS-details that are encoded in the configuration API. We would only need to accept a region flag, and if such flag is set then we would provide IAM auth. A downside there is that an AWS region flag doesn't scream "this enables IAM". We could make that clear in the docs, or maybe we name the flag something like... |
@black-adder with that change, do you feel the API surface area is kept minimal enough? I think we need at least one flag for the client to indicate that they actually do want IAM auth enabled; inferring too much based on what's available in the environment seems potentially troublesome and not backwards compatible with existing clients. |
Ah, but you can actually specify the region in that config file as well! So really, we can just have one flag that specifies that the client wants IAM auth enabled. So we could have a I like that! If that sounds good to y'all I can update the PR with such changes. |
@wesleyk |
Great! I think we don't even need the region because clients can specify that view a local config file. |
I'm good with just exposing |
Fantastic! Working on it. |
Allows clients to specify jaeger to use AWS IAM auth for their connection to ElasticSearch. We allow this to enable an additional layer of security for those clients running on AWS. More details on connecting to ElasticSearch on AWS here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html AWS configuration and credentials are expected to be available at either ~/.aws/credentials or ~/.aws/config. More details on configuration here: https://docs.aws.amazon.com/sdk-for-go/api/aws/session/#Session Signed-off-by: Wesley Kim <[email protected]>
@black-adder PR updated! |
@wesleyk The credential provider determines when the credentials will expire: The token however is optional for aws static credentials, omitting the token from the static credentials might solve the expiry issue. Static credentials provider won't expire: Similar to what you had before, with values from the session credentials:
|
@wesleyk |
Looks like #1139 provides a fix for this. |
For anyone else who stumbles on this issue, I was able to get IAM auth + signed requests working with Jaeger! I followed the hint from this comment:
Jaeger will send requests to |
@sohan Would you mind sharing what configuration you did to point With the below configuration where in service es-proxy is running in the same namespace(in AWS EKS) as
I was able to make a similar setup working for Logstash which as well does not support irsa yet, but the issue here seems to be that, the requests are not reaching the es-proxy at all. The above jaeger-operator configuration translates to the below container definition:
|
In case someone is stuck on the same issue as above, I was able to solve the above by adding I am now going to look into some alternative methods as well, maybe something like data-prepper and then compare what works best. |
Hi, i was trying to integrate jaeger with opensearch fine grain access. I'm puzzled that why would we want to use proxy than to embed jaeger enable iam authentication feature. with proxy there is additional maintenance and extra hopes. looking at this PR, it seems to deal with aws iam authentication on jaeger #1036 i seek enlightenment on this, and real world best practice |
I'd like to use AWS Elasticsearch as my datastore, using AWS credentials to authenticate. This requires signing requests, so we'd probably need to use the AWS SDK here.
The text was updated successfully, but these errors were encountered: