fix: set file permissions on AWS credentials, remove sensitive data from SSH logs#1907
Closed
jlima8900 wants to merge 0 commit intoKeeper-Security:releasefrom
Closed
Conversation
b7707ef to
445d3a4
Compare
Contributor
Author
|
@aaunario — ready for review. Squashed to single commit, all CodeQL alerts resolved, 19 unit tests passing. |
dcbc112 to
d610fb9
Compare
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.
Summary
Two validated findings from a security audit of the Commander codebase (445 Python files, 10 categories, 3-pass validation).
KC-2026-001: AWS credentials file permissions
The
awskeyrotation plugin writes credentials to~/.aws/credentialswithout restricting file permissions, leaving them world-readable by default.Fix: Use
os.open()withO_WRONLY | O_CREAT | O_TRUNCand mode0o600to atomically create the file with restricted permissions, preventing TOCTOU race conditions.KC-2026-002: SSH connection logging
SSH connection handler logs contain sensitive session data that should be redacted.
Fix: Sanitize log output to remove sensitive connection details. Also removed truncated input data from error logs to resolve CodeQL clear-text logging alerts.
Tests
test_security_hardening.pyCodeQL
All clear-text logging alerts resolved in this single squashed commit.