0

I'm setting up some authentication methods in my elasticsearch endpoint in AWS. So, I'm trying to make HTTP requests to this endpoint parsing inside this body the IAM credentials but I have no idea how I can do it.

Maybe adding a field in the content body or header before the query or something like.

{
    "IAM-ARN":"SOMERANDOMID",
    "IAM-PASS":"SOMERANDOMPASS"
}

I would be so thankful for finding this solution.

Thank you!

1 Answers1

0

You can access using IAM credentials by signing the requests as if you were making a call to AWS api.

Here's an exapmple:

https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheAuthenticationHeader

Or you could just use an sdk. What language are you using?

Magus
  • 2,905
  • 28
  • 36
  • Magus, I'm using Java. I've seen this documentation and now I understood how it works, but it's a bit hard to do. My main problem now is the signature calculation that always I receive a response with a message saying that my calculation is wrong. – Carlos Araujo Jun 03 '19 at 21:19
  • You're probably forgetting to sort the parameters alphabetically! Since you're using java, have you considered using the sdk? https://github.com/aws/aws-sdk-java-v2 – Magus Jun 03 '19 at 23:24
  • Magus, no, I haven't. I have been trying to get the calculation result using 3rd part libs that I've found on github. And I noticed that the aws sdk for elasticsearch has a built-in implementation (not a generic http one) in order to query over the elasticsearch. Question is, can I use only the 'signature libs/methods' and put the calculed result in the REST body? Once again, thank you for helping me! – Carlos Araujo Jul 08 '19 at 20:36
  • Yes you can. The AWS methods you'll see on the sdk concern que administration of ELK clusters, so all the ES stuff remains the same for you. – Magus Jul 09 '19 at 13:30