Hi everyone! I'd like to create an application for system monitoring using the Endpoint Security framework. I already have a working prototype and now I am trying to expand its capabilities to capture more event types.
Started looking at filesystem-related events as one of the most important ones for my use case. These seem to be supported fairly well by the framework (ES_EVENT_TYPE_NOTIFY_OPEN
/CLOSE
/CREATE
/WRITE
etc.) However, the "READ FILE" event seems to be absent… Am I missing something here, or Endpoint Security framework does not provide this kind of information? If it doesn't, what is the reason behind this? Capturing this type of events seems quite relevant for security-related software.
Thanks & Best regards, Roman
Hi everyone! I'd like to create an application for system monitoring using the Endpoint Security framework. I already have a working prototype, and now I am trying to expand its capabilities to capture more event types.
So, I need to pass you a broad warning here. It is VERY easy to put together a test/development app that "works" in the basic sense that it runs and doesn't create any obvious failure, but is in fact fundamentally flawed and will fail over and over again under real-world conditions. Even worse, most of these failures will not be simple crashes or hangs in your product but will instead be a variety of strange failures "everywhere else". See the forum threads here, here, and here for a few examples.
Started looking at filesystem-related events as one of the most important ones for my use case. These seem to be supported fairly well by the framework (ES_EVENT_TYPE_NOTIFY_OPEN/CLOSE/CREATE/WRITE, etc.). However, the "READ FILE" event seems to be absent… Am I missing something here, or does the Endpoint Security framework not provide this kind of information?
No, you haven't missed anything; there is no ES_EVENT_TYPE_NOTIFY_READ.
If it doesn't, what is the reason behind this?
So, there are a few different reasons it's missing:
-
read() is one of the single highest-volume syscalls, so the cost of notifying on it is extremely high.
-
From a security perspective, it isn't all that useful/meaningful. The critical security "gate" here is open, not the I/O functions (particularly in light of #3).
-
It wouldn't tell you what you think it would and, in fact, would encourage a false sense of security.
The issue with #3 is that the system HEAVILY relies on memory mapped I/O, which bypasses the standard I/O functions (both read and write) and makes the issue of "tracking real file access" EXTREMELY difficult. There's an extended forum thread on this here, but the bottom line is that once a file is mapped, it's VERY difficult to know if/when it's been modified. That's even more true for read access, since the shared cache of the system means that I don't think you can trust st_atime for memory mapped reads.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware