open-consul/website/build/docs/agent/encryption.html

22 lines
6.1 KiB
HTML

<!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8> <meta name=viewport content="width=device-width, initial-scale=1.0"> <meta name=description content=""> <meta name=author content=""> <title>Encryption - Serf</title> <link href="/stylesheets/bootstrap.min-82fe1490.css" media=screen rel=stylesheet /><link href="/stylesheets/main-e5014f86.css" media=screen rel=stylesheet /> <!--[if lt IE 9]><script src="/javascripts/html5shiv-310dd184.js"></script> <script src="/javascripts/respond.min-88c91176.js"></script><![endif]--> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45101516-1', 'serfdom.io');
ga('send', 'pageview');
</script> </head> <body class=page-Encryption> <div id=header> <div class=container> <a class="navbar-brand logo" href="/"> <span></span> </a> <a class="navbar-brand text rls-l" href="/">SERF</a> <ul class="buttons nav navbar-nav navbar-right rls-sb"> <li class=first><a href="/downloads.html">Download</a></li> <li><a href="https://github.com/hashicorp/serf">Github</a></li> </ul> <ul class="main-links nav navbar-nav navbar-right rls-sb"> <li><a href="/intro/index.html">Intro</a></li> <li><a href="/docs/index.html">Docs</a></li> <li><a href="/community.html">Community</a></li> </ul> </div> </div> <div class=container> <div class=col-md-4> <div class="docs-sidebar hidden-print affix-top" role=complementary> <ul class="nav docs-sidenav"> <li> <a href="/docs/index.html">Documentation Home</a> </li> <li> <a href="/docs/upgrading.html">Upgrading and Compatibility</a> <ul class=nav> <li> <a href="/docs/upgrading.html">Upgrading Serf</a> </li> <li> <a href="/docs/compatibility.html">Compatibility Promise</a> </li> </ul> </li> <li> <a href="/docs/internals/index.html">Serf Internals</a> <ul class=nav> <li> <a href="/docs/internals/gossip.html">Gossip Protocol</a> </li> <li> <a href="/docs/internals/security.html">Security Model</a> </li> <li> <a href="/docs/internals/simulator.html">Convergence Simulator</a> </li> </ul> </li> <li> <a href="/docs/commands/index.html">Serf Commands (CLI)</a> <ul class=nav> <li> <a href="/docs/commands/agent.html">agent</a> </li> <li> <a href="/docs/commands/event.html">event</a> </li> <li> <a href="/docs/commands/force-leave.html">force-leave</a> </li> <li> <a href="/docs/commands/join.html">join</a> </li> <li> <a href="/docs/commands/keygen.html">keygen</a> </li> <li> <a href="/docs/commands/leave.html">leave</a> </li> <li> <a href="/docs/commands/members.html">members</a> </li> <li> <a href="/docs/commands/monitor.html">monitor</a> </li> </ul> </li> <li class=active> <a href="/docs/agent/basics.html">Serf Agent</a> <ul class=nav> <li> <a href="/docs/agent/basics.html">Running and Stopping</a> </li> <li> <a href="/docs/agent/options.html">Configuration</a> </li> <li> <a href="/docs/agent/event-handlers.html">Event Handlers</a> </li> <li class=active> <a href="/docs/agent/encryption.html">Encryption</a> </li> <li> <a href="/docs/agent/rpc.html">RPC Protocol</a> </li> </ul> <li> <a href="/docs/roadmap.html">Roadmap</a> </li> </ul> </div> </div> <div class=col-md-8 role=main> <div class=bs-docs-section> <h1 id=toc_0>Encryption</h1> <p>The Serf agent supports encrypting all of its network traffic. The exact method of this encryption is described on the <a href="/docs/internals/security.html">encryption internals page</a>.</p> <h2 id=toc_1>Enabling Encryption</h2> <p>Enabling encryption only requires that you set an encryption key when starting the Serf agent. The key can be set using the <code>-encrypt</code> flag on <code>serf agent</code> or by setting the <code>encrypt_key</code> in a configuration file. It is advisable to put the key in a configuration file to avoid other users from being able to discover it by inspecting running processes. The key must be 16-bytes that are base64 encoded. The easiest method to obtain a cryptographically suitable key is by using <code>serf keygen</code>.</p> <pre><code>$ serf keygen
cg8StVXbQJ0gPvMd9o7yrg==
</code></pre> <p>With that key, you can enable encryption on the agent. You can verify encryption is enabled because the output will include &quot;Encrypted: true&quot;.</p> <pre><code>$ serf agent -encrypt=cg8StVXbQJ0gPvMd9o7yrg==
==&gt; Starting Serf agent...
==&gt; Serf agent running!
Node name: &#39;mitchellh.local&#39;
Bind addr: &#39;0.0.0.0:7946&#39;
RPC addr: &#39;127.0.0.1:7373&#39;
Encrypted: true
...
</code></pre> <p>All nodes within a Serf cluster must share the same encryption key in order to send and receive cluster information.</p> <h2 id=toc_2>Multiple Clusters</h2> <p>If you&#39;re running multiple Serf clusters, for example a Serf cluster to maintain cache nodes and a Serf cluster to maintain web servers, then you can use different encryption keys for each cluster in order to separately encrypt the traffic.</p> <p>This has the added benefit that the Serf agents from one cluster cannot even accidentally join the other cluster, since the two clusters will not be able to communicate without the same encryption key.</p> </div> </div> </div> <div id=footer> <div class=container> <div class=footer-links> <ul class="main-links nav navbar-nav rls-sb"> <li><a href="/intro/index.html">Intro</a></li> <li class=active><a href="/docs/index.html">Docs</a></li> <li><a href="/community.html">Community</a></li> </ul> <ul class="buttons nav navbar-nav rls-sb"> <li class=first><a href="/downloads.html">Download</a></li> <li><a href="https://github.com/hashicorp/serf">Github</a></li> </ul> </div> <div class=footer-logo> <span></span> </div> <div class="footer-hashi os"> <span>© 2013. A <a href="//www.hashicorp.com">HashiCorp</a> Project.</span> <a href="//www.hashicorp.com"><img src="/images/hashi-logo-s-3644fe63.png"></a> </div> </div> </div> <script src="javascripts/lib/d3.v3.min.js"></script> <script src="javascripts/app/deploy/site.js"></script> <script>
Serf.initialize();
</script> </body> </html>