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

RFE: improve filtering events by exe for containers #145

Open
RChernov opened this issue Jul 6, 2023 · 2 comments
Open

RFE: improve filtering events by exe for containers #145

RChernov opened this issue Jul 6, 2023 · 2 comments

Comments

@RChernov
Copy link

RChernov commented Jul 6, 2023

In current version of auditd filtering by exe field in audit.rules doesn't work for executables from containers.

As I can see it's due to the logic of the audit_exe_compare() function. It compares dev and inode for files, not fullpath. At the same time in events for containers I see fullpath to an excutable file relative to container file system tree, not host file system.

type=SYSCALL msg=audit(1688638681.978:8214739): arch=c000003e syscall=288 success=no exit=-11 a0=7 a1=7ffc92a75c50 a2=7ffc92a75c2c a3=80000 items=0 ppid=1422 pid=34388 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="gunicorn" exe="/usr/local/bin/python3.8" subj=docker-default (enforce) key="pt_siem_api_accept" ARCH=x86_64 SYSCALL=accept4 AUID="unset" UID="root" GID="root" EUID="root" SUID="root" FSUID="root" EGID="root" SGID="root" FSGID="root"

Of course I can find fullpath in OverlayFS (for Docker) to file and set it in -F exe (and it works). But I have to do this for all current and new containers. It's not good user experience at all.

docker

Is it possible to do something with it?

@pcmoore
Copy link
Member

pcmoore commented Jul 6, 2023

Currently the Linux Kernel's audit subsystem is not container/namespace aware and thus all filtering decisions must be made in the context of the initial namespace.

@pcmoore
Copy link
Member

pcmoore commented Jul 6, 2023

While issue #90 is related, additional work beyond the audit container ID support would be needed to fully support filtering rooted in an individual namespace.

@pcmoore pcmoore changed the title RFE: Improve filtering events by exe for containers RFE: improve filtering events by exe for containers Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants