Commit Graph

16927 Commits

Author SHA1 Message Date
Seth Hoenig d204f2f4f0 client: enable envoy bootstrap hook to set SI token
When creating the envoy bootstrap configuration, we should append
the "-token=<token>" argument in the case where the sidsHook placed
the token in the secrets directory.
2020-01-31 19:04:01 -06:00
Seth Hoenig 9df33f622f nomad: proxy requests for Service Identity tokens between Clients and Consul
Nomad jobs may be configured with a TaskGroup which contains a Service
definition that is Consul Connect enabled. These service definitions end
up establishing a Consul Connect Proxy Task (e.g. envoy, by default). In
the case where Consul ACLs are enabled, a Service Identity token is required
for these tasks to run & connect, etc. This changeset enables the Nomad Server
to recieve RPC requests for the derivation of SI tokens on behalf of instances
of Consul Connect using Tasks. Those tokens are then relayed back to the
requesting Client, which then injects the tokens in the secrets directory of
the Task.
2020-01-31 19:03:53 -06:00
Seth Hoenig 93cf770edb client: enable nomad client to request and set SI tokens for tasks
When a job is configured with Consul Connect aware tasks (i.e. sidecar),
the Nomad Client should be able to request from Consul (through Nomad Server)
Service Identity tokens specific to those tasks.
2020-01-31 19:03:38 -06:00
Seth Hoenig 2b66ce93bb nomad: ensure a unique ClusterID exists when leader (gh-6702)
Enable any Server to lookup the unique ClusterID. If one has not been
generated, and this node is the leader, generate a UUID and attempt to
apply it through raft.

The value is not yet used anywhere in this changeset, but is a prerequisite
for gh-6701.
2020-01-31 19:03:26 -06:00
Seth Hoenig f030a22c7c command, docs: create and document consul token configuration for connect acls (gh-6716)
This change provides an initial pass at setting up the configuration necessary to
enable use of Connect with Consul ACLs. Operators will be able to pass in a Consul
Token through `-consul-token` or `$CONSUL_TOKEN` in the `job run` and `job revert`
commands (similar to Vault tokens).

These values are not actually used yet in this changeset.
2020-01-31 19:02:53 -06:00
Mahmood Ali 5d992a6535
Merge pull request #7043 from hashicorp/b-collection-interval
Pass stats interval colleciton to executor
2020-01-31 15:03:30 -05:00
Mahmood Ali 68dbbc155d changelog 2020-01-31 14:22:08 -05:00
Mahmood Ali ac80d62c84 Pass stats interval colleciton to executor
This fixes a bug where executor based drivers emit stats every second,
regardless of user configuration.

When serializing the Stats request across grpc, the nomad agent dropped
the Interval value, and then executor uses 1s as a default value.
2020-01-31 14:17:15 -05:00
Michael Lange ef33a47553
Merge pull request #7028 from hashicorp/f-ui/node-drain-disable
UI: Disable client write actions when ACL token only allows client read
2020-01-31 10:20:06 -08:00
Mahmood Ali 60779a36e2
Merge pull request #7041 from tiangolo/patch-1
Use secret ID for NOMAD_TOKEN
2020-01-31 13:00:40 -05:00
Sebastián Ramírez 830ee3a693
Use secret ID for NOMAD_TOKEN
Use secret ID for NOMAD_TOKEN as the accessor ID doesn't seem to work.

I tried with a local micro cluster following the tutorials, and if I do:

```console
$ export NOMAD_TOKEN=85310d07-9afa-ef53-0933-0c043cd673c7
```

Using the accessor ID as in this example, I get an error:

```
Error querying jobs: Unexpected response code: 403 (ACL token not found)
```

