Changeset 11052785 in trunk


Ignore:
Timestamp:
2015-06-11T20:33:47Z (10 years ago)
Author:
Daira Hopwood <daira@…>
Branches:
master
Children:
f26423c
Parents:
66178f01
git-author:
Daira Hopwood <daira@…> (2015-06-11 20:33:09)
git-committer:
Daira Hopwood <daira@…> (2015-06-11 20:33:47)
Message:

Finish user-interface.rst. fixes ticket:2443

Signed-off-by: Daira Hopwood <daira@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified docs/proposed/magic-folder/user-interface-design.rst

    r66178f01 r11052785  
    55-----
    66
    7 In this Objective we will write the design document for how users can conveniently
    8 and securely indicate which folders on some devices should be magically linked to
    9 which folders on other devices.
     7In this Objective we will design a user interface to allow users to conveniently
     8and securely indicate which folders on some devices should be "magically" linked
     9to which folders on other devices.
    1010
    1111This is a critical usability and security issue for which there is no known perfect
    12 solution, but which will hopefully be amenable to a "good enough" trade-off solution.
     12solution, but which we believe is amenable to a "good enough" trade-off solution.
    1313This document explains the design and justifies its trade-offs in terms of security,
    1414usability, and time-to-market.
     
    1818
    1919.. _otf-magic-folder-objective6: https://tahoe-lafs.org/trac/tahoe-lafs/query?status=!closed&keywords=~otf-magic-folder-objective6
     20
     21Glossary
     22''''''''
     23
     24Object: a file or directory
     25
     26DMD: distributed mutable directory
     27
     28Folder: an abstract directory that is synchronized between clients.
     29(A folder is not the same as the directory corresponding to it on
     30any particular client, nor is it the same as a DMD.)
     31
     32Collective: the set of clients subscribed to a given Magic Folder.
     33
     34Diminishing: the process of deriving, from an existing capability,
     35another capability that gives less authority (for example, deriving a
     36read cap from a read/write cap).
     37
     38
     39Design Constraints
     40------------------
     41
     42The design of the Tahoe-side representation of a Magic Folder, and the polling
     43mechanism that the Magic Folder clients will use to detect remote changes was
     44discussed in `<remote-to-local-sync.rst>`_, and we will not revisit that here.
     45The assumption made by that design was that each client would be configured with
     46the following information:
     47
     48* a write cap to its own *client DMD*.
     49* a read cap to a *collective directory*.
     50
     51The collective directory contains links to each client DMD named by the
     52corresponding client's nickname.
     53
     54This design was chosen to allow straightforward addition of clients without
     55requiring each existing client to change its configuration.
     56
     57Note that each client in a Magic Folder collective has the authority to add,
     58modify or delete any object within the Magic Folder. It is also able to control
     59to some extent whether its writes will be treated by another client as overwrites
     60or as conflicts. However, there is still a reliability benefit to preventing a
     61client from accidentally modifying another client's DMD, or from accidentally
     62modifying the collective directory in a way that would lose data. This motivates
     63ensuring that each client only has access to the caps above, rather than, say,
     64every client having a write cap to the collective directory.
     65
     66Another important design constraint is that we cannot violate the
     67`write coordination directive`_; that is, we cannot write to the same mutable
     68directory from multiple clients, even during the setup phase when adding a
     69client.
     70
     71.. _`write coordination directive`: ../../write_coordination.rst
     72
     73Within these constraints, for usability we want to minimize the number of steps
     74required to configure a Magic Folder collective.
     75
     76
     77Proposed Design
     78---------------
     79
     80Three ``tahoe`` subcommands are added::
     81
     82  tahoe magic-folder create MAGIC: [MY_NICKNAME LOCAL_DIR]
     83
     84    Create an empty Magic Folder. The MAGIC: local alias is set
     85    to a write cap which can be used to refer to this Magic Folder
     86    in future ``tahoe magic-folder invite`` commands.
     87
     88    If MY_NICKNAME and LOCAL_DIR are given, the current client
     89    immediately joins the newly created Magic Folder with that
     90    nickname and local directory.
     91
     92
     93  tahoe magic-folder invite MAGIC: THEIR_NICKNAME
     94
     95    Print an "invitation" that can be used to invite another
     96    client to join a Magic Folder, with the given nickname.
     97
     98    The invitation must be sent to the user of the other client
     99    over a secure channel (e.g. PGP email, OTR, or ssh).
     100
     101    This command will normally be run by the same client that
     102    created the Magic Folder. However, it may be run by a
     103    different client if the ``MAGIC:`` alias is copied to
     104    the ``private/aliases`` file of that other client, or if
     105    ``MAGIC:`` is replaced by the write cap to which it points.
     106
     107
     108  tahoe magic-folder join INVITATION LOCAL_DIR
     109
     110    Accept an invitation created by ``tahoe magic-folder invite``.
     111    The current client joins the specified Magic Folder, which will
     112    appear in the local filesystem at the given directory.
     113
     114
     115There are no commands to remove a client or to revoke an
     116invitation, although those are possible features that could
     117be added in future. (When removing a client, it is necessary
     118to copy each file it added to some other client's DMD, if it
     119is the most recent version of that file.)
     120
     121
     122Implementation
     123''''''''''''''
     124
     125For "``tahoe magic-folder create MAGIC: [MY_NICKNAME LOCAL_DIR]``" :
     126
     1271. Run "``tahoe create-alias MAGIC:``".
     1282. If ``MY_NICKNAME`` and ``LOCAL_DIR`` are given, do the equivalent of::
     129
     130     INVITATION=`tahoe invite-magic-folder MAGIC: MY_NICKNAME`
     131     tahoe join-magic-folder INVITATION LOCAL_DIR
     132
     133
     134For "``tahoe magic-folder invite COLLECTIVE_WRITECAP NICKNAME``" :
     135
     136(``COLLECTIVE_WRITECAP`` can, as a special case, be an alias such as ``MAGIC:``.)
     137
     1381. Create an empty client DMD. Let its write URI be ``CLIENT_WRITECAP``.
     1392. Diminish ``CLIENT_WRITECAP`` to ``CLIENT_READCAP``, and
     140   diminish ``COLLECTIVE_WRITECAP`` to ``COLLECTIVE_READCAP``.
     1413. Run "``tahoe ln CLIENT_READCAP COLLECTIVE_WRITECAP/NICKNAME``".
     1424. Print "``COLLECTIVE_READCAP|CLIENT_WRITECAP``" as the invitation,
     143   accompanied by instructions on how to accept the invitation and
     144   the need to send it over a secure channel.
     145
     146
     147For "``tahoe magic-folder join INVITATION LOCAL_DIR``" :
     148
     1491. Parse ``INVITATION`` as ``COLLECTIVE_READCAP|CLIENT_WRITECAP``.
     1502. Write ``CLIENT_WRITECAP`` to the file ``magic_folder_dircap``
     151   under the client's ``private`` directory.
     1523. Write ``COLLECTIVE_READCAP`` to the file ``collective_dircap``
     153   under the client's ``private`` directory.
     1544. Edit the client's ``tahoe.cfg`` to set
     155   ``[magic_folder] enabled = True`` and
     156   ``[magic_folder] local.directory = LOCAL_DIR``.
     157
     158
     159Discussion
     160----------
     161
     162The proposed design has a minor violation of the
     163`Principle of Least Authority`_ in order to reduce the number
     164of steps needed. The invoker of "``tahoe magic-folder invite``"
     165creates the client DMD on behalf of the invited client, and
     166could retain its write cap (which is part of the invitation).
     167
     168.. _`Principle of Least Authority`: http://www.eros-os.org/papers/secnotsep.pdf
     169
     170A possible alternative design would be for the invited client
     171to create its own client DMD, and send it back to the inviter
     172to be linked into the collective directory. However this would
     173require another secure communication and another command
     174invocation per client. Given that, as mentioned earlier, each
     175client in a Magic Folder collective already has the authority
     176to add, modify or delete any object within the Magic Folder,
     177we considered the potential security/reliability improvement
     178here not to be worth the loss of usability.
     179
     180We also considered a design where each client had write access
     181to the collective directory. This would arguably be a more
     182serious violation of the Principle of Least Authority than the
     183one above (because all clients would have excess authority rather
     184than just the inviter). In any case, it was not clear how to make
     185such a design satisfy the `write coordination directive`_,
     186because the collective directory would have needed to be written
     187to by multiple clients.
     188
     189The reliance on a secure channel to send the invitation to its
     190intended recipient is not ideal, since it may involve additional
     191software such as clients for PGP, OTR, ssh etc. However, we believe
     192that this complexity is necessary rather than incidental, because
     193there must be some way to distinguish the intended recipient from
     194potential attackers who would try to become members of the Magic
     195Folder collective without authorization. By making use of existing
     196channels that have likely already been set up by security-conscious
     197users, we avoid reinventing the wheel or imposing substantial extra
     198implementation costs.
     199
     200The length of an invitation will be approximately the combined
     201length of a Tahoe-LAFS read cap and write cap. This is several
     202lines long, but still short enough to be cut-and-pasted successfully
     203if care is taken. Errors in copying the invitation can be detected
     204since Tahoe-LAFS cap URIs are self-authenticating.
     205
     206The implementation of the ``tahoe`` subcommands is straightforward
     207and raises no further difficult design issues.
Note: See TracChangeset for help on using the changeset viewer.