LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-02-2023, 07:06 PM   #1
Yetoo
Member
 
Registered: Dec 2015
Distribution: Fedora, Debian, Ubuntu, couldn't install gentoo
Posts: 44

Rep: Reputation: 5
Stop firewalld logging to kernel ring buffer/dmesg.


When I run dmesg it is flooded with dropped or rejected messages. I want to keep the logs, but not log to the kernel ring buffer such that dmesg would read it. I created a file /etc/rsyslog.d/firewalld-droppd.conf and then restarted rsyslog so that firewall messages go to a separate file. The contents of the config:
Code:
:msg,contains,"_DROP" /var/log/firewalld-droppd.log
:msg,contains,"_REJECT" /var/log/firewalld-droppd.log
& stop
But this most likely didn't disable writing to kernel ring buffer because when I run dmesg I still get recent REJECT and DROP messages. /var/log/messages don't contain these recent messages. How do I stop firewalld or rsyslogd from logging to the kernel ring buffer? I am trying to do this on Fedora 37.
 
Old 03-03-2023, 07:40 PM   #2
Yetoo
Member
 
Registered: Dec 2015
Distribution: Fedora, Debian, Ubuntu, couldn't install gentoo
Posts: 44

Original Poster
Rep: Reputation: 5
It looks like, according to https://github.com/firewalld/firewalld/issues/984 (if I'm understanding it correctly), that firewalld currently only logs deny messages to kernel ring buffer and there currently isn't an option to log to a different target. So it seems that there is no way to configure firewalld to log to rsyslog or other. In the mean time I'm open to any ideas on how to intercept and block global/individual application writes or reads to/from /dev/kmsg, /proc/kmsg, and/or other devices that fall under the umbrella that is "kernel ring buffer" as referenced by the dmesg documentation.
 
Old 03-03-2023, 08:14 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,146

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
On the contrary, it looks like the fix mentioned by @Talkless on Sept 12, 2022 added precisely what you are wanting.
 
Old 03-03-2023, 09:01 PM   #4
Yetoo
Member
 
Registered: Dec 2015
Distribution: Fedora, Debian, Ubuntu, couldn't install gentoo
Posts: 44

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by syg00 View Post
On the contrary, it looks like the fix mentioned by @Talkless on Sept 12, 2022 added precisely what you are wanting.
@TorontoMedia replied saying that only affects logging in the daemon and not packets. I tried --log-target=rsyslog and it failed to start. I tried --log-target=syslog and it still logs to ring buffer. --log-target=file logs to default log file /var/log/firewalld and, like @TorontoMedia said, only shows logs from daemon and not packets. --set-log-denied is for firewall-cmd and is just setting what kind of packets gets logged with values all, unicast, broadcast, multicast, and off and no log target.
 
  


Reply

Tags
dmesg, firewall, firewalld, kernel, rsyslogd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Ring Buffer: <3>rc_kthread_mem_user_copy: 8 Fred4321 Linux - Kernel 3 04-10-2021 08:14 AM
What Kernel Ring Buffer Contains? Nishant Desai Linux - Kernel 4 02-07-2011 01:47 PM
Determining kernel ring buffer size anon255 Linux - General 1 03-07-2007 04:00 PM
What is the difference between the free buffer and buffer in the buffer hash queue? Swagata Linux - Enterprise 0 05-25-2006 11:57 PM
kernel's ring buffer sixth_sense Linux - General 1 04-01-2004 02:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration