Skip to content
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

Fix permissions issue #4628

Merged
merged 2 commits into from
Nov 27, 2023
Merged

Conversation

holmanb
Copy link
Member

@holmanb holmanb commented Nov 25, 2023

Additional Context

Since cloud-init still redacts sensitive information from /var/log/cloud-init.log, there is no way to expose a secure system (no CVE). However, #4250 weakens our mitigation of restricting logs by allowing more permissive log permissions. Revert that commit and implement the behavior it was trying to introduce.

Checklist

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

…han the new mode (canonical#4250)"

This reverts commit a0e4ec1.

This commit introduced a broken `compare_permissions()` function. With
this implementation, a log file with a mode of 0o407 would remain
readable to other users on the system.

If the unit tests included in this commit expected the correct output values,
the tests would have caught this error.
@holmanb holmanb changed the title Holmanb/fix permissions issue Fix permissions issue Nov 25, 2023
@holmanb holmanb added the 23.4 label Nov 27, 2023
@TheRealFalcon TheRealFalcon self-assigned this Nov 27, 2023
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

LGTM!

Previous implementations loosened permissions in non-default scenarios.

Fixes canonicalGH-4243
@holmanb holmanb force-pushed the holmanb/fix-permissions-issue branch from 5cb8a84 to 6833c90 Compare November 27, 2023 17:45
@holmanb
Copy link
Member Author

holmanb commented Nov 27, 2023

Reworded the commit message

@holmanb holmanb merged commit 2fb656f into canonical:main Nov 27, 2023
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