-
Notifications
You must be signed in to change notification settings - Fork 905
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
falco logs contaminating /var/log/messages #1673
Comments
I have found the same bug in the last version of Falco 0.28.1 (after the packages 0.28.2 was removed from Falco repos) |
I used Falco 0.28.1-34+0f24448 (driver version 17f5df52a7d9ed6bb12d3b1768460def8439936d) on the following system: {
"machine": "x86_64",
"nodename": "REDACTED",
"release": "5.4.0-1045-aws",
"sysname": "Linux",
"version": "#47-Ubuntu SMP Tue Apr 13 07:02:25 UTC 2021"
} Disabling Jun 17 13:10:00 ip-172-31-46-109 falco: Falco version 0.28.1-34+0f24448 (driver version 17f5df52a7d9ed6bb12d3b1768460def8439936d)
Jun 17 13:10:00 ip-172-31-46-109 falco: Falco initialized with configuration file /etc/falco/falco.yaml
Jun 17 13:10:00 ip-172-31-46-109 falco: Loading rules from file /etc/falco/falco_rules.yaml:
Jun 17 13:10:00 ip-172-31-46-109 falco: Loading rules from file /etc/falco/falco_rules.local.yaml:
Jun 17 13:10:00 ip-172-31-46-109 falco: Loading rules from file /etc/falco/k8s_audit_rules.yaml:
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.451281] falco: adding new consumer 00000000fea1a8d2
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.451294] falco: initializing ring buffer for CPU 0
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.475657] falco: CPU buffer initialized, size=8388608
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.475660] falco: initializing ring buffer for CPU 1
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.504736] falco: CPU buffer initialized, size=8388608
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.504738] falco: initializing ring buffer for CPU 2
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.538759] falco: CPU buffer initialized, size=8388608
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.538761] falco: initializing ring buffer for CPU 3
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.571165] falco: CPU buffer initialized, size=8388608
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.571168] falco: initializing ring buffer for CPU 4
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.599411] falco: CPU buffer initialized, size=8388608
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.599413] falco: initializing ring buffer for CPU 5
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.622187] falco: CPU buffer initialized, size=8388608
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.622189] falco: initializing ring buffer for CPU 6
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.648849] falco: CPU buffer initialized, size=8388608
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.648852] falco: initializing ring buffer for CPU 7
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.675664] falco: CPU buffer initialized, size=8388608
Jun 17 13:10:01 ip-172-31-46-109 kernel: [1127042.675667] falco: starting capture
Jun 17 13:10:01 ip-172-31-46-109 falco: Starting internal webserver, listening on port 8765
Jun 17 13:10:07 ip-172-31-46-109 falco: SIGINT received, exiting...
Jun 17 13:10:07 ip-172-31-46-109 kernel: [1127048.565977] falco: deallocating consumer 00000000fea1a8d2
Jun 17 13:10:07 ip-172-31-46-109 kernel: [1127048.581148] falco: no more consumers, stopping capture Are you referring to all the Falco logs or only to the Falco alerts? |
Hi Leo, thank you for your answer.
All Falco logs AND Falco alerts are written in I am going to do other tests now and add as much details as possible in another comment. |
I did a test from a clean AWS instance and used the installation script MachineI used AWS to perform this test: Prepare machineupdate and restart # sudo yum update -y
# sudo reboot now OS info # cat /etc/*release*
CentOS Linux release 7.9.2009 (Core)
Derived from Red Hat Enterprise Linux 7.9 (Source)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.9.2009 (Core)
CentOS Linux release 7.9.2009 (Core)
cpe:/o:centos:centos:7 Installationfollowing https://falco.org/docs/getting-started/third-party/install-tools/ # curl -o install_falco -s https://falco.org/script/install
# sudo bash install_falco Installation output* Detecting operating system
* Installing EPEL repository (for DKMS)
warning: /var/tmp/rpm-tmp.EhxjMc: # curl -o install_falco -s https://falco.org/script/installHeader V4 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
* Installing Falco public GPG key
* Installing Falco repository
* Installing kernel headers
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Warning: RPMDB altered outside of yum.
* Installing Falco
warning: /var/cache/yum/x86_64/7/epel/packages/dkms-2.8.4-1.el7.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for dkms-2.8.4-1.el7.noarch.rpm is not installed
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-13.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Creating symlink /var/lib/dkms/falco/5c0b863ddade7a45568c0ac97d037422c9efb750/source ->
/usr/src/falco-5c0b863ddade7a45568c0ac97d037422c9efb750
DKMS: add completed.
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
make -j2 KERNELRELEASE=3.10.0-1160.31.1.el7.x86_64 -C /lib/modules/3.10.0-1160.31.1.el7.x86_64/build M=/var/lib/dkms/falco/5c0b863ddade7a45568c0ac97d037422c9efb750/build....
cleaning build area...
DKMS: build completed.
falco.ko.xz:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/3.10.0-1160.31.1.el7.x86_64/extra/
Adding any weak-modules
depmod....
DKMS: install completed.
modprobe: FATAL: Module falco_probe not found.
Update Falco configurationIn syslog_output:
enabled: false Check and start FalcoCheck status # systemctl status falco -l
● falco.service - Falco: Container Native Runtime Security
Loaded: loaded (/usr/lib/systemd/system/falco.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: https://falco.org/docs/
Jun 17 14:52:15 ip-172-31-36-116.eu-west-3.compute.internal systemd[1]: [/usr/lib/systemd/system/falco.service:19] Unknown lvalue 'ProtectKernelTunables' in section 'Service'
Jun 17 14:52:15 ip-172-31-36-116.eu-west-3.compute.internal systemd[1]: [/usr/lib/systemd/system/falco.service:20] Unknown lvalue 'RestrictRealtime' in section 'Service'
Jun 17 14:52:27 ip-172-31-36-116.eu-west-3.compute.internal systemd[1]: [/usr/lib/systemd/system/falco.service:19] Unknown lvalue 'ProtectKernelTunables' in section 'Service'
Jun 17 14:52:27 ip-172-31-36-116.eu-west-3.compute.internal systemd[1]: [/usr/lib/systemd/system/falco.service:20] Unknown lvalue 'RestrictRealtime' in section 'Service'
Jun 17 14:52:36 ip-172-31-36-116.eu-west-3.compute.internal systemd[1]: [/usr/lib/systemd/system/falco.service:19] Unknown lvalue 'ProtectKernelTunables' in section 'Service'
Jun 17 14:52:36 ip-172-31-36-116.eu-west-3.compute.internal systemd[1]: [/usr/lib/systemd/system/falco.service:20] Unknown lvalue 'RestrictRealtime' in section 'Service' Start Falco # systemctl status falco -l
● falco.service - Falco: Container Native Runtime Security
Loaded: loaded (/usr/lib/systemd/system/falco.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2021-06-17 14:53:08 UTC; 1min 8s ago
Docs: https://falco.org/docs/
Process: 12338 ExecStartPre=/sbin/modprobe falco (code=exited, status=0/SUCCESS)
Main PID: 12342 (falco)
CGroup: /system.slice/falco.service
└─12342 /usr/bin/falco --pidfile=/var/run/falco.pid
Jun 17 14:53:08 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Thu Jun 17 14:53:08 2021: Falco initialized with configuration file /etc/falco/falco.yaml
Jun 17 14:53:08 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Thu Jun 17 14:53:08 2021: Loading rules from file /etc/falco/falco_rules.yaml:
Jun 17 14:53:08 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Falco initialized with configuration file /etc/falco/falco.yaml
Jun 17 14:53:08 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Loading rules from file /etc/falco/falco_rules.yaml:
Jun 17 14:53:08 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Loading rules from file /etc/falco/falco_rules.local.yaml:
Jun 17 14:53:08 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Thu Jun 17 14:53:08 2021: Loading rules from file /etc/falco/falco_rules.local.yaml:
Jun 17 14:53:09 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Loading rules from file /etc/falco/k8s_audit_rules.yaml:
Jun 17 14:53:09 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Thu Jun 17 14:53:09 2021: Loading rules from file /etc/falco/k8s_audit_rules.yaml:
Jun 17 14:53:09 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Starting internal webserver, listening on port 8765
Jun 17 14:53:09 ip-172-31-36-116.eu-west-3.compute.internal falco[12342]: Thu Jun 17 14:53:09 2021: Starting internal webserver, listening on port 8765 Reproduce errorGenerate alert # touch /etc/domenico log in Jun 17 14:55:23 ip-172-31-36-116 falco: 14:55:23.315542901: Error File below /etc opened for writing (user=root user_loginuid=1000 command=touch /etc/domenico parent=bash pcmdline=bash file=/etc/domenico program=touch gparent=sudo ggparent=bash gggparent=sshd container_id=host image=<NA>)
Jun 17 14:55:23 ip-172-31-36-116 falco: 14:55:23.315542901: Error File below /etc opened for writing (user=root user_loginuid=1000 command=touch /etc/domenico parent=bash pcmdline=bash file=/etc/domenico program=touch gparent=sudo ggparent=bash gggparent=sshd container_id=host image=<NA>) /cc @leodido |
It looks like enabling We have an old machine with falco 0.20 with |
Since 0.28 we migrated from initd to systemd 👉 #1448 The behavior should be configurable by the systemd unit configuration (see Also, I can confirm the problem is not present when manually running Falco (without using systemd). |
I didn't have time to perform another test but in the last one on CentOS 7 (#1673 (comment)) I got 2 identical log entries in
I will try to do some other tests on the last release. |
With systemd, disabling stdout_output:
enabled: false |
Have you tried leaving |
I did not. I will. |
@leogr my colleague did a test and with |
Describe the bug
falco writing logs in /var/log/messages and contaminating syslogs.
After having changed the configuration in
/etc/falco/falco.yaml
by disablingsyslog_output
:Falco seems to ignore this configuration and continues to write to
/var/log/messages
How to reproduce it
curl -s -o /etc/yum.repos.d/falcosecurity.repo https://falco.org/repo/falcosecurity-rpm.repo
yum install falco
(orapt install falco
)Expected behaviour
After disabling
syslog_output
falco should not write logs into /var/log/messagesEnvironment
This creates 2 particular issues:
The text was updated successfully, but these errors were encountered: