-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Osqueryd seems to be missing alerting on updates to nested folders that were moved into the watch file_paths #1969
Comments
I can confirm this is still happening on |
Possibly related to #3212 |
I believe |
@directionless between osquery/osquery/events/linux/inotify.cpp Lines 122 to 125 in 22d614c
Then osquery/osquery/events/linux/inotify.cpp Lines 321 to 328 in 22d614c
when a new event should be dispatched to the subscribers, we check if the original subscription watch was meant to be recursive, and if the event is CREATED then we add that new subtree.And here lies the issue though, because if you move a folder into the monitored path, that event is not a CREATED anymore, but a MOVED_TO , which we do not handle.
Made a quick test and changing the condition to be: if (sc->recursive && (ec->action == "CREATED" || ec->action == "MOVED_TO") && isDirectory(ec->path)) { seems to work as expected. |
As part of our testing, we wanted the FIM functionality to properly alert on changes that are made to a directory tree which was created outside of watch directory but subsequently moved into it. However when we tested, the sub directory thats under watch and holds the nested tree does not produce any alerts for files added/changed at any depth while inside the watched file path. The osquery.conf looks like this:
do the following to make sure alerts are showing in the /var/log/messages file
do the following to see the alerts do not show up in the /var/log/messages
The text was updated successfully, but these errors were encountered: