Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The following cloud providers are supported:
- https://www.qcloud.com/?lang=en[Tencent Cloud] (QCloud)
- Alibaba Cloud (ECS)
- Huawei Cloud (ECS)
- Azure Virtual Machine
- Azure Virtual Machine (*not supported in FIPS-capable artifacts*)
- Openstack Nova
- Hetzner Cloud

Expand Down
2 changes: 2 additions & 0 deletions libbeat/processors/add_cloud_metadata/provider_azure_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.

//go:build !requirefips

package add_cloud_metadata

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.

//go:build !requirefips

package add_cloud_metadata

import (
Expand Down Expand Up @@ -164,7 +166,7 @@
}
}()

logp.TestingSetup()

Check failure on line 169 in libbeat/processors/add_cloud_metadata/provider_azure_vm_test.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

SA1019: logp.TestingSetup is deprecated: Prefer using localized loggers. Use logptest.NewTestingLogger. (staticcheck)

Check failure on line 169 in libbeat/processors/add_cloud_metadata/provider_azure_vm_test.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

SA1019: logp.TestingSetup is deprecated: Prefer using localized loggers. Use logptest.NewTestingLogger. (staticcheck)

server := initAzureTestServer()
defer server.Close()
Expand Down
3 changes: 1 addition & 2 deletions libbeat/processors/add_cloud_metadata/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type result struct {
var cloudMetaProviders = map[string]provider{
"alibaba": alibabaCloudMetadataFetcher,
"ecs": alibabaCloudMetadataFetcher,
"azure": azureVMMetadataFetcher,
"digitalocean": doMetadataFetcher,
"aws": ec2MetadataFetcher,
"ec2": ec2MetadataFetcher,
Expand All @@ -78,7 +77,7 @@ var cloudMetaProviders = map[string]provider{
// or other common endpoints. For example, Openstack supports EC2 compliant metadata endpoint. Thus adding possibility to
// conflict metadata between EC2/AWS and Openstack.
var priorityProviders = []string{
"aws", "ec2", "azure",
"aws", "ec2",
}

func selectProviders(configList providerList, providers map[string]provider) map[string]provider {
Expand Down
29 changes: 29 additions & 0 deletions libbeat/processors/add_cloud_metadata/providers_nofips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 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 add_cloud_metadata

func init() {
// Include the Azure provider ONLY in non-FIPS builds, as the Azure provider depends on
// the Azure SDK which, in turn, depends on the golang.org/x/crypto/pkcs12 package, which
// is not FIPS-compliant, and the SDK doesn't plan to offer a way to disable the use of
// this package at compile time (see https://github.com/Azure/azure-sdk-for-go/issues/24336).
cloudMetaProviders["azure"] = azureVMMetadataFetcher
priorityProviders = append(priorityProviders, "azure")
}
Loading