### Serve Credentials Example Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Example usage of the serve command specifying a custom port and required authentication parameters. ```bash aws_signing_helper serve \ --port 1338 \ --certificate client-cert.pem \ --private-key client-key.pem \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### Credential Process Example Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md An example of using the credential-process command with required certificate, private key, role ARN, and trust anchor ARN arguments. ```bash aws_signing_helper credential-process \ --certificate client-cert.pem \ --private-key client-key.pem \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### sign-string usage example Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Example of signing a string using a private key file and specifying the output format as text. ```bash aws_signing_helper sign-string \ --private-key client-key.pem \ --format text ``` -------------------------------- ### read-certificate-data usage example Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Example of reading certificate data from a specified certificate file. ```bash aws_signing_helper read-certificate-data --certificate client-cert.pem ``` -------------------------------- ### Install dependencies on macOS with Homebrew Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Install git, make, and Go using Homebrew on macOS. Apple clang must be installed separately if not already present. ```bash brew install git make go ``` -------------------------------- ### Build the Docker image Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Execute the build script to install Docker if necessary and build the image for your platform. ```bash ./build.sh ``` -------------------------------- ### List installed certificates Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/notation/README.md After importing certificates, this command shows the installed certificates. The expected output is shown below. ```bash notation cert list ``` ```text STORE TYPE STORE NAME CERTIFICATE signingAuthority aws-signer-ts aws-signer-notation-root.crt signingAuthority aws-us-gov-signer-ts aws-us-gov-signer-notation-root.crt ``` -------------------------------- ### Install dependencies on Windows with Chocolatey Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Install git and make using Chocolatey on Windows. GCC is obtained via MinGW-w64 and Go via the official installer. ```bash choco install git make ``` -------------------------------- ### Build Docker image with build.sh Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Run this command to build the Docker image for the current architecture (amd64 or arm64 auto-detected). The script checks for Docker, installs it if necessary, builds using docker buildx, and creates two tags: ${REGISTRY}/${REPOSITORY}:${VERSION}-${PLATFORM} and ${REGISTRY}/${REPOSITORY}:${VERSION}. ```bash # Build for the current architecture (amd64 or arm64 auto-detected) ./build.sh ``` -------------------------------- ### Serve temporary credentials via local endpoint Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Use the serve command to provide credentials through a local endpoint. This example includes the command invocation and its expected output. ```bash aws_signing_helper serve \ --certificate client-cert.pem \ --private-key client-key.pem \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 \ --port 1338 ``` ```txt Starting server on port 1338... ``` -------------------------------- ### Build the aws_signing_helper binary Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Build the package from the package root after installing the tools and adding them to PATH. The resulting binary is placed at build/bin/aws_signing_helper. ```bash make release ``` -------------------------------- ### Update AWS Profile Example Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Example usage of the update command with required certificate, key, role, and trust anchor arguments. ```bash aws_signing_helper update \ --profile my-profile \ --certificate client-cert.pem \ --private-key client-key.pem \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### PKCS#11 credential-process configurations Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Examples of using the aws_signing_helper credential-process command with various PKCS#11 URI configurations for certificates and private keys. ```bash # Using a certificate from a PKCS#11 token aws_signing_helper credential-process \ --certificate 'pkcs11:manufacturer=piv_II;id=%01' \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 # Using both certificate and key from a PKCS#11 token aws_signing_helper credential-process \ --certificate 'pkcs11:object=My%20RA%20key' \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 # Using a certificate from a file but the key from a PKCS#11 token aws_signing_helper credential-process \ --certificate client-cert.pem \ --private-key 'pkcs11:model=SoftHSM%20v2;object=My%20RA%20key' \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### Install dependencies on Debian-based Linux Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Install the required dependencies (git, gcc, GNU make, and golang) on Debian-based Linux systems. ```bash sudo apt-get install git build-essential golang-go ``` -------------------------------- ### Set up environment variables Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Copy the template file, edit it with your values, and load the environment variables into your session. ```bash # Copy the template file cp .env.template myEnvironmentVariables.env # Edit the .env file with your values vim myEnvironmentVariables.env # Load the environment variables source myEnvironmentVariables.env ``` -------------------------------- ### Run the test suite Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Optionally run the full test suite, which sets up a Kind cluster, loads the image, and executes all tests. ```bash ./tests/run-tests.sh ``` -------------------------------- ### Import PFX to Windows MY store Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Imports a certificate and private key into the user's 'MY' certificate store using certutil. ```bash certutil -user -p %UNWRAPPING_PASSWORD% -importPFX "MY" \path\to\identity.pfx ``` -------------------------------- ### Basic Syntax Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md The general syntax for invoking the credential helper tool. ```bash aws_signing_helper [command] ``` -------------------------------- ### Serve Credentials Syntax Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Syntax for the serve command to provide credentials via a local endpoint. ```bash aws_signing_helper serve [--port ] [--hop-limit ] [options] ``` -------------------------------- ### Help Command Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Displays help information for the credential helper or its subcommands. ```bash aws_signing_helper --help ``` -------------------------------- ### Use a TPM key handle Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Use a persistent TPM key handle instead of a key file for authentication. ```bash aws_signing_helper credential-process \ --certificate client-cert.pem \ --private-key handle:${CHILD_HANDLE} \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### Import trust policy Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/notation/README.md Use this command to import the trust policy file. Replace with the appropriate file name. ```bash notation policy import docker_image_resources/notation/ ``` -------------------------------- ### Run Credential Helper in Serve Mode Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Configures the credential helper container to run in serve mode, mounting certificates and providing necessary ARNs as arguments. ```yaml containers: - name: credential-helper image: local/iamra-credential-helper:latest args: - "serve" - "--certificate" - "/certs/certificate.pem" - "--private-key" - "/certs/private_key.pem" - "--trust-anchor-arn" - "arn::rolesanywhere:::trust-anchor/id" - "--profile-arn" - "arn::rolesanywhere:::profile/id" - "--role-arn" - "arn::iam:::role/role-name" volumeMounts: - name: certs-volume mountPath: /certs readOnly: true ``` -------------------------------- ### Use Credential Helper with TPM Key File Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Command to execute the credential helper using a TPM key PEM file. The parent of the signing key must not be password-protected. ```bash aws_signing_helper credential-process \ --certificate /path/to/certificate/file \ --private-key /path/to/tpm/key/file \ --role-arn ${ROLE_ARN} \ --trust-anchor-arn ${TA_ARN} \ --profile-arn ${PROFILE_ARN} ``` -------------------------------- ### aws_signing_helper --help Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Displays help information for the aws_signing_helper command or its subcommands. This is a global option that can be used with any command. ```APIDOC ## aws_signing_helper --help ### Description Show help for the aws_signing_helper or its subcommands. ### Syntax aws_signing_helper --help ### Options - --help, -h (String) - Optional - Show help for the aws_signing_helper or its subcommands. ### Example aws_signing_helper --help ``` -------------------------------- ### Execute credential-process with --cert-selector Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Basic syntax for the credential-process command using the --cert-selector flag to specify a certificate from a secure store. ```bash aws_signing_helper credential-process \ --cert-selector --private-key --role-arn --trust-anchor-arn [options] ``` -------------------------------- ### Show trust policy configuration Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/notation/README.md This command displays the current trust policy configuration. ```bash notation policy show ``` -------------------------------- ### Use the TPM key with the credential helper Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Execute the credential helper using the persistent TPM handle. ```bash /path/to/aws_signing_helper credential-process \ —certificate /path/to/certificate/file \ —private-key handle:${CHILD_HANDLE} \ —role-arn ${ROLE_ARN} \ —trust-anchor-arn ${TA_ARN} \ —profile-arn ${PROFILE_ARN} ``` -------------------------------- ### Use Command Line Parameters for Certificate Selection Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Specify certificate criteria directly in the command line using the --cert-selector flag. ```bash aws_signing_helper credential-process \ --cert-selector Key=x509Subject,Value=CN=Subject Key=x509Issuer,Value=CN=Issuer Key=x509Serial,Value=15D19632234BF759A32802C0DA88F9E8AFC8702D \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### Load the child key Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Load the created child key into the TPM context. ```bash tpm2_load -C parent.ctx -u child.pub -r child.priv -c child.ctx -P ${TPM_PRIMARY_KEY_PASSWORD} ``` -------------------------------- ### Run individual tests Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Optionally run a specific test case by providing the test case name. Available cases include serve, update, and update-custom-credentials-file. ```bash ./tests/scripts/run-test.sh ``` -------------------------------- ### Use JSON Selector with credential-process Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Pass the path to the JSON selector file to the credential-process command. ```bash aws_signing_helper credential-process \ --cert-selector file://path/to/selector.json \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### Use a TPM wrapped key file Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Use a private key file containing a TPM wrapped key in the TSS2 format with the credential helper. ```bash aws_signing_helper credential-process \ --certificate client-cert.pem \ --private-key tpm-key.pem \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### Create a child key Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Create a child key associated with the primary key context. ```bash tpm2_create -C parent.ctx -u child.pub -r child.priv -P ${TPM_PRIMARY_KEY_PASSWORD} -p ${TPM_CHILD_KEY_PASSWORD} ``` -------------------------------- ### Verify a Docker image Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/notation/README.md Use this command to verify a Docker image with Notation. Replace with the image reference. ```bash notation verify --plugin-config aws-region=us-east-1 ``` -------------------------------- ### Import AWS Signer root certificates Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/notation/README.md Use this command to import the AWS Signer root certificates into Notation. Replace , , and with your values. ```bash notation cert add --type --store ``` -------------------------------- ### Set GOPROXY environment variable Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Command to set the GOPROXY environment variable for troubleshooting dependency resolution. ```bash export GOPROXY="direct" ``` -------------------------------- ### Create a primary key in the TPM owner hierarchy Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Initialize a primary key in the TPM owner hierarchy using tpm2_createprimary. ```bash tpm2_createprimary -G rsa -g sha256 -p ${TPM_PRIMARY_KEY_PASSWORD} -c parent.ctx -P ${OWNER_HIERARCHY_PASSWORD} ``` -------------------------------- ### Encrypt Private Key with Scrypt Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Encrypts a private key using the memory-intensive scrypt KDF for improved security. ```bash openssl pkcs8 -topk8 -in unencrypted-key.pem -out encrypted-key.pem -passout pass:password -scrypt ``` -------------------------------- ### Create a new macOS Keychain Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Creates a new Keychain for the credential helper using the specified password. ```bash security create-keychain -p ${CREDENTIAL_HELPER_KEYCHAIN_PASSWORD} credential-helper.keychain ``` -------------------------------- ### Retrieve Credentials via Diagnostic Commands Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Use these curl commands to interact with the local metadata service to retrieve a token, list available roles, and fetch security credentials. ```bash # Get a token TOKEN=$(curl -X PUT "http://localhost:1338/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") # Get the role name curl -H "X-aws-ec2-metadata-token: $TOKEN" http://localhost:1338/latest/meta-data/iam/security-credentials/ # Get the credentials curl -H "X-aws-ec2-metadata-token: $TOKEN" http://localhost:1338/latest/meta-data/iam/security-credentials/default ``` -------------------------------- ### Import certificates into macOS Keychain Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Imports a PFX file into the specified Keychain, allowing the credential helper access. ```bash security import /path/to/identity.pfx -T /path/to/aws_signing_helper -P ${UNWRAPPING_PASSWORD} -k credential-helper.keychain ``` -------------------------------- ### sign-string command syntax Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Syntax for the sign-string command to sign a fixed string using a private key or certificate. ```bash aws_signing_helper sign-string [--private-key ] [--certificate ] [--format ] [--digest ] [options] ``` -------------------------------- ### Verify latest credential-helper image Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/notation/README.md This command verifies the latest credential-helper image from the public ECR repository. ```bash notation verify public.ecr.aws/rolesanywhere/credential-helper:latest --plugin-config aws-region=us-east-1 ``` -------------------------------- ### Run Credential Helper in Update Mode Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Configures the container to run in update mode, requiring root privileges to write credentials to the root directory. ```yaml containers: - name: credential-helper image: local/iamra-credential-helper:latest securityContext: runAsUser: 0 # Necessary for write to root directory args: - "update" - "--certificate" - "/certs/certificate.pem" - "--private-key" - "/certs/private_key.pem" - "--trust-anchor-arn" - "arn::rolesanywhere:::trust-anchor/id" - "--profile-arn" - "arn::rolesanywhere:::profile/id" - "--role-arn" - "arn::iam:::role/role-name" - "--profile" - "default" volumeMounts: - name: certs-volume mountPath: /certs readOnly: true - name: aws-credentials mountPath: /root/.aws ``` -------------------------------- ### Check version with aws_signing_helper Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Displays the current version number of the AWS IAM Roles Anywhere Credential Helper. ```bash aws_signing_helper version ``` -------------------------------- ### Credential Process Syntax Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md The syntax for the credential-process command, which retrieves temporary AWS credentials. ```bash aws_signing_helper credential-process --certificate --private-key --role-arn --trust-anchor-arn [options] ``` -------------------------------- ### serve Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Serves AWS credentials through a local endpoint compatible with IMDSv2. Allows configuration of port and hop limit. ```APIDOC ## serve ### Description Serves AWS credentials through a local endpoint that is compatible with IMDSv2. ### Syntax aws_signing_helper serve [--port ] [--hop-limit ] [options] ### Options #### --port - Type: Integer - Required: No - Default: 9911 - Description: The port used to run the local server. #### --hop-limit - Type: Integer - Required: No - Default: 64 - Description: The IP TTL to set on responses. ### Example aws_signing_helper serve \ --port 1338 \ --certificate client-cert.pem \ --private-key client-key.pem \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### Create a CSR using the TPM provider Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Generate a Certificate Signing Request using the OpenSSL TPM2 provider. ```bash openssl req -provider tpm2 -provider default -propquery '?provider=tpm2' \ -new -key handle:${CHILD_HANDLE} \ -out client-csr.pem ``` -------------------------------- ### Run an individual test case Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Executes a specific test case using the run-test.sh script. The test-case-name can be serve, update, or update-custom-credentials-file, with an optional timeout in seconds. ```bash ./tests/scripts/run-test.sh [timeout] ``` -------------------------------- ### Define Certificate Selector in JSON Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Create a selector.json file to specify certificate criteria such as Subject, Issuer, and Serial Number. ```json [ { "Key": "x509Subject", "Value": "CN=Subject" }, { "Key": "x509Issuer", "Value": "CN=Issuer" }, { "Key": "x509Serial", "Value": "15D19632234BF759A32802C0DA88F9E8AFC8702D" } ] ``` -------------------------------- ### Encrypt Private Key with AES-256-CBC Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Encrypts an unencrypted PKCS#8 private key using the AES-256-CBC cipher and a specified password. ```bash openssl pkcs8 -topk8 -in unencrypted-key.pem -out encrypted-key.pem -passout pass:password -v2 aes-256-cbc ``` -------------------------------- ### Make the child key persistent Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Evict the child key to make it persistent and capture the handle. ```bash CHILD_HANDLE=$(tpm2_evictcontrol -c child.ctx | cut -d ' ' -f 2 | head -n 1) ``` -------------------------------- ### read-certificate-data command syntax Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Syntax for the read-certificate-data command to display certificate information. ```bash aws_signing_helper read-certificate-data [--certificate ] [--cert-selector ] [options] ``` -------------------------------- ### Successful verification output Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/notation/README.md This is the expected output when verification succeeds. ```text Successfully verified signature for public.ecr.aws/rolesanywhere/credential-helper:latest ``` -------------------------------- ### Pull the Docker image Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Command to pull the latest version of the AWS IAM Roles Anywhere Credential Helper image from the ECR Public Gallery. ```bash docker pull public.ecr.aws/rolesanywhere/credential-helper:latest ``` -------------------------------- ### aws_signing_helper credential-process Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Retrieves temporary AWS credentials by sending a CreateSession request to the IAM Roles Anywhere service. This command requires a private key, role ARN, trust anchor ARN, and profile ARN, with an optional certificate path or certificate selector. ```APIDOC ## aws_signing_helper credential-process ### Description Retrieves temporary AWS credentials by sending a CreateSession request to the IAM Roles Anywhere service. ### Syntax aws_signing_helper credential-process --certificate --private-key --role-arn --trust-anchor-arn [options] ### Options - --certificate (String) - Optional - Path to the end-entity certificate file. Alternatively, provide --cert-selector. - --private-key (String) - Required - Path to the private key file. Encrypted and plaintext private keys are supported. - --role-arn (String) - Required - ARN of the role to obtain temporary credentials for. - --trust-anchor-arn (String) - Required - ARN of the trust anchor used for authentication. - --profile-arn (String) - Required - ARN of the profile that provides a mapping for the specified role. - --debug (Boolean) - Optional - Provide debugging output about the request. - --no-verify-ssl (Boolean) - Optional - Skip verification of the SSL certificate on the endpoint. ### Example aws_signing_helper credential-process \ --certificate client-cert.pem \ --private-key client-key.pem \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ``` -------------------------------- ### Add macOS Keychain to search list Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Adds the new Keychain to the top of the system's search list. ```bash EXISTING_KEYCHAINS=$(security list-keychains | cut -d '"' -f2) security list-keychains -s credential-helper.keychain $(echo ${EXISTING_KEYCHAINS} | awk -v ORS=" " '{print $1}') ``` -------------------------------- ### Run Credential Helper in Update Mode with AWS_SHARED_CREDENTIALS_FILE Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/docker_image_resources/README.md Configures the container to write credentials to a custom path defined by the AWS_SHARED_CREDENTIALS_FILE environment variable. ```yaml containers: - name: credential-helper image: local/iamra-credential-helper:latest env: - name: AWS_SHARED_CREDENTIALS_FILE value: "/tmp/.aws/credentials" args: - "update" - "--certificate" - "/certs/certificate.pem" - "--private-key" - "/certs/private_key.pem" - "arn::rolesanywhere:::trust-anchor/id" - "--profile-arn" - "arn::rolesanywhere:::profile/id" - "--role-arn" - "arn::iam:::role/role-name" - "--profile" - "default" volumeMounts: - name: certs-volume mountPath: /certs readOnly: true - name: aws-credentials mountPath: /tmp/.aws ``` -------------------------------- ### sign-string Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Signs a fixed string using the specified private key or certificate. The output format and digest algorithm can be configured via options. ```APIDOC ## sign-string ### Description Signs a fixed string using the specified private key or certificate. ### Syntax aws_signing_helper sign-string [--private-key ] [--certificate ] [--format ] [--digest ] [options] ### Options - --private-key (String, Optional) - Path to the private key file or PKCS#11 URI to identify the private key. - --certificate (String, Optional) - PKCS#11 URI to identify the certificate. - --format (String, Optional, Default: "json", Valid values: "json", "text", "bin") - Output format for the signature. - --digest (String, Optional, Default: "SHA256", Valid values: "SHA256", "SHA384", "SHA512") - Digest algorithm to use for signing. ### Example aws_signing_helper sign-string \ --private-key client-key.pem \ --format text ``` -------------------------------- ### read-certificate-data Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Reads and displays certificate data from a file, PKCS#11 token, or certificate store. The certificate can be specified by path or by a JSON selector. ```APIDOC ## read-certificate-data ### Description Reads and displays certificate data from a file, PKCS#11 token, or certificate store. ### Syntax aws_signing_helper read-certificate-data [--certificate ] [--cert-selector ] [options] ### Options - --certificate (String, Optional) - Path to the certificate file or PKCS#11 URI to identify the certificate. - --cert-selector (String, Optional) - JSON structure to identify a certificate from a certificate store. ### Example aws_signing_helper read-certificate-data --certificate client-cert.pem ``` -------------------------------- ### Update AWS Profile Syntax Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Syntax for the update command to modify a profile in the AWS credentials file. ```bash aws_signing_helper update [--profile ] [--once] [options] ``` -------------------------------- ### Unlock the macOS Keychain Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Unlocks the newly created Keychain to allow operations. ```bash security unlock-keychain -p ${CREDENTIAL_HELPER_KEYCHAIN_PASSWORD} credential-helper.keychain ``` -------------------------------- ### Encrypt Private Key with Custom PRF Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/README.md Encrypts a private key using a specific pseudorandom function (PRF) such as hmacWithSHA256. ```bash openssl pkcs8 -topk8 -in unencrypted-key.pem -out encrypted-key.pem -passout pass:password -v2prf hmacWithSHA256 ``` -------------------------------- ### update Source: https://github.com/aws/rolesanywhere-credential-helper/blob/main/commands.md Updates a named profile in the AWS credentials file with temporary AWS credentials. Supports optional profile name and once flags. ```APIDOC ## update ### Description Updates a profile in the AWS credentials file with temporary AWS credentials. ### Syntax aws_signing_helper update [--profile ] [--once] [options] ### Options #### --profile - Type: String - Required: No - Default: "default" - Description: Named profile to update in the AWS credentials file. #### --once - Type: Boolean - Required: No - Default: false - Description: Update credentials only once instead of continuously. ### Example aws_signing_helper update \ --profile my-profile \ --certificate client-cert.pem \ --private-key client-key.pem \ --role-arn arn:aws:iam::123456789012:role/MyRole \ --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abcdef1234567890 ```