Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cryptography documentation added. #629

Merged
merged 3 commits into from
Jun 3, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion www/data/docs_sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@
"link": "/docs/concepts-plans/"
},
{
"title": "Packages and artifacts",
"title": "Packages",
"link": "/docs/concepts-packages/"
},
{
"title": "Keys",
"link": "/docs/concepts-keys/"
},
{
"title": "Studio",
"link": "/docs/concepts-studio/"
Expand Down
37 changes: 37 additions & 0 deletions www/source/docs/concepts-keys.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Keys

Habitat has strong cryptography built into both the build system and the supervisor. This means there are several different kinds of keys.

## Origin Keys

As described in a <a href="/docs/concepts-packages">previous topic</a>, every package in Habitat belongs to an origin, and is cryptographically signed with that origin's private key.

Origin key cryptography is asymmetric; it has a public key that you can distribute freely, and a private key that you should keep safe.

Supervisors, by default, will refuse to run packages for which they do not have the public key. They use this public key to verify the integrity of the Habitat package they download, before running it. Supervisors can be provided the public key by pointing them at a depot that has it, or by putting the key on disk outside of Habitat.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...or by putting the key on disk outside of Habitat." => do we want to call out /hab/cache/keys and HAB_CACHE_KEY_PATH?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a concepts document I'm leaving out the specifics; when we write the "jobs"-oriented documents we can put it in there.


## User and Service Group Keys

User and service group keys are used to set up trust relationships between these two entities. Service groups can be set up to reject communication (e.g. applying new configuration via `hab config apply`) from untrusted users.

By default, service groups will trust *any* communication, so for a production deployment of Habitat, setting up these relationships is essential.

User and service group keys also utilize asymmetric cryptography. To apply configuration changes to service groups when running in this mode, a user uses their own private key to encrypt configuration information for a service group, using that service group's public key. The service group then uses its private key to decrypt the configuration information.
Copy link
Contributor

@bookshelfdave bookshelfdave Jun 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service group then uses its private key to decrypt and the users public key to verify

Copy link
Contributor

@bookshelfdave bookshelfdave Jun 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the user's private key is used to sign, the public service key does the encryption.


## Ring Encryption Key

A supervisor ring can be optionally set up to encrypt *all* communication across the network. This requires the use of a symmetric pre-shared key. Any supervisor joining the ring that does not present this key will be rejected.

## Technology

Habitat implements cryptography using a Rust implementation of [NaCl](https://nacl.cr.yp.to/), which provides a fast, modern framework for encryption, decryption, signing, and verification.

Encrypted messages use the Curve25519, Salsa20, and Poly1305 ciphers specified in [Cryptography in NaCl](http://nacl.cr.yp.to/valid.html).

Habitat packages are signed using [BLAKE2b](https://blake2.net/) checksums. BLAKE2b is a cryptographic hash function faster than MD5, SHA-1, SHA-2 and SHA3, yet provides at least as much security as the latest standard SHA-3.

<hr>
<ul class="main-content--link-nav">
<li>Continue to the next topic</li>
<li><a href="/docs/concepts-studio">Studio</a></li>
</ul>
2 changes: 1 addition & 1 deletion www/source/docs/concepts-packages.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ If the package identifier isn't fully specified (having less than four component
<hr>
<ul class="main-content--link-nav">
<li>Continue to the next topic</li>
<li><a href="/docs/concepts-studio">Studio</a></li>
<li><a href="/docs/concepts-keys">Keys</a></li>
</ul>