Skip to content

Commit b7983ee

Browse files
committed
Bump elastic-agent-libs to v0.46.0 and add FIPS test coverage for makeGoTestArgs
Picks up elastic/elastic-agent-libs#426 (enforce FIPS 140-3 peer cert key types across all TLS verification modes), mirroring the native-Go FIPS migration landing in elastic/beats#51345. Replaces a local filesystem replace directive used to validate against that PR before it merged. Also adds TestMakeGoTestArgsFIPS covering the FIPS env propagation added in the prior follow-up commit.
1 parent e1d7069 commit b7983ee

7 files changed

Lines changed: 52 additions & 10 deletions

File tree

NOTICE-fips.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,11 +1053,11 @@ SOFTWARE
10531053

10541054
--------------------------------------------------------------------------------
10551055
Dependency : github.com/elastic/elastic-agent-libs
1056-
Version: v0.44.0
1056+
Version: v0.46.0
10571057
Licence type (autodetected): Apache-2.0
10581058
--------------------------------------------------------------------------------
10591059

1060-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.44.0/LICENSE:
1060+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.46.0/LICENSE:
10611061

10621062
Apache License
10631063
Version 2.0, January 2004

NOTICE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,11 +1053,11 @@ SOFTWARE
10531053

10541054
--------------------------------------------------------------------------------
10551055
Dependency : github.com/elastic/elastic-agent-libs
1056-
Version: v0.44.0
1056+
Version: v0.46.0
10571057
Licence type (autodetected): Apache-2.0
10581058
--------------------------------------------------------------------------------
10591059

1060-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.44.0/LICENSE:
1060+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.46.0/LICENSE:
10611061

10621062
Apache License
10631063
Version 2.0, January 2004

