create the credential cache directory with 0700 in JSONFileCache - #3753
Open
ubeddulla wants to merge 1 commit into
Open
create the credential cache directory with 0700 in JSONFileCache#3753ubeddulla wants to merge 1 commit into
ubeddulla wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3753 +/- ##
===========================================
- Coverage 92.59% 92.42% -0.18%
===========================================
Files 68 68
Lines 15634 15829 +195
===========================================
+ Hits 14477 14630 +153
- Misses 1157 1199 +42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
|
gentle ping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JSONFileCache creates its working directory with os.makedirs and no mode, so it lands at 0o777 & ~umask. That directory backs
~/.aws/sso/cache(SSO access and refresh tokens) and~/.aws/boto/cache(cached assume-role credentials); the entries themselves are already 0600 since they come from mkstemp and os.replace keeps the mode, but under umask 000, which is easy to hit in containers and in systemd units with no UMask=, the directory is world-writable and another local user can unlink an entry and drop in their own for botocore to load back. Passing mode=0o700 lines this up with what the CLI does for the directories it creates, and I added a regression test alongside the existing atomic-write ones.