Security/B2G/PermissionReview: Difference between revisions

Jump to navigation Jump to search
Clock app added to the wiki
(Clock app added to the wiki)
Line 270: Line 270:
An example of the possible temporary hosted app following this approach is available at:
An example of the possible temporary hosted app following this approach is available at:
https://github.com/telefonicaid/gaia/tree/hosted-web/apps/fm
https://github.com/telefonicaid/gaia/tree/hosted-web/apps/fm
=== Clock Application ===
Clock app is declaring the following permissions in its Manifest:
*"alarms"
**OK, this permission allows hosted content without any special prompt.
**It's used for defining alarms.
*"audio-alarm-content"
**NOT OK for HOSTED: only available to PRIVILEGED apps.
**It’s used for playing alarms sound on the app
*"attention"
**NOT OK for HOSTED, only available to CERTIFIED apps.
**It's used for display an attention window when an alarm is fired.
*"themeable"
**NOT OK for HOSTED, only available to CERTIFIED apps.
*"settings - readwrite"
**NOT OK for HOSTED, only available to CERTIFIED apps.
**Required for:
*** 1. set the audio volume of the alarms
*** 2. set a flag to notify the system that there is alarms enabled.
==== How can we make FM Radio a hosted app? ====
Lets focus on the APIs not open to hosted content yet:
*audio-alarm-channel: though it is ok for using in Trusted apps, it might be possible to open the permission for all the hosted apps too, however we should notify the user showing a prompt perhaps, because the apps that use this permission will be able to play sound in a high priority channel. At first sight, it doesn't seem like a security risk, but more as an annoyance to the user if used maliciously.
*Themeable: Does not seem like a essential feature for the application functionality so this can be disabled without impacting end-user in the short term.
**In the longer term, it does not seem like a dangerous feature to be used by hosted app that want to use the device theme.
*Settings:
**For the audio volume and alarms enabled: currently there's no way to avoid the settings check, so we use a hack in the builds for allowing access for Trusted apps to the permission. We did, instead, a change on the granularity of settings request, giving access only to the specific flag needed, and not to the whole settings object  [settings:audio.volume.alarm], [settings:alarm.enable]
**Attention Screen: we should use another type of screen when an alarm is fired or if this permission is not allowed in Trusted apps, we should hack it by bringing the app to the foreground and using window.open instead of creating the attention window.
In conclusion:
*Think about how the themeable capability could be used by any app willing to be “themed”.
**For this experiment, we decided to disable this feature, as it does not have an impact for the user at the moment.
*There is just one APIs that is not exposed to hosted content and that could reduce the functionality of the Clock Hosted App: Settings.
**To detect if there is any alarm enable and to set up the audio volume.
*Also we have an issue with the audio-alarm-channel that cannot be accessed by non privileged apps.
An example of the possible temporary hosted app following this approach is available at:
https://github.com/telefonicaid/gaia/tree/hosted-web/apps/clock
2

edits

Navigation menu