RFC: forbid rotating hardlinks as root#397
Closed
cgzones wants to merge 6 commits intologrotate:masterfrom
Closed
Conversation
Do not continue in a possible root owned directory
Use O_CREAT inside of `createOutputFile()` instead of specifying it by every caller.
We do check a priori if a log file is a link and skip such files. An attacker could potentially setup a regular file for this check and replace it afterwards with a link. Error out if an actual opened log files is a link.
If build with SELinux support but SELinux is disabled, do not unnecessarily open a file in `setSecCtxByName()`, as `setSecCtx()` will be a no-op.
Member
|
Thanks for the proposal! Could you please send me privately the attack scenario that this change would prevent? |
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.
Related: #237
To avoid any kind of attack scenarios with malicious hard-links to privileged file (like /etc/shadow) do not rotate hard-links as root (we already do not rotate symbolic-links).