Commit Graph

334 Commits

Author SHA1 Message Date
Charlie Voiselle
180bab892d Update hcl/v2 to latest patched version v2.20.2-0.20240517235513-55d9c02d147d (#22439) 2024-05-31 15:42:17 -04:00
Tim Gross
623486b302 deps: vendor containernetworking/plugins functions for net NS utils (#20556)
We bring in `containernetworking/plugins` for the contents of a single file,
which we use in a few places for running a goroutine in a specific network
namespace. This code hasn't needed an update in a couple of years, and a good
chunk of what we need was previously vendored into `client/lib/nsutil`
already.

Updating the library via dependabot is causing errors in Docker driver tests
because it updates a lot of transient dependencies, and it's bringing in a pile
of new transient dependencies like opentelemetry. Avoid this problem going
forward by vendoring the remaining code we hadn't already.

Ref: https://github.com/hashicorp/nomad/pull/20146
2024-05-13 09:10:16 -04:00
James Rasell
cd9e032855 deps: upgrade hashicorp/cap to v0.6.0 (#20517) 2024-05-03 15:30:48 +01:00
dependabot[bot]
b25de662a1 chore(deps): bump github.com/docker/docker from 25.0.2+incompatible to 26.0.1+incompatible (#20389)
* chore(deps): bump github.com/docker/docker

Bumps [github.com/docker/docker](https://github.com/docker/docker) from 25.0.2+incompatible to 26.0.1+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v25.0.2...v26.0.1)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* include changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-04-18 11:35:09 -04:00
Tim Gross
e4fe564bba deps: update golang.org/x/net (#20434)
Although Nomad does not use HTTP2, vulnerability scans detect our version of
`golang.org/x/net` as having an HPACK DoS vuln (GHSA-4v7x-pqxf-cx7m). Upgrade
the library so as to quiet the alerts.

Fixes: https://github.com/hashicorp/nomad-enterprise/issues/1423
2024-04-18 10:34:35 -04:00
Tim Gross
745d1dbe10 deps: update go-getter (#20391) 2024-04-15 16:59:53 -04:00
Tim Gross
c3e7b13d54 deps: update consul-template to 0.37.4 to fix resource leak (#20234)
A Nomad user reported an issue where template runner `View.poll` goroutines were
being leaked when using templates with many dependencies. This resource leak was
fixed in consul-template 0.37.4.

Fixes: https://github.com/hashicorp/nomad/issues/20163
2024-03-27 11:51:34 -04:00
Michael Schurter
23e4b7c9d2 Upgrade go-msgpack to v2 (#20173)
Replaces #18812

Upgraded with:
```
find . -name '*.go' -exec sed -i s/"github.com\/hashicorp\/go-msgpack\/codec"/"github.com\/hashicorp\/go-msgpack\/v2\/codec/" '{}' ';'
find . -name '*.go' -exec sed -i s/"github.com\/hashicorp\/net-rpc-msgpackrpc"/"github.com\/hashicorp\/net-rpc-msgpackrpc\/v2/" '{}' ';'
go get
go get -v -u github.com/hashicorp/raft-boltdb/v2
go get -v github.com/hashicorp/serf@5d32001edfaa18d1c010af65db707cdb38141e80
```

see https://github.com/hashicorp/go-msgpack/releases/tag/v2.1.0
for details
2024-03-21 11:44:23 -07:00
Luke Kysow
9c3bbd191a Bump consul-template to 0.37.2 (#20105) 2024-03-08 14:56:35 -05:00
Tim Gross
ac366521f2 deps: upgrade protobuf lib to 1.33.0 (#20100)
Although Nomad is not vulnerable to CVE-2024-24786 because it's configured to
discard unknown messages during unmarshaling, we should upgrade so that
third-party vulnerability scanners don't detect the vulnerable version and
complain.

Also update go1.22.1 changelog entry to include CVEs
2024-03-08 10:55:55 -05:00
Seth Hoenig
55b0795866 build: upgrade to go1.22 (#20066)
* build: upgrade to go1.22

* add cl

* build: use codecgen from go-msgpack v1.1.5+base32 and stringer 0.18.0

for compatability with go1.22

* ci: update golangci-lint to 1.56.2

* build: update hclogvet for go1.22

* build: bump to go1.22.1
2024-03-06 09:54:04 -06:00
Seth Hoenig
4d83733909 tests: swap testify for test in more places (#20028)
* tests: swap testify for test in plugins/csi/client_test.go

* tests: swap testify for test in testutil/

* tests: swap testify for test in host_test.go

* tests: swap testify for test in plugin_test.go

* tests: swap testify for test in utils_test.go

* tests: swap testify for test in scheduler/

* tests: swap testify for test in parse_test.go

* tests: swap testify for test in attribute_test.go

* tests: swap testify for test in plugins/drivers/

* tests: swap testify for test in command/

* tests: fixup some test usages

* go: run go mod tidy

* windows: cpuset test only on linux
2024-02-29 12:11:35 -06:00
Tim Gross
df86503349 template: sandbox template rendering
The Nomad client renders templates in the same privileged process used for most
other client operations. During internal testing, we discovered that a malicious
task can create a symlink that can cause template rendering to read and write to
arbitrary files outside the allocation sandbox. Because the Nomad agent can be
restarted without restarting tasks, we can't simply check that the path is safe
at the time we write without encountering a time-of-check/time-of-use race.

To protect Nomad client hosts from this attack, we'll now read and write
templates in a subprocess:

* On Linux/Unix, this subprocess is sandboxed via chroot to the allocation
  directory. This requires that Nomad is running as a privileged process. A
  non-root Nomad agent will warn that it cannot sandbox the template renderer.

* On Windows, this process is sandboxed via a Windows AppContainer which has
  been granted access to only to the allocation directory. This does not require
  special privileges on Windows. (Creating symlinks in the first place can be
  prevented by running workloads as non-Administrator or
  non-ContainerAdministrator users.)

Both sandboxes cause encountered symlinks to be evaluated in the context of the
sandbox, which will result in a "file not found" or "access denied" error,
depending on the platform. This change will also require an update to
Consul-Template to allow callers to inject a custom `ReaderFunc` and
`RenderFunc`.

This design is intended as a workaround to allow us to fix this bug without
creating backwards compatibility issues for running tasks. A future version of
Nomad may introduce a read-only mount specifically for templates and artifacts
so that tasks cannot write into the same location that the Nomad agent is.

Fixes: https://github.com/hashicorp/nomad/issues/19888
Fixes: CVE-2024-1329
2024-02-08 10:40:24 -05:00
hc-github-team-nomad-core
c03c735c99 Backport of deps: update dependencies indirectly bringing in older runc into release/1.7.x #19866
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-02-08 10:40:24 -05:00
hc-github-team-nomad-core
af7cf79df7 Backport of chore(deps): bump github.com/opencontainers/runc from 1.1.10 to 1.1.12 into release/1.7.x #19862
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-08 10:40:24 -05:00
Tim Gross
f1637bdd5f deps: update dependencies indirectly bringing in older runc (#19863)
Although Nomad itself is not vulnerable to CVE-2024-21626, we want to update
dependencies that bring in the vulnerable packages so as not to trip
vulnerability scanners. Update `containerd` and `go-dockerclient` as well as the
various transitive dependencies these bring in.
2024-02-02 16:08:22 -05:00
dependabot[bot]
b94a193c8a chore(deps): bump github.com/opencontainers/runc from 1.1.10 to 1.1.12 (#19851)
* chore(deps): bump github.com/opencontainers/runc from 1.1.10 to 1.1.12

Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.10 to 1.1.12.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/v1.1.12/CHANGELOG.md)
- [Commits](https://github.com/opencontainers/runc/compare/v1.1.10...v1.1.12)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* add changelog entry

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tim Gross <tgross@hashicorp.com>
2024-02-02 10:18:53 -05:00
dependabot[bot]
af2cdc98a5 chore(deps): bump golang.org/x/sync from 0.4.0 to 0.6.0 (#19792) 2024-01-22 07:32:21 +00:00
dependabot[bot]
d62280941d chore(deps): bump github.com/hashicorp/go-immutable-radix/v2 (#19734) 2024-01-15 10:27:31 +00:00
dependabot[bot]
40bbddf3d8 chore(deps): bump github.com/prometheus/client_golang (#19733) 2024-01-15 08:24:43 +00:00
dependabot[bot]
f3bc9c7c41 chore(deps): bump github.com/docker/docker (#19672) 2024-01-09 08:24:20 +00:00
dependabot[bot]
398b5000c1 chore(deps): bump github.com/hashicorp/go-plugin from 1.4.10 to 1.6.0 (#19646)
Co-authored-by: James Rasell <jrasell@hashicorp.com>
2024-01-08 08:26:34 +00:00
dependabot[bot]
37af843b01 chore(deps): bump github.com/opencontainers/runc from 1.1.8 to 1.1.10 (#19289) 2024-01-05 09:57:54 +00:00
dependabot[bot]
c2e6d8aee2 build(deps): bump github.com/containerd/containerd from 1.6.18 to 1.6.26 (#19531) 2024-01-05 09:29:14 +00:00
dependabot[bot]
b2f640346d build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#19514) 2023-12-19 11:17:48 +00:00
Luiz Aoqui
099ee06a60 Revert "deps: update go-metrics to v0.5.3 (#19190)" (#19374)
* Revert "deps: update go-metrics to v0.5.3 (#19190)"

This reverts commit ddb060d8b3.

* changelog: add entry for #19374
2023-12-08 08:46:55 -05:00
Luiz Aoqui
ddb060d8b3 deps: update go-metrics to v0.5.3 (#19190)
Update `go-metrics` to v0.5.3 to pick
https://github.com/hashicorp/go-metrics/pull/146.
2023-11-28 12:37:57 -05:00
dependabot[bot]
73746cc199 chore(deps): bump google.golang.org/grpc from 1.55.0 to 1.59.0 (#18908) 2023-11-27 09:07:17 +00:00
dependabot[bot]
2bbce293ad chore(deps): bump github.com/hashicorp/go-kms-wrapping/v2 (#19175) 2023-11-27 08:41:01 +00:00
dependabot[bot]
36b74496a5 chore(deps): bump github.com/go-jose/go-jose/v3 from 3.0.0 to 3.0.1 (#19146)
Bumps [github.com/go-jose/go-jose/v3](https://github.com/go-jose/go-jose) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/v3/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 20:20:45 -05:00
Adriano Caloiaro
f66eb83fc0 Add go-netaddrs support to retry_join (#18745) 2023-11-15 10:07:18 -05:00
Luke Kysow
36c9aee3f0 Bump consul-template to 0.35.0 (#19032)
* Bump consul-template to 0.35.0

* run go mod tidy
2023-11-09 09:48:33 -05:00
Seth Hoenig
a28e5b6965 e2e: refactor metrics test to use NSD and WI (#19022)
* e2e: remove old metrics suite

* e2e: install stress on e2e jammy image

* e2e: overhaul metrics test to use nomad service discovery, workload identity

* e2e: format metrics hcl files and copywrite

* e2e: undo tf lock file

* e2e: undo reg auth file perms

* e2e: format cpustress.hcl
2023-11-09 08:21:16 -06:00
Seth Hoenig
3ba364e42f deps: update some dependencies (#19002)
* deps: update shoenig/test to 1.7.0

* deps: update go-set/v2 to v2.1.0

* deps: update shoenig/go-landlock to v1.2.0
2023-11-07 07:34:40 -06:00
Justin Yang
b76e0429c4 client: add support for NetBSD clients (#18562)
Bumps `shirou/gopsutil` to v3.23.9
2023-10-27 10:33:00 -04:00
Seth Hoenig
043b1a95a7 deps: bump go-set/v2 to alpha.3 (#18844)
fixes a rather critical bug in .Equals implementation
2023-10-24 08:23:25 -05:00
James Rasell
1a0d1efb0d cli: use single dep func for opening URLs. (#18808) 2023-10-20 08:24:11 +01:00
dependabot[bot]
cb2363f2fb chore(deps): bump github.com/hashicorp/go-bexpr from 0.1.12 to 0.1.13 (#18758) 2023-10-16 08:21:57 +01:00
dependabot[bot]
cecd9b0472 chore(deps): bump golang.org/x/net from 0.14.0 to 0.17.0 (#18734) 2023-10-12 07:58:59 +01:00
Tim Gross
7ca619fe97 deps: remove Vault SDK (#18725)
Nomad imports the Vault SDK to get testing helpers, but it turns out the only
thing actually in use was a single string constant for the Vault namespace
header. Remove this dependency and hardcode the constant to reduce dependency
churn.
2023-10-11 10:42:09 -04:00
dependabot[bot]
9a38a9c188 chore(deps): bump github.com/docker/cli (#18565) 2023-10-10 09:12:32 +01:00
dependabot[bot]
fbf792f895 chore(deps): bump github.com/docker/distribution (#18693) 2023-10-10 08:20:28 +01:00
dependabot[bot]
5945ed5cfd chore(deps): bump google.golang.org/protobuf from 1.30.0 to 1.31.0 (#18694) 2023-10-09 11:39:51 +01:00
Seth Hoenig
e3c8700ded deps: upgrade to go-set/v2 (#18638)
No functional changes, just cleaning up deprecated usages that are
removed in v2 and replace one call of .Slice with .ForEach to avoid
making the intermediate copy.
2023-10-05 11:56:17 -05:00
dependabot[bot]
ccafb94645 chore(deps): bump github.com/cyphar/filepath-securejoin (#18545) 2023-10-02 08:25:35 +01:00
Tim Gross
02a5aab359 consul: provide workload's Consul token to service client (#18559)
This is a work-in-progress changeset to provide workload-specific Consul tokens
that are created by the `consul_hook` and attached to workload registration
requests by the `group_service_hook` and `service_hook`.

This requires unreleased updates to Consul's `api` package, so this changeset
includes a temporary `replace` directive in the go.mod file.
2023-09-26 14:13:29 -04:00
James Rasell
d23ee134c5 deps: update hashicorp/go-set to v0.1.14 (#18240) 2023-08-17 15:03:15 +01:00
Seth Hoenig
d9341f0664 update go1.21 (#18184)
* build: update to go1.21

* go: eliminate helpers in favor of min/max

* build: run go mod tidy

* build: swap depguard for semgrep

* command: fixup broken tls error check on go1.21
2023-08-14 08:43:27 -05:00
Seth Hoenig
a4cc76bd3e numa: enable numa topology detection (#18146)
* client: refactor cgroups management in client

* client: fingerprint numa topology

* client: plumb numa and cgroups changes to drivers

* client: cleanup task resource accounting

* client: numa client and config plumbing

* lib: add a stack implementation

* tools: remove ec2info tool

* plugins: fixup testing for cgroups / numa changes

* build: update makefile and package tests and cl
2023-08-10 17:05:30 -05:00
Seth Hoenig
37dd4c4a69 e2e: modernize vaultcompat testing (#18179)
* e2e: modernize vaultcompat testing

* e2e: cr fixes for vaultcompat
2023-08-09 09:24:51 -05:00