Jonas, thank you for your response, please find my notes below
On Tue, Jul 30, 2013 at 4:18 PM, Jonas Sicking <
jo...@sicking.cc> wrote:
> I don't think that we should follow what chrome is doing. Chrome and
> Android relies on that users make a lot of security decisions up front at
> installation time. This is bad for security as users have very little
> context to make a decision on.
>
I agree. I was making a suggestion to implement "permissionrequest"
event under the assumption that Mozilla decided to follow the native &
Chrome permissions model for packaged apps, that is to ask the user to
approve a list of permissions at the app install time.
In this model, when mozBrowser iFrame is loaded by the packaged app,
delegating this decision to the "permissionrequest" event listener in
packaged app seems logical, doesn't it?
> It also means that users have only one recourse if they don't want to
> grant a permission: don't install the application.
>
100% with you on that. It ends up being a trust decision, e.g. "I trust
that the app marketplace will not keep the apps that are malicious" or a
brand trust: "I trust Twitter will not knowingly create a malicious app".
User in this case relies on the Marketplace's power to remove bad apps from
the marketplace.
This *revoking power* to me is the most powerful security feature that
keeps native apps in line today (marketplace review process - not so much
IMHO).
While it is better for the user to give his camera permission for the app
in-context, it is still not secure. The app can spy on the user all day
long after that (mentioned by Paul on bug
853356<
https://bugzilla.mozilla.org/show_bug.cgi?id=853356#c8>
).
So evolving Paul's idea, may be we can create access/throttling profiles, a
bit similar to bluetooth profiles, filesystem quotas, and bandwidth
allowances. For camera it could be the amount of minutes it is allowed to
work in the background. These profiles would be completely orthogonal to
WebAPIs (no API change whatsoever) and will affect only the mode of access
or the amount of access, asking the user to grant more access when quota
exceeded or profile boundaries crossed.
It also means that chrome can't do silent updates since updates can mean
> that users need to make a security decision.
>
Silent update would need to be blocked only if permissions list changed.
Yet, is install-time permissions is not the model Mozilla will follow, it
becomes a moot point.
> Instead we should follow the model that all our other APIs are using.
>
Right, but the case I originally described was more complex. We created a
thin packaged app and run the rest of the code in mozBrowser iframe, which
is sandboxed with a different origin. We did that to avoid killing
ourselves and Marketplace reviewers with app update requests. Most of our
changes are made daily, and are in UI anyway, so serving most code live via
an iframe while offlining with appcache, LS & IndexedDB (instead of a
packaged zip) works better. Just need to make sure we do not annoy the hell
out users with repeated permission requests.
> I.e. have a modal dialog at runtime where the user can choose to grant or
> deny, and where they can choose to do so temporarily or permanently.
>
yep, the word "Permanently" is key here. As a user I could not find a way
to confirm the WebRTC permission UI once and for all in an iframe, so on
the 10th request I was swearing like a pirate :-)