I've been tinkering with something like this for a week or so, but it's not production ready at this point.
I know Strfry has plug-in support, and it looks like there's an example that covers the write side of whitelisting. Not familiar with their plug-ins enough to know whether or not you can plug-in to the read side.
Anyway, this might help you: https://github.com/hoytech/strfry/blob/master/docs/plugins.md