Bug 2160380

Summary: new libcap-ng functionality in rsyslog can't be turned off, is totally undocumented, breaks stuff
Product: Red Hat Enterprise Linux 9 Reporter: Jonathan Kamens <h1k6zn2m>
Component: rsyslogAssignee: Attila Lakatos <alakatos>
Status: CLOSED CURRENTRELEASE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bstinson, dapospis, jwboyer, pascal.tempier, rsroka
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-01 12:45:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Kamens 2023-01-12 08:09:50 UTC
As per bug 2127404, version rsyslog-8.2102.0-107.el9, which just came out, has code in it to use libcap to drop capabilities on startup.

Problems:

* There doesn't appear to be any way to turn this off.
* The behavior is completely undocumented so the only way you can find out it's doing this is to find the one-line note about it in the RPM changelog.
* It is preventing rsyslog from writing to log files owned by other users.

The last bullet point above is the sticking point for me. INN stores log files in /var/log/news, not /var/log, and they're owned by news, not by root. This is necessary because the nightly job that INN runs to clean up log files runs as news, not root, and it needs to be able to manipulate these log files in ways it would not be able to do if they were owned by root.

There are undoubtedly other similar user cases which this change is going to be problematic for.

Please make it possible to turn this functionality off entirely or at least to configure the capability dropping to allow rsyslog to continue to be able to write to files owned by other users.

Comment 1 Attila Lakatos 2023-01-13 09:15:54 UTC
This was a security enhancement, so that's why there is no way to turn it off.

I gave a second thought to the list of enabled capabilities and modified it. Could you try out the latest scratch-build and let me know if that helps your use case?
Scratch-build: https://kojihub.stream.rdu2.redhat.com/koji/taskinfo?taskID=1782475

Comment 2 Jonathan Kamens 2023-01-13 14:59:01 UTC
>This was a security enhancement, so that's why there is no way to turn it off.

SELinux is a security enhancement, and yet it can be disabled.

Access permissions on my web server are a security enhancement, and yet I can turn them on or off as desired.

File access permissions are a security enhancement, and yet if I want I can make all of my files and directories mode 0777.

Maybe this is something that should be enabled by default—though not if the default configuration is going to break things!—but sysadmins should have the option of configuring more permissive behavior if they need it and understand the risks.

That's true unless the permissions you're dropping are absolutely positively never going to be needed by rsyslog for anything, which clearly is not the case here. Perhaps you've fixed that with the changes you just made, but I can't know that for certain, since as I mentioned you haven't documented this change anywhere.

>Could you try out the latest scratch-build and let me know if that helps your use case?
>Scratch-build: https://kojihub.stream.rdu2.redhat.com/koji/taskinfo?taskID=1782475

That is presumably a Red Hat internal Koji server and not accessible to me, at least not at that host name:

$ host kojihub.stream.rdu.redhat.com
Host kojihub.stream.rdu.redhat.com not found: 3(NXDOMAIN)

Comment 3 Jonathan Kamens 2023-02-12 20:43:52 UTC
Some progress on this is required.

As noted above, I cannot test the test build you asked me to test because you sent a link to an internal Red Hat server.

Comment 4 pascal.tempier 2023-03-10 18:54:41 UTC
@alakatos

Please see the issue i did open here : https://bugzilla.redhat.com/show_bug.cgi?id=2127404
This is actually a security regression as rsyslog somehow now needs more capabilities than before to work.

I was dropping capabilities via docker in the previous version.
Now in the last version, i need to first provide more capabilities so that rsyslog can then drop them, else it won't work.
At least i hope it drops them, i didn't checked the new source code.

Comment 5 Jonathan Kamens 2023-03-28 18:10:57 UTC
My issue appears to have been fixed via the change committed to address Bug 2158659. Pity no one from Red Hat could be bothered to post a comment to that effect here.

Comment 6 Attila Lakatos 2023-08-01 12:45:22 UTC
The problem has been fixed via https://bugzilla.redhat.com/show_bug.cgi?id=2158659. Closing it.