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 drain: refactor batch_future into its own file 2018-04-02 16:40:06 -07:00
batch_future_test.go drain: refactor batch_future into its own file 2018-04-02 16:40:06 -07:00
bitmap.go assign names 2017-07-07 12:03:11 -07:00
bitmap_test.go assign names 2017-07-07 12:03:11 -07:00
devices.go Initial implementation of device preemption 2018-11-15 11:09:26 -06:00
devices_test.go Split device accounter and allocator 2018-11-07 10:32:03 -08:00
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 allocs fit checks if devices get oversubscribed 2018-11-07 10:33:22 -08:00
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 Fix copying drivers 2018-04-16 15:45:51 -07:00
node_class.go Device hook and devices affect computed node class 2018-11-27 17:25:33 -08:00
node_class_test.go Device hook and devices affect computed node class 2018-11-27 17:25:33 -08:00
node_test.go fix issue when updating node events 2018-03-21 15:15:26 -04:00
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 spelling: requested 2018-03-11 18:43:21 +00:00
structs.go Merge pull request #6922 from hashicorp/b-alloc-canoncalize 2020-01-28 15:12:41 -05:00
structs_codegen.go Codecgen full package 2018-04-26 15:24:53 -07:00
structs_test.go Migrate old alloc structs on read 2020-01-09 08:46:50 -05:00
testing.go Split device accounter and allocator 2018-11-07 10:32:03 -08:00
volumes.go volumes: Add support for mount propagation 2019-10-14 14:09:58 +02:00