aws / aws/aws-cli

Access and Secret access key visible in plain text while creating new aws profile.

Open
#7,372 2 comments 1 reaction 0 assignees View on GitHub
configure feature-request p3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

### Describe the bug

Access key and secret access key not being masked as intended as i could see there is a function to mask value or at least hide from the prompt

### Expected Behavior

When i run `aws configure --profile demo`

the prompt should be something like this
```
➜ ~ aws configure --profile demo
AWS Access Key ID [None]: ***************
AWS Secret Access Key [None]: ******************
Default region name [None]: us-west-1
Default output format [None]:
```

### Current Behavior

When i configure profile then access key and secrets are displayed on the screen in plain text which does not look good from security perspective
```
➜ ~ aws configure --profile demo
AWS Access Key ID [None]: ANASDMNXCVKJYHUS.
AWS Secret Access Key [None]: JjkhasdknbmnbHkasdmbnJHZJKH
Default region name [None]: us-west-1
Default output format [None]:
```

### Reproduction Steps

Run `aws configure --profile demo` to try to create a new profile with access and secret access key and the issue would be reproduced.

### Possible Solution

I would suggest the access key to hidden from user when configuring the profile. You could use python `getpass` for fetching access key and secret access key

https://github.com/aws/aws-cli/blob/45b0063b2d0b245b17a57fd9eebd9fcc87c4426a/awscli/customizations/configure/configure.py#L37

implementation could be something like using `python getpass`

https://docs.python.org/3/library/getpass.html

### Additional Information/Context

_No response_

### CLI version used

2.8.6

### Environment details (OS name and version, etc.)

MacOs Darwin, Kernel version 21.6.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.