fix(log): su syslog root#4370
Conversation
This addresses an issue raised docker-mailserver/docker-mailserver-helm#137
|
@casperklein @polarathene should we cram this into v15.0.0? |
|
If we merge this, this can be in v15 👍 I wonder, what the initial motivation for Line 235 in 0ebf820
It's neither world writeable nor writable by group which is not "root" 🤔 |
|
Please verify that we do not accidentally include a potential regression with this change right before the v15.0.0 release. I do not know enough about the permissions at the moment, hence I am not sure whether the actual permissions need a change or whether this PR's script change is accurate. |
|
TL;DR:
Unclear, it was committed to the Dockerfile in April 2016, the only context is a reference to the DMS v2 tracking issue but nothing in that issue thread or linked commit provides any context. EDIT: Assumption is rsyslog runs as the Additionally when deploying a container as rootless there is a common pattern to only change the runtime user while keeping a root group ( You could also use SGID bit IIRC to have any service with write permission to a directory to enforce files created are assigned the common parent directory group.
That'd depend on the context. For As the linked bug report shows, their bind mount volume has modified permissions to Related history / contextWe do have this other related change in the Lines 147 to 148 in bcee78e That was introduced in Jan 2018 during the base image swap from Ubuntu 16.04 to Debian 9 Stretch (PR):
While this runtime snippet: Originates from Oct 2019 (associated issue + PR). Basically belongs in The Oct 2019 issue was specifically about Not sure if we're actually leveraging the supervisor ClamAV logs for anything: docker-mailserver/target/supervisor/conf.d/dms-services.conf Lines 72 to 79 in 1a938df The two separate ClamAV logs are configured only via the Lines 246 to 259 in 1a938df Even with syslog, we have rsyslog run via supervisord. I haven't looked for config for this, presumably something has it run as the docker-mailserver/target/supervisor/conf.d/dms-services.conf Lines 27 to 34 in 1a938df Probably should address for DMS v15DMS v12 release split the runtime fix for docker-mailserver/target/scripts/startup/setup.d/security/misc.sh Lines 158 to 163 in bcee78e docker-mailserver/target/scripts/startup/setup.d/log.sh Lines 3 to 11 in bcee78e Until we have a better location, the current location for such fixes is grouped into this method: docker-mailserver/target/scripts/startup/setup-stack.sh Lines 85 to 104 in bcee78e DMS v15 correctly runs that even for container restarts so we could move these changes into that 👍 Will eventually improveI've covered extensive info on our current logging situation in the past (see the "What are you going to contribute?" section)
That'll get tackled once I've found time to return to the Vector syslog PR. With Vector we can better manage ingesting log files, syslog, etc and output to centralized logs for individual services or other formats for structured logs, etc. |
|
UPDATE:
I'm not sure if it makes sense to merge this PR, like @casperklein pointed out it doesn't look like this would be reproduced unless the user has modified permissions for their volume bind mount. I don't know how likely that should be needed to support or expect. If this concern doesn't occur with our defaults, then we could just make the changes I mention in "Probably should address for DMS v15" section in my previous comment, which can add another line to reset permissions for docker-mailserver/docker-mailserver-helm#137 (comment) mentions the helm / k8s config (sorry not too familiar with that) is a limitation for managing this, I'm not sure how compatible the fix I propose would be with the helm project, if someone can confirm it's compatible that'd be great 👍 |
rsyslogd runs as root: |
|
TL;DR: Ok I think I got the gist of it now 💪
Am I confident in avoiding a breaking change? No. Technically we should also ensure ownership is changed away from Earlier suggestion as an interim fix is still valid for DMS v15. Summary:
It may still be configured somewhere to write as syslog? Initial docker-mailserver/target/scripts/start-mailserver.sh Lines 193 to 205 in 0294294 Symlink created to Lines 170 to 179 in 0294294 rsyslog packageInstalling the package in DMS Lines 240 to 241 in 0294294 Lines 254 to 255 in 0294294 Lines 234 to 235 in 0294294 Observations
|
|
I have applied the interim fix I suggested: #4374 I do not know if that'll resolve the issue with k8s / helm but I don't think the proposed solution from this PR is the right fix? (especially since we'd be going back to |
Description
This addresses an issue raised
docker-mailserver/docker-mailserver-helm#137
Line 10 enforces permissions of the
/var/log/mailfolder to besyslog:root. As described in the issue, in my helm-based setup this causes the following warningThe proposed change will implement what the warning suggests.
Type of change
Checklist
docs/)CHANGELOG.md