Skip to content

Tighten file permissions when writing credentials in CodeArtifact#10192

Merged
AndrewAsseily merged 1 commit intoaws:v2from
FiveSlashNine:v2
Apr 8, 2026
Merged

Tighten file permissions when writing credentials in CodeArtifact#10192
AndrewAsseily merged 1 commit intoaws:v2from
FiveSlashNine:v2

Conversation

@FiveSlashNine
Copy link
Copy Markdown
Contributor

Description of changes:
This change updates the CodeArtifact login credential file operations to use secure file permissions (0o600) by replacing standard open() calls with os.open() and os.fdopen(). This prevents credentials in .netrc and .pypirc files from being created with default permissions that could expose them to unauthorized users on the system.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AndrewAsseily AndrewAsseily changed the title Fix insecure file permissions when writing credentials in CodeArtifact Tighten file permissions when writing credentials in CodeArtifact Apr 7, 2026
@AndrewAsseily
Copy link
Copy Markdown
Contributor

Thanks!
The PR has failing CI that looks like a valid failure. Can you take a look and add a changelog entry?

@FiveSlashNine FiveSlashNine force-pushed the v2 branch 2 times, most recently from 3064dde to 465bf6f Compare April 7, 2026 16:03
@FiveSlashNine
Copy link
Copy Markdown
Contributor Author

Added the changelog entry but I need to skip the tests for windows

@FiveSlashNine
Copy link
Copy Markdown
Contributor Author

Added an annotation to skip the tests for windows

@FiveSlashNine
Copy link
Copy Markdown
Contributor Author

The other pr had failures, most likely because I pass fd to chmod instead of the path. I will change it and push again

Copy link
Copy Markdown
Contributor

@AndrewAsseily AndrewAsseily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@AndrewAsseily AndrewAsseily merged commit 94ce3f6 into aws:v2 Apr 8, 2026
55 checks passed
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