Get audited access to RDS databases without a VPN using the Granted RDS Plugin.
Learn more here.
AWS config file generation
Examples
Here are some quick examples of config file generation below. The generate command prints the profiles to the stdout stream in your terminal, and the populate command writes the profiles to your local AWS configuration file. You can exchange generate for populate when running the below commands.
All available AWS SSO roles
Output:
Custom profile format
Output:
Prefix for generated profiles
Output:
Prune stale generated profiles
When --prune is provided, profiles with the commonfate_generated_by key will be removed if they no longer exist in the source. This can be useful for removing roles which no longer exist in AWS SSO. The --prune flag is only supported on the populate command.
Opt-out of Granted Credential Process
By default, generated profiles use the Granted Credential Process and will include a credential_process entry. If you’d like to opt out of this behaviour, you can provide the --no-credential-process flag when generating profiles:
Output:
Sources
Granted supports the below profile sources, using the --source flag. We’d love to hear from you if you have any suggestions for additional profile sources for us to add - you can raise an issue here. Multiple sources can be provided by specifying --source more than once when running a command.
Source
CLI flag
Description
AWS IAM Identity Center (default)
--source aws-sso
Creates a profile for each account and permission set available to you in AWS IAM Identity Center
generate command
This will print an AWS configuration with profiles from accounts and roles available in AWS IAM Identity Center.
Example Usage
You should see an output like the following:
populate command
This will populate your AWS config file directly.
Example Usage
This command will write an output similar to the following to ~/.aws/config:
The profile name can be customized using the --profile-template flag. The template uses the gotemplate format. The available fields are those of this struct:
The default template used to generate profile names is:
Here is a Granted populate command example that generates profiles using a period as the separator between the AWS account name and the role name:
Additional notes
If you have access to multiple AWS SSO instances, you’ll need to run this command once for each instance.
Acknowledgements
A special thank you to @misterjoshua for the implementation of this feature.