CloudServices/WheresMyFox: Difference between revisions
(→Design) |
|||
Line 123: | Line 123: | ||
<dt><b>r</b>ing | <dt><b>r</b>ing | ||
<dd>cause the phone to ring constantly for <b>d</b>uration seconds.<br> | <dd>cause the phone to ring constantly for <b>d</b>uration seconds.<br> | ||
for example, the following will cause the device to ring for 60 seconds | |||
{"c":"r","d":60} | |||
</dd> | |||
<dt><b>t</b>rack | <dt><b>t</b>rack | ||
<dd>Have the phone report back it's location every <b>p</b>eriod seconds<br> | <dd>Have the phone report back it's location every <b>p</b>eriod seconds<br> | ||
e.g. <code>{"c":"t","p":20}</code> will cause the phone to POST to <code>/<i>$v</i>/cmd/<i>$id</i></code> | e.g. <code>{"c":"t","p":20}</code> will cause the phone to POST to <code>/<i>$v</i>/cmd/<i>$id</i></code> | ||
{"c":"t", "la": | {"c":"t", "t":"la":37.388017, "lo":-122.0833} | ||
The server may reply back to the "track" POST with either an empty 200 or a <i>COMMAND</i> object | The server may reply back to the "track" POST with either an empty 200 or a <i>COMMAND</i> object | ||
<dt><b>c</b>ancel | <dt><b>c</b>ancel | ||
<dd>Cancel the current | <dd>Cancel the current <b>a</b>ctivity ("ring" or "track"). | ||
<dt> | {"c":"c", "a":"t"} | ||
<dd> | <dt><b>l</b>ost | ||
{"c":"k", " | <dd>Set a phone into "lost" mode. This may include a number of items, optionally displaying a callback <b>n</b>umber and message, lock a device to the provided <b>k</b>ey. | ||
* Key codes are limited to 4 numerals. | |||
* Contact Number can only consist of numerals plus "()- ". | |||
* Messages must be less than 100 non-control, UTF8 characters. <br> | |||
<i>Note</i>: this needs to be stripped and scrubbed like nobody's business. It's potentially an attack vector. | |||
<br> | |||
{"c":"l", "k":1234, "m":"If found, please email reward@example.com", "n":"555-123-4567"} | |||
<dt><b>m</b>essage | <dt><b>m</b>essage | ||
<dd>Set a brief message on the lock screen of the phone. Messages must be less than 100 non control, UTF8 characters. | <dd>Set a brief message on the lock screen of the phone. Messages must be less than 100 non control, UTF8 characters. | ||
{"c":"m", "m":"If found, please email reward@example.com..."} | {"c":"m", "m":"If found, please email reward@example.com" } | ||
<i>Note</i>: this needs to be stripped and scrubbed like nobody's business. It's potentially an attack vector. | |||
<dt><b>e</b>rase | |||
<dd>Factory Reset your device. | |||
Optional fields may include a contact <b>n</b>umber, <b>m</b>essage, and lock <b>k</b>ey. This information will be displayed on the device prior and during device erasure. | |||
* Key codes are limited to 4 numerals. | |||
* Contact Number can only consist of numerals plus "()- ". | |||
* Messages must be less than 100 non-control, UTF8 characters. <br> | |||
<i>Note</i>: this needs to be stripped and scrubbed like nobody's business. It's potentially an attack vector. | |||
<br> | |||
<i><b>Question</b></i>: They go away after a factory reset, right? Otherwise you've either bricked or you're maintaining data across a formatting (bad idea). | |||
{"c":"e", "m":"commencing device termination"} | |||
<dt><b>s</b>tatus | |||
<dd>return the current status information about the device. | |||
< | format consists of: | ||
* is the lock <b>k</b>ey present? True or False | |||
* the current <b>t</b>racking location information for the device. | |||
{"c":"s", "k":True, "t":{"la":37.388017, "lo":-122.0833}} | |||
</dl> | </dl> | ||
<b>Response from device</b> | |||
For each command the client receives, the client optionally POSTs an Ack: | For each command the client receives, the client optionally POSTs an Ack: |
Revision as of 21:58, 12 November 2013
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.
- 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?
- remove all user information from a device
- Remotely lock/unlock device?
- Factory reset or brick?
- report location on a regular interval (for motion tracking)
- Securely display UI for phone including
- current location
- previous locations
- available commands
- help
- login page
- 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 "lastExchange":UTC // last time an exchange happened. "pendingCommand": {outboundCommand} } user => ["key:name",...] // A list of known keys & user friendly names for devices
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).
POST /$v/init
Post the Init JSON block to the WMF server.
From Client (not wrapped in JWS):
{"secret":bin64encoded 128b value}
Server Reply:
200 {"id": $id}
GET /$v/cmd/$id
GET the next command from the Server. This call is triggered by a SimplePush version update.
From Server:
{"c":COMMAND, ARGS}
where COMMAND is:
- ring
- cause the phone to ring constantly for duration seconds.
for example, the following will cause the device to ring for 60 seconds {"c":"r","d":60} - track
- Have the phone report back it's location every period seconds
e.g.{"c":"t","p":20}
will cause the phone to POST to/$v/cmd/$id
{"c":"t", "t":"la":37.388017, "lo":-122.0833} The server may reply back to the "track" POST with either an empty 200 or a COMMAND object - cancel
- Cancel the current activity ("ring" or "track"). {"c":"c", "a":"t"}
- lost
- Set a phone into "lost" mode. This may include a number of items, optionally displaying a callback number and message, lock a device to the provided key.
- Key codes are limited to 4 numerals.
- Contact Number can only consist of numerals plus "()- ".
- Messages must be less than 100 non-control, UTF8 characters.
{"c":"l", "k":1234, "m":"If found, please email reward@example.com", "n":"555-123-4567"} - message
- Set a brief message on the lock screen of the phone. Messages must be less than 100 non control, UTF8 characters. {"c":"m", "m":"If found, please email reward@example.com" } Note: this needs to be stripped and scrubbed like nobody's business. It's potentially an attack vector.
- erase
- Factory Reset your device.
Optional fields may include a contact number, message, and lock key. This information will be displayed on the device prior and during device erasure.
- Key codes are limited to 4 numerals.
- Contact Number can only consist of numerals plus "()- ".
- Messages must be less than 100 non-control, UTF8 characters.
Question: They go away after a factory reset, right? Otherwise you've either bricked or you're maintaining data across a formatting (bad idea). {"c":"e", "m":"commencing device termination"} - status
- return the current status information about the device.
format consists of:
- is the lock key present? True or False
- the current tracking location information for the device.
Response from device
For each command the client receives, the client optionally POSTs an Ack:
{"command":"ack", "action":"command letter}
e.g. for the "ring" command:
{"c":"a", "a":"r"}
Each client Ack may return an additional COMMAND object from the server.
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 # -