distribution/registry
Stephen J Day 29fa466deb
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:37:43 -07:00
..
api Remove support for X-Forwarded-Port 2017-03-20 17:02:58 -07:00
auth Update registry server to support repository class 2016-12-20 15:42:12 -08:00
client Add class to repository scope 2016-12-20 15:42:11 -08:00
handlers registry/{storage,handlers}: limit content sizes 2017-07-20 13:37:43 -07:00
listener
middleware Add support for blobAccessController middleware 2016-05-19 14:02:15 +02:00
proxy Refactor authorization challenges to its own package 2016-11-09 15:27:40 -08:00
storage registry/{storage,handlers}: limit content sizes 2017-07-20 13:37:43 -07:00
doc.go
registry.go Add configuration option to disable access logging 2016-09-14 14:33:30 -07:00
registry_test.go Allow registry clients to connect via http2 2016-08-13 22:07:42 -04:00
root.go Remove signature store from registry. Return a generated signature for manifest 2016-05-27 13:19:26 -07:00