distribution/registry
Stephen J Day 58d239d723
registry/{storage,handlers}: limit content sizes
Under certain circumstances, the use of `StorageDriver.GetContent` can
result in unbounded memory allocations. In particualr, this happens when
accessing a layer through the manifests endpoint.

This problem is mitigated by setting a 4MB limit when using to access
content that may have been accepted from a user. In practice, this means
setting the limit with the use of `BlobProvider.Get` by wrapping
`StorageDriver.GetContent` in a helper that uses `StorageDriver.Reader`
with a `limitReader` that returns an error.

When mitigating this security issue, we also noticed that the size of
manifests uploaded to the registry is also unlimited. We apply similar
logic to the request body of payloads that are full buffered.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 55ea440428)
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-20 13:39:13 -07:00
..
api Merge pull request #1774 from RichardScothern/catalog-clarifcation 2016-06-08 12:59:09 -07:00
auth Update to fix lint errors 2016-11-11 11:58:28 -08:00
client Merge pull request #1775 from dmcgowan/get-content-digest 2016-06-13 14:59:05 -07:00
handlers registry/{storage,handlers}: limit content sizes 2017-07-20 13:39:13 -07:00
listener [Server] Listen and serve on a unix socket 2015-05-11 16:00:14 +03:00
middleware Add support for blobAccessController middleware 2016-05-19 14:02:15 +02:00
proxy Satisfy the latest go lint rules 2016-11-14 13:48:06 -08:00
storage registry/{storage,handlers}: limit content sizes 2017-07-20 13:39:13 -07:00
doc.go Move initialization code from main.go to the registry package 2015-09-09 14:39:31 -07:00
registry.go Add support for Let's Encrypt 2016-06-13 11:30:42 -07:00
root.go Remove signature store from registry. Return a generated signature for manifest 2016-05-27 13:19:26 -07:00