-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write passwords only to serial console, lock down cloud-init-output.log #847
Merged
Conversation
This file contains 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
Prior to this commit, when a user specified configuration which would generate random passwords for users, cloud-init would cause those passwords to be written to the serial console by emitting them on stderr. In the default configuration, any stdout or stderr emitted by cloud-init is also written to `/var/log/cloud-init-output.log`. This file is world-readable, meaning that those randomly-generated passwords were available to be read by any user with access to the system. This presents an obvious security issue. This commit responds to this issue in two ways: * We address the direct issue by moving from writing the passwords to sys.stderr to writing them directly to /dev/console (via util.multi_log); this means that the passwords will never end up in cloud-init-output.log * To avoid future issues like this, we also modify the logging code so that any files created in a log sink subprocess will only be owner/group readable and, if it exists, will be owned by the adm group. This results in `/var/log/cloud-init-output.log` no longer being world-readable, meaning that if there are other parts of the codebase that are emitting sensitive data intended for the serial console, that data is no longer available to all users of the system. LP: #1918303
TheRealFalcon
approved these changes
Mar 19, 2021
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 19, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 19, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 19, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 19, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 22, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 22, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 22, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 22, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 22, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 22, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
TheRealFalcon
added a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Mar 22, 2021
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
This was referenced May 12, 2023
Closed
holmanb
pushed a commit
to holmanb/cloud-init
that referenced
this pull request
Feb 7, 2024
In b794d42 (canonical#847), we changed log permissions on /var/log/cloud-init.log to be owned by root:adm and have 740 permissions by default. This commit performs that same change on upgrade. LP: #1918303
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.
Proposed Commit Message
Test Steps
See the included integration tests.
Checklist: