-
Notifications
You must be signed in to change notification settings - Fork 1
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
DAAC direct Bucket Access #793
Comments
I have a working example with Python code now. It should be simple enough to supply the ARNs via the maap-py library (possibly as SSM parameters) https://gist.github.com/wildintellect/e561eccdddee851a571004cf1fbe83b8 Funny story, GEDI L4B seems to have more open permissions, or ORNL granted permission to the ADE role too. So I switched to testing with GES DISC data. |
@wildintellect, here's another possible approach that works within the ADE:
Now, the AWS CLI and AWS SDK will automatically obtain the necessary credentials when using the For example, using the CLI:
Using Python:
|
That means everything will operate under that profile? Will this cause issues for bucket permissions inside MAAP? When running DPS jobs will this cause problems interacting with DPS (writing outputs), etc... We should also confirm that |
I'm not following what you mean about the SSM approach. How do you envision SSM parameters being used? Regarding use of an AWS profile, we can scope the profile to a particular session, like so:
Regarding Thus, in order to leverage the idea shown above, we might then be able to do something like so (simplified) to download granules from S3 because the
This can all be done without introducing breaking changes. |
@chuckwondo we actually already have docs on this. Though we don't show how to pass it to maap-py. |
@wildintellect, thanks for the link to the docs. The only downside to that approach is that credentials are not automatically refreshed, so long-running programs might run into errors due to expired credentials. As part of the research I did several months ago into configuring custom boto3/botocore credentials refreshers, which I will be incorporating into |
Hmm, how long does our current method work; 1 hour, 12 hours? Would be good to document. |
It's 1 hour. Here's a response (partially redacted): {
"Credentials": {
"AccessKeyId": "***",
"SecretAccessKey": "***",
"SessionToken": "***",
"Expiration": "2024-03-04T23:40:40+00:00"
},
"AssumedRoleUser": {
"AssumedRoleId": "***:botocore-session-1709592040",
"Arn": "arn:aws:sts::***:assumed-role/maap-data-reader/botocore-session-1709592040"
},
"ResponseMetadata": {
"RequestId": "f86a9f44-5fd3-4771-9b2f-28cfae125d62",
"HTTPStatusCode": 200,
"HTTPHeaders": {
"x-amzn-requestid": "f86a9f44-5fd3-4771-9b2f-28cfae125d62",
"content-type": "text/xml",
"content-length": "1513",
"date": "Mon, 04 Mar 2024 22:40:40 GMT"
},
"RetryAttempts": 0
}
} Specifically, we can see that the expiration is 1 hour after the request time:
|
I looked into this a little, we can increase the duration of these keys up to 12 hours. Would that be helpful to simply reduce the frequency of refreshes needed?
Once the role properties are changed, adding the DurationSeconds would increase the longevity of the session validity.
|
That's an option that might suffice, but I still view it as a bit of a band-aid. Ideally, we want auto-refresh to occur so we don't even care (nor worry about) how long individual creds last. |
New Task - find a code way to apply the 12 hour limit to the policy. |
Is your feature request related to a problem? Please describe.
Not all DAACs have Federated Tokens working with S3 temporary credential endpoints, and managing temporary sessions. As part of the next generation of solutions from EOSDIS we, along with VEDA, are piloting direct bucket access with the same AWS region as EarthDataCloud (us-west-2)
Several DAACs have granted us read access:
Describe the solution you'd like
User of the ADE and DPS need a way to make user of these credentials.
Possible options:
Describe alternatives you've considered
User could manually code Role switching themselves.
Additional context
For testing in MCP the
MAAP-ADE-K8S
role was given trust to assumemaap-data-reader
. switching back was not tested yet, and probably requires trust the other direction.The following roles have permissions
MAAP Prod account, on MCP
arn:aws:iam::8_7:role/maap-data-reader
arn:aws:iam::8_7:role/tiler-lambda-role
arn:aws:iam::8_7:role/maap-data-manager
MAAP Dev account, on SMCE
arn:aws:iam::9_4:role/maap-data-reader-dev
arn:aws:iam::9_4:role/maap-data-manager-dev
To test currently you have to do:
Then you can try to access
The text was updated successfully, but these errors were encountered: