-
Notifications
You must be signed in to change notification settings - Fork 104
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 connection assume_role
configuration
#1844
Comments
assume_role
configuration
This looks like it would be a great addition! Happy to help out to push this through if needed, although not contributed here before either. Let me know 😄 |
@brittandeyoung Thanks for opening the issue and submitting the PR! I like the idea of being able to specify a role ARN for easier creds setup, but I do have some concerns around how to pass options/config when assuming the role. For instance, if you want to assume a role with an external ID or MFA serial number in the AWS CLI or the AWS plugin today, you'd setup the AWS profile like:
If you were to use Steampipe today to authenticate to an AWS account and reference your profile in So if we wanted to offer the same functionality in the AWS plugin, we'd most likely need to offer additional config args, e.g.,
Is your use case just for assuming a role with no other configuration/options specified, or do you have use cases for this as well? @johnsmyth Any thoughts on how we could support a feature like this? |
My thoughts on this: If we were deploying Steampipe to ECS or similar, we would need to have:
Whereas with this implementation, the roles are assumed within Steampipe itself, and does not depend on AWS CLI at all. These roles would be assumable directly from the values in the environment variables through AWS SDK. I don't think you will need to support Terraform AWS provider is a good example of what to support and what not to. They support assume_role and access keys, but not mfa_serial or the others you mentioned. Edit: |
@p5 Thanks for the examples! I don't think AWS CLI would need to be installed, as the AWS plugin uses the AWS SDK Go v2, which I don't believe relies on the AWS CLI (but I could be wrong on this), as it handles creds and API calls directly in its code. The Terraform AWS provider provides an assume_role block, which allows users to pass in other options, e.g.,:
So we could provide something similar in this plugin (along with assume_role_with_web_identity now or in the future). |
@p5 covered exactly why I raised this issue. Having to both manage the I will adjust my PR to use the |
From what I can see, the steampipe plugin schema does not have a method for doing a configuration block within the schema. I will be making root configuration items for each assume role config. |
@brittandeyoung We have an example in the Kubernetes plugin you can follow:
In this example, we allow any top level key in the map, e.g., |
@cbruno10 Thank you for the example I am currently looking to see if i can make the needed adjustments to move it to a block using your example. |
@brittandeyoung Can you please also test what happens when you try to run a query past the role session expiration time when using your new config arg(s)? For instance, if you run the following steps:
Do you get an error, does the request succeed, or is there another outcome? I believe this scenario is already handled in the AWS plugin by the AWS SDK when pointing to a profile that has configuration details in the credentials or config file (except when a static MFA token is passed in), so it should be supported for this new config arg as well in order to allow users to use long running Steampipe processes. |
assume_role
configurationassume_role
configuration
assume_role
configurationassume_role
configuration
@cbruno10 I am struggling to get the configuration working in the config block. The configuration that I currently have pushed to the PR works great with the root level configurations. One thing I am struggling with is that the schema for the plugin you are referencing is dynamic, while the schema of this plugin is statically defined. I do not see a way in the static definition to define a block, in other projects like terraform providers this is typically done by a List of one, but I do not see that as an option in the plugin schema. Any tips from here are appreciated. Here is what I tried, I removed the static schema config, and set the schema to be dynamic. This alone causes the plugin to crash even without adding any additional configuration. This is the error when attempting to run with dynamic schema:
I am very new to steampipe development, so i could be making a simple rookie mistake =) . This is the configuration structures I was testing with:
|
Hi @brittandeyoung, thanks for submitting the PR. The changes look great! For the above config example, I think you need to mention the Could you please try the below config struct?
Let us know if you need any help, thanks! |
To join the party :) I think adding both the @brittandeyoung I have been through developing the above mentioned credentials setup so you are more than welcome to take any parts for your PR https://github.com/RaftechNL/qbconf/blob/main/main.go#L294 |
I have updated the PR with a working assume role configuraiton. Below is an example config that will work for assuming roles:
I am still having issues with the optional config items not actually being read into the config. In this example, |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Still would love to have this available. |
Closing the issue for now, we plan to resume work on it once the Steampipe SDK update is released. Progress and updates will continue to be tracked at the following - |
Is your feature request related to a problem? Please describe.
Currently in order to configure a connection to an AWS account, you need to provide a aws config profile or the credentials in the configuration file. This can make connecting to a large number of accounts difficult to maintain the configuration.
Describe the solution you'd like
It would be ideal to be able to provide a
assume_role
to the connection config in place of credentials and this role would be assumed for the connection.Describe alternatives you've considered
A way to dynamically generate the needed aws profiles and dynamically generate the connection configuration file. This is not ideal in any way.
Additional context
This type of configuration would make dynamically adjusting the connection information simple and scale well with large multi account configurations.
The text was updated successfully, but these errors were encountered: