Skip to content

Commit 15b8c8a

Browse files
authored
Bump Go version to 1.25.1 (#5562)
* Bump Go version to 1.25.1 * Update CHANGELOG entry * Bump the version of golangci-lint * Remove references to the ms_tls13kdf build tag * Download go module dependencies before GODEBUG=fips140=only is set * Exclude X25519 curve types when testing in FIPS-140 mode * Stricter check * Add missing license header * Exclude X25519 curve types when testing in FIPS-140-only mode * Use stricter check * Update NOTICE files * Remove IsFIPS140Only helper function * Set GODEBUG=tlsmlkem=0 for FIPS140-only unit tests * Remove replace directive from go.mod * Try not pre-downloading dependencies
1 parent e6ea6c9 commit 15b8c8a

File tree

9 files changed

+57
-21
lines changed

9 files changed

+57
-21
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
4040
with:
4141
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
42-
version: v2.1.0
42+
version: v2.5.0
4343

4444
# Give the job more time to execute.
4545
# Regarding `--whole-files`, the linter is supposed to support linting of changed a patch only but,

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24.7
1+
1.25.1

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ run:
44
timeout: 1m
55
build-tags:
66
- integration
7-
go: "1.24.7"
7+
go: "1.25.1"
88

99
issues:
1010
# Maximum count of issues with the same text.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: enhancement
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Update Go to v1.25.1
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component: fleet-server
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
pr: https://github.com/elastic/fleet-server/pull/5562
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234

dev-tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/elastic/fleet-server/dev-tools
22

3-
go 1.24.7
3+
go 1.25.1
44

55
tool (
66
github.com/elastic/go-json-schema-generate/cmd/schema-generate

docs/fips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ This toolchain must be present for local compilation.
1212

1313
As we are using micrsoft/go as a base we follow their conventions.
1414

15-
Our FIPS changes require the `requirefips` and `ms_tls13kdf` buildtags.
15+
Our FIPS changes require the `requirefips` build tag.
1616
When compiling `GOEXPERIMENT=systemcrypto` and `CGO_ENABLED=1` must be set.
1717
Additionally the `MS_GOTOOLCHAIN_TELEMETRY_ENABLED=0` env var is set to disable telemetry for [microsoft/go](https://github.com/microsoft/go).
1818

1919
The `FIPS=true` env var is used by our magefile as the FIPS toggle.
20-
This env var applies to all targets, at a minimum the `requirefips` and `ms_tls13kdf` tags will be set.
20+
This env var applies to all targets, at a minimum the `requirefips` tag will be set.
2121
For targets that compile binaries, the `GOEXPERIMENT=systemcrypto` and `CGO_ENABLED=1` env vars are set.
2222

2323
For developer conveniance, running `FIPS=true mage multipass` will provision a multipass VM with the Microsoft/go toolchain.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/elastic/fleet-server/v7
22

3-
go 1.24.7
3+
go 1.25.1
44

55
require (
66
github.com/Pallinder/go-randomdata v1.2.0

magefile.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ var (
326326
tags = append(tags, "snapshot")
327327
}
328328
if isFIPS() {
329-
tags = append(tags, "requirefips", "ms_tls13kdf")
329+
tags = append(tags, "requirefips")
330330
}
331331
return strings.Join(tags, ",")
332332
})
@@ -486,7 +486,7 @@ func (Check) Notice() {
486486
// DetectFIPSCryptoImports will do a best effort attempt to ensure that the imports list for FIPS compatible artifacts does not contain any external crypto libraries.
487487
// Specifically it will fail if the modules list contains an entry with: "crypto", "gokrb5", or "pbkdf2"
488488
func (Check) DetectFIPSCryptoImports() error {
489-
tags := []string{"requirefips", "ms_tls13kdf"}
489+
tags := []string{"requirefips"}
490490
mods, err := getModules(tags...)
491491
if err != nil {
492492
return err
@@ -514,7 +514,7 @@ func genNotice(fips bool) error {
514514
outFile := "NOTICE.txt"
515515
if fips {
516516
log.Println("Generating NOTICE-fips.txt.")
517-
tags = append(tags, "requirefips", "ms_tls13kdf")
517+
tags = append(tags, "requirefips")
518518
outFile = "NOTICE-fips.txt"
519519
} else {
520520
log.Println("Generating NOTICE.txt.")
@@ -1202,7 +1202,7 @@ func (Docker) CustomAgentImage() error {
12021202
// Unit runs unit tests.
12031203
// Produces a unit test output file, and test coverage file in the build directory.
12041204
// SNAPSHOT adds the snapshot build tag.
1205-
// FIPS adds the requirefips and ms_tls13kdf build tags.
1205+
// FIPS adds the requirefips build tag.
12061206
func (Test) Unit() error {
12071207
mg.Deps(mg.F(mkDir, "build"))
12081208
output, err := teeCommand(environMap(), "go", "test", "-tags="+getTagsString(), "-v", "-race", "-coverprofile="+filepath.Join("build", "coverage-"+runtime.GOOS+".out"), "./...")
@@ -1214,19 +1214,26 @@ func (Test) Unit() error {
12141214
// This is done because mage may have issues when running with fips140=only set.
12151215
// Produces a unit test output file, and test coverage file in the build directory.
12161216
// SNAPSHOT adds the snapshot build tag.
1217-
// FIPS adds the requirefips and ms_tls13kdf build tags.
1217+
// FIPS adds the requirefips build tag.
12181218
func (Test) UnitFIPSOnly() error {
12191219
mg.Deps(mg.F(mkDir, "build"))
1220+
1221+
// We also set GODEBUG=tlsmlkem=0 to disable the X25519MLKEM768 TLS key
1222+
// exchange mechanism; without this setting and with the GODEBUG=fips140=only
1223+
// setting, we get errors in tests like so:
1224+
// Failed to connect: crypto/ecdh: use of X25519 is not allowed in FIPS 140-only mode
1225+
// Note that we are only disabling this TLS key exchange mechanism in tests!
12201226
env := environMap()
1221-
env["GODEBUG"] = "fips140=only"
1227+
env["GODEBUG"] = "fips140=only,tlsmlkem=0"
1228+
12221229
output, err := teeCommand(env, "go", "test", "-tags="+getTagsString(), "-v", "-race", "-coverprofile="+filepath.Join("build", "coverage-"+runtime.GOOS+".out"), "./...")
12231230
err = errors.Join(err, os.WriteFile(filepath.Join("build", "test-unit-fipsonly-"+runtime.GOOS+".out"), output, 0o644))
12241231
return err
12251232
}
12261233

12271234
// Integration provisions the integration test environment with docker compose, runs the integration tests, then destroys the environment.
12281235
// SNAPSHOT runs integration tests with the snapshot build tag.
1229-
// FIPS runs the integration tests the requirefips and ms_tls13kdf build tags.
1236+
// FIPS runs the integration tests the requirefips build tag.
12301237
func (Test) Integration() {
12311238
mg.SerialDeps(mg.F(mkDir, "build"), Test.IntegrationUp, Test.IntegrationRun, Test.IntegrationDown)
12321239
}
@@ -1240,7 +1247,7 @@ func (Test) IntegrationUp() error {
12401247
// Assumes that the integration test environment is up.
12411248
// Produces an integration test output file in the build directory.
12421249
// SNAPSHOT runs integration tests with the snapshot build tag.
1243-
// FIPS runs the integration tests the requirefips and ms_tls13kdf build tags.
1250+
// FIPS runs the integration tests the requirefips build tag.
12441251
func (Test) IntegrationRun(ctx context.Context) error {
12451252
env, err := readEnvFile(filepath.Join("dev-tools", "integration", ".env"))
12461253
if err != nil {
@@ -1592,9 +1599,6 @@ func checkFIPSBinary(path string) error {
15921599
if !strings.Contains(setting.Value, "requirefips") {
15931600
return fmt.Errorf("requirefips tag not found in %s", setting.Value)
15941601
}
1595-
if !strings.Contains(setting.Value, "ms_tls13kdf") {
1596-
return fmt.Errorf("requirefips tag not found in %s", setting.Value)
1597-
}
15981602
continue
15991603
case "GOEXPERIMENT":
16001604
foundExperiment = true
@@ -1665,15 +1669,15 @@ func (Test) JunitReport() error {
16651669

16661670
// All runs unit and integration tests and produces junit reports for all the tests.
16671671
// SNAPSHOT adds the snapshot build tag.
1668-
// FIPS adds the requirefips and ms_tls13kdf build tags.
1672+
// FIPS adds the requirefips build tag.
16691673
func (Test) All() {
16701674
mg.SerialDeps(mg.F(mkDir, "build"), Test.Unit, Test.Integration, Test.JunitReport)
16711675
}
16721676

16731677
// Benchmark runs the included benchmarks
16741678
// Produces a benchmark file in the build directory.
16751679
// SNAPSHOT adds the snapshot build tag.
1676-
// FIPS adds the requirefips and ms_tls13kdf build tags.
1680+
// FIPS adds the requirefips build tag.
16771681
// BENCHMARK_FILTER can be used to filter what benchmarks run.
16781682
// BENCHMARK_ARGS can be used to change what is being benchmarked. Default: -count=10 -benchtime=3s -benchmem.
16791683
// BENCH_BASE can be used to change the output file name.

testing/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/elastic/fleet-server/testing
22

3-
go 1.24.7
3+
go 1.25.1
44

55
replace (
66
github.com/elastic/fleet-server/pkg/api => ../pkg/api

0 commit comments

Comments
 (0)