What are my options to have more fine-grained control of internet access of an app, that I'm develping?
We are developing an Ionic app and therefore rely on many node modules, which are per se untrusted code (see HN discussion). Since the content is sensible, I want to safe-guard against the possiblity of that untrusted sending any data in undesired ways.
For my app to function, it needs to talk only to a single IP, however I could not find a way to declare in the manifest of android or iOS to declare just that: allow talking to only a single IP/domain domain.
Is there a way to prevent (untrusted code in) my own app from talking from /to anywhere else? Preferably, the user installing the app should not be concerned with any additional steps.
- Best would be android or iOs platform would allow to declare in the manifest that I want to have restricted internet access. I saw one can define custom-permissions and intents, but in my understanding that doesn't per se allow me to define restricted internet access. Can I declaratively restrict my owns app internet access to a specific host in the manifest?
- If not, what I need is an app-firewall. Normally, one would install a firewall and setup firewall rules for that app. However, I can't require the app user to install and setup a firewall. Is there a way to directly setup a iftables rules using some script during app installation?
- If not, being cordova-based, my app ship with their own browser and JS-runtime. I was looking into deliberately crippling node, such that socket.connect ignores parameters and just connects to the required hard-coded domains, sending data and only open sockets to a given IP? However, that requires me to change c/c++, which I'm not an expert in. Is there an easy & clean way to do this?
Thanks for your hints!