Commit Graph

23223 Commits

Author SHA1 Message Date
James Rasell f6d12a3c00
acl: enable configuration and visualisation of token expiration for users (#13846)
* api: add ACL token expiry params to HTTP API

* cli: allow setting and displaying ACL token expiry
2022-07-20 10:06:23 +02:00
James Rasell 9264f07cc1
core: add expired token garbage collection periodic jobs. (#13805)
Two new periodic core jobs have been added which handle removing
expired local and global tokens from state. The local core job is
run on every leader; the global core job is only run on the leader
within the authoritative region.
2022-07-19 15:37:46 +02:00
James Rasell a8a8b1f84f
acl: add token expiry checking to ACL token resolution. (#13756)
This commit adds basic expiry checking when performing ACL token
resolution. This expiry checking is local to each server and does
not at this time take into account potential time skew on server
hosts.

A new error message has been created so clients whose token has
expired get a clear message, rather than a generic token not
found.

The ACL resolution tests have been refactored into table driven
tests, so additions are easier in the future.
2022-07-15 15:20:50 +02:00
James Rasell 0cde3182eb
core: add ACL token expiry state, struct, and RPC handling. (#13718)
The ACL token state schema has been updated to utilise two new
indexes which track expiration of tokens that are configured with
an expiration TTL or time. A new state function allows listing
ACL expired tokens which will be used by internal garbage
collection.

The ACL endpoint has been modified so that all validation happens
within a single function call. This is easier to understand and
see at a glance. The ACL token validation now also includes logic
for expiry TTL and times. The ACL endpoint upsert tests have been
condensed into a single, table driven test.

There is a new token canonicalize which provides a single place
for token canonicalization, rather than logic spread in the RPC
handler.
2022-07-13 15:40:34 +02:00
James Rasell 0292f48396
server: add ACL token expiration config parameters. (#13667)
This commit adds configuration parameters to control ACL token
expirations. This includes both limits on the min and max TTL
expiration values, as well as a GC threshold for expired tokens.
2022-07-12 13:43:25 +02:00
James Rasell 9eb63c9e03
cli: ensure node status and drain use correct cmd name. (#13656) 2022-07-11 09:50:42 +02:00
James Rasell 17a467020c
e2e: add terraform init commands to readme doc. (#13655) 2022-07-08 16:52:35 +02:00
Michael Schurter 2a25f2870b
ignore b0a20b4dc965a38b0c843f47c16685ccad7439da (#13648)
Mainly an excuse to experiment with .git-blame-ignore-revs
2022-07-07 15:16:18 -07:00
Seth Hoenig 8c98a8e06c
Merge pull request #13644 from hashicorp/docs-max-kill-timeout
docs: upgrade guide for client max_kill_timeout
2022-07-07 16:47:10 -05:00
Seth Hoenig ed2f2b1a75
docs: move upgrade docs for max_client_timeout
Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2022-07-07 16:46:26 -05:00
Seth Hoenig 905e673553 docs: upgrade guide for client max_kill_timeout 2022-07-07 15:27:40 -05:00
Seth Hoenig 9861afcbe7
Merge pull request #13630 from hashicorp/b-critical-typo
boltdd: fixup typo and use unreachable assertion
2022-07-07 14:59:38 -05:00
Seth Hoenig 239eaf9a29
Merge pull request #13626 from hashicorp/b-client-max-kill-timeout
client: enforce max_kill_timeout client configuration
2022-07-07 13:44:39 -05:00
Luiz Aoqui 85908415f9
state: fix eval list by prefix with * namespace (#13551) 2022-07-07 14:21:51 -04:00
Luiz Aoqui 03433dd8af
cli: improve output of eval commands (#13581)
Use the same output format when listing multiple evals in the `eval
list` command and when `eval status <prefix>` matches more than one
eval.

Include the eval namespace in all output formats and always include the
job ID in `eval status` since, even `node-update` evals are related to a
job.

Add Node ID to the evals table output to help differentiate
`node-update` evals.

Co-authored-by: James Rasell <jrasell@hashicorp.com>
2022-07-07 13:13:34 -04:00
Ted Behling 6a032a54d2
driver/docker: Don't pull InfraImage if it exists (#13265)
Co-authored-by: James Rasell <jrasell@hashicorp.com>
2022-07-07 17:44:06 +02:00
James Rasell d6ef3432c5
terraform: update installed versions of HashiCorp tools. (#13635) 2022-07-07 16:12:19 +02:00
Seth Hoenig 5ef04ac7c0
Merge pull request #13631 from hashicorp/docs-service-rwh
docs: add docs for simple load balancing nomad services
2022-07-07 08:40:29 -05:00
Seth Hoenig b9fe6c8d2c docs: fixup from cr comments 2022-07-07 08:37:10 -05:00
Seth Hoenig 1c31ef285e docs: add docs for simple load balancing nomad services
This PR adds a section to template docs for simple load balancing with nomad servicse.
2022-07-06 17:34:30 -05:00
Seth Hoenig b1a3a8a5bb helpers: use unreachable assertion 2022-07-06 17:05:35 -05:00
Seth Hoenig 7cca6604e7 helpers: fix critical typo 2022-07-06 17:03:00 -05:00
Michael Schurter f21272065d
core: emit node evals only for sys jobs in dc (#12955)
Whenever a node joins the cluster, either for the first time or after
being `down`, we emit a evaluation for every system job to ensure all
applicable system jobs are running on the node.

This patch adds an optimization to skip creating evaluations for system
jobs not in the current node's DC. While the scheduler performs the same
feasability check, skipping the creation of the evaluation altogether
saves disk, network, and memory.
2022-07-06 14:35:18 -07:00
Seth Hoenig 5dd8aa3e27 client: enforce max_kill_timeout client configuration
This PR fixes a bug where client configuration max_kill_timeout was
not being enforced. The feature was introduced in 9f44780 but seems
to have been removed during the major drivers refactoring.

We can make sure the value is enforced by pluming it through the DriverHandler,
which now uses the lesser of the task.killTimeout or client.maxKillTimeout.
Also updates Event.SetKillTimeout to require both the task.killTimeout and
client.maxKillTimeout so that we don't make the mistake of using the wrong
value - as it was being given only the task.killTimeout before.
2022-07-06 15:29:38 -05:00
Luiz Aoqui a9a66ad018
api: apply new ACL check for wildcard namespace (#13608)
api: apply new ACL check for wildcard namespace

In #13606 the ACL check was refactored to better support the all
namespaces wildcard (`*`). This commit applies the changes to the jobs
and alloc list endpoints.
2022-07-06 16:17:16 -04:00
Luiz Aoqui 74c5578432
api: refactor ACL check for namespace wildcard (#13606)
Improve how the all namespaces wildcard (`*`) is handled when checking
ACL permissions. When using the wildcard namespace the `AllowNsOp` would
return false since it looks for a namespace called `*` to match.

This commit changes this behavior to return `true` when the queried
namespace is `*` and the token allows the operation in _any_ namespace.

Actual permission must be checked per object. The helper function
`AllowNsOpFunc` returns a function that can be used to make this
verification.
2022-07-06 15:22:30 -04:00
Seth Hoenig 29c6b9dfdf
Merge pull request #13586 from hashicorp/build-bump-circleci-macos
build: bump circleci macos version
2022-07-06 10:41:06 -05:00
Tim Gross 1fc8995590
query for leader in `operator debug` command (#13472)
The `operator debug` command doesn't output the leader anywhere in the
output, which adds extra burden to offline debugging (away from an
ongoing incident where you can simply check manually). Query the
`/v1/status/leader` API but degrade gracefully.
2022-07-06 10:57:44 -04:00
Charlie Voiselle 07418877c6
Fix Testutil for delve debugging API tests (#13589) 2022-07-06 10:47:48 -04:00
James Rasell 0c0b028a59
core: allow deleting of evaluations (#13492)
* core: add eval delete RPC and core functionality.

* agent: add eval delete HTTP endpoint.

* api: add eval delete API functionality.

* cli: add eval delete command.

* docs: add eval delete website documentation.
2022-07-06 16:30:11 +02:00
Leela Gangavarapu 488e65d960
demo/docs: update demo of Kadalu CSI Plugin (#13610)
ref: kadalu/kadalu#817

Signed-off-by: Leela Venkaiah G <leelavg@thoughtexpo.com>
2022-07-06 10:24:34 -04:00
James Rasell 181b247384
core: allow pausing and un-pausing of leader broker routine (#13045)
* core: allow pause/un-pause of eval broker on region leader.

* agent: add ability to pause eval broker via scheduler config.

* cli: add operator scheduler commands to interact with config.

* api: add ability to pause eval broker via scheduler config

* e2e: add operator scheduler test for eval broker pause.

* docs: include new opertor scheduler CLI and pause eval API info.
2022-07-06 16:13:48 +02:00
Michelle Noorali f227855de1
doc: explain permissions for Vault sys/capabilties-self 2022-07-06 10:01:30 -04:00
Yann Coleu fe64f8cdd7
docs: typo on command word (#13582) 2022-07-05 16:24:25 -04:00
Steven Collins ab97650098
docs: Add 'serial' attribute to usb driver (#13547) 2022-07-05 16:23:04 -04:00
Phil Renaud 84a59ff059
[ui] Fix a bug where redirects after planning/editing a job didn't include namespace (#13588)
* Job editing and planning handles namespace as part of ID instead of queryParam

* Changelog added

* Tests updated to reflect new namespace redirects
2022-07-05 15:58:56 -04:00
Seth Hoenig 44a2d8f8a7 build: bump circleci macos version
Got an email from Circle about removing the version we are currently
using; bump to the latest stable version
2022-07-05 09:38:00 -05:00
Seth Hoenig 037bbe957f
Merge pull request #13548 from hashicorp/f-bbolt-helpers
boltdd: add iterate and prefix deletion helpers
2022-07-05 09:01:15 -05:00
Seth Hoenig a49b98ac6b boltdd: add iterate and prefix deletion helpers
This PR adds 2 helper functions to the helpers/bbolt package

- Iterate: iterate every key in a bucket. Automatically decodes the
msg pack value into the provided value argument.

- DeletePrefix: deletes every key in a bucket starting with a
given prefix. Manages the wrapper's hash values accordingly. Uses
a cursor & sync to operate efficiently.
2022-07-03 11:52:57 -05:00
Seth Hoenig 646ac6e38e
Merge pull request #13539 from hashicorp/f-update-go1.18.3
build: update to go1.18.3
2022-07-01 11:41:07 -05:00
Seth Hoenig 5d91bddf2f
Merge pull request #13531 from hashicorp/dependabot/go_modules/api/github.com/stretchr/testify-1.8.0
build(deps): bump github.com/stretchr/testify from 1.7.5 to 1.8.0 in /api
2022-07-01 10:19:03 -05:00
Seth Hoenig 8392ee8988 build: update to go1.18.3
Release Notes:
https://groups.google.com/g/golang-announce/c/TzIC9-t8Ytg

Contains 4 security fixes - the 2 related to Windows might be relevant.
2022-07-01 10:12:56 -05:00
dependabot[bot] 4278846eeb build(deps): bump github.com/stretchr/testify in /api
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.5 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.5...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 09:50:54 -05:00
Seth Hoenig 97726c2fd8
Merge pull request #12862 from hashicorp/f-choose-services
api: enable selecting subset of services using rendezvous hashing
2022-06-30 15:17:40 -05:00
Seth Hoenig 0048c59f1a
cl: fixup changelog comment
Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
2022-06-30 15:10:47 -05:00
Michael Schurter 1cc0ae8795
docs: fix Plan{,Result}.NodeUpdate comment (#13534)
It appears way back when this was first implemented in
9a917281af9c0a97a6c59575eaa52c5c86ffc60d, it was renamed from
NodeEvict (with a correct comment) to NodeUpdate. The comment was
changed from referring to only evictions to referring to "all allocs" in
the first sentence and "stop or evict" in the second.

This confuses every time I see it because I read the name (NodeUpdate)
and first sentence ("all the allocs") and assume this represents *all*
allocations... which isn't true.

I'm going to assume I'm the only one who doesn't read the 2nd sentence
and that's why this suboptimal wording has lasted 7 years, but can we
change it for my sake?
2022-06-30 12:47:14 -07:00
Conner 137073b5d3
Demo Vagrant version updates (nomad, consul, ubuntu) (#13518)
- Use latest nomad 1.3.1 and consul 1.12.2
- Use latest Ubuntu LTS (easier to get podman plugin working, 18.04 does not have podman in main repositories).
- Add increased memory for libvirt to match other VM providers
2022-06-29 10:12:07 -04:00
Derek Strickland 47e3b28dba
docs: update task leader to explain shutdown sequence. (#13498)
* docs: update task leader to explain shutdown sequence.
2022-06-29 05:13:45 -04:00
James Rasell d21e4abe3f
docs: fixup HCL2 index collection function documentation. (#13511) 2022-06-28 18:27:38 +02:00
Andrew 3a87406f2f
Fix typo in Docker docs (#13497) 2022-06-28 11:05:50 +02:00