You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can provide more detailed debuging/source-tracing information of the fix I'm proposing, but I'll try to cut right to the chase first.
Also, apologies in advance if I'm misusing the terminology, or being a bit vague/obtuse. I'm not an expert on EKS or AWS IAM stuff, I'm just feeling around in the dark here a bit.
Background
We are using SaturnCloud, which also deploys analysis instances for end users via EKS. Users assume IAM roles on these instances so that they can interact with the rest of our AWS infra "as perscribed."
These roles are assigned using the whole ASSUME_ROLE_WITH_WEB_IDENTITY and AWS_WEB_IDENTITY_TOKEN_FILE mojo, and things were working swimmingly with paws 0.3.0 for us.
When paws 0.4.0 came out, we've found that the users are now assuming the role of the underlyling instance as opposed to the the webidentity that worked in the past.
For example, with paws 0.3.0 the paws::sts()$get_caller_identity() call matched the caller identity returned from the aws cli:
I went digging down the paws::sts()$get_caller_identity() call stack to see what has changed between the behavior in paws 0.3.0 vs 0.4.0, and have discovered that the structure of the resp object returned from svc$assume_role_with_web_identity in the get_assume_role_with_web_identity_creds function has changed.
generates a resp list, with "top-level" resp$Credentials and resp$AssumedRoleUser lists that has values at their top-level that can be directly accessed downstream.
What I mean is that calling resp$Credentials$AccessKeyId and resp$AssumedRoleUser$Arn gives you values to work with in paws 0.3.0 (paws.common 0.5.8)
However, in paws 0.4.0 (paws.common 0.6.0), the same resp object has a list of length-1 in resp$Credentials and resp$AssumedRoleUser.
So, instead of resp$Credentials$AccessKeyId providing you a valid value, you now have to call it as resp$Credentials[[1]]$AccessKeyId, and resp$AssumedRoleUser[[1]]$Arn to get the values you need.
I've found that if I simply hotwire the get_creds_from_sts_resp() function to pull out the first element of the Credentials object and use that, like so:
The role I want to assume on the instance is now recovered:
# after installing my hotwired paws.common packageR>paws::sts()$get_caller_identity()
$UserId
[1] "AROAQH6ZRAUT23O2GZDRN:default"$Account
[1] "XXXXXXXXXXX"$Arn
[1] "arn:aws:sts::XXXXXXXXXXX:assumed-role/XXX-saturn-data-analysts/default"
I know this isn't the right fix to move forward, but just wanted to point out what works now and hopefully help illuminate where we might go to debug further and help to find a more principled fix.
Thanks!
The text was updated successfully, but these errors were encountered:
Sorry about that, I will have a look at what is possibly causing this issue. My initial thought is the new xml_parse method. But I thought I got all scenarios 🤔
I think this recently merged PR that enables EKS auth via AssumeRoleWithWebIdentity might not be 100% just yet.
I can provide more detailed debuging/source-tracing information of the fix I'm proposing, but I'll try to cut right to the chase first.
Also, apologies in advance if I'm misusing the terminology, or being a bit vague/obtuse. I'm not an expert on EKS or AWS IAM stuff, I'm just feeling around in the dark here a bit.
Background
We are using SaturnCloud, which also deploys analysis instances for end users via EKS. Users assume IAM roles on these instances so that they can interact with the rest of our AWS infra "as perscribed."
These roles are assigned using the whole
ASSUME_ROLE_WITH_WEB_IDENTITY
andAWS_WEB_IDENTITY_TOKEN_FILE
mojo, and things were working swimmingly with paws 0.3.0 for us.When paws 0.4.0 came out, we've found that the users are now assuming the role of the underlyling instance as opposed to the the webidentity that worked in the past.
For example, with paws 0.3.0 the
paws::sts()$get_caller_identity()
call matched the caller identity returned from the aws cli:and from the shell:
However when I upgrade to paws 0.4.0 on this same instance, we now get this:
Proposed Superficial(?) Fix
I went digging down the
paws::sts()$get_caller_identity()
call stack to see what has changed between the behavior in paws 0.3.0 vs 0.4.0, and have discovered that the structure of theresp
object returned fromsvc$assume_role_with_web_identity
in theget_assume_role_with_web_identity_creds
function has changed.In v0.3.0, this call:
generates a
resp
list, with "top-level"resp$Credentials
andresp$AssumedRoleUser
lists that has values at their top-level that can be directly accessed downstream.What I mean is that calling
resp$Credentials$AccessKeyId
andresp$AssumedRoleUser$Arn
gives you values to work with in paws 0.3.0 (paws.common 0.5.8)However, in paws 0.4.0 (paws.common 0.6.0), the same
resp
object has a list of length-1 inresp$Credentials
andresp$AssumedRoleUser
.So, instead of
resp$Credentials$AccessKeyId
providing you a valid value, you now have to call it asresp$Credentials[[1]]$AccessKeyId
, andresp$AssumedRoleUser[[1]]$Arn
to get the values you need.I've found that if I simply hotwire the get_creds_from_sts_resp() function to pull out the first element of the
Credentials
object and use that, like so:The role I want to assume on the instance is now recovered:
I know this isn't the right fix to move forward, but just wanted to point out what works now and hopefully help illuminate where we might go to debug further and help to find a more principled fix.
Thanks!
The text was updated successfully, but these errors were encountered: