CloudServices/WheresMyFox
Where's My Fox
Overview
To provide a means for users to locate, track and purge devices remotely.
Project Contacts
Principal Point of Contact - Doug Turner dougt@mozilla.com
Product - vishy@, elancaster@
IRC - #services-dev
Group Email - TBD
Goals
- Be able to provide a simple, secure means for FirefoxOS users to remotely locate, track and purge their devices.
Use Cases
1) Albert can't remember the location of his phone. Going to a nearby computer, he logs into WheresMyFox and requests the phone to report it's location. The phone reports that it is nearby, so Albert requests the device to ring. Albert quickly finds that his phone is in his coat pocket.
2) Bea discovers that her phone is missing. Using a friends phone, she logs into WheresMyFox and requests the phone to report it's location. She discovers that the phone is currently headed down Broadway, and realizes she has left it in the cab. Realizing that she may never see her phone again, she requests the phone to remotely wipe itself, before calling the cab agency to see if she can recover her device.
Requirements
- The user must use a secure credentialing and authorization system to identify self and associate to a device.
- The login system is currently Out of Scope of these requirements, but should be or substantially similar to Firefox Accounts.
- A user may have one or more devices.
- A device shall have a Globally Unique Identifier (WTFID).
- A device shall be associated with a single user.
- Data exchanged between client and server shall be via JSON Web Signature format
- The secret shall be generated and stored on the client, and sent to the server ONLY on initialization.
- The secret shall be a 128bit value.
- The secret shall be stored on the device as long as the WTFID remains unchanged.
- A new WTFID shall require a new secret to be generated and the device to reconnect as if new.
- No data shall be preserved in the case of a WTFID changing.
- Data signatures shall use HMAC SHA-256 or any more secure signing method for any exchange EXCEPT for Initialization.
- The secret shall be generated and stored on the client, and sent to the server ONLY on initialization.
- A remote wipe operation will format any additional storage (e.g. SD card) on the phone and reset the phone to initial Factory conditions.
- Only allow registered user to display and remotely control devices.
- login page?
- secured by session cookie
- Securely send commands to:
- report location on a regular interval (for motion tracking)
- record tracking information keeping latest location for device
- older records expired after ? period ?
- play a default audio alarm.
- For known period? Forever? What happens if multiple of these commands sent?
- lock a device
- to a key code (if not present? Override?)
- display an optional message
- remove all user information from a device
- Factory reset
- Display message and contact phone
- lock to a key code
- report location on a regular interval (for motion tracking)
- Securely display UI for phone including
- current location
- previous recent locations
- store user & device information (multiple devices)
- How long to store data?
- How reliable does storage need to be?
Get Involved
Call to action for folks who want to help.
Design
Points of Contact
Engineer - Name jr@
Discussions
https://etherpad.mozilla.org/wheresmyfox-2013-10-28
Client API Reference/Documentation
Client UX was presented by Epic:
https://www.dropbox.com/sh/uaxlhzz211br438/rH2UA0Tf6_/WIMF_3.0.pdf
Server API Reference/Documentation
API calls will be a combination of REST calls and BOSH where possible. This avoids some of the issues with the fragility of websockets in areas where connectivity is sub-optimal or sporadic.
In addition, packet identifiers have been reduced as much as possible. This is to both reduce bandwidth costs as well as require less time to exchange data.
To reduce risk of injection attacks, calls will use Hawk to sign requests (unless otherwise specified).
Data Schema
Since each server system will be unique, it does not make sense to strictly specify the data storage method. Instead an example storage mechanism will be offered to illustrate how the server would manage data.
A simple storage object would be keyed off of the ID returned in the /$v/init
call.
key => {"lastPosition":{"lat":lat, // The last position reported by track "lon":lon, "alt":altitude?, // Optional "altitude", if provided "tim":UTC}, // UTC Timestamp "previousPositions":[{position},...], // the last 5? position reports for the device "state":"(rtn)", // the state the server thinks the device is in "lockable"1:True|False, // does the device have a user supplied key code1 "lastExchange":UTC // last time an exchange happened. "pendingCommand": {outboundCommand} } user => ["key:name",...] // A list of known keys & user friendly names for devices
1Note: this should be queried on device. User might set a passcode while the device is active or between updates.
API
For this API discussion:
$v - API Version (currently 1)
$id - Globally unique ID for a device
Unless otherwise specified, all exchanged JSON blocks are signed using HAWK (not shown here for simplicity). Standard HTTP responses apply (401, 500, 301)
POST /$v/register
from device:
{'userid':$uuid, 'pushurl':$simplePushURL, 'deviceid':$deviceUniqueId, 'secret':$HawkSecretHashKey}
arguments:
$uuid - this is the Firefox Accounts user UUID taken from the
verified assertion response.
$SimplePushURL - this is the SimplePush registration URL. If this
changes the device must call register again, specifying the device_id.
$deviceUniqeId - the existing $deviceUniqueId returned by previous
registration. If this is the first time the device is registering, no
value should be set. If the $deviceUniqueId is not recognized by the server
as belonging to the $UUID, it is ignored and a new $deviceUniqueId is
returned.
$HawkSecretHashKey - a HAWK valid secret hash key for the device.
reply from server:
{'id':$deviceUniqueId}
arguments:
$deviceUniqueId - A unique designator for the device. All
After device registration, a device should immediately call POST /$v/cmd/$deviceUniqueId as if it had just received the following command:
{"t":{"p":1,"d":1}}
This should return the devices current location.
POST /$v/cmd/$deviceUniqueId
A device may acknowledge the last commands received and additional information as appropriate. See Device commands for details about these commands.
Replies for the "l", "r", "m", or "e" command:
the device shall return an object containg a "status" and optionally an
"error" string.
For example, a successful lock and ring would return:
{"l":{"ok":true},"r":{"ok":true}}
In the case of an error with the ringer:
{"l":{"ok":true},"r":{"ok":false,"error":"no ringtone found"}}
For the "t" command:
the device shall return an object that includes the "ok" status, latitude,
loongitude, device time as UTC and other related positional
information.
If the tracking information is not available, it will also report "ok" as
false and optionally include an "error" string.
For example, a successful tracking request would return:
{"t":{"ok":true, "la":37.388017, "lo":-122.0833, "ti":1234567890}}
Periodic updates for "t" commands do not need to include other commands.
The body of the POST reply shall optionally contain further commands from the server. The following section describes these commands.
Device commands
Commands consist of a JSON object containing zero or more of the following:
{"command": {arguments},... }
- lock
- Specify the lock code to use, if no device lock code is present.
If a lock code already exists on the device, lock the device with the
device's lock code.
Example:
{"l":{"c":1234}} - ring
- Cause the device to ring every period seconds for a
duration of seconds. Specifying a duration of "0" stops the device
from ringing.
Example:
{"r":{"p":10,"d":60}} - message
- Display a message on the device consisting of a contact number
and text message.
contact numbers may only consist of the following:0123456789 +-()
, and is limited to 25 characters.
message text may only be 100 or less standard ASCII, non-control characters.
Example:
{"m":{"n":"+1 (408) 555-555", "m":"Help, I'm lost. Please return me!"}} - track
- Begin active location tracking on the device, reporting the devices
position every period second for a duration of seconds.
See POST /$v/cmd/$deviceUniqueId for how the device reports this
information. Specifying a duration of 0 stops the device from reporting
its location.
Example:
{"t":{"p":10,"d":300}} - erase
- Erase the device. This performs a factory reset.
Example:
{"e":{}}
Any of the above commands may be combined into a single command. For example, to lock a phone, display a message with contact number and cause the device to ring ever 30 seconds for 5 minutes:
{"l":{"c":1111}, "m":{"n":"555-555-5555","m":"Please return me!"}, "r":{"p":30,"d":300}}
Platform Requirements
What are the things this needs (OS, language, databases, etc.)?
Libraries Required
List of external project dependencies. (Stuff that's not pulled in via the installation script)
Code Repository
Links to the published code bases
Release Schedule
Predicted code delivery dates
QA
Points of Contact
Engineer - Ed Wong edwong@
Test Framework
Security and Privacy
Tracking bug: 935724
- Bug 935725 - Security Review: Where's My Fox
- Bug 935726 - Legal Review: Where's My Fox
- Bug 935727 - Privacy-Technical Review: Where's My Fox
- Bug 935728 - Privacy-Policy Review: Where's My Fox
Points of Contact
Legal - udevi@
Questionnaire Answers
1.1 Goal of Feature
2. Potential Threat Vectors and Mitigation Points
Review Status
https://bugzilla.mozilla.org/show_bug.cgi?id=935725
see https://wiki.mozilla.org/Security/Reviews
Issues and Resolutions
Operations
Points of Contact
Deployment Architecture
Bugzilla Tracking # -