But when using the secret ID in that env var it seems to work correctly.
2020-01-31 18:57:16 +01:00
Michael Lange 31b83b1c70 Acceptance test for disabled node write controls 2020-01-31 09:41:37 -08:00
Michael Lange 5c4c05824a Account for disabled ACLs in ability tests 2020-01-31 09:41:36 -08:00
Michael Lange 59897f9716 Handle the case where ACLs aren't enabled in abilities 2020-01-31 09:41:36 -08:00
Michael Lange 175f80da16 Fix token referencing from the token controller, as well as resetting 2020-01-31 09:41:35 -08:00
Michael Lange 9438330329 Add an explanatory tooltip to the unauthorized node drain popover 2020-01-31 09:41:33 -08:00
Michael Lange 4eac743262 Update disabled 'Run Job' button to use standard disabled style 2020-01-31 09:41:32 -08:00
Mahmood Ali 73200bfa69
Merge pull request #7010 from hashicorp/doc-bulk-20200129
Docs and Changelog catch up
2020-01-31 10:51:07 -05:00
Tim Gross 5d9783da79
hclfmt a test jobspec (#7011) 2020-01-31 08:04:03 -05:00
Michael Lange eb7d34df6b Disable options for popover and drain-popover 2020-01-30 21:29:29 -08:00
Michael Lange 1599b8b5fc Disabled button styles 2020-01-30 21:29:28 -08:00
Michael Lange cdd7a4fdb7 New disabled buttons story 2020-01-30 21:29:26 -08:00
Michael Lange 7c796a33a9 Refetch all ACL things when the token changes 2020-01-30 21:29:24 -08:00
Michael Lange c7af942652 Enable the eligibility toggle conditionally based on acls 2020-01-30 21:29:22 -08:00
Michael Lange 2dac1d6705 Refactor ability tests to use a setup hook for ability lookup 2020-01-30 21:29:21 -08:00
Michael Lange 1fae4083eb Add an ability for client permissions 2020-01-30 21:29:19 -08:00
Michael Schurter 1d8f1ee473
Merge pull request #7026 from hashicorp/post-0103
Post 0103
2020-01-30 15:25:26 -08:00
Michael Schurter 77bd6c0b9c docs: add v0.10.3 release to changelog 2020-01-30 15:24:33 -08:00
Michael Schurter 60e1ae5012 docs: bump 0.10.2 -> 0.10.3 2020-01-30 15:22:59 -08:00
Michael Schurter 54324bb91c
Merge pull request #7023 from hashicorp/b-tls-validation
Validate role and region for mTLS
2020-01-30 11:05:37 -08:00
Michael Schurter dd7712795d
Merge branch 'master' into b-tls-validation 2020-01-30 11:05:15 -08:00
Michael Schurter c7d63305b0
Merge pull request #7022 from hashicorp/f-handshake-deadlines-oss
core: add limits to unauthorized connections
2020-01-30 11:01:10 -08:00
Mahmood Ali a9f551542d Merge pull request #160 from hashicorp/b-mtls-hostname
server: validate role and region for RPC w/ mTLS
2020-01-30 12:59:17 -06:00
Michael Schurter 8d18b5d6be docs: document limits
Taken more or less verbatim from Consul.
2020-01-30 10:38:42 -08:00
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
Seth Hoenig 9a4e0c354d
Merge pull request #7018 from hashicorp/f-e2e-specify-suite
e2e: add a -suite flag to e2e.Framework
2020-01-30 08:41:02 -06:00
Mahmood Ali 42907cf259 incorporate review feedback 2020-01-29 21:56:26 -05:00
Mahmood Ali ad02d9feb5 batch mahmood's changelog entries
[ci skip]
2020-01-29 21:44:11 -05:00
Mahmood Ali 14c806248e document docker's disable_log_collection flag 2020-01-29 21:44:05 -05:00
Mahmood Ali a7d65049c5 Document default_scheduler_config option 2020-01-29 21:44:05 -05:00
Mahmood Ali 3c8136671f
Merge pull request #7009 from hashicorp/golang-1.12.16
use golang 1.12.16
2020-01-29 20:32:24 -05:00
Seth Hoenig 93d347442f e2e: add a -suite flag to e2e.Framework
This change allows for providing the -suite=<Name> flag when
running the e2e framework. If set, only the matching e2e/Framework.TestSuite.Component
will be run, and all ther suites will be skipped.
2020-01-29 14:57:43 -06:00
Drew Bailey 3e9e8262f8
Merge pull request #7015 from hashicorp/b-allow-monitor-by-server-id
Allow nomad monitor command to lookup server UUID
2020-01-29 14:46:53 -05:00
Drew Bailey da4af9bef3
fix tests, update changelog 2020-01-29 13:55:39 -05:00
Drew Bailey a61bf32314
Allow nomad monitor command to lookup server UUID
Allows addressing servers with nomad monitor using the servers name or
ID.

Also unifies logic for addressing servers for client_agent_endpoint
commands and makes addressing logic region aware.

rpc getServer test
2020-01-29 13:55:29 -05:00
Mahmood Ali fb68c7dcdc use golang 1.12.16 2020-01-29 09:52:03 -05:00
Nick Ethier 25a0a697f9
Merge pull request #7005 from shantanugadgil/patch-2
canary_meta will be part of 0.10.3 (not 0.10.2)
2020-01-29 00:18:31 -05:00
Shantanu Gadgil 3cc952754a
canary_meta will be part of 0.10.3 (not 0.10.2)
I assume this is just an oversight. I tried adding the `canary_meta` stanza to an existing v0.10.2 setup (Nomad v0.10.2 (0d2d6e3dc5a171c21f8f31fa117c8a765eb4fc02) and it did show the error message:
```
* group: 'ggg', task: 'tttt', invalid key: canary_meta
```
2020-01-29 10:42:26 +05:30
Mahmood Ali 9611324654
Merge pull request #6922 from hashicorp/b-alloc-canoncalize
Handle Upgrades and Alloc.TaskResources modification
2020-01-28 15:12:41 -05:00
Mahmood Ali 90cae566e5
Merge pull request #6935 from hashicorp/b-default-preemption-flag
scheduler: allow configuring default preemption for system scheduler
2020-01-28 15:11:06 -05:00