Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 27647990744ebd9cfe32398f37f67e20 > files > 2939

bzr-2.6.0-11.1.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Security &mdash; Bazaar 2.6.0 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.6.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/bzr.ico"/>
    <link rel="top" title="Bazaar 2.6.0 documentation" href="../index.html" />
    <link rel="up" title="Bazaar System Administrator’s Guide" href="index.html" />
    <link rel="next" title="Back-up and Restore" href="backup.html" />
    <link rel="prev" title="Integration with Other Tools" href="integration.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="backup.html" title="Back-up and Restore"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="integration.html" title="Integration with Other Tools"
             accesskey="P">previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="../_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li><a href="../index.html">Table of Contents (2.6.0)</a> &raquo;</li>

          <li><a href="index.html" accesskey="U">Bazaar System Administrator&#8217;s Guide</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="security">
<h1>Security<a class="headerlink" href="#security" title="Permalink to this headline">¶</a></h1>
<div class="section" id="authentication">
<h2>Authentication<a class="headerlink" href="#authentication" title="Permalink to this headline">¶</a></h2>
<p>Bazaar&#8217;s philosophy on authentication is that it is best to reuse existing
authentication technologies, rather than trying to reinvent potentially
complicated methods for securely identifying users.  As such, we describe two
such uses of existing software for authentication purposes.</p>
<div class="section" id="using-ssh">
<h3>Using SSH<a class="headerlink" href="#using-ssh" title="Permalink to this headline">¶</a></h3>
<p>SSH is a very well tested and featureful technology for authenticating users.
For situations where all of the developers have local accounts on the server,
it is trivial to provide secure, authenticated <tt class="docutils literal"><span class="pre">bzr+ssh://</span></tt> access.  One
concern with this method is that it may not be desirable to grant shell access
to developers on the server machine.  In this case, Bazaar provides
<tt class="docutils literal"><span class="pre">bzr_ssh_path_limiter</span></tt>, a script that runs the Bazaar smart server on the
server machine at a specified path, and allows no other access.</p>
<p>To set it up, specify:</p>
<div class="highlight-python"><div class="highlight"><pre>command=&quot;/path/to/bzr_ssh_path_limiter &lt;path&gt;&quot; &lt;typical key line&gt;
</pre></div>
</div>
<p>in each user&#8217;s <tt class="docutils literal"><span class="pre">~/.ssh/authorized_keys</span></tt> file on the server, where <cite>&lt;path&gt;</cite> is
the path to limit access to (and its subdirectories).  For more documentation
on the syntax of the <tt class="docutils literal"><span class="pre">authorized_keys</span></tt> file see the documentation of the SSH
server.  This will only permit Bazaar access to the specified path and no other
SSH access for that user.</p>
<p>If it isn&#8217;t desired to give each user an account on the server, multiple
private/public key pairs can be included under one single SSH account (say
sshuser) in the <tt class="docutils literal"><span class="pre">~sshuser/.ssh/authorized_keys</span></tt> file and then each developer
can be given their own private key.  They can then use
<tt class="docutils literal"><span class="pre">bzr+ssh://sshuser&#64;server.example.com/</span></tt> URLs to access the server.</p>
</div>
<div class="section" id="using-http-authentication-methods">
<h3>Using HTTP authentication methods<a class="headerlink" href="#using-http-authentication-methods" title="Permalink to this headline">¶</a></h3>
</div>
</div>
<div class="section" id="access-control">
<h2>Access Control<a class="headerlink" href="#access-control" title="Permalink to this headline">¶</a></h2>
<p>Many projects need fine-grained access control on who may read and write to
which branches.  Incorporating these controls into OS-level user accounts
using groups and filesystem permissions can be difficult or even not permitted
in some instances.  Bazaar provides a script called <tt class="docutils literal"><span class="pre">bzr_access</span></tt> that can be
used to provide access control based on usernames, with authentication
performed by SSH.  To do so, we need to set up private-key authentication in
SSH.  This can be done using a single SSH user on the server, or one account
per user.  The idea is to use the SSH&#8217;s <tt class="docutils literal"><span class="pre">authorized_keys</span></tt> file to specify
the <tt class="docutils literal"><span class="pre">bzr_access</span></tt> script as the only command that can be run by a user
identified by a particular key pair.</p>
<p>First, you will need to generate a private/public key pair for each user who
will be accessing the repository.  The private key should be distributed to
the user and the public key will be needed on the server to identify the user.
On the server, in the SSH user&#8217;s <tt class="docutils literal"><span class="pre">~/.ssh/authorized_keys</span></tt> file, use the
following line for each repository user and the corresponding public key:</p>
<div class="highlight-python"><div class="highlight"><pre>command=&quot;/path/to/bzr_access /path/to/bzr /path/to/repository &lt;username&gt;&quot;,no- port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-&lt;type&gt; &lt;key&gt;
</pre></div>
</div>
<p>where <cite>&lt;key&gt;</cite> is the (possibly very long) public key, <cite>&lt;type&gt;</cite> is the type of
SSH key and <cite>&lt;username&gt;</cite> is the username to associate with that public key.</p>
<p>The <tt class="docutils literal"><span class="pre">bzr_access</span></tt> script obtains its configuration information from the file
<tt class="docutils literal"><span class="pre">/path/to/repository/bzr_access.conf</span></tt>.  This file should not be placed under
version control in a branch located at <tt class="docutils literal"><span class="pre">/path/to/repository</span></tt> since that
would allow anyone with access to the repository to change the access control
rules.  The <tt class="docutils literal"><span class="pre">bzr_access.conf</span></tt> file is in a simple INI-style format with
sections defined by <tt class="docutils literal"><span class="pre">[groups]</span></tt> and <tt class="docutils literal"><span class="pre">[/]</span></tt>.  The options in the <tt class="docutils literal"><span class="pre">[groups]</span></tt>
section are the names of groups and the values of those options should be the
usernames in that group.  Inside the <tt class="docutils literal"><span class="pre">[/]</span></tt> section, the options are
usernames or group names (prefixed with <tt class="docutils literal"><span class="pre">&#64;</span></tt>) and the values are either
<tt class="docutils literal"><span class="pre">rw</span></tt>, <tt class="docutils literal"><span class="pre">r</span></tt> or nothing, representing read-write access, read-only access or
no access at all.  A sample of <tt class="docutils literal"><span class="pre">bzr_access.conf</span></tt> could be:</p>
<div class="highlight-python"><div class="highlight"><pre>[groups]
admins = alpha
devels = beta, gamma, delta

[/]
@admins = rw
@devels = r
upsilon =
</pre></div>
</div>
<p>where the user whose key is associated with <cite>alpha</cite> would have read-write
access, the users <cite>beta</cite>, <cite>gamma</cite> and <cite>delta</cite> would have read-only access and
user <cite>upsilon</cite> would not be able to access any branches under
<tt class="docutils literal"><span class="pre">/path/to/repository</span></tt>.</p>
<div class="section" id="additional-considerations-with-bzr-access">
<h3>Additional Considerations with <tt class="docutils literal"><span class="pre">bzr_access</span></tt><a class="headerlink" href="#additional-considerations-with-bzr-access" title="Permalink to this headline">¶</a></h3>
<p>As currently written, <tt class="docutils literal"><span class="pre">bzr_access</span></tt> only allows each public key to be
associated with a single repository location.  This means that if developers
need to access two or more different repositories, then each developer will
need to have two or more private keys for SSH and be able to select between
them (see <tt class="docutils literal"><span class="pre">man</span> <span class="pre">ssh</span></tt> for more information on configuring multiple private
keys).</p>
<p>Also, each repository can only have a single configuration file, with access
configured for all branches in the repository.  This means that if different
access rules are needed for different projects, then those projects must be in
different repositories.  This then necessitates the use of multiple private
keys as just described.</p>
<p>Finally, as noted above under <a class="reference internal" href="#using-ssh">Using SSH</a> all of the public keys may be
included in the <tt class="docutils literal"><span class="pre">authorized_keys</span></tt> file of a single user on the server.  It
is also possible to use a single private/public key pair for all of the
developers, but this only allows a single username for access control to the
repository (since the username is associated with the public key in
<tt class="docutils literal"><span class="pre">authorized_keys</span></tt>.  While this is certainly possible it seems to defeat the
purpose of fine-grained access control, although it does provide the same
limited SSH access as that described above.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Security</a><ul>
<li><a class="reference internal" href="#authentication">Authentication</a><ul>
<li><a class="reference internal" href="#using-ssh">Using SSH</a></li>
<li><a class="reference internal" href="#using-http-authentication-methods">Using HTTP authentication methods</a></li>
</ul>
</li>
<li><a class="reference internal" href="#access-control">Access Control</a><ul>
<li><a class="reference internal" href="#additional-considerations-with-bzr-access">Additional Considerations with <tt class="docutils literal"><span class="pre">bzr_access</span></tt></a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="integration.html"
                        title="previous chapter">Integration with Other Tools</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="backup.html"
                        title="next chapter">Back-up and Restore</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/admin-guide/security.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="backup.html" title="Back-up and Restore"
             >next</a></li>
        <li class="right" >
          <a href="integration.html" title="Integration with Other Tools"
             >previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="../_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li><a href="../index.html">Table of Contents (2.6.0)</a> &raquo;</li>

          <li><a href="index.html" >Bazaar System Administrator&#8217;s Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2011 Canonical Ltd.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>