Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
| ... | ... |
@@ -4724,18 +4724,21 @@ Inspect swarm |
| 4724 | 4724 |
"ElectionTick" : 3 |
| 4725 | 4725 |
}, |
| 4726 | 4726 |
"TaskDefaults" : {},
|
| 4727 |
+ "EncryptionConfig" : {
|
|
| 4728 |
+ "AutoLockManagers": false |
|
| 4729 |
+ }, |
|
| 4727 | 4730 |
"Name" : "default" |
| 4728 | 4731 |
}, |
| 4729 |
- "JoinTokens" : {
|
|
| 4732 |
+ "JoinTokens" : {
|
|
| 4730 | 4733 |
"Worker" : "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-6qmn92w6bu3jdvnglku58u11a", |
| 4731 | 4734 |
"Manager" : "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-8llk83c4wm9lwioey2s316r9l" |
| 4732 |
- }, |
|
| 4733 |
- "ID" : "70ilmkj2f6sp2137c753w2nmt", |
|
| 4734 |
- "UpdatedAt" : "2016-08-15T16:32:09.623207604Z", |
|
| 4735 |
- "Version" : {
|
|
| 4736 |
- "Index" : 51 |
|
| 4735 |
+ }, |
|
| 4736 |
+ "ID" : "70ilmkj2f6sp2137c753w2nmt", |
|
| 4737 |
+ "UpdatedAt" : "2016-08-15T16:32:09.623207604Z", |
|
| 4738 |
+ "Version" : {
|
|
| 4739 |
+ "Index" : 51 |
|
| 4740 |
+ } |
|
| 4737 | 4741 |
} |
| 4738 |
- } |
|
| 4739 | 4742 |
|
| 4740 | 4743 |
**Status codes**: |
| 4741 | 4744 |
|
| ... | ... |
@@ -4761,7 +4764,10 @@ Initialize a new swarm. The body of the HTTP response includes the node ID. |
| 4761 | 4761 |
"Orchestration": {},
|
| 4762 | 4762 |
"Raft": {},
|
| 4763 | 4763 |
"Dispatcher": {},
|
| 4764 |
- "CAConfig": {}
|
|
| 4764 |
+ "CAConfig": {},
|
|
| 4765 |
+ "EncryptionConfig" : {
|
|
| 4766 |
+ "AutoLockManagers": false |
|
| 4767 |
+ } |
|
| 4765 | 4768 |
} |
| 4766 | 4769 |
} |
| 4767 | 4770 |
|
| ... | ... |
@@ -4816,6 +4822,9 @@ JSON Parameters: |
| 4816 | 4816 |
- **URL** - URL where certificate signing requests should be sent. |
| 4817 | 4817 |
- **Options** - An object with key/value pairs that are interpreted |
| 4818 | 4818 |
as protocol-specific options for the external CA driver. |
| 4819 |
+ - **EncryptionConfig** – Parameters related to encryption-at-rest. |
|
| 4820 |
+ - **AutoLockManagers**: If set, generate a key and use it to lock data stored on the |
|
| 4821 |
+ managers. |
|
| 4819 | 4822 |
|
| 4820 | 4823 |
### Join an existing swarm |
| 4821 | 4824 |
|
| ... | ... |
@@ -4885,6 +4894,44 @@ Leave a swarm |
| 4885 | 4885 |
- **200** – no error |
| 4886 | 4886 |
- **406** – node is not part of a swarm |
| 4887 | 4887 |
|
| 4888 |
+### Retrieve the swarm's unlock key |
|
| 4889 |
+ |
|
| 4890 |
+`GET /swarm/unlockkey` |
|
| 4891 |
+ |
|
| 4892 |
+Get unlock key |
|
| 4893 |
+ |
|
| 4894 |
+**Example response**: |
|
| 4895 |
+ |
|
| 4896 |
+ HTTP/1.1 200 OK |
|
| 4897 |
+ Content-Type: application/json |
|
| 4898 |
+ |
|
| 4899 |
+ {
|
|
| 4900 |
+ "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" |
|
| 4901 |
+ } |
|
| 4902 |
+ |
|
| 4903 |
+**Status codes**: |
|
| 4904 |
+ |
|
| 4905 |
+- **200** - no error |
|
| 4906 |
+ |
|
| 4907 |
+### Unlock a locked manager |
|
| 4908 |
+ |
|
| 4909 |
+`POST /swarm/unlock` |
|
| 4910 |
+ |
|
| 4911 |
+Unlock a manager |
|
| 4912 |
+ |
|
| 4913 |
+**Example request**: |
|
| 4914 |
+ |
|
| 4915 |
+ POST /v1.25/swarm/unlock HTTP/1.1 |
|
| 4916 |
+ Content-Type: application/json |
|
| 4917 |
+ |
|
| 4918 |
+ {
|
|
| 4919 |
+ "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" |
|
| 4920 |
+ } |
|
| 4921 |
+ |
|
| 4922 |
+**Status codes**: |
|
| 4923 |
+ |
|
| 4924 |
+- **200** - no error |
|
| 4925 |
+ |
|
| 4888 | 4926 |
### Update a swarm |
| 4889 | 4927 |
|
| 4890 | 4928 |
|
| ... | ... |
@@ -4916,6 +4963,9 @@ Update a swarm |
| 4916 | 4916 |
"JoinTokens": {
|
| 4917 | 4917 |
"Worker": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx", |
| 4918 | 4918 |
"Manager": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" |
| 4919 |
+ }, |
|
| 4920 |
+ "EncryptionConfig": {
|
|
| 4921 |
+ "AutoLockManagers": false |
|
| 4919 | 4922 |
} |
| 4920 | 4923 |
} |
| 4921 | 4924 |
|
| ... | ... |
@@ -4932,6 +4982,7 @@ Update a swarm |
| 4932 | 4932 |
required to avoid conflicting writes. |
| 4933 | 4933 |
- **rotateWorkerToken** - Set to `true` (or `1`) to rotate the worker join token. |
| 4934 | 4934 |
- **rotateManagerToken** - Set to `true` (or `1`) to rotate the manager join token. |
| 4935 |
+- **rotateManagerUnlockKey** - Set to `true` (or `1`) to rotate the manager unlock key. |
|
| 4935 | 4936 |
|
| 4936 | 4937 |
**Status codes**: |
| 4937 | 4938 |
|
| ... | ... |
@@ -4965,6 +5016,9 @@ JSON Parameters: |
| 4965 | 4965 |
- **JoinTokens** - Tokens that can be used by other nodes to join the swarm. |
| 4966 | 4966 |
- **Worker** - Token to use for joining as a worker. |
| 4967 | 4967 |
- **Manager** - Token to use for joining as a manager. |
| 4968 |
+- **EncryptionConfig** – Parameters related to encryption-at-rest. |
|
| 4969 |
+ - **AutoLockManagers**: If set, generate a key and use it to lock data stored on the |
|
| 4970 |
+ managers. |
|
| 4968 | 4971 |
|
| 4969 | 4972 |
## 3.9 Services |
| 4970 | 4973 |
|
| ... | ... |
@@ -22,6 +22,7 @@ Initialize a swarm |
| 22 | 22 |
|
| 23 | 23 |
Options: |
| 24 | 24 |
--advertise-addr value Advertised address (format: <ip|interface>[:port]) |
| 25 |
+ --autolock Enable or disable manager autolocking (requiring an unlock key to start a stopped manager) |
|
| 25 | 26 |
--cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s) |
| 26 | 27 |
--dispatcher-heartbeat duration Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s) |
| 27 | 28 |
--external-ca value Specifications of one or more certificate signing endpoints |
| ... | ... |
@@ -57,6 +58,18 @@ to [swarm join](swarm_join.md). |
| 57 | 57 |
After you create the swarm, you can display or rotate the token using |
| 58 | 58 |
[swarm join-token](swarm_join_token.md). |
| 59 | 59 |
|
| 60 |
+### `--autolock` |
|
| 61 |
+ |
|
| 62 |
+This flag enables automatic locking of managers with an encryption key. The |
|
| 63 |
+private keys and data stored by all managers will be protected by the |
|
| 64 |
+encryption key printed in the output, and will not be accessible without it. |
|
| 65 |
+Thus, it is very important to store this key in order to activate a manager |
|
| 66 |
+after it restarts. The key can be passed to `docker swarm unlock` to reactivate |
|
| 67 |
+the manager. Autolock can be disabled by running |
|
| 68 |
+`docker swarm update --autolock=false`. After disabling it, the encryption key |
|
| 69 |
+is no longer required to start the manager, and it will start up on its own |
|
| 70 |
+without user intervention. |
|
| 71 |
+ |
|
| 60 | 72 |
### `--cert-expiry` |
| 61 | 73 |
|
| 62 | 74 |
This flag sets the validity period for node certificates. |
| 63 | 75 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,41 @@ |
| 0 |
+--- |
|
| 1 |
+title: "swarm unlock" |
|
| 2 |
+description: "The swarm unlock command description and usage" |
|
| 3 |
+keywords: "swarm, unlock" |
|
| 4 |
+--- |
|
| 5 |
+ |
|
| 6 |
+<!-- This file is maintained within the docker/docker Github |
|
| 7 |
+ repository at https://github.com/docker/docker/. Make all |
|
| 8 |
+ pull requests against that repo. If you see this file in |
|
| 9 |
+ another repository, consider it read-only there, as it will |
|
| 10 |
+ periodically be overwritten by the definitive file. Pull |
|
| 11 |
+ requests which include edits to this file in other repositories |
|
| 12 |
+ will be rejected. |
|
| 13 |
+--> |
|
| 14 |
+ |
|
| 15 |
+# swarm unlock |
|
| 16 |
+ |
|
| 17 |
+```markdown |
|
| 18 |
+Usage: docker swarm unlock |
|
| 19 |
+ |
|
| 20 |
+Unlock swarm |
|
| 21 |
+ |
|
| 22 |
+Options: |
|
| 23 |
+ --help Print usage |
|
| 24 |
+``` |
|
| 25 |
+ |
|
| 26 |
+Unlocks a locked manager using a user-supplied unlock key. This command must be |
|
| 27 |
+used to reactivate a manager after its Docker daemon restarts if the autolock |
|
| 28 |
+setting is turned on. The unlock key is printed at the time when autolock is |
|
| 29 |
+enabled, and is also available from the `docker swarm unlock-key` command. |
|
| 30 |
+ |
|
| 31 |
+ |
|
| 32 |
+```bash |
|
| 33 |
+$ docker swarm unlock |
|
| 34 |
+Please enter unlock key: |
|
| 35 |
+``` |
|
| 36 |
+ |
|
| 37 |
+## Related information |
|
| 38 |
+ |
|
| 39 |
+* [swarm init](swarm_init.md) |
|
| 40 |
+* [swarm update](swarm_update.md) |
| 0 | 41 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,84 @@ |
| 0 |
+--- |
|
| 1 |
+title: "swarm unlock-key" |
|
| 2 |
+description: "The swarm unlock-keycommand description and usage" |
|
| 3 |
+keywords: "swarm, unlock-key" |
|
| 4 |
+--- |
|
| 5 |
+ |
|
| 6 |
+<!-- This file is maintained within the docker/docker Github |
|
| 7 |
+ repository at https://github.com/docker/docker/. Make all |
|
| 8 |
+ pull requests against that repo. If you see this file in |
|
| 9 |
+ another repository, consider it read-only there, as it will |
|
| 10 |
+ periodically be overwritten by the definitive file. Pull |
|
| 11 |
+ requests which include edits to this file in other repositories |
|
| 12 |
+ will be rejected. |
|
| 13 |
+--> |
|
| 14 |
+ |
|
| 15 |
+# swarm unlock-key |
|
| 16 |
+ |
|
| 17 |
+```markdown |
|
| 18 |
+Usage: docker swarm unlock-key [OPTIONS] |
|
| 19 |
+ |
|
| 20 |
+Manage the unlock key |
|
| 21 |
+ |
|
| 22 |
+Options: |
|
| 23 |
+ --help Print usage |
|
| 24 |
+ -q, --quiet Only display token |
|
| 25 |
+ --rotate Rotate unlock key |
|
| 26 |
+``` |
|
| 27 |
+ |
|
| 28 |
+An unlock key is a secret key needed to unlock a manager after its Docker daemon |
|
| 29 |
+restarts. These keys are only used when the autolock feature is enabled for the |
|
| 30 |
+swarm. |
|
| 31 |
+ |
|
| 32 |
+You can view or rotate the unlock key using `swarm unlock-key`. To view the key, |
|
| 33 |
+run the `docker swarm unlock-key` command without any arguments: |
|
| 34 |
+ |
|
| 35 |
+ |
|
| 36 |
+```bash |
|
| 37 |
+$ docker swarm unlock-key |
|
| 38 |
+To unlock a swarm manager after it restarts, run the `docker swarm unlock` |
|
| 39 |
+command and provide the following key: |
|
| 40 |
+ |
|
| 41 |
+ SWMKEY-1-fySn8TY4w5lKcWcJPIpKufejh9hxx5KYwx6XZigx3Q4 |
|
| 42 |
+ |
|
| 43 |
+Please remember to store this key in a password manager, since without it you |
|
| 44 |
+will not be able to restart the manager. |
|
| 45 |
+``` |
|
| 46 |
+ |
|
| 47 |
+Use the `--rotate` flag to rotate the unlock key to a new, randomly-generated |
|
| 48 |
+key: |
|
| 49 |
+ |
|
| 50 |
+```bash |
|
| 51 |
+$ docker swarm unlock-key --rotate |
|
| 52 |
+Successfully rotated manager unlock key. |
|
| 53 |
+ |
|
| 54 |
+To unlock a swarm manager after it restarts, run the `docker swarm unlock` |
|
| 55 |
+command and provide the following key: |
|
| 56 |
+ |
|
| 57 |
+ SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8 |
|
| 58 |
+ |
|
| 59 |
+Please remember to store this key in a password manager, since without it you |
|
| 60 |
+will not be able to restart the manager. |
|
| 61 |
+``` |
|
| 62 |
+ |
|
| 63 |
+The `-q` (or `--quiet`) flag only prints the key: |
|
| 64 |
+ |
|
| 65 |
+```bash |
|
| 66 |
+$ docker swarm unlock-key -q |
|
| 67 |
+SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8 |
|
| 68 |
+``` |
|
| 69 |
+ |
|
| 70 |
+### `--rotate` |
|
| 71 |
+ |
|
| 72 |
+This flag rotates the unlock key, replacing it with a new randomly-generated |
|
| 73 |
+key. The old unlock key will no longer be accepted. |
|
| 74 |
+ |
|
| 75 |
+### `--quiet` |
|
| 76 |
+ |
|
| 77 |
+Only print the unlock key, without instructions. |
|
| 78 |
+ |
|
| 79 |
+## Related information |
|
| 80 |
+ |
|
| 81 |
+* [swarm unlock](swarm_unlock.md) |
|
| 82 |
+* [swarm init](swarm_init.md) |
|
| 83 |
+* [swarm update](swarm_update.md) |
| ... | ... |
@@ -21,6 +21,7 @@ Usage: docker swarm update [OPTIONS] |
| 21 | 21 |
Update the swarm |
| 22 | 22 |
|
| 23 | 23 |
Options: |
| 24 |
+ --autolock Enable or disable manager autolocking (requiring an unlock key to start a stopped manager) |
|
| 24 | 25 |
--cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s) |
| 25 | 26 |
--dispatcher-heartbeat duration Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s) |
| 26 | 27 |
--external-ca value Specifications of one or more certificate signing endpoints |