-
-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encrypt push notifications end-to-end from Zulip server #1190
Comments
Quick supplement:
|
I did create a 'Security' project to group all related issues. |
Thanks for the hint to this in your mail, Greg! Reading through your original proposal I see the current idea would be to add a notification extension. This is indeed a nice solution, but I think it could be done much more simple by loading the data from the on-premise server directly. There would be no need for an extension or further de-/encryption. When the server sends a "content-available" key within the notification payload, the app itself starts in background mode and gets about 30 seconds to run. This way it could be done quite quickly without introducing a lot of new code. |
@julian-weinert this needs to work on Android too. (and older versions of iOS and older Android). |
@borisyankov For older versions of iOS yes. Unfortunately, I don't know, how Android works. After searching the internet it seems as it is indeed possible, although not many people are talking about it. I could also imagine I simply don't know how to google for android topics correctly ;) |
Thanks @julian-weinert ! The reason I think I'd prefer to include the details with the notification payload is that it allows the notification to render without any additional network requests. That might not be a big deal when on a fast, reliable Internet connection; but a lot of places a phone can go don't always have a good connection, and I think it's important to design apps to work gracefully in that case. Anywhere we're able to run code to contact the server before a notification is rendered, we should be able to decrypt something as well. (We do need a key to decrypt; but we also need some kind of secret to authenticate to the server.) Re iOS version compatibility: new iOS versions tend to get adopted much faster than new Android versions, so I'm not concerned about having some features of the app only work on iOS 10+. Looks like the latest data from the App Store shows 92% of devices on iOS 10+. |
@gnprice I have discussed this with Tim before, the percentage game is dangerous. |
@borisyankov I'd definitely agree with that when it comes to the app working at all, or core functionality of the app. I think it's different for features that are nice to have but the app still works fine without them. In this case, like I said above, we'll need to make sure to behave robustly where this API is absent, and we might accomplish that at the same time as handling the case of old versions of the app. |
Cool. I agree with you too. So something like 'to take advantage fully of our security features, use iOS 10+ and Android 7+' sounds reasonable. |
Just wanted to add that I'm 100% on board with that plan as well. |
Let me add a v2 (version 2) endpoint for registering a device. Any device registered through this endpoint will be expected to work with encrypted notifications, while any device registered through v1 endpoint will continue to work as before. I think this is the only thing left in zulip/zulip#8076 for a seamless transition. |
Hello @zulip/server-notifications members, this issue was labeled with the "area: notifications" label, so you may want to check it out! |
A couple of links for reference, as I just ran across them:
|
Currently the private data in a Zulip push notification (sender, stream name, message body) is encrypted over the wire, but handled in plaintext within the Zulip notification forwarder and the Apple or Google notification service.
This is consistent with standard practice until at least last year; but last October Apple introduced in iOS 10 a way to have the app's code run to adjust a received notification, which opens the option of encrypting the data all the way to the app. That'd be neat, and doubly so because for a Zulip server other than zulipchat.com, there are two third parties involved in handling the notification: Apple or Google, and Kandra Labs.
Quoting my comment at zulip/zulip#6364 (comment) (on a PR specifically about iOS):
"""
A bit of web searching tells me that as of 2016 (and iOS 10), there is actually a way to have your app's code invoked when a notification is delivered! Docs here: https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension
It's not well documented. The APNs payload reference @kunall17 linked above doesn't mention the relevant key, and claims that all keys not mentioned "are ignored by Apple". I'm a little dubious of how well-supported it will be, like whether the OS will reliably actually call the extension and how much time it'll give the extension to run. As part of Apple's obsession with battery life for iOS, they've always been stingy with every form of background processing for apps, which is why push notifications without this API have always been self-contained data that the OS would interpret without consulting the app.
I think my inclination would be:
"""
I believe something similar is also possible for Android, though I haven't read up on it.
The text was updated successfully, but these errors were encountered: