Just install AFWall+ or NetGuard from F-Droid and set that only whitelisted apps allowed to connect. I don't see a need to create separate mod for this.
Along with that I've had issues in the past with whitelists where I disabled something where the IP address wound up being a dependency for something else I was using.