open-nomad/nomad/structs/config
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
..
autopilot.go config merge maintains *HCL string fields used for duration conversion 2019-06-11 16:34:04 -04:00
autopilot_test.go Refactor redundancy_zone/upgrade_version out of client meta 2018-01-29 20:03:38 -08:00
consul.go Fix error parsing config when setting consul.timeout. (#6907) 2020-01-07 13:40:55 -05:00
consul_test.go consul: use Consul's defaults and env vars 2019-08-27 14:56:52 -07:00
limits.go core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
limits_test.go core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
plugins.go tag HCL bookkeeping keys with json:"-" to keep them out of the api 2019-04-30 10:29:14 -04:00
plugins_test.go Plugin config parsing 2018-08-29 17:06:01 -07:00
README.md Create a nomad/structs/config to break an import cycle. 2016-06-10 15:48:36 -04:00
sentinel.go sync 2017-09-19 10:08:23 -05:00
tls.go tag HCL bookkeeping keys with json:"-" to keep them out of the api 2019-04-30 10:29:14 -04:00
tls_test.go add support for tls PreferServerCipherSuites 2018-05-25 13:20:00 -04:00
vault.go agent/config, config/* mapstructure tags -> hcl tags 2019-04-30 10:29:14 -04:00
vault_test.go fix for dynamically reloading vault 2018-06-07 15:34:18 -04:00

Overview

nomad/structs/config is a package for configuration structs that are shared among packages that needs the same struct definitions, but can't import each other without creating a cyle. This config package must be terminal in the import graph (or very close to terminal in the dependency graph).