Skip to content

Commit 86ed1d3

Browse files
mergify[bot]ycombinatorbelimawr
authored
[9.2](backport #47409) Include whether Beat is running from a FIPS distribution in User Agent (#47486)
(cherry picked from commit 5df7f06) --------- Co-authored-by: Shaunak Kashyap <[email protected]> Co-authored-by: Tiago Queiroz <[email protected]>
1 parent fc9938c commit 86ed1d3

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
@@ -10879,11 +10879,11 @@ SOFTWARE
1087910879

1088010880
--------------------------------------------------------------------------------
1088110881
Dependency : github.com/elastic/elastic-agent-libs
10882-
Version: v0.24.1
10882+
Version: v0.26.0
1088310883
Licence type (autodetected): Apache-2.0
1088410884
--------------------------------------------------------------------------------
1088510885

10886-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.24.1/LICENSE:
10886+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.26.0/LICENSE:
1088710887

1088810888
Apache License
1088910889
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.26.0
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
@@ -368,8 +368,8 @@ github.com/elastic/elastic-agent-autodiscover v0.10.0 h1:WJ4zl9uSfk1kHmn2B/0byQB
368368
github.com/elastic/elastic-agent-autodiscover v0.10.0/go.mod h1:Nf3zh9FcJ9nTTswTwDTUAqXmvQllOrNliM6xmORSxwE=
369369
github.com/elastic/elastic-agent-client/v7 v7.15.0 h1:nDB7v8TBoNuD6IIzC3z7Q0y+7bMgXoT2DsHfolO2CHE=
370370
github.com/elastic/elastic-agent-client/v7 v7.15.0/go.mod h1:6h+f9QdIr3GO2ODC0Y8+aEXRwzbA5W4eV4dd/67z7nI=
371-
github.com/elastic/elastic-agent-libs v0.24.1 h1:kFPpOG5mbdaGRRNXPb2KfEaR65Uoi8nsMbDOKA02/Go=
372-
github.com/elastic/elastic-agent-libs v0.24.1/go.mod h1:o/iXtbHYaojpG4BOY7Z3hFMQAgEoqq2owO17JPGpf3A=
371+
github.com/elastic/elastic-agent-libs v0.26.0 h1:ne+cNu2fleCzHm2z0tkAKwVH0EByJRi7r7TgIr3YKio=
372+
github.com/elastic/elastic-agent-libs v0.26.0/go.mod h1:o/iXtbHYaojpG4BOY7Z3hFMQAgEoqq2owO17JPGpf3A=
373373
github.com/elastic/elastic-agent-system-metrics v0.13.3 h1:VlY3Ezuwi5bPZRsAM97WaJEW78XkXgqmPHcTl1WGMRw=
374374
github.com/elastic/elastic-agent-system-metrics v0.13.3/go.mod h1:lB8veYWYBlA9eF6TahmPN87G1IEgWlbep7QSqLSW90U=
375375
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)