[ca] Limit the size of the response back from the external CA#2300
[ca] Limit the size of the response back from the external CA#2300aaronlehmann merged 1 commit intomoby:masterfrom
Conversation
|
LGTM Is there a similar issue when a new node downloads the root certificate over gRPC without any authentication? |
Codecov Report
@@ Coverage Diff @@
## master #2300 +/- ##
=========================================
- Coverage 61.08% 61% -0.09%
=========================================
Files 128 128
Lines 20549 20550 +1
=========================================
- Hits 12553 12536 -17
- Misses 6615 6643 +28
+ Partials 1381 1371 -10 |
|
@aaronlehmann It looks like GRPC by default limits the maximum message size to 4MB?
If I'm understanding this correctly, that should limit the response size to 4MB. |
|
Ok, I think this is ready to merge, but let me ping @riyazdf for an extra review. |
ca/external.go
Outdated
| "sync" | ||
| "time" | ||
|
|
||
| "io" |
There was a problem hiding this comment.
super nit: this is odd in its own block
There was a problem hiding this comment.
Ah yeah, goimport doesn't always put stuff with other blocks. Thanks!
ca/external.go
Outdated
| // While there is no upper limit on the length of certificate chains, long chains are impractical. | ||
| // To be conservative, and to also account for external CA certificate responses in JSON format | ||
| // from CFSSL, we'll set the max to be 256KiB. | ||
| CertificateMaxSize int64 = 1 << 18 |
There was a problem hiding this comment.
👍 on size. Wondering if 256 << 10 is more readable but this is fine as-is
There was a problem hiding this comment.
Agree, much more readable.
4baff73 to
693c9da
Compare
|
I think a rebase will fix the CI problem. |
Signed-off-by: Ying Li <ying.li@docker.com>
693c9da to
4f02b92
Compare
- moby/swarmkit#2266 (support for templating Node.Hostname in docker executor) - moby/swarmkit#2281 (change restore action on objects to be update, not delete/create) - moby/swarmkit#2285 (extend watch queue with timeout and size limit) - moby/swarmkit#2253 (version-aware failure tracking in the scheduler) - moby/swarmkit#2275 (update containerd and port executor to container client library) - moby/swarmkit#2292 (rename some generic resources) - moby/swarmkit#2300 (limit the size of the external CA response) - moby/swarmkit#2301 (delete global tasks when the node running them is deleted) Minor cleanups, dependency bumps, and vendoring: - moby/swarmkit#2271 - moby/swarmkit#2279 - moby/swarmkit#2283 - moby/swarmkit#2282 - moby/swarmkit#2274 - moby/swarmkit#2296 (dependency bump of etcd, go-winio) Signed-off-by: Ying Li <ying.li@docker.com> Upstream-commit: 4509a00 Component: engine
- moby/swarmkit#2281 - fixes an issue where some cluster updates could be missed if a manager receives a catch-up snapshot from another manager - moby/swarmkit#2300 - fixes a possible memory issue if an external CA sends an overlarge response Signed-off-by: Ying <ying.li@docker.com>
- moby/swarmkit#2281 - fixes an issue where some cluster updates could be missed if a manager receives a catch-up snapshot from another manager - moby/swarmkit#2300 - fixes a possible memory issue if an external CA sends an overlarge response Signed-off-by: Ying <ying.li@docker.com>
- moby/swarmkit#2281 - fixes an issue where some cluster updates could be missed if a manager receives a catch-up snapshot from another manager - moby/swarmkit#2300 - fixes a possible memory issue if an external CA sends an overlarge response Signed-off-by: Ying <ying.li@docker.com>
- moby/swarmkit#2266 (support for templating Node.Hostname in docker executor) - moby/swarmkit#2281 (change restore action on objects to be update, not delete/create) - moby/swarmkit#2285 (extend watch queue with timeout and size limit) - moby/swarmkit#2253 (version-aware failure tracking in the scheduler) - moby/swarmkit#2275 (update containerd and port executor to container client library) - moby/swarmkit#2292 (rename some generic resources) - moby/swarmkit#2300 (limit the size of the external CA response) - moby/swarmkit#2301 (delete global tasks when the node running them is deleted) Minor cleanups, dependency bumps, and vendoring: - moby/swarmkit#2271 - moby/swarmkit#2279 - moby/swarmkit#2283 - moby/swarmkit#2282 - moby/swarmkit#2274 - moby/swarmkit#2296 (dependency bump of etcd, go-winio) Signed-off-by: Ying Li <ying.li@docker.com> Upstream-commit: 4509a00 Component: engine
- moby/swarmkit#2281 - fixes an issue where some cluster updates could be missed if a manager receives a catch-up snapshot from another manager - moby/swarmkit#2300 - fixes a possible memory issue if an external CA sends an overlarge response Signed-off-by: Ying <ying.li@docker.com>
Clean up some of the external CA signing code.