open-nomad/nomad/structs
Michael Schurter c82b14b0c4 core: add limits to unauthorized connections
Introduce limits to prevent unauthorized users from exhausting all
ephemeral ports on agents:

 * `{https,rpc}_handshake_timeout`
 * `{http,rpc}_max_conns_per_client`

The handshake timeout closes connections that have not completed the TLS
handshake by the deadline (5s by default). For RPC connections this
timeout also separately applies to first byte being read so RPC
connections with TLS enabled have `rpc_handshake_time * 2` as their
deadline.

The connection limit per client prevents a single remote TCP peer from
exhausting all ephemeral ports. The default is 100, but can be lowered
to a minimum of 26. Since streaming RPC connections create a new TCP
connection (until MultiplexV2 is used), 20 connections are reserved for
Raft and non-streaming RPCs to prevent connection exhaustion due to
streaming RPCs.

All limits are configurable and may be disabled by setting them to `0`.

This also includes a fix that closes connections that attempt to create
TLS RPC connections recursively. While only users with valid mTLS
certificates could perform such an operation, it was added as a
safeguard to prevent programming errors before they could cause resource
exhaustion.
2020-01-30 10:38:25 -08:00
..
config core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
batch_future.go
batch_future_test.go
bitmap.go
bitmap_test.go
devices.go
devices_test.go
diff.go structs: add taskgroup networks and services to plan diffs 2019-08-20 16:18:30 -04:00
diff_test.go client/connect: ConsulProxy LocalServicePort/Address (#6358) 2019-09-23 14:30:48 -04:00
errors.go adds qc param, address pr feedback 2020-01-09 15:15:11 -05:00
errors_test.go api: acl bootstrap errors aren't 500 2019-11-19 15:51:57 -05:00
funcs.go
funcs_test.go fix tests from introducing new struct fields 2019-07-31 01:03:16 -04:00
generate.sh dev: avoid codecgen code in downstream projects 2019-09-06 09:22:00 -04:00
network.go cli: display group ports and address in alloc status command output (#6189) 2019-08-27 23:59:36 -04:00
network_test.go cli: display group ports and address in alloc status command output (#6189) 2019-08-27 23:59:36 -04:00
node.go
node_class.go
node_class_test.go
node_test.go
operator.go Support customizing full scheduler config 2020-01-28 14:51:42 -05:00
services.go consul: add support for canary meta 2020-01-27 09:53:30 -05:00
services_test.go connect: enable setting tags on consul connect sidecar service in jobspec (#6415) 2019-10-17 19:25:20 +00:00
streaming_rpc.go
structs.go Merge pull request #6922 from hashicorp/b-alloc-canoncalize 2020-01-28 15:12:41 -05:00
structs_codegen.go
structs_test.go Migrate old alloc structs on read 2020-01-09 08:46:50 -05:00
testing.go
volumes.go volumes: Add support for mount propagation 2019-10-14 14:09:58 +02:00