Skip to content

Commit 5df7f06

Browse files
authored
Include whether Beat is running from a FIPS distribution in User Agent (#47409)
* Include whether Beat is running from a FIPS distribution in User Agent * Add unit tests * Adding CHANGELOG fragment * Remove temporary replace directive for elastic-agent-libs dependency
1 parent 9c4239e commit 5df7f06

File tree

6 files changed

+48
-6
lines changed

6 files changed

+48
-6
lines changed

NOTICE.txt

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

1066810668
--------------------------------------------------------------------------------
1066910669
Dependency : github.com/elastic/elastic-agent-libs
10670-
Version: v0.24.1
10670+
Version: v0.24.1-0.20251103215058-03ca4525a4b6
1067110671
Licence type (autodetected): Apache-2.0
1067210672
--------------------------------------------------------------------------------
1067310673

10674-
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE:
10674+
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]-0.20251103215058-03ca4525a4b6/LICENSE:
1067510675

1067610676
Apache License
1067710677
Version 2.0, January 2004
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: feature
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Include whether Beat is running from a FIPS distribution in User Agent
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: all
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/owner/repo/1234
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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ require (
174174
github.com/elastic/bayeux v1.0.5
175175
github.com/elastic/ebpfevents v0.8.0
176176
github.com/elastic/elastic-agent-autodiscover v0.10.0
177-
github.com/elastic/elastic-agent-libs v0.24.1
177+
github.com/elastic/elastic-agent-libs v0.24.1-0.20251103215058-03ca4525a4b6
178178
github.com/elastic/elastic-agent-system-metrics v0.13.3
179179
github.com/elastic/go-elasticsearch/v8 v8.19.0
180180
github.com/elastic/go-freelru v0.16.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ github.com/elastic/elastic-agent-autodiscover v0.10.0 h1:WJ4zl9uSfk1kHmn2B/0byQB
366366
github.com/elastic/elastic-agent-autodiscover v0.10.0/go.mod h1:Nf3zh9FcJ9nTTswTwDTUAqXmvQllOrNliM6xmORSxwE=
367367
github.com/elastic/elastic-agent-client/v7 v7.15.0 h1:nDB7v8TBoNuD6IIzC3z7Q0y+7bMgXoT2DsHfolO2CHE=
368368
github.com/elastic/elastic-agent-client/v7 v7.15.0/go.mod h1:6h+f9QdIr3GO2ODC0Y8+aEXRwzbA5W4eV4dd/67z7nI=
369-
github.com/elastic/elastic-agent-libs v0.24.1 h1:kFPpOG5mbdaGRRNXPb2KfEaR65Uoi8nsMbDOKA02/Go=
370-
github.com/elastic/elastic-agent-libs v0.24.1/go.mod h1:o/iXtbHYaojpG4BOY7Z3hFMQAgEoqq2owO17JPGpf3A=
369+
github.com/elastic/elastic-agent-libs v0.24.1-0.20251103215058-03ca4525a4b6 h1:i0c5UMN/6ArQW3v8XC4z1v37qCycMdnwd78CDimKwmk=
370+
github.com/elastic/elastic-agent-libs v0.24.1-0.20251103215058-03ca4525a4b6/go.mod h1:o/iXtbHYaojpG4BOY7Z3hFMQAgEoqq2owO17JPGpf3A=
371371
github.com/elastic/elastic-agent-system-metrics v0.13.3 h1:VlY3Ezuwi5bPZRsAM97WaJEW78XkXgqmPHcTl1WGMRw=
372372
github.com/elastic/elastic-agent-system-metrics v0.13.3/go.mod h1:lB8veYWYBlA9eF6TahmPN87G1IEgWlbep7QSqLSW90U=
373373
github.com/elastic/elastic-transport-go/v8 v8.7.0 h1:OgTneVuXP2uip4BA658Xi6Hfw+PeIOod2rY3GVMGoVE=

libbeat/beat/beat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (beat *Beat) GenerateUserAgent() {
132132
unprivileged := beat.userAgentUnprivilegedMode()
133133

134134
beat.Info.UserAgent = useragent.UserAgentWithBeatTelemetry(userAgentProduct, version.GetDefaultVersion(),
135-
mode, unprivileged)
135+
mode, unprivileged, beat.Info.FIPSDistribution)
136136
}
137137

138138
// BeatConfig struct contains the basic configuration of every beat

libbeat/beat/beat_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ func TestUserAgentString(t *testing.T) {
9393
Manager: nil},
9494
expectedComments: []string{},
9595
},
96+
{
97+
name: "fips-distribution",
98+
beat: &Beat{Info: Info{Beat: "testbeat", FIPSDistribution: true}, Manager: nil},
99+
expectedComments: []string{"FIPS"},
100+
},
101+
{
102+
name: "not-fips-distribution",
103+
beat: &Beat{Info: Info{Beat: "testbeat", FIPSDistribution: false}, Manager: nil},
104+
expectedComments: []string{},
105+
},
96106
}
97107

98108
// User-Agent will take the form of

0 commit comments

Comments
 (0)