Skip to content
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

Add Support for IAM Roles Anywhere CreateSession #3533

Open
2 tasks
rittneje opened this issue Jul 19, 2022 · 10 comments
Open
2 tasks

Add Support for IAM Roles Anywhere CreateSession #3533

rittneje opened this issue Jul 19, 2022 · 10 comments
Labels
cross-sdk feature-request A feature should be added or improved. l Effort estimation: large p2 This is a standard priority issue

Comments

@rittneje
Copy link

Describe the feature

Add native support for CreateSession to the SDK.

Use Case

We would like to leverage IAM Roles Anywhere to "bootstrap" AWS credentials into our external services that are written in C#. We are unable to use the precanned credential_process binaries.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS .NET SDK and/or Package version used

n/a

Targeted .NET Platform

.NET Standard 2.0

Operating System and version

Windows, Linux

@rittneje rittneje added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 19, 2022
@ashishdhingra
Copy link
Contributor

Hi @rittneje,

Good afternoon.

The link https://docs.aws.amazon.com/rolesanywhere/latest/userguide/credential-helper.html talks about downloading the external utility for signing process using it in conjunction with credential-process. This returns the same output structure as returned by the credentials_process mentioned in Sourcing credentials with an external process. May be you could setup the IAM roles anywhere credentials helper to be executed as part of batch program (on Windows) and specify that batch program with parameters in the credentials file:

[profile developer]
credential_process = <<path-to-credentials-helper-batch-program>> --certificate <<path-to-certificate-file>> ...

How is this implemented in other SDK(s)? As per above reference links, you intend to call the external helper tool that returns temporary credentials. This external helper could be used with credential_process setting in credentials file.

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 14, 2022
@rittneje
Copy link
Author

@ashishdhingra We cannot run an external binary like that, which is why I'd like the SDK to do it natively instead.

How is this implemented in other SDK(s)?

AFAIK it is not currently implemented in any SDKs, since the expectation from AWS was everyone would outsource to it as a credential process. However, as I mentioned that is neither feasible nor desirable for us. Instead the functionality within that binary should be ported into all the SDKs as a first-class feature.

@ashishdhingra
Copy link
Contributor

@ashishdhingra We cannot run an external binary like that, which is why I'd like the SDK to do it natively instead.

How is this implemented in other SDK(s)?

AFAIK it is not currently implemented in any SDKs, since the expectation from AWS was everyone would outsource to it as a credential process. However, as I mentioned that is neither feasible nor desirable for us. Instead the functionality within that binary should be ported into all the SDKs as a first-class feature.

@rittneje There is specification around this as far as we are aware of. This needs to be discussed with the team, probably a cross-SDK feature request.

@ashishdhingra ashishdhingra added needs-review and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Sep 14, 2022
@ashishdhingra ashishdhingra transferred this issue from aws/aws-sdk-net Sep 15, 2022
@lee-11
Copy link

lee-11 commented Dec 9, 2022

Likewise, when creating applications to run on remote devices I would like to make use of IAM Roles Anywhere to authenticate all calls made via the SDK without managing a dependency manually or altering my existing SDK client code.

The overhead of manually install and update a separate executable dependency is burdensome. I don't need to do that in general (that is, if I use keys they are automatically discovered on storage or in the environment). Likewise, when using SSO authentication I don't need to alter my code to make use of credentials generated by aws sso login (which I don't expect to be directly supported in the SDK since human involvement is necessary).

I appreciate that a credential provider is being made available, and understand that it's necessary to identify that a given profile should make use of a certificate at a given location, but it seems a convention-based approach (certificate file name/location) would work as well. Bundling support for certificate based authentication into the SDK (likely as a new nuget package as was done with AWSSDK.SSO) would make adoption much easier.

@bhsdodo
Copy link

bhsdodo commented Sep 7, 2023

Any updates on this issue?

@dylanbartley
Copy link

dylanbartley commented Nov 17, 2023

Is there an update on this? I have tried to replicate the functionality in .netstandard2.0 following instructions from https://docs.aws.amazon.com/rolesanywhere/latest/userguide/authentication-sign-process.html. with no luck

as well as trying to understand the go implementation https://github.com/aws/rolesanywhere-credential-helper. which doesn't work for and i don't know enough about go to make it work.

@TomTum89
Copy link

When will this resolved?

@salrashid123
Copy link

i uploaded a small library here in go that does this exchange....its not going to help out much in this case since you're asking about .net support and for something official from aws.

(disclaimer, i rarely use aws and only recently came across this capability so the library there is just a proof of concept, thats all; suggestion are welcome)

@dylanbartley
Copy link

forgot to return and update this thread. I did up creating a .NET library for this.

SaiphIamRolesAnywhere

@ashishdhingra ashishdhingra added p2 This is a standard priority issue and removed needs-review labels Aug 29, 2024
@krnbr
Copy link

krnbr commented Oct 28, 2024

I recently did one POC with regards to this. First of all thanks to AWS! Awesome service - AWS IAM roles anywhere.

I am more of a java + spring boot developer, So leveraged that tech and did a custom provider based on AWS's internal classes etc.

Though the piece of code I did is not perfect(comparing to awesome AWS SDKs - majorly it is inspired from them only)!

The link to the blog post is here

Suggestions to the team is a custom AWS provider where it can accept

  • cert, keys as base64 strings or as an alternative as a file location.
  • important ARNs relating to role, trust anchor, profile, etc.
  • region
  • duration of session

The piece of POC I did, covered the following important scenarios:-

  • supports EC and RSA keys
  • supports chained EC and RSA keys, only one level of intermediate CA as of date.
  • auto refreshes the temporary credentials, just before expiry of the existing credentials, majorly inspired from STS's providers.

This way I can fetch IAM roles anywhere sessions based temporary credentials without creating a complex custom image/ server that depends of heavily on CLI or signing helper.

@ashishdhingra ashishdhingra transferred this issue from aws/aws-sdk Oct 30, 2024
@ashishdhingra ashishdhingra removed their assignment Oct 30, 2024
@ashishdhingra ashishdhingra added the l Effort estimation: large label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-sdk feature-request A feature should be added or improved. l Effort estimation: large p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

8 participants