crowdsecurity / cs-firewall-bouncer

Crowdsec bouncer written in golang for firewalls
MIT License
119 stars 43 forks source link

Remove hard-coded 0600 log file perms #294

Closed jarppiko closed 1 year ago

jarppiko commented 1 year ago

Summary

Solves #293. Removes obsolete code from cfg/logging.go that sets log file permissions to hard-coded 0600 in every bouncer start. This PR uses lumberjacklog roller library's native log file creation functionality instead which preserves existing log file permissions.

The logtools.SetLogFilePermissions() seems to have been copy-pasted from lumberjack as a quick-fix to natefinch/lumberjack#82, but the upstream issue has been fixed four years ago.

mmetc commented 1 year ago

Thanks! We had outdated dependencies until 0.0.26 so I didn't spot this one. I like removing code.