-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation script ACL adjustments don't persist log rotation #1106
Comments
I found that logrotate on RHEL 9 does correctly apply the parent directory's default file ACL. Setting the correct parent directory default file ACL results in the desired outcome:
For example:
|
If this isn't the case on a particular distribution/version, we could create a "dummy" log file and logrotate configuration to adjust the ACL of specific files. The logrotate configuration would execute on the regular schedule. For example:
|
releated to #1106 (comment) Signed-off-by: Sean Porter <[email protected]>
releated to #1106 (comment) Signed-off-by: Sean Porter <[email protected]>
Problem
The installation script currently adjusts log file ACLs making it possible for an unprivileged system user (otelcol-sumo) to ingest log events. This works in most cases, however, the ACLs do not persist log rotation (a log file is replaced by an empty file without the ACL).
Possible Solutions
Most Linux distributions use logrotate to handle the rotation of log files. Users can configure logrotate to use a
postrotate
script to reapply the ACL. For example:The value of
$1
is the log file path (set by logrotate).Unfortunately, we cannot create a logrotate config that applies this
postrotate
script to all log files for a few reasons. This could apply log rotation to the wrong files or thepostrotate
statement is overridden by more specific log file path matches and the ACL is not applied. For example:/etc/logrotate.d/otel
On my Rocky 9 (RHEL) host, this configuration would be overridden by the default rsyslog configuration:
/etc/logrotate.d/rsyslog
To fix the log file ACLs after rotation on my host, I updated the rsyslog configuration:
Not convinced we can script the "safe" installation of logrotate config. This is likely to be addressed via documentation and the trial user onboarding flow dialog. For example, we already call out file ACLs as a prerequisite:
The text was updated successfully, but these errors were encountered: