Skip to content

"Passing a single string to Aws::ProcessCredentials.new is insecure" now appearing when using credential_process option in an aws config #3061

@cswilliams

Description

@cswilliams

Describe the bug

After upgrading to the most recent version of aws-sdk-core, I started receiving the following warning:
Passing a single string to Aws::ProcessCredentials.new is insecure, please use use an array of system arguments instead

This appears to happen because I have the "credential_process" option set in my aws config file like so:

[profile my-account]
role_arn = << role_arn >>
source_profile = << profile >>
region= << region >>

[profile my-account-creds]
credential_process = aws-vault export --format=json my-account
region=us-east-2

Then in ruby I try to use the profile:

require 'aws-sdk-core'
require 'aws-sdk-s3'
Aws.config.update(profile: 'my-account-creds')
Aws::S3::Client.new
Passing a single string to Aws::ProcessCredentials.new is insecure, please use use an array of system arguments instead
=> #<Aws::S3::Client>

It seems like this warning was adding recently in #3048

Is there a proper way to set credential_process in the aws config file to avoid this warning? I couldn't find any example of it taking an array.

Expected Behavior

Not receive a warning.

Current Behavior

A warning appears: Passing a single string to Aws::ProcessCredentials.new is insecure, please use use an array of system arguments instead

Reproduction Steps

See the bug description.

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-core 3.201.0

Environment details (Version of Ruby, OS environment)

Ruby 3.3.1 OSX

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions