Commit graph

3314 commits

Author SHA1 Message Date
Odin Ugedal
9c94e8260a
Fix phrasing when referring to the freezer cgroup
Signed-off-by: Odin Ugedal <odin@ugedal.com>
2019-08-16 20:39:30 +02:00
SataQiu
f6226a2a56 fix some spelling mistakes
Signed-off-by: SataQiu <qiushida@beyondcent.com>
2019-08-13 22:57:55 +08:00
Sebastiaan van Stijn
e4b9edd31f
Merge pull request from GHSA-99qr-h2rp-65rc
DebugRequestMiddleware: unconditionally scrub data field
2019-07-17 17:19:48 +02:00
Jérémy Leherpeur
cf315bedc5
Fix indentation in some description
Fix the indentation to allow jane-openapi generate to work

Signed-off-by: Jeremy Leherpeur <jeremy.leherpeur@yousign.fr>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-14 13:42:29 +02:00
skanehira
3afdc46314 fix swagger.yaml #39484
Signed-off-by: skanehira <sho19921005@gmail.com>
2019-07-11 09:33:32 +09:00
Sebastiaan van Stijn
f8a0f26843 DebugRequestMiddleware: Remove path handling
Path-specific rules were removed, so this is no longer used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 530e63c1a61b105a6f7fc143c5acb9b5cd87f958)
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-07-09 21:42:12 +00:00
Sebastiaan van Stijn
73db8c77bf DebugRequestMiddleware: unconditionally scrub data field
Commit 77b8465d7e added a secret update
endpoint to allow updating labels on existing secrets. However, when
implementing the endpoint, the DebugRequestMiddleware was not updated
to scrub the Data field (as is being done when creating a secret).

When updating a secret (to set labels), the Data field should be either
`nil` (not set), or contain the same value as the existing secret. In
situations where the Data field is set, and the `dockerd` daemon is
running with debugging enabled / log-level debug, the base64-encoded
value of the secret is printed to the daemon logs.

The docker cli does not have a `docker secret update` command, but
when using `docker stack deploy`, the docker cli sends the secret
data both when _creating_ a stack, and when _updating_ a stack, thus
leaking the secret data if the daemon runs with debug enabled:

1. Start the daemon in debug-mode

        dockerd --debug

2. Initialize swarm

        docker swarm init

3. Create a file containing a secret

        echo secret > my_secret.txt

4. Create a docker-compose file using that secret

        cat > docker-compose.yml <<'EOF'
        version: "3.3"
        services:
          web:
            image: nginx:alpine
            secrets:
              - my_secret
        secrets:
          my_secret:
            file: ./my_secret.txt
        EOF

5. Deploy the stack

        docker stack deploy -c docker-compose.yml test

6. Verify that the secret is scrubbed in the daemon logs

        DEBU[2019-07-01T22:36:08.170617400Z] Calling POST /v1.30/secrets/create
        DEBU[2019-07-01T22:36:08.171364900Z] form data: {"Data":"*****","Labels":{"com.docker.stack.namespace":"test"},"Name":"test_my_secret"}

7. Re-deploy the stack to trigger an "update"

        docker stack deploy -c docker-compose.yml test

8. Notice that this time, the Data field is not scrubbed, and the base64-encoded secret is logged

        DEBU[2019-07-01T22:37:35.828819400Z] Calling POST /v1.30/secrets/w3hgvwpzl8yooq5ctnyp71v52/update?version=34
        DEBU[2019-07-01T22:37:35.829993700Z] form data: {"Data":"c2VjcmV0Cg==","Labels":{"com.docker.stack.namespace":"test"},"Name":"test_my_secret"}

This patch modifies `maskSecretKeys` to unconditionally scrub `Data` fields.
Currently, only the `secrets` and `configs` endpoints use a field with this
name, and no other POST API endpoints use a data field, so scrubbing this
field unconditionally will only scrub requests for those endpoints.

If a new endpoint is added in future where this field should not be scrubbed,
we can re-introduce more fine-grained (path-specific) handling.

This patch introduces some change in behavior:

- In addition to secrets, requests to create or update _configs_ will
  now have their `Data` field scrubbed. Generally, the actual data should
  not be interesting for debugging, so likely will not be problematic.
  In addition, scrubbing this data for configs may actually be desirable,
  because (even though they are not explicitely designed for this purpose)
  configs may contain sensitive data (credentials inside a configuration
  file, e.g.).
- Requests that send key/value pairs as a "map" and that contain a
  key named "data", will see the value of that field scrubbed. This
  means that (e.g.) setting a `label` named `data` on a config, will
  scrub/mask the value of that label.
- Note that this is already the case for any label named `jointoken`,
  `password`, `secret`, `signingcakey`, or `unlockkey`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c7ce4be93ae8edd2da62a588e01c67313a4aba0c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-07-09 21:42:12 +00:00
Sebastiaan van Stijn
ebb542b3f8 TestMaskSecretKeys: use subtests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 32d70c7e21631224674cd60021d3ec908c2d888c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-07-09 21:42:12 +00:00
Sebastiaan van Stijn
18dac2cf32 TestMaskSecretKeys: add more test-cases
Add tests for

- case-insensitive matching of fields
- recursive masking

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit db5f811216e70bcb4a10e477c1558d6c68f618c5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-07-09 21:42:12 +00:00
Michael Crosby
fb459f6671
Merge pull request #38441 from sirlatrom/swarm_plugin_env
Allow specifying environment variables when installing an engine plugin as a Swarm service
2019-07-08 15:26:55 -04:00
Brian Goff
6ddd43b589 Make ErrorResponse implement Error
This allows an ErrorResponse to be used directly as an error type.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2019-07-02 10:17:03 -07:00
Sebastiaan van Stijn
28678f2226
Merge pull request #38349 from wk8/wk8/os_version
Adding OS version info to nodes' `Info` struct and to the system info's API
2019-06-07 14:54:51 +02:00
Sebastiaan van Stijn
c85fe2d224
Merge pull request #38522 from cpuguy83/fix_timers
Make sure timers are stopped after use.
2019-06-07 13:16:46 +02:00
Jean Rouge
d363a1881e Adding OS version info to the nodes' Info struct
This is needed so that we can add OS version constraints in Swarmkit, which
does require the engine to report its host's OS version (see
https://github.com/docker/swarmkit/issues/2770).

The OS version is parsed from the `os-release` file on Linux, and from the
`ReleaseId` string value of the `SOFTWARE\Microsoft\Windows NT\CurrentVersion`
registry key on Windows.

Added unit tests when possible, as well as Prometheus metrics.

Signed-off-by: Jean Rouge <rougej+github@gmail.com>
2019-06-06 22:40:10 +00:00
Kirill Kolyshkin
1d5748d975
Merge pull request #39173 from olljanat/25885-capabilities-swarm
Add support for capabilities options in services
2019-06-06 15:03:46 -07:00
Sebastiaan van Stijn
71e00574c7
Merge pull request #39279 from ZYecho/fix-swagger-copy
fix: fix lack of copyUIDGID in swagger.yaml
2019-06-05 13:13:59 +02:00
zhangyue
a4f828cb89 fix: fix lack of copyUIDGID in swagger.yaml
Signed-off-by: Zhang Yue <zy675793960@yeah.net>
Signed-off-by: zhangyue <zy675793960@yeah.net>
2019-06-05 09:58:04 +08:00
Tibor Vass
6104eb1ae2 build: fix panic when exporting to tar
Fixes a panic on `docker build -t foo -o - . >/dev/null`

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-06-03 22:34:15 +00:00
Sebastiaan van Stijn
3d21b86e0a
Merge pull request #39299 from AkihiroSuda/ro-none-cgroupdriver
info: report cgroup driver as "none" when running rootless
2019-06-03 22:46:08 +02:00
Akihiro Suda
ca5aab19b4 rootless: update docker info docs
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-06-03 19:41:50 +09:00
Yong Tang
784bd2c883
Merge pull request #39248 from dontub/fix-api-operation-PutContainerArchive
API: Set format of body parameter in operation PutContainerArchive to "binary"
2019-06-02 12:56:15 -07:00
Olli Janatuinen
f787b235de Add support capabilities list on services
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-05-28 19:52:36 +03:00
Sebastiaan van Stijn
752d78017a
Merge pull request #39264 from dontub/fix-api-type-PortMap
API: Move "x-nullable: true" from type PortBinding to type PortMap
2019-05-25 21:56:05 +02:00
Sebastiaan van Stijn
54872a8024
Merge pull request #39265 from ad-m/patch-1
Update docs to remove restriction of tty resize
2019-05-25 21:54:45 +02:00
Adam Dobrawy
4898f493d8 Update docs to remove restriction of tty resize
Signed-off-by: Adam Dobrawy <naczelnik@jawnosc.tk>
2019-05-23 19:16:59 +02:00
Dominic Tubach
32b5d296ea API: Move "x-nullable: true" from type PortBinding to type PortMap
Currently the API spec would allow `"443/tcp": [null]`, but what should
be allowed is `"443/tcp": null`
Signed-off-by: Dominic Tubach <dominic.tubach@to.com>
2019-05-23 16:03:48 +02:00
Dominic Tubach
d5f6bdb027 API: Change type of RemotrAddrs to array of strings in operation SwarmJoin
Signed-off-by: Dominic Tubach <dominic.tubach@to.com>
2019-05-23 15:14:34 +02:00
Dominic Tubach
fa6f63e79b API: Set format of body parameter in operation PutContainerArchive to "binary"
Signed-off-by: Dominic Tubach <dominic.tubach@to.com>
2019-05-21 17:09:18 +02:00
Sebastiaan van Stijn
7bacd1d6dc
Move CgroupnsMode feature to API v1.41
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-13 15:04:28 -07:00
Sebastiaan van Stijn
771fc7e7f8
Bump API version to v1.41
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-13 14:55:20 -07:00
Yong Tang
3042254a87
Merge pull request #38377 from rgulewich/38332-cgroup-ns
Start containers in their own cgroup namespaces
2019-05-11 20:18:31 -07:00
Rob Gulewich
072400fc4b Make cgroup namespaces configurable
This adds both a daemon-wide flag and a container creation property:
- Set the `CgroupnsMode: "host|private"` HostConfig property at
  container creation time to control what cgroup namespace the container
  is created in
- Set the `--default-cgroupns-mode=host|private` daemon flag to control
  what cgroup namespace containers are created in by default
- Set the default if the daemon flag is unset to "host", for backward
  compatibility
- Default to CgroupnsMode: "host" for client versions < 1.40

Signed-off-by: Rob Gulewich <rgulewich@netflix.com>
2019-05-07 10:22:16 -07:00
Yash Murty
a31a088665 Remove DiskQouta field.
Signed-off-by: Yash Murty <yashmurty@gmail.com>
2019-04-30 15:13:08 +07:00
Yong Tang
0c07dad66a
Merge pull request #39049 from thaJeztah/add_missing_import_aliases
Add "import" statement to generated API types
2019-04-28 10:45:59 -07:00
giovanism
65e68f6222 Update container name pattern in swagger.yaml
Signed-off-by: giovanism <giovanism@outlook.co.id>
2019-04-15 16:41:46 +07:00
Sebastiaan van Stijn
93886fcc5a
Add "import" statement to generated API types
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-10 14:07:55 +02:00
Sebastiaan van Stijn
2e1cfbca03
Merge pull request #39021 from imxyb/err-is-always-nil
Remove the "err == nil" because is always equal nil.
2019-04-09 02:48:36 +02:00
Sebastiaan van Stijn
c334a87aec
Remove deprecated filter functions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-08 15:46:45 +02:00
Xiao YongBiao
372b9f769e Remove the "err == nil" because is always equal nil.
Signed-off-by: Xiao YongBiao <xyb4638@gmail.com>
2019-04-08 12:28:43 +08:00
Sune Keller
fca5ee3bd5 Support environment vars in Swarm plugins services
Allow specifying environment variables when installing an engine plugin
as a Swarm service. Invalid environment variable entries (without an
equals (`=`) char) will be ignored.

Signed-off-by: Sune Keller <absukl@almbrand.dk>
2019-04-07 09:48:19 +02:00
Sebastiaan van Stijn
a2fdfaa830
Merge pull request #38819 from AkihiroSuda/fix-logs-docs
api: fix description about logs
2019-04-03 17:11:51 +02:00
Tibor Vass
05c5d20a2c grpc: register BuildKit controller to /grpc
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-04-02 19:57:59 +00:00
Tibor Vass
e8382ece65 api: add undocumented /grpc endpoint to talk to GRPC services
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-04-02 19:57:59 +00:00
Akihiro Suda
d2281bbfa3 api: fix description about logs
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-04-02 19:06:14 +09:00
Tõnis Tiigi
25661a3a04
Merge pull request #38793 from thaJeztah/pids_limit_improvements
Some refactoring on PidsLimit
2019-03-21 13:44:05 -07:00
Akihiro Suda
7fc0f820ea builder-next: fix squash
Tagger was not called for BuildKit-mode.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-03-21 01:08:55 +09:00
John Howard
a3eda72f71
Merge pull request #38541 from Microsoft/jjh/containerd
Windows: Experimental: ContainerD runtime
2019-03-19 21:09:19 -07:00
Sebastiaan van Stijn
e7b5f7dbe9
Merge pull request #38891 from thaJeztah/warn_manager_count
Return a warning when running in a two-manager setup
2019-03-19 22:54:53 +01:00
Tibor Vass
827cb09f87
Merge pull request #38898 from tonistiigi/build-outputs
builder-next: allow outputs configuration
2019-03-19 14:00:16 -07:00
Tonis Tiigi
768c6d7b29 builder-next: allow outputs configuration
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-19 10:28:30 -07:00