-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
exclude_spawns_of not working as expected #251
Comments
Forgot to add that I installed snoopy using the debian 11 (Bullseye) repo: Proxmox VE 7.0 is based on Debian 11 so it seems appropriate to choose this repo. Nevertheless, the kernel provided in Proxmox is different from the generic one provided in a debian 11 vanilla. |
@alo0, thanks for the detailed report. The only things that immediately spring to my mind are:
Other than that, I'll need to verify this filter's functionality. Since it was a third party contribution to Snoopy, I don't really know it by heart, so it might take some time. |
Thank you @bostjan for your quick response pve_firewall is not executed by cron but by systemd. So I don't think the issue is related to cron. Btw it is cron in proxmox as in debian.
pstree display the same parent process. I think we can rule out 1 and 2 |
Thanks for correcting the Yeah, I can't see any sane reason why this shouldn't work as expected. Unfortunately, the filtering implementation (and this filter too) is fairly weak in terms of either tracing or error reporting, so this might be a bit of a challenge to figure out. BTW, revisiting your Snoopy configuration listed above, I see the |
Note to self: there are no tests for verifying the correctness of processing the filter chain. Fix it. |
Tested with a fresh debian and exclude_spawns_of is working perfectly. |
Tested on a vbox with freshly installed proxmox 7 over debian 11 Next step will be to reinstall my OVH server using the proxmox template and test again... |
Interesting. Looking forward to your next update. Anyhow, I am not 100% sure what's going on with that TTY-related filter I mentioned above. But if I ignore that, the most likely culprit is probably a somehow limited access to the PS: Once you figure out the reproduction scenario, and if it is possible from your side (i.e. the system is set up for testing purposes only, unrelated to anything else, and publicly accessible), it might be easier for me to simply use your system to analyse the issue & potentially figure out a fix, than reproducing the issue on my side. Once applicable, if that is an option, let me know. |
I am sorry to say that I can't reproduce the issue anymore.
Unless the problem appear again, I won't be able to provide you more insights. Thank again for the support. |
Thank you for the update. |
Hello,
I confirm that:
Issue description
I installed snoopy on a freshly installed proxmox and I have a lot of noise coming from the pve-firewall process. I tried to filter it using exclude_spawns_of and following the provided guide without any success. To be more precise, even using the "sh" keyword provided within the guide I was not able to achieve the same results (as in the guide). It seems exclude_spawns_of doesn't have any effect on my setup. What am I missing ?
Below you will find more info on my setup:
$ uname -a
Linux ns386187 5.15.64-1-pve #1 SMP PVE 5.15.64-1 (Thu, 13 Oct 2022 10:30:34 +0200) x86_64 GNU/Linux
(Latest version of proxmox)
$ snoopyctl status
/etc/ld.so.preload: OK - Snoopy is enabled.
LD_PRELOAD environment var: NOT OK - Not set.
Current process (shared libs): OK - libsnoopy.so is loaded in front of libc.so.6.
Current process (execve addr): OK - execve() symbol address changed, looks like Snoopy is loaded.
$ snoopyctl version
Snoopy CLI tool version: 2.5.1
Snoopy library version: 2.5.1 (path: /lib/x86_64-linux-gnu/libsnoopy.so)
$ snoopyctl conf
; Options from config file (or defaults): /etc/snoopy.ini
[snoopy]
error_logging = no
filter_chain = "only_tty;exclude_spawns_of:cron,pve-firewall"
message_format = [login:%{login} ssh:(%{env:SSH_CONNECTION}) sid:%{sid} tty:%{tty} (%{tty_uid}/%{tty_username}) uid:%{username}(%{uid})/%{eusername}(%{euid}) cwd:%{cwd}]: %{cmdline}
output = devlog
syslog_facility = AUTHPRIV
syslog_ident = snoopy
syslog_level = INFO
I changed the message_format and the modification was visible in the /var/log/auth.log file. So modification of the ini are taken into account. Moreover i tried
filter_chain = "only_uid:1000"
and it was successful. So no reasonexclude_spawns_of
should not work.These are the lines that I want to filter
...
Nov 9 10:42:50 ns386187 snoopy[217814]: [login:(unknown) ssh:((undefined)) sid:1555 tty:(none) ((none)/(none)) uid:root(0)/root(0) cwd:/]: sed s/ebtable_//
Nov 9 10:42:50 ns386187 snoopy[217813]: [login:(unknown) ssh:((undefined)) sid:1555 tty:(none) ((none)/(none)) uid:root(0)/root(0) cwd:/]: cut -f1 -d
Nov 9 10:43:00 ns386187 snoopy[217825]: [login:(unknown) ssh:((undefined)) sid:1555 tty:(none) ((none)/(none)) uid:root(0)/root(0) cwd:/]: grep -E ^ebtable_ /proc/modules
Nov 9 10:43:00 ns386187 snoopy[217826]: [login:(unknown) ssh:((undefined)) sid:1555 tty:(none) ((none)/(none)) uid:root(0)/root(0) cwd:/]: cut -f1 -d
Nov 9 10:43:00 ns386187 snoopy[217827]: [login:(unknown) ssh:((undefined)) sid:1555 tty:(none) ((none)/(none)) uid:root(0)/root(0) cwd:/]: sed s/ebtable_//
Nov 9 10:43:00 ns386187 snoopy[217845]: [login:(unknown) ssh:((undefined)) sid:1555 tty:(none) ((none)/(none)) uid:root(0)/root(0) cwd:/]: grep -E ^ebtable_ /proc/modules
Nov 9 10:43:00 ns386187 snoopy[217846]: [login:(unknown) ssh:((undefined)) sid:1555 tty:(none) ((none)/(none)) uid:root(0)/root(0) cwd:/]: cut -f1 -d
Nov 9 10:43:00 ns386187 snoopy[217847]: [login:(unknown) ssh:((undefined)) sid:1555 tty:(none) ((none)/(none)) uid:root(0)/root(0) cwd:/]: sed s/ebtable_//
...
# cat /proc/1555/stat
1555 (pve-firewall) S 1 1555 1555 0 -1 1077936448 32491726 44278219 0 601 7086 11816 19959 18266 20 0 1 0 2201 281214976 22488 18446744073709551615 94748966924288 94748968513589 140728626643408 0 0 0 0 4224 81927 1 0 0 17 2 0 0 0 0 0 94748970247464 94748970316388 94748980756480 140728626646787 140728626646830 140728626646830 140728626647009 0
I am thinking about filtering the log using regexp through syslog, but I would prefer to use the native function of snoopy available for that. Any idea on how to make it work ?
Thanks
The text was updated successfully, but these errors were encountered: