natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.81k stars 593 forks source link

custom file and dir permission (#164) #168

Open counten opened 2 years ago

jedisct1 commented 1 year ago

Any hope to see that PR merged?

djarbz commented 1 year ago

Please merge this!

counten commented 1 year ago

allow user to custom file permission , use default if not configured。 I think this is better for users @natefinch

jedisct1 commented 1 year ago

Yes the current behavior is not great.

fissssssh commented 1 year ago

I think using the same permission (0755) as the parent folder could also be feasible.

fissssssh commented 1 year ago

When working with sidecar to collect logs in Kubernetes, this issue becomes quite visible. @jedisct1

djarbz commented 1 year ago

I think using the same permission (0755) as the parent folder could also be feasible.

0644 would be more appropriate for files, we don't need to be able to execute log files.

fissssssh commented 1 year ago

I think using the same permission (0755) as the parent folder could also be feasible.

0644 would be more appropriate for files, we don't need to be able to execute log files.

Yes, changing the file permission to 0644 is sufficient and there is no need to customize the permission further.

186

djarbz commented 1 year ago

I think using the same permission (0755) as the parent folder could also be feasible.

0644 would be more appropriate for files, we don't need to be able to execute log files.

Yes, changing the file permission to 0644 is sufficient and there is no need to customize the permission further.

186

I would disagree, having the ability to have restrictive or open permissions on log files is very important in a security sense. I would prefer this PR over yours.

counten commented 1 year ago

I think using the same permission (0755) as the parent folder could also be feasible.

0644 would be more appropriate for files, we don't need to be able to execute log files.

Yes, changing the file permission to 0644 is sufficient and there is no need to customize the permission further.

186

I would disagree, having the ability to have restrictive or open permissions on log files is very important in a security sense. I would prefer this PR over yours.

Strict file permissions meet security requirements. Hope to be merged.

mohamedtaher567 commented 1 year ago

Is there any hope for this to be merged? Or even reviewed by the owners. So that it could eventually be merged.

bnpfeife commented 10 months ago

+1

I would also like this merged. I think that a library forcing permissions should be a "last resort" option. I totally understand why gpg and ssh do it, but it makes little to no sense for logs. The authors of this library don't have context for which the logs are being used. Having a strict default is fine as long as it is configurable (as it is with this PR).