Skip to content
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

[noble] syslog release breaks rsyslog #361

Closed
Tracked by #892
ramonskie opened this issue Jun 28, 2024 · 8 comments
Closed
Tracked by #892

[noble] syslog release breaks rsyslog #361

ramonskie opened this issue Jun 28, 2024 · 8 comments

Comments

@ramonskie
Copy link
Contributor

in syslog_storer in the syslog release
it overwrite rsyslog see: https://github.com/cloudfoundry/syslog-release/blob/main/jobs/syslog_storer/templates/rsyslog.conf.erb

this causes rsyslog to fail.
it seems to have to do with write permissions.

as we had also problems with writing the bosh-agent logs to the /var/vcap/bosh/log from systemd due to permissions.
and we agreed that logs should be in the logs directory.

more investigation is needed

@ramonskie
Copy link
Contributor Author

noticed when ci tests where failing https://bosh.ci.cloudfoundry.org/teams/stemcell/pipelines/stemcells-ubuntu-noble/jobs/test-stemcells-master-ipv4/builds/47#L667487cc:926

systemctl status rsyslog output:

un 28 09:05:38 b1518270-e300-444b-a56f-e2f356433f53 rsyslogd[5399]: action 'action-8-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension.>
Jun 28 09:05:38 b1518270-e300-444b-a56f-e2f356433f53 rsyslogd[5399]: action 'action-8-builtin:omfile' resumed (module 'builtin:omfile') [v8.2312.0 try https://www.rsyslog.com/e/2359 ]
Jun 28 09:05:38 b1518270-e300-444b-a56f-e2f356433f53 rsyslogd[5399]: action 'action-8-builtin:omfile' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one giving the reason for suspension.>
Jun 28 09:05:50 b1518270-e300-444b-a56f-e2f356433f53 rsyslogd[5399]: rsyslogd: file '/var/vcap/data/syslog_storer/buffered/agg_backlog.00000001': open error: Permission denied [v8.2312.0 try https://www.rsyslog.com/e/2433 ]
Jun 28 09:05:50 b1518270-e300-444b-a56f-e2f356433f53 rsyslogd[5399]: file '/var/vcap/data/syslog_storer/buffered/agg_backlog.00000001': open error: Permission denied [v8.2312.0 try https://www.rsyslog.com/e/2433 ]

@ctlong
Copy link
Member

ctlong commented Jun 28, 2024

This reads like rsyslog does not have access to /var/vcap/data/syslog_storer in Noble. Was there a permissions change from Jammy to Noble related to this directory?

@rkoster
Copy link
Contributor

rkoster commented Jul 4, 2024

Nobel stemcells can be found here:

  • storage.googleapis.com/bosh-core-stemcells-candidate/google/bosh-stemcell-0.59-google-kvm-ubuntu-noble-go_agent.tgz
  • storage.googleapis.com/bosh-core-stemcells-candidate/aws/bosh-stemcell-0.59-aws-xen-hvm-ubuntu-noble-go_agent.tgz
  • storage.googleapis.com/bosh-core-stemcells-candidate/azure/bosh-stemcell-0.59-azure-hyperv-ubuntu-noble-go_agent.tgz

Source: https://bosh.ci.cloudfoundry.org/teams/stemcell/pipelines/stemcells-ubuntu-noble/

@ctlong
Copy link
Member

ctlong commented Sep 11, 2024

Sorry, I lost track of this for a while.

❓ Is this error still occurring?
❓ Has the new rsyslog package for Noble been pulled in?

@ramonskie
Copy link
Contributor Author

ramonskie commented Oct 29, 2024

@ctlong yes this error is still occuring.
the problem is not rsyslog but systemd and its new security measures.
it does not allow logs writing outside of /var/log/**/*

According to the Rsyslog documentation and user experiences, rsyslog has a default behavior that restricts log writing to directories outside of /var/log. This limitation is in place for security and compatibility reasons.

Why is this limitation in place?
Security: By default, rsyslog runs as the syslog user and group, which has limited privileges. Writing logs to directories outside of /var/log could potentially allow unauthorized access or tampering with logs.
Compatibility: Rsyslog is designed to work with the traditional Linux logging infrastructure, which assumes logs are stored in /var/log. Writing logs to other directories might break compatibility with other system components or tools that rely on the standard log location.

ramonskie added a commit to ramonskie/syslog-release that referenced this issue Oct 29, 2024
in nobel a new apparmor profile for rsyslog is now enabled by default preventing to write log files outside /var/log
by adding these apparmor profile
would solve
cloudfoundry/bosh-linux-stemcell-builder#361
@ctlong
Copy link
Member

ctlong commented Oct 31, 2024

I don't appear to be able to view the pipeline, but I just wanted to confirm what tests you're running to see the syslog_storer failures? Are you running the tests in the syslog-release repo?

@ramonskie
Copy link
Contributor Author

ramonskie commented Oct 31, 2024

ctlong pushed a commit to cloudfoundry/syslog-release that referenced this issue Nov 4, 2024
…ory (#188)

* add apparmor write permissiosn for syslog location.

in nobel a new apparmor profile for rsyslog is now enabled by default preventing to write log files outside /var/log
by adding these apparmor profile
would solve
cloudfoundry/bosh-linux-stemcell-builder#361

* use rw as lock and follow symlink are unnecessary in this case.
@ramonskie
Copy link
Contributor Author

syslog-release 12.3.4 sovled the issue

@github-project-automation github-project-automation bot moved this from Pending Review | Discussion to Done in Foundational Infrastructure Working Group Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants