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

Make default log file mode 0600 #112

Closed
wants to merge 1 commit into from
Closed

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Oct 7, 2020

When a file is not pre-created, the default mode were 0644. This
could be very problematic for audit log files which require tighter
permissions.

This changes the default mode to be 0600 which is more
restrictive. Note that rotation of log files already uses this
mode by default. Also note that when files are pre-created, the mode the
file already had is respected.

When a file is not pre-created, the default mode were 0644. This
could be very problematic for audit log files which require tighter
permissions.

This changes the default mode to be 0600 which is more
restrictive. Note that rotation of log files already uses this
mode by default. Also note that when files are pre-created, the mode the
file already had is respected.
@natefinch
Copy link
Owner

Here's the thing, we already set the default log mode to 600 when opening a new log file. That line you changed only opens an existing log file. The filemod in that call is ignored when opening an existing file. You can see that here:

https://play.golang.org/p/cupAhV1GAI1

It might be worth a comment saying "hey, this filemod gets ignored" and maybe setting it to 0000 just to show it's really and truly not a valid value.

@JAORMX JAORMX closed this Nov 4, 2020
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