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

Only processing K8s Audit Logs #1757

Closed
levigross opened this issue Oct 13, 2021 · 12 comments
Closed

Only processing K8s Audit Logs #1757

levigross opened this issue Oct 13, 2021 · 12 comments

Comments

@levigross
Copy link

Motivation
I would like to be able to just use unprivileged (not running as root or with CAP_SYS_ADMIN) falco to process K8s audit events.

The important bit here, is that Falco should be able to do this while running unprivileged (because all that I can know needs to run is the webserver and the falco rules engine).

Feature
When Falco is started in user mode, and set to ignore the syscall source - don't require falco to run as root.

Alternatives

Leave things as is....

Additional context

First I want to say that I appreciate the work involved in creating and maintaining an OSS project. Thank you!!

Second, please take this request with in a respectful tone (this is something I would like, not something that I am demanding)

Finally, I was looking into doing it -- and I would be happy to brainstorm on ideas for implementation (if you find this worthy).

Thanks,
Levi

@FedeDP
Copy link
Contributor

FedeDP commented Oct 28, 2021

Hi! Thanks for this feature request!
As far as I know, falco already provides a way to disable syscalls monitoring, thus avoiding the need to be run as root or with CAP_SYS_ADMIN:
--disable-source syscall -> (see falco -h for more info!)

Is this what you want?

@levigross
Copy link
Author

I am getting an error running that as nobody :)

@FedeDP
Copy link
Contributor

FedeDP commented Nov 2, 2021

I'll give it a look!

@FedeDP
Copy link
Contributor

FedeDP commented Nov 2, 2021

I am getting an error running that as nobody :)

Mind to share the error?
Thanks!

@levigross
Copy link
Author

Runtime error: scap_open_live() error creating the process list. Make sure you have root credentials.. Exiting.

@levigross
Copy link
Author

This is running with:

  1. Dropping all capabilities
  2. Running as nobody

@FedeDP
Copy link
Contributor

FedeDP commented Nov 3, 2021

Running as nobody

If you instead run as your user, does it work?
I guess that parsing /proc could be completely skipped in case syscalls source is disabled.
@leogr any hint on this?

@leogr
Copy link
Member

leogr commented Nov 8, 2021

Hey @levigross
That is interesting. I haven't yet considered the nobody user, which totally makes sense in your use case.

@FedeDP, I agree. I don't see any valid reason to scan /proc if sycalls source is disabled. We shall dig into sinsp::open_nodriver() to know why that is happening.

@poiana
Copy link
Contributor

poiana commented Feb 6, 2022

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@leogr
Copy link
Member

leogr commented Feb 7, 2022

/remove-lifecycle stale

Update: we will likely port the current k8s audit log impl. to a plugin that would not require any priviledege, capabilities, etc...

I will keep you posted

@jasondellaluce
Copy link
Contributor

Hey @levigross, keep an eye open for this 👉🏼 #1952

This is the PR that finalizes the porting of K8S Audit to the plugin implementation. Assuming this will get merged soon, from the next release of Falco you'll be able to run Falco in K8S Audit-only mode as a plugin, which should run as unprivileged with no issue.

@jasondellaluce
Copy link
Contributor

This can now be closed, because since #1952 k8s audit log support has been ported to the plugin system. Running this without syscalls is the only supported mode right now.

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

5 participants