aws / aws/aws-cli

AWS CLI v2 permissions wrong if installed after CIS hardening (umask 077 vs 022 default) on CentOS

Open
#5,769 16 comments 3 reactions 0 assignees View on GitHub
enhancement feature-request installation p3 v2
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

Confirm by changing [ ] to [x] below to ensure that it's a bug:
- [x] I've gone though the [User Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) and the [API reference](https://docs.aws.amazon.com/cli/latest/reference/)
- [x] I've searched for [previous similar issues](https://github.com/aws/aws-cli/issues) and didn't find any solution

**Describe the bug**
Under a new install of 2.1.4, the folder permissions are wrong. This bug causes the PATH var to technically not work unless su into root.

This seems to be recent as I've not experienced this when installing a few

**SDK version number**

**Platform/OS/Hardware/Device**
CentOS 8

**To Reproduce (observed behavior)**
1. Follow the instructions to [install](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html)
2. Run `aws`
3. Get command not found

**Expected behavior**
1. Follow instructions to [install](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html)
2. Run `aws`
3. Get the help output

**Logs/output**
Post-install command test
```
$ sudo ./aws/install
You can now run: /usr/local/bin/aws --version
$ aws
-bash: aws: command not found
```

Post install directory permissions
```
$ ll /usr/local/
drwx------. 3 root root 16 Nov 30 20:03 aws-cli
```

Post-install directory permissions FIXED
```
$ sudo chmod -R 755 aws-cli
$ aws

usage: aws [options] [ ...] [parameters]
To see help text, you can run:

aws help
aws help
aws help

aws: error: the following arguments are required: command
```

**Additional context**
This was on a clean brand new instance of CentOS 8 using the CIS benchmark level 1 image.

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.