Skip to content

create the credential cache directory with 0700 in JSONFileCache - #3753

Open
ubeddulla wants to merge 1 commit into
boto:developfrom
ubeddulla:sso-cache-dir-mode
Open

create the credential cache directory with 0700 in JSONFileCache#3753
ubeddulla wants to merge 1 commit into
boto:developfrom
ubeddulla:sso-cache-dir-mode

Conversation

@ubeddulla

Copy link
Copy Markdown

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.

@ubeddulla
ubeddulla requested a review from a team as a code owner July 20, 2026 08:25
@codecov-commenter

codecov-commenter commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.42%. Comparing base (ee748e4) to head (3bd1533).
⚠️ Report is 381 commits behind head on develop.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ubeddulla

Copy link
Copy Markdown
Author

gentle ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants