objective-see / BlockBlock

BlockBlock provides continual protection by monitoring persistence locations.
GNU General Public License v3.0
619 stars 38 forks source link

[Feature Request] Support monitoring of arbitrary user-defined files #32

Closed clong closed 8 months ago

clong commented 2 years ago

Since BlockBlock is already monitoring a set of pre-defined files/directories and other areas of the OS, it would be an incredible addition if users could choose their own filepaths to monitor on disk as well.

Some examples of paths people might want to monitor on their Macs:

Users could even leverage this to add canary files that look super interesting to an adversary but contain no actual sensitive content!

Successful implementation of this feature request would involve the following:

  1. An expansion of the rules interface. There should way that users can enter paths of files they want to monitor and also define a whitelist on a per-filepath basis. For example, only /Applications/Google Chrome.app/Contents/MacOS/Google Chrome should be able to access /Users/*/Library/Application Support/Google/Chrome/Default/Cookies

The most straightforward way to do this would probably be to implement a New Rule button on the rules page that allows you to define a one-to-one or one-to-many mapping of "file to watch" and "whitelisted processes"

  1. It's important that the paths outlined above support wildcards and globbing. For example, to set up a recursive file watch on all hidden files and directories on all users, I should be able to define a rule like: Watch: /Users/*/.** Whitelist: /bin/**

In this case, any attempt to access a hidden file or file inside of a hidden directory in any users' home directory would set off a BlockBlock alert unless the process attempting the access is located in /bin or in a subdirectory of /bin/

jchkn commented 2 years ago

great idea!

clong commented 8 months ago

This capability is now in osquery! https://material.security/blog/protecting-the-security-and-privacy-of-our-customers