github.com/akashshinde/docker@v1.9.1/docs/security/trust/trust_key_mng.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "Manage keys for content trust"
     4  description = "Manage keys for content trust"
     5  keywords = ["trust, security, root,  keys, repository"]
     6  [menu.main]
     7  parent= "smn_content_trust"
     8  +++
     9  <![end-metadata]-->
    10  
    11  # Manage keys for content trust
    12  
    13  Trust for an image tag is managed through the use of keys. Docker's content
    14  trust makes use four different keys:
    15  
    16  | Key                 | Description                                                                                                                                                                                                                                                                                                                                                                         |
    17  |---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    18  | root key         | Root of content trust for a image tag. When content trust is enabled, you create the root key once. |
    19  | target and snapshot | These two keys are known together as the "repository" key. When content trust is enabled, you create this key when you add a new image repository. If you have the root key, you can export the repository key and allow other publishers to sign the image tags.    |
    20  | timestamp           | This key applies to a repository. It allows Docker repositories to have freshness security guarantees without requiring periodic content refreshes on the client's side.                                                                                                              |
    21  
    22  With the exception of the timestamp, all the keys are generated and stored locally
    23  client-side. The timestamp is safely generated and stored in a signing server that
    24  is deployed alongside the Docker registry. All keys are generated in a backend
    25  service that isn't directly exposed to the internet and are encrypted at rest.
    26  
    27  ## Choosing a passphrase
    28  
    29  The passphrases you chose for both the root key and your repository key should
    30  be randomly generated and stored in a password manager.  Having the repository key
    31  allow users to sign image tags on a repository. Passphrases are used to encrypt
    32  your keys at rest and ensures that a lost laptop or an unintended backup doesn't
    33  put the private key material at risk.
    34  
    35  ## Back up your keys
    36  
    37  All the Docker trust keys are stored encrypted using the passphrase you provide
    38  on creation. Even so, you should still take care of the location where you back them up.
    39  Good practice is to create two encrypted USB keys.
    40  
    41  It is very important that you backup your keys to a safe, secure location. Loss
    42  of the repository key is recoverable; loss of the root key is not.
    43  
    44  The Docker client stores the keys in the `~/.docker/trust/private` directory.
    45  Before backing them up, you should `tar` them into an archive:
    46  
    47  ```bash
    48  $ umask 077; tar -zcvf private_keys_backup.tar.gz ~/.docker/trust/private; umask 022
    49  ```
    50  
    51  ## Lost keys
    52  
    53  If a publisher loses keys it means losing the ability to sign trusted content for
    54  your repositories.  If you lose a key, contact [Docker
    55  Support](https://support.docker.com) (support@docker.com) to reset the repository
    56  state.
    57  
    58  This loss also requires **manual intervention** from every consumer that pulled
    59  the tagged image prior to the loss. Image consumers would get an error for
    60  content that they already downloaded:
    61  
    62  ```
    63  could not validate the path to a trusted root: failed to validate data with current trusted certificates
    64  ```
    65  
    66  To correct this, they need to download a new image tag with that is signed with
    67  the new key.
    68  
    69  ## Related information
    70  
    71  * [Content trust in Docker](content_trust.md) 
    72  * [Automation with content trust](trust_automation.md)
    73  * [Play in a content trust sandbox](trust_sandbox.md)