Videos
I found the easiest thing to do was to create a separate script for the credential_process to target, this isn't necessary I just found it easier.
So create a script along the lines of:
#! /bin/bash
# raw_helper.sh
/path/to/aws_signing_helper credential-process \
--certificate /path/to/cert.crt \
--private-key /path/to/key.key \
--trust-anchor-arn <TA_ARN> \
--profile-arn <Roles_Anywhere_Profile_ARN> \
--role-arn <IAM_Role_ARN>
The key thing I found is that most places (including AWS documentation) tell you to use the ~/.aws/config file and declare the profile there. This didn't seem to work, but when I added the profile to my ~/.aws/credentials file it did work. Assuming you've created a helper script, this would look like this:
# ~/.aws/credentials
[raw_profile]
credential_process = /path/to/raw_helper.sh
Based on AWS recommendations and my previous experience in a similiar application, you should
- Create the AWS config file on the server envirnoment or containers with the parameters - certificate, private-key, trust-anchor-arn, profile-arn, role-arn and the signing helper file location (Secure options such as using K8S secrets or other options should be considered here)
- Use AWS SDK to retrieve the credentials from the application.
If you are not using containers it will be a straight forward process to create the aws config file with a profile and then you can use the sdk to retireve the credentials. (aws signing helper file should also be uploaded to a path in the server)
Java SDK: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/auth/credentials/ProfileCredentialsProvider.html
Python SDK: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html