Skip to content

Commit

Permalink
Merge branch 'main' into markjhoy/remove_ent_search_metricbeat_module
Browse files Browse the repository at this point in the history
  • Loading branch information
markjhoy authored Feb 27, 2025
2 parents 7312af6 + e532bbe commit 6cb9dca
Show file tree
Hide file tree
Showing 39 changed files with 478 additions and 825 deletions.
18 changes: 18 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- auditbeat/
Expand Down Expand Up @@ -40,6 +41,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- heartbeat/
Expand Down Expand Up @@ -74,6 +76,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- filebeat/
Expand Down Expand Up @@ -109,6 +112,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- filebeat/
Expand Down Expand Up @@ -146,6 +150,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- x-pack/dockerlogbeat/
Expand Down Expand Up @@ -180,6 +185,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- metricbeat/
Expand Down Expand Up @@ -214,6 +220,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- metricbeat/
Expand Down Expand Up @@ -251,6 +258,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- x-pack/osquerybeat/**
Expand Down Expand Up @@ -288,6 +296,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- winlogbeat/
Expand Down Expand Up @@ -323,6 +332,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- .buildkite/deploy/kubernetes/**
Expand Down Expand Up @@ -353,6 +363,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- libbeat/
Expand Down Expand Up @@ -386,6 +397,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- libbeat/
Expand Down Expand Up @@ -421,6 +433,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- auditbeat/
Expand Down Expand Up @@ -457,6 +470,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- heartbeat/
Expand Down Expand Up @@ -493,6 +507,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- packetbeat/
Expand Down Expand Up @@ -529,6 +544,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- winlogbeat/
Expand Down Expand Up @@ -563,6 +579,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- packetbeat/
Expand Down Expand Up @@ -597,6 +614,7 @@ steps:
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- auditbeat/
Expand Down
33 changes: 31 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ CHANGELOG*
/metricbeat/module/nats/ @elastic/obs-ds-hosted-services
/metricbeat/module/nginx @elastic/obs-infraobs-integrations
/metricbeat/module/php_fpm @elastic/obs-infraobs-integrations
/metricbeat/module/prometheus/ @elastic/obs-ds-hosted-services
/metricbeat/module/prometheus @elastic/obs-infraobs-integrations
/metricbeat/module/prometheus/collector @elastic/obs-infraobs-integrations
/metricbeat/module/prometheus/query @elastic/obs-infraobs-integrations
/metricbeat/module/prometheus/remote_write @elastic/obs-ds-hosted-services
/metricbeat/module/postgresql @elastic/obs-infraobs-integrations
/metricbeat/module/rabbitmq @elastic/obs-infraobs-integrations
/metricbeat/module/redis @elastic/obs-infraobs-integrations
Expand Down Expand Up @@ -139,6 +142,12 @@ CHANGELOG*
/x-pack/filebeat/input/streaming/ @elastic/security-service-integrations
/x-pack/filebeat/module/activemq @elastic/obs-infraobs-integrations
/x-pack/filebeat/module/aws @elastic/obs-ds-hosted-services
/x-pack/filebeat/module/aws/cloudtrail @elastic/obs-infraobs-integrations
/x-pack/filebeat/module/aws/cloudwatch @elastic/obs-ds-hosted-services
/x-pack/filebeat/module/aws/ec2 @elastic/obs-ds-hosted-services
/x-pack/filebeat/module/aws/elb @elastic/obs-infraobs-integrations
/x-pack/filebeat/module/aws/s3access @elastic/obs-ds-hosted-services @elastic/security-service-integrations
/x-pack/filebeat/module/aws/vpcflow @elastic/security-service-integrations
/x-pack/filebeat/module/awsfargate @elastic/obs-ds-hosted-services
/x-pack/filebeat/module/azure @elastic/obs-ds-hosted-services
/x-pack/filebeat/module/barracuda @elastic/security-service-integrations
Expand Down Expand Up @@ -196,6 +205,24 @@ CHANGELOG*
/x-pack/metricbeat/module/activemq @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/airflow @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/aws/billing @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/cloudwatch @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/aws/dynamodb @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/ebs @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/aws/ec2 @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/aws/elb @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/kinesis @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/lambda @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/natgateway @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/rds @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/s3_daily_storage @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/aws/s3_request @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/aws/sns @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/sqs @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/transitgateway @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/usage @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/vpn @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/aws/sqs @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/awsfargate @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/azure @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/azure/billing @elastic/obs-infraobs-integrations
Expand Down Expand Up @@ -228,7 +255,9 @@ CHANGELOG*
/x-pack/metricbeat/module/openai @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/oracle @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/panw @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/prometheus/ @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/prometheus @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/prometheus/collector @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/prometheus/remote_write @elastic/obs-ds-hosted-services
/x-pack/metricbeat/module/redisenterprise @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/sql @elastic/obs-infraobs-integrations
/x-pack/metricbeat/module/statsd @elastic/obs-infraobs-integrations
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: docs-build

on:
push:
branches:
- main
pull_request_target: ~
merge_group: ~

jobs:
docs-preview:
uses: elastic/docs-builder/.github/workflows/preview-build.yml@main
with:
path-pattern: docs/**
permissions:
deployments: write
id-token: write
contents: read
pull-requests: read
14 changes: 14 additions & 0 deletions .github/workflows/docs-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: docs-cleanup

on:
pull_request_target:
types:
- closed

jobs:
docs-preview:
uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main
permissions:
contents: none
id-token: write
deployments: write
2 changes: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ otherwise no tag is added. {issue}42208[42208] {pull}42403[42403]
- Add GCP organization and project details to ECS cloud fields. {pull}40461[40461]
- Add support for specifying a custom endpoint for GCP service clients. {issue}40848[40848] {pull}40918[40918]
- Fix incorrect handling of types in SQL module. {issue}40090[40090] {pull}41607[41607]
- Remove kibana.settings metricset since the API was removed in 8.0 {issue}30592[30592] {pull}42937[42937]
- Removed support for the Enterprise Search module {pull}42915[42915]

*Osquerybeat*
Expand Down Expand Up @@ -270,6 +271,7 @@ otherwise no tag is added. {issue}42208[42208] {pull}42403[42403]
- Fixed errors in the `elasticsearch.index` metricset when index settings are missing. {issue}42424[42424] {pull}42426[42426]
- Fixed panic caused by uninitialized meraki device wifi0 and wifi1 struct pointers in the device WiFi data fetching. {issue}42745[42745] {pull}42746[42746]
- Only fetch cluster-level index stats summary {issue}36019[36019] {pull}42901[42901]
- Fixed an issue in Metricbeat's Windows module where data collection would fail if the data was unavailable. {issue}42802[42802] {pull}42803[42803]

*Osquerybeat*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ processors:
`

func TestTranslateGUIDWithLDAP(t *testing.T) {
t.Skip("Flaky Test: https://github.com/elastic/beats/issues/42616")
startOpenldapContainer(t)

var entryUUID string
Expand Down
21 changes: 8 additions & 13 deletions libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,10 @@ func NewBeatReceiver(settings Settings, receiverConfig map[string]interface{}, u

if settings.DisableConfigResolver {
config.OverwriteConfigOpts(obfuscateConfigOpts())
} else {
} else if store != nil {
// TODO: Allow the options to be more flexible for dynamic changes
config.OverwriteConfigOpts(configOpts(store))
// note that if the store is nil it should be excluded as an option
config.OverwriteConfigOpts(configOptsWithKeystore(store))
}

b.Beat.Info.Monitoring.Namespace = monitoring.GetNamespace(b.Info.Beat + "-" + b.Info.ID.String())
Expand Down Expand Up @@ -1004,9 +1005,10 @@ func (b *Beat) configure(settings Settings) error {

if settings.DisableConfigResolver {
config.OverwriteConfigOpts(obfuscateConfigOpts())
} else {
} else if store != nil {
// TODO: Allow the options to be more flexible for dynamic changes
config.OverwriteConfigOpts(configOpts(store))
// note that if the store is nil it should be excluded as an option
config.OverwriteConfigOpts(configOptsWithKeystore(store))
}

instrumentation, err := instrumentation.New(cfg, b.Info.Beat, b.Info.Version)
Expand Down Expand Up @@ -1667,9 +1669,9 @@ func (b *Beat) logSystemInfo(log *logp.Logger) {
}
}

// configOpts returns ucfg config options with a resolver linked to the current keystore.
// configOptsWithKeystore returns ucfg config options with a resolver linked to the current keystore.
// Refactor to allow insert into the config option array without having to redefine everything
func configOpts(store keystore.Keystore) []ucfg.Option {
func configOptsWithKeystore(store keystore.Keystore) []ucfg.Option {
return []ucfg.Option{
ucfg.PathSep("."),
ucfg.Resolve(keystore.ResolverWrap(store)),
Expand All @@ -1687,13 +1689,6 @@ func obfuscateConfigOpts() []ucfg.Option {
}
}

// LoadKeystore returns the appropriate keystore based on the configuration.
func LoadKeystore(cfg *config.C, name string) (keystore.Keystore, error) {
keystoreCfg, _ := cfg.Child("keystore", -1)
defaultPathConfig := paths.Resolve(paths.Data, fmt.Sprintf("%s.keystore", name))
return keystore.Factory(keystoreCfg, defaultPathConfig, common.IsStrictPerms())
}

func InitKibanaConfig(beatConfig beatConfig) *config.C {
var esConfig *config.C
if isElasticsearchOutput(beatConfig.Output.Name()) {
Expand Down
30 changes: 30 additions & 0 deletions libbeat/cmd/instance/keystore_fips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//go:build requirefips

package instance

import (
"github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/keystore"
)

// LoadKeystore returns nil in FIPS mode
func LoadKeystore(cfg *config.C, name string) (keystore.Keystore, error) {
return nil, nil
}
36 changes: 36 additions & 0 deletions libbeat/cmd/instance/keystore_fips_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//go:build requirefips

package instance

import (
"testing"

"github.com/elastic/elastic-agent-libs/config"
)

func TestLoadKeystore(t *testing.T) {
ks, err := LoadKeystore(config.NewConfig(), "test")
if err != nil {
t.Errorf("Unexpected error: %v", err)
}
if ks != nil {
t.Error("keystore is not nil.")
}
}
Loading

0 comments on commit 6cb9dca

Please sign in to comment.