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 chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
testdata config: Add required configuration for logging to a file 2019-10-07 14:16:59 +02:00
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 acl: check ACL against object namespace 2019-10-08 12:59:22 -04:00
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 clientconfig: Fix parsing multiple host volumes 2019-08-21 22:19:58 +02:00
config_parse_test.go config: Add required configuration for logging to a file 2019-10-07 14:16:59 +02:00
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 agent: report fs log errors as http errors 2019-10-04 16:33:58 -04:00
fs_endpoint_test.go tests: avoid using unnecessary pipe 2019-10-15 17:22:03 -04:00
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 connect: enable setting tags on consul connect sidecar service in jobspec (#6415) 2019-10-17 19:25:20 +00:00
keyring.go
keyring_test.go
log_file.go logging: Correctly track number of written bytes 2019-10-10 14:02:14 +02:00
log_file_test.go logging: Sort files when pruning old logs 2019-10-10 13:51:16 +02:00
log_levels.go Support for hot reloading log levels 2019-07-24 13:37:08 +02:00
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 take NodeID from url in api for node eligibility 2019-07-15 18:34:53 +03:00
node_endpoint_test.go take NodeID from url in api for node eligibility 2019-07-15 18:34:53 +03:00
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