Hi! not sure if this is the best channel to ask…. ...
# macos
Hi! not sure if this is the best channel to ask…. was it ever considered to use openbsm to do a process_file_events table on MacOS? From what I’m seeing openbsm can monitor file accesses and it provides the pid. Just want to know if it was thought before and possible problems I’m not seeing (same for socket_events I guess)
I don’t know the history, but I have sorta odd answers?
There is a file events table, I think it’s using some of the underlying inode based things. This are, AFAIK, pretty standard for file monitoring. They also don’t require any additional host setup. (unlike most audit frameworks, which usually require additional configuration)
I don’t have well developed thoughts about openbsm, but I could see the argument that it’s worth creating one. (Not sure how apple’s expected shift away from that works)
I guess I’m saying I don’t know whether it was considered, you could look in the PR/issue history. If there’s interest, you could also PR something. It feels a little duplicative with the file_events, but it would also expose additional data. Which makes me wonder if there’s space for an alternate implementation
socket_events was merged in 4.3.0!
👏 1
process_file_events is rather heavy on cpu/memory, I think that is the only problem
then again, Audit is not the best syscall tracer in the world, and the fact that it contains so much text that you need to parse is extremely bad
I haven't looked at openbsm but if it supports all the required events then it can be implemented
it requires 1. syscalls that create file handles (open, mknod, create, ...) 2. syscalls that duplicate file handles (dup, dup2...) 3. write syscalls 4. mmap 5. fork and alternatives (to inherit fd from one process to the other) 6. execve (used to clear the fd map)
alternative: if it is able to pass the full file information (like EndpointSecurity), then there is no need to track the whole fd map for each process
EndpointSecurity is a good candidate, but good luck acquiring the entitlements from Apple 😞
Thanks all for the feedback. My idea was to try monitor file uploads / downloads from browsers and pontentially other applications. It wouldn’t never be 100% accurate but it would avoid sneaking into TLS connections. What you mean with EndpointSecurity @alessandrogario ? is this this other product ?
Endpoint security is apples new security framework. I expect it'll eventually replace openbsm
It's a bit different, but you can monitor all file changes in the Downloads folder
I see, didn’t knew about it. This EndpointSecurity looks interesting, bad it is only supported 10.15+.
the existing file events will let you monitor all additions to the Downloads folder
Yes, but it doesn't give me the process that did the action, and I want to monitor uploads also