dev-tools/mage/gotest_test.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,45 @@ var wantTestWithWrongPanic = `(?sm:
357357
.*
358358
panic: Fail in goroutine after TestGoTest_Helper_WithWrongPanic/setup_failing_go-routine has completed.*
359359
)`
360+
361+
func TestMakeGoTestArgsFIPS(t *testing.T) {
362+
t.Run("FIPS disabled: no FIPS env vars injected", func(t *testing.T) {
363+
s := DefaultSettings()
364+
s.Build.FIPSBuild = false
365+
366+
args := makeGoTestArgs(s, "Unit")
367+
368+
assert.NotContains(t, args.Tags, "requirefips")
369+
assert.NotContains(t, args.Env, "GOFIPS140")
370+
assert.NotContains(t, args.Env, "GODEBUG")
371+
})
372+
373+
t.Run("FIPS enabled: requirefips tag added", func(t *testing.T) {
374+
s := DefaultSettings()
375+
s.Build.FIPSBuild = true
376+
377+
args := makeGoTestArgs(s, "Unit")
378+
379+
assert.Contains(t, args.Tags, "requirefips")
380+
})
381+
382+
t.Run("FIPS enabled: compile env from packages.yml propagated", func(t *testing.T) {
383+
s := DefaultSettings()
384+
s.Build.FIPSBuild = true
385+
386+
args := makeGoTestArgs(s, "Unit")
387+
388+
// packages.yml sets GOFIPS140=v1.0.0 under fips.compile.env;
389+
// makeGoTestArgs must forward every key from that map.
390+
assert.Equal(t, "v1.0.0", args.Env["GOFIPS140"])
391+
})
392+
393+
t.Run("FIPS enabled: GODEBUG enforces FIPS-only runtime", func(t *testing.T) {
394+
s := DefaultSettings()
395+
s.Build.FIPSBuild = true
396+
397+
args := makeGoTestArgs(s, "Unit")
398+
399+
assert.Equal(t, "fips140=only,tlsmlkem=0", args.Env["GODEBUG"])
400+
})
401+
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/elastic/cloud-on-k8s/v3 v3.4.1
2020
github.com/elastic/elastic-agent-autodiscover v0.10.3
2121
github.com/elastic/elastic-agent-client/v7 v7.18.1
22-
github.com/elastic/elastic-agent-libs v0.44.0
22+
github.com/elastic/elastic-agent-libs v0.46.0
2323
github.com/elastic/elastic-agent-system-metrics v0.14.4
2424
github.com/elastic/elastic-transport-go/v8 v8.11.0
2525
github.com/elastic/fleet-server/pkg/api v0.0.0-20260515154942-99dc973fd52e

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ github.com/elastic/elastic-agent-autodiscover v0.10.3 h1:3pGm0wOVOK5dNdqAypZzQCI
244244
github.com/elastic/elastic-agent-autodiscover v0.10.3/go.mod h1:HyjdiEVP/A7iMN0jeac2EoUohpHKAZIFRDQsvPDg2Dw=
245245
github.com/elastic/elastic-agent-client/v7 v7.18.1 h1:WnM53JjaukeysrAuiTyrhDPmFxJG07ZAByc2TrkcKcs=
246246
github.com/elastic/elastic-agent-client/v7 v7.18.1/go.mod h1:uDpSGZ+YCKgqgtkwCA0qjwX0gU/wmixDsVbPjY3GkPs=
247-
github.com/elastic/elastic-agent-libs v0.44.0 h1:dONaZsY5G0rVGULP+j5xKyT51rK7nsBNEGywIXcCrg4=
248-
github.com/elastic/elastic-agent-libs v0.44.0/go.mod h1:axkpqDCCzAky6G4D/cklgtZQa3jTNGAMVHVkU0u6YbU=
247+
github.com/elastic/elastic-agent-libs v0.46.0 h1:4otnN3M34k2sngeeeSEza1YS+XKY1zZ8sBoSVhu2Tew=
248+
github.com/elastic/elastic-agent-libs v0.46.0/go.mod h1:axkpqDCCzAky6G4D/cklgtZQa3jTNGAMVHVkU0u6YbU=
249249
github.com/elastic/elastic-agent-system-metrics v0.14.4 h1:XGGepNVOxhtfJmanQsgqCAZESIJtyDIFOKErOaVzFEw=
250250
github.com/elastic/elastic-agent-system-metrics v0.14.4/go.mod h1:NyNMrdqMfznb/Zy8EmIAHlJpX6HuRlNW+bBL9UN7WQY=
251251
github.com/elastic/elastic-transport-go/v8 v8.11.0 h1:taYmqC2M6+fZt/+W+ENYh/W5L9+KrlJGOSbEJs8egWc=

internal/edot/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/Masterminds/semver/v3 v3.5.0
1414
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20260702230059-6566b625eeb8
1515
github.com/elastic/elastic-agent v0.0.0-00010101000000-000000000000
16-
github.com/elastic/elastic-agent-libs v0.44.0
16+
github.com/elastic/elastic-agent-libs v0.46.0
1717
github.com/elastic/mock-es v0.0.0-20250530054253-8c3b6053f9b6
1818
github.com/elastic/opentelemetry-collector-components/connector/elasticapmconnector v0.59.0
1919
github.com/elastic/opentelemetry-collector-components/connector/profilingmetricsconnector v0.59.0

internal/edot/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ github.com/elastic/elastic-agent-autodiscover v0.10.3 h1:3pGm0wOVOK5dNdqAypZzQCI
482482
github.com/elastic/elastic-agent-autodiscover v0.10.3/go.mod h1:HyjdiEVP/A7iMN0jeac2EoUohpHKAZIFRDQsvPDg2Dw=
483483
github.com/elastic/elastic-agent-client/v7 v7.18.1 h1:WnM53JjaukeysrAuiTyrhDPmFxJG07ZAByc2TrkcKcs=
484484
github.com/elastic/elastic-agent-client/v7 v7.18.1/go.mod h1:uDpSGZ+YCKgqgtkwCA0qjwX0gU/wmixDsVbPjY3GkPs=
485-
github.com/elastic/elastic-agent-libs v0.44.0 h1:dONaZsY5G0rVGULP+j5xKyT51rK7nsBNEGywIXcCrg4=
486-
github.com/elastic/elastic-agent-libs v0.44.0/go.mod h1:axkpqDCCzAky6G4D/cklgtZQa3jTNGAMVHVkU0u6YbU=
485+
github.com/elastic/elastic-agent-libs v0.46.0 h1:4otnN3M34k2sngeeeSEza1YS+XKY1zZ8sBoSVhu2Tew=
486+
github.com/elastic/elastic-agent-libs v0.46.0/go.mod h1:axkpqDCCzAky6G4D/cklgtZQa3jTNGAMVHVkU0u6YbU=
487487
github.com/elastic/elastic-agent-system-metrics v0.14.4 h1:XGGepNVOxhtfJmanQsgqCAZESIJtyDIFOKErOaVzFEw=
488488
github.com/elastic/elastic-agent-system-metrics v0.14.4/go.mod h1:NyNMrdqMfznb/Zy8EmIAHlJpX6HuRlNW+bBL9UN7WQY=
489489
github.com/elastic/elastic-transport-go/v8 v8.11.0 h1:taYmqC2M6+fZt/+W+ENYh/W5L9+KrlJGOSbEJs8egWc=

0 commit comments

Comments
 (0)