Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ca] Limit the size of the response back from the external CA #2300

Merged
merged 1 commit into from Jul 7, 2017

Conversation

cyli
Copy link
Contributor

@cyli cyli commented Jul 7, 2017

Clean up some of the external CA signing code.

@aaronlehmann
Copy link
Collaborator

LGTM

Is there a similar issue when a new node downloads the root certificate over gRPC without any authentication?

@codecov
Copy link

codecov bot commented Jul 7, 2017

Codecov Report

Merging #2300 into master will decrease coverage by 0.08%.
The diff coverage is 100%.

@@            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

@cyli
Copy link
Contributor Author

cyli commented Jul 7, 2017

@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.

@aaronlehmann
Copy link
Collaborator

Ok, I think this is ready to merge, but let me ping @riyazdf for an extra review.

Copy link

@riyazdf riyazdf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small style nits but LGTM!

ca/external.go Outdated
@@ -13,6 +13,8 @@ import (
"sync"
"time"

"io"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: this is odd in its own block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on size. Wondering if 256 << 10 is more readable but this is fine as-is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, much more readable.

@cyli cyli force-pushed the limit-CFSSL-response-size branch from 4baff73 to 693c9da Compare July 7, 2017 20:57
@aaronlehmann
Copy link
Collaborator

I think a rebase will fix the CI problem.

Signed-off-by: Ying Li <ying.li@docker.com>
@cyli cyli force-pushed the limit-CFSSL-response-size branch from 693c9da to 4f02b92 Compare July 7, 2017 22:21
@aaronlehmann aaronlehmann merged commit fd73175 into moby:master Jul 7, 2017
@cyli cyli deleted the limit-CFSSL-response-size branch July 7, 2017 23:24
andrewhsu pushed a commit to docker/docker-ce that referenced this pull request Jul 14, 2017
- 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
silvin-lubecki pushed a commit to silvin-lubecki/docker-ce that referenced this pull request Feb 3, 2020
- 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>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Feb 3, 2020
- 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>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Mar 10, 2020
- 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>
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Mar 16, 2020
- 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
silvin-lubecki pushed a commit to silvin-lubecki/engine-extract that referenced this pull request Mar 23, 2020
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants