open-nomad/command/agent
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
..
consul consul: fix var name from rebase 2020-01-27 14:00:19 -05:00
monitor unlock before returning, no need for label 2019-11-05 11:44:29 -05:00
pprof Rename profile package to pprof 2020-01-09 15:15:10 -05:00
test-resources
testdata
acl_endpoint.go
acl_endpoint_test.go
agent.go core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
agent_endpoint.go refactor api profile methods 2020-01-09 15:15:12 -05:00
agent_endpoint_test.go condense table test 2020-01-09 15:15:10 -05:00
agent_test.go core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
alloc_endpoint.go
alloc_endpoint_test.go
bindata_assetfs.go refactor api profile methods 2020-01-09 15:15:12 -05:00
command.go Added service wrapper code (#6220) 2019-11-11 15:16:07 -05:00
command_test.go
config.go core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
config_oss.go
config_parse.go
config_parse_test.go
config_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
deployment_endpoint.go
deployment_endpoint_test.go
eval_endpoint.go
eval_endpoint_test.go
fs_endpoint.go
fs_endpoint_test.go
helpers.go
helpers_test.go
http.go core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
http_oss.go
http_test.go core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
job_endpoint.go consul: add support for canary meta 2020-01-27 09:53:30 -05:00
job_endpoint_test.go
keyring.go
keyring_test.go
log_file.go
log_file_test.go
log_levels.go
log_levels_test.go
metrics_endpoint.go
metrics_endpoint_test.go tests: deflake TestHTTP_FreshClientAllocMetrics 2019-11-22 18:41:21 -05:00
node_endpoint.go
node_endpoint_test.go
operator_endpoint.go
operator_endpoint_test.go
plugins.go
region_endpoint.go
region_endpoint_test.go
retry_join.go
retry_join_test.go
search_endpoint.go
search_endpoint_test.go
stats_endpoint.go
stats_endpoint_test.go
status_endpoint.go
status_endpoint_test.go
stub_asset.go
syslog.go
syslog_test.go
system_endpoint.go
system_endpoint_test.go
testagent.go core: add limits to unauthorized connections 2020-01-30 10:38:25 -08:00
testingutils_test.go command/agent: Prune Dead Code (#6682) 2019-11-13 08:20:01 -05:00