Content Filter Reporting

I created a content filter app in iOS (swift). The app lets me toggle the content filter ON or OFF. When the content filter is on, it restricts access to one particular url.

This works as intended; however, I would like to generate a log that shows the url from each inspected flow (I'm using NEFilterFlow to inspect the url from each webkit flow). Ideally, I'd like the url, the verdict, and the verdict timestamp appended to the log each time a flow passes through the content filter for a decision.

I cannot figure out how to capture any data from the flow. I'm even trying to use the NEFilterReport class, but I can't seem to capture any of the data in the report. Can the url even be extracted from a NEFilterReport? I assume it can, since it's part of the flow.

I understand that FilterDataProvider can only communicate with FilterControlProvider (on a very limited basis). However, it is my understanding that FilterControlProvider can communicate with the main target.

So how can I send the url from FilterDataProvider over to FilterControlProvider, and then onward to the main target to print to the console?

I'm starting to read about IPCConnection. Hopefully that is the answer to my question and I will get there in the coming days. If not, please help. There is very limited information out there on the network extension framework and content filtering.

Answered by Engineer in 793672022

There's no supported way for you to pull logs from a Content Filter Reporting Extension with the APIs currently available. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

Rico
WWDR - Software Engineer

There's no supported way for you to pull logs from a Content Filter Reporting Extension with the APIs currently available. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

Rico
WWDR - Software Engineer

Thanks for the info. In that case, what actual purpose does the NEFilterReport class serve if none of that report data is accessible?

Here is the enhancement request.

https://feedbackassistant.apple.com/feedback/14166622

Also, in the follow video, Jamie Wood said this…

Another example of a Content Filter App is an app that doesn't actively block any network traffic but instead just keeps a record of network activity on the Mac so that that log of no activity can be analyzed later, for example, to determine when some sensitive data was transmitted.

https://developer.apple.com/videos/play/wwdc2019/714/?time=122

this is what I am trying to do

Content Filter Reporting
 
 
Q