For anyone stumbling upon this question, I've found what I believe to be the answer.
In the NEFilterDataProvider class, there is a method :
@available(macOS 10.15.4, *)
open func update(_ flow: NEFilterSocketFlow, using verdict: NEFilterDataVerdict, for direction: NETrafficDirection)
In an initial test demo, this appeared to be what I'm looking for. NEFilterFlow objects from handleNewFlow can be cached and this update method can be used to change a verdict at a later date. No idea when this method was added to the system extension framework SDK as it definitely didn't exist when this problem initially arose.
Few other comments:
it appears that trying to update a flow thats finished doesn't seem to cause harm
I believe all flow operations take place on the extensions main dispatchqueue.
If the new flow object doesn't contain the full 5 tuple information, peeking 1 byte will allow the information to become available in the cached NEFilterSocketFlow object.
Topic:
App & System Services
SubTopic:
Networking
Tags: