logrotate template create by default world readable logs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Router Charm |
Fix Committed
|
Undecided
|
DUFOUR Olivier | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This is related to CIS hardening deployment.
Logrotated files should not just be readable to the world but they are still created with a default rule of 0644 from logrotate template
This has been seen on :
- Ubuntu : Focal
- Channel : 8.0/stable
ubuntu@
/var/lib/
rotate 9
notifempty
size 10M
create 0644 mysql mysql
postrotate
kill -HUP $(pidof mysqlrouter)
endscript
}
Updating the logrotate template to create files with 0640 should be sufficient since "/var/lib/
root@juju-
total 44
drwx------ 2 mysql mysql 4096 Oct 13 02:52 .
drwx------ 5 mysql mysql 4096 Oct 13 02:54 ..
-rw-r--r-- 1 mysql mysql 29843 Oct 13 06:18 mysqlrouter.log
Changed in charm-mysql-router: | |
assignee: | nobody → DUFOUR Olivier (odufourc) |
status: | New → In Progress |
Fix proposed to branch: master /review. opendev. org/c/openstack /charm- mysql-router/ +/861693
Review: https:/