Skip to content

Commit 5ca33e3

Browse files
committed
Resolve merge conflict
2 parents c51f445 + eac1431 commit 5ca33e3

File tree

349 files changed

+70258
-2013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+70258
-2013
lines changed

.buildkite/hooks/pre-command

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ export TMP_FOLDER_TEMPLATE="${TMP_FOLDER_TEMPLATE_BASE}.XXXXXXXXX"
3131
REPO_BUILD_TAG="${REPO_NAME}/$(buildkite_pr_branch_build_id)"
3232
export REPO_BUILD_TAG
3333

34-
AWS_SERVICE_ACCOUNT_SECRET_PATH=kv/ci-shared/platform-ingest/aws_ingest_ci
35-
PRIVATE_CI_GCS_CREDENTIALS_PATH=kv/ci-shared/platform-ingest/gcp-platform-ingest-ci-service-account
36-
3734
BUILDKITE_API_TOKEN_PATH=kv/ci-shared/platform-ingest/buildkite_token
3835

3936
EC_TOKEN_PATH=kv/ci-shared/platform-ingest/platform-ingest-ec-qa
@@ -43,6 +40,8 @@ EC_DATA_PATH=secret/ci/elastic-integrations/ec_data
4340
export ENVIRONMENT="ci"
4441
export REPO="${REPO_NAME}"
4542

43+
export JOB_GCS_BUCKET_INTERNAL="ecosystem-ci-internal"
44+
4645
branch_name_label() {
4746
local branch="$1"
4847

@@ -107,32 +106,13 @@ if [[ "${BUILDKITE_PIPELINE_SLUG}" =~ ^(integrations|integrations-test-stack)$ ]
107106
fi
108107

109108
if [[ "${BUILDKITE_STEP_KEY}" =~ ^test-integrations- ]]; then
110-
ELASTIC_PACKAGE_AWS_SECRET_KEY=$(retry 5 vault kv get -field secret_key "${AWS_SERVICE_ACCOUNT_SECRET_PATH}")
111-
export ELASTIC_PACKAGE_AWS_SECRET_KEY
112-
ELASTIC_PACKAGE_AWS_ACCESS_KEY=$(retry 5 vault kv get -field access_key "${AWS_SERVICE_ACCOUNT_SECRET_PATH}")
113-
export ELASTIC_PACKAGE_AWS_ACCESS_KEY
114-
115-
PRIVATE_CI_GCS_CREDENTIALS_SECRET=$(retry 5 vault kv get -field plaintext -format=json "${PRIVATE_CI_GCS_CREDENTIALS_PATH}")
116-
export PRIVATE_CI_GCS_CREDENTIALS_SECRET
117-
export JOB_GCS_BUCKET_INTERNAL="ingest-buildkite-ci"
118-
119-
# Environment variables required by the service deployer
120-
export AWS_SECRET_ACCESS_KEY=${ELASTIC_PACKAGE_AWS_SECRET_KEY}
121-
export AWS_ACCESS_KEY_ID=${ELASTIC_PACKAGE_AWS_ACCESS_KEY}
122-
123109
BUILDKITE_API_TOKEN=$(retry 5 vault kv get -field buildkite_token "${BUILDKITE_API_TOKEN_PATH}")
124110
export BUILDKITE_API_TOKEN
125111
fi
126112
fi
127113

128114
if [[ "${BUILDKITE_PIPELINE_SLUG}" == "integrations-serverless" ]]; then
129115
if [[ "${BUILDKITE_STEP_KEY}" == "test-integrations-serverless-project" ]]; then
130-
# Currently, system tests are not run when testing with an Elastic Serverless project, so it is not required to
131-
# add the AWS credentials as in the integrations pipeline.
132-
133-
PRIVATE_CI_GCS_CREDENTIALS_SECRET=$(retry 5 vault kv get -field plaintext -format=json "${PRIVATE_CI_GCS_CREDENTIALS_PATH}")
134-
export PRIVATE_CI_GCS_CREDENTIALS_SECRET
135-
export JOB_GCS_BUCKET_INTERNAL="ingest-buildkite-ci"
136116

137117
BUILDKITE_API_TOKEN=$(retry 5 vault kv get -field buildkite_token "${BUILDKITE_API_TOKEN_PATH}")
138118
export BUILDKITE_API_TOKEN

.buildkite/hooks/pre-exit

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ set -euo pipefail
77
if [[ "$BUILDKITE_PIPELINE_SLUG" =~ ^(integrations|integrations-test-stack)$ ]]; then
88
# FIXME: update condition depending on the pipeline steps triggered
99
if [[ "$BUILDKITE_STEP_KEY" =~ ^test-integrations- ]]; then
10-
unset ELASTIC_PACKAGE_AWS_ACCESS_KEY
11-
unset ELASTIC_PACKAGE_AWS_SECRET_KEY
12-
unset AWS_ACCESS_KEY_ID
13-
unset AWS_SECRET_ACCESS_KEY
1410

1511
# Ensure that kind cluster is deleted
1612
delete_kind_cluster
@@ -25,10 +21,6 @@ fi
2521

2622
if [[ "$BUILDKITE_PIPELINE_SLUG" == "integrations-serverless" ]]; then
2723
if [[ "$BUILDKITE_STEP_KEY" == "test-integrations-serverless-project" ]]; then
28-
unset ELASTIC_PACKAGE_AWS_ACCESS_KEY
29-
unset ELASTIC_PACKAGE_AWS_SECRET_KEY
30-
unset AWS_ACCESS_KEY_ID
31-
unset AWS_SECRET_ACCESS_KEY
3224

3325
# Ensure that kind cluster is deleted
3426
delete_kind_cluster
@@ -44,8 +36,6 @@ fi
4436
unset_secrets
4537
cleanup
4638

47-
google_cloud_logout_active_account
48-
4939
if [[ "$BUILDKITE_PIPELINE_SLUG" == "integrations-backport" && "$BUILDKITE_STEP_KEY" == "create-backport-branch" ]]; then
5040
cd "${WORKSPACE}"
5141
git config remote.origin.url "https://github.com/elastic/integrations.git"

.buildkite/pipeline.serverless.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ steps:
6767
agents:
6868
provider: "gcp"
6969
image: "${IMAGE_UBUNTU_X86_64}"
70+
plugins:
71+
# See https://github.com/elastic/oblt-infra/blob/main/conf/resources/repos/integrations/01-aws-buildkite-oidc.tf
72+
# This plugin creates the environment variables required by the service deployer (AWS_SECRET_ACCESS_KEY and AWS_SECRET_KEY_ID)
73+
- elastic/oblt-aws-auth#v0.1.0:
74+
duration: 10800 # seconds
75+
# See https://github.com/elastic/oblt-infra/blob/main/conf/resources/repos/integrations/01-gcp-buildkite-oidc.tf
76+
# This plugin authenticates to Google Cloud using the OIDC token.
77+
- elastic/oblt-google-auth#v1.3.0:
78+
lifetime: 10800 # seconds
79+
project-id: "elastic-observability-ci"
80+
project-number: "911195782929"
7081
artifact_paths:
7182
- "build/test-results/*.xml"
7283
- "build/elastic-stack-dump/*/logs/*.log"

.buildkite/scripts/common.sh

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ platform_type_lowercase="${platform_type,,}"
1010

1111
SCRIPTS_BUILDKITE_PATH="${WORKSPACE}/.buildkite/scripts"
1212

13-
GOOGLE_CREDENTIALS_FILENAME="google-cloud-credentials.json"
1413
export ELASTIC_PACKAGE_BIN=${WORKSPACE}/build/elastic-package
1514

1615
API_BUILDKITE_PIPELINES_URL="https://api.buildkite.com/v2/organizations/elastic/pipelines/"
@@ -255,34 +254,6 @@ with_github_cli() {
255254
gh version
256255
}
257256

258-
## Logging and logout from Google Cloud
259-
google_cloud_auth_safe_logs() {
260-
local gsUtilLocation
261-
gsUtilLocation=$(mktemp -d -p "${WORKSPACE}" -t "${TMP_FOLDER_TEMPLATE}")
262-
local secretFileLocation=${gsUtilLocation}/${GOOGLE_CREDENTIALS_FILENAME}
263-
264-
echo "${PRIVATE_CI_GCS_CREDENTIALS_SECRET}" > "${secretFileLocation}"
265-
266-
gcloud auth activate-service-account --key-file "${secretFileLocation}" 2> /dev/null
267-
export GOOGLE_APPLICATION_CREDENTIALS=${secretFileLocation}
268-
}
269-
270-
google_cloud_logout_active_account() {
271-
local active_account
272-
active_account=$(gcloud auth list --filter=status:ACTIVE --format="value(account)" 2>/dev/null || true)
273-
if [[ -n "$active_account" && -n "${GOOGLE_APPLICATION_CREDENTIALS+x}" ]]; then
274-
echo "Logging out from GCP for active account"
275-
gcloud auth revoke "$active_account" > /dev/null 2>&1
276-
else
277-
echo "No active GCP accounts found."
278-
fi
279-
280-
if [ -n "${GOOGLE_APPLICATION_CREDENTIALS+x}" ]; then
281-
rm -rf "${GOOGLE_APPLICATION_CREDENTIALS}"
282-
unset GOOGLE_APPLICATION_CREDENTIALS
283-
fi
284-
}
285-
286257
## Helpers for integrations pipelines
287258
check_git_diff() {
288259
cd "${WORKSPACE}"
@@ -983,16 +954,16 @@ upload_safe_logs() {
983954
local source="$2"
984955
local target="$3"
985956

957+
echo "--- Uploading safe logs to GCP bucket ${bucket}"
958+
986959
if ! ls ${source} 2>&1 > /dev/null ; then
987960
echo "upload_safe_logs: artifacts files not found, nothing will be archived"
988961
return
989962
fi
990963

991-
google_cloud_auth_safe_logs
992-
993-
gsutil cp ${source} "gs://${bucket}/buildkite/${REPO_BUILD_TAG}/${target}"
964+
gcloud storage cp ${source} "gs://${bucket}/buildkite/${REPO_BUILD_TAG}/${target}"
994965

995-
google_cloud_logout_active_account
966+
echo "GCP logout is not required, the BK plugin will do it for us"
996967
}
997968

998969
clean_safe_logs() {

.buildkite/scripts/trigger_integrations_in_parallel.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ for package in ${PACKAGE_LIST}; do
8888
FORCE_CHECK_ALL: "${FORCE_CHECK_ALL}"
8989
SERVERLESS: "false"
9090
UPLOAD_SAFE_LOGS: ${UPLOAD_SAFE_LOGS}
91+
plugins:
92+
# See https://github.com/elastic/oblt-infra/blob/main/conf/resources/repos/integrations/01-aws-buildkite-oidc.tf
93+
# This plugin creates the environment variables required by the service deployer (AWS_SECRET_ACCESS_KEY and AWS_SECRET_KEY_ID)
94+
- elastic/oblt-aws-auth#v0.1.0:
95+
duration: 10800 # seconds
96+
# See https://github.com/elastic/oblt-infra/blob/main/conf/resources/repos/integrations/01-gcp-buildkite-oidc.tf
97+
# This plugin authenticates to Google Cloud using the OIDC token.
98+
- elastic/oblt-google-auth#v1.3.0:
99+
lifetime: 10800 # seconds
100+
project-id: "elastic-observability-ci"
101+
project-number: "911195782929"
91102
artifact_paths:
92103
- build/test-results/*.xml
93104
- build/test-coverage/*.xml

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
/packages/citrix_adc/data_stream/vpn @elastic/obs-infraobs-integrations
165165
/packages/citrix_waf @elastic/sec-deployment-and-devices
166166
/packages/claroty_ctd @elastic/security-service-integrations
167+
/packages/claroty_xdome @elastic/security-service-integrations
167168
/packages/cloud_defend @elastic/sec-linux-platform
168169
/packages/cloud_security_posture @elastic/cloud-security-posture
169170
/packages/cloud_asset_inventory @elastic/cloud-security-posture

packages/awsfirehose/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.7.0"
3+
changes:
4+
- description: set event.dataset matching the routed target dataset for ingesting records
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/13910
27
- version: "1.6.0"
38
changes:
49
- description: Add support for AmazonMQ metrics for both managed RabbitMQ and ActiveMQ.

packages/awsfirehose/data_stream/logs/_dev/test/pipeline/test-apigateway-log.json-expected.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"ecs": {
1919
"version": "8.11.0"
2020
},
21+
"event": {
22+
"dataset": "aws.apigateway_logs"
23+
},
2124
"event.id": "37670326805251200781477669690942747782212394134076063744",
2225
"message": "{\"requestId\":\"GQIVriFLIAMEMsA=\",\"ip\":\"1.128.0.0\",\"requestTime\":\"09/Jun/2023:12:54:08 +0000\",\"httpMethod\":\"GET\",\"routeKey\":\"GET /\",\"status\":\"200\",\"protocol\":\"HTTP/1.1\",\"responseLength\":\"47140\"}"
2326
},
@@ -39,6 +42,9 @@
3942
"ecs": {
4043
"version": "8.11.0"
4144
},
45+
"event": {
46+
"dataset": "aws.apigateway_logs"
47+
},
4248
"event.id": "37670326805251200781477669690942747782212394134076063744",
4349
"message": "{\"requestId\":\"Iq9gjE_aIAMFZTg=\",\"ip\":\"1.128.0.0\",\"caller\":\"-\",\"user\":\"-\",\"requestTime\":\"26/Jul/2023:12:20:44 +0000\",\"eventType\":\"CONNECT\",\"routeKey\":\"$connect\",\"status\":\"500\",\"connectionId\":\"Iq8gj1UmIAMCKpA=\",\"apiId\":\"z1ctxygne5\",\"stage\":\"production\",\"domainName\":\"z1ctxygne5.execute-api.us-east-1.amazonaws.com\"}"
4450
},
@@ -57,6 +63,9 @@
5763
"data_stream.dataset": "aws.apigateway_logs",
5864
"data_stream.namespace": "default",
5965
"data_stream.type": "logs",
66+
"event": {
67+
"dataset": "aws.apigateway_logs"
68+
},
6069
"ecs": {
6170
"version": "8.11.0"
6271
},

packages/awsfirehose/data_stream/logs/_dev/test/pipeline/test-cloudfront-log.json-expected.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"ecs": {
1616
"version": "8.11.0"
1717
},
18+
"event": {
19+
"dataset": "aws.cloudfront_logs"
20+
},
1821
"event.id": "37670326805251200781477669690942747782212394134076063744",
1922
"message": "2022-04-19 12:29:36 SEA19-C2 10157 81.2.69.143 POST d111111abcdef8.cloudfront.net /getApplications 200 https://test.com/global Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/100.0.4896.127%20Safari/537.36 source=global - Miss hrsHM5OM6sTIXUleC1G20YtDxMf5Cq0Jbz0pwhVpod2kgEn_W6akCQ== test.com https 1057 0.238 - TLSv1.3 TLS_AES_128_GCM_SHA256 Miss HTTP/2.0 - - 4203 0.238 Miss application/json;charset=UTF-8 - - -"
2023
}

packages/awsfirehose/data_stream/logs/_dev/test/pipeline/test-cloudtrail-log.json-expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
"ecs": {
1919
"version": "8.11.0"
2020
},
21+
"event": {
22+
"dataset": "aws.cloudtrail"
23+
},
2124
"event.id": "37670326805251200781477669690942747782212394134076063744",
2225
"message": "{\"eventVersion\":\"1.08\",\"userIdentity\":{\"type\":\"AWSService\",\"invokedBy\":\"cloudtrail.amazonaws.com\"},\"eventTime\":\"2023-07-17T21:02:26Z\",\"eventSource\":\"sts.amazonaws.com\",\"eventName\":\"AssumeRole\",\"awsRegion\":\"sa-east-1\",\"sourceIPAddress\":\"cloudtrail.amazonaws.com\",\"userAgent\":\"cloudtrail.amazonaws.com\",\"requestParameters\":{\"roleArn\":\"arn:aws:iam::123456:role/service-role/aws-cloudtrail-logs-123456-b888baff_Role\",\"roleSessionName\":\"CLOUDWATCH_LOGS_DELIVERY_SESSION\"},\"responseElements\":{\"credentials\":{\"accessKeyId\":\"ASIAZEDJODE3A5LVGLFB\",\"sessionToken\":\"IQoJb3JpZ2luX2VjEGUaCXNhLWVhc3QtMSJHMEUCIHgHmtcrhwDhosJlQVky+C2zsYDKuR99qVlNjGIp8FLWAiEAsJtTDQ3Arq8iXEOHwv0ImEQdGb5tbgc+fLpoK58Enb4q9AII3v//////////ARAEGgw2MjcyODYzNTAxMzQiDN5gNdfO4ZdSqDmmwSrIAicTBYZg+ZXjwiJTN/Bz2YsMWYU6psw5znG3/Gh3EJ1P3RCmB7d79X6XZzFVi2u2xdrnaY/sTKDfp1jdl8OoAsSKYwJiGbzjoQlv59bB6JqPbKfAKUPAmz6JEMWNFgWTtaQL9rNkdPz23u/1msoUSzxCcxR9f3A2dD4yqnVpNJe8ipuhxpBMzQ61vcGL4G5hQEDM/o8sORP2PXbK4O7QAuWOyuryYkHAPwY9RrL0WHfflGBEBQV6XlidGpsRCtIppZVn025n3DQOypDEaL3fKp0gUsMkDH+frFjxop4o4wRYC3CxXe3XRJ5/Te886rQry7RUfXlQtiCfojZO5ohcLB+z6Y/uCK0IHp3zrfl5shKsQIAFt7p0B8W7PK5yHE4W9HHRiktJ9wTtq1YCTaWECpnjW0bISNgumRmDOAJvVHAjSjfkr4yAlJkw4qm8pQY6vwGbBiuf98AfRFrXMy01hVdE3GNTBrIS68zxUJaOjBLgw8l0nEC00L+LPuqaASFWz65Dnq5JAjXaDD9E3iCi4klp4gZFAcj7uGgeBIPkP7Bpr4SvBfnnqCgE2oyFrWke3NnYtqkL5iHLJeGlOTrvI5ND2H4jurQv0KbiqwHt6DmGF3poZOrtf8R3piNcuCCDLU8RvhRVLHy5rKPzsWgNokBc9XXmgltwvB6rIgdZhBJzupzmy/NSoWZcOeH2ooEELw==\",\"expiration\":\"Jul 12, 2023, 10:02:26 PM\"},\"assumedRoleUser\":{\"assumedRoleId\":\"AROAZEDJODE3NLJAH2FZC:CLOUDWATCH_LOGS_DELIVERY_SESSION\",\"arn\":\"arn:aws:sts::123456:assumed-role/aws-cloudtrail-logs-123456-b888baff_Role/CLOUDWATCH_LOGS_DELIVERY_SESSION\"}},\"requestID\":\"041c9e5f-a031-47d2-a4a0-011bc8d5352c\",\"eventID\":\"3096b662-7aa9-43e6-8bee-541a45686745\",\"readOnly\":true,\"resources\":[{\"accountId\":\"123456\",\"type\":\"AWS::IAM::Role\",\"ARN\":\"arn:aws:iam::123456:role/service-role/aws-cloudtrail-logs-123456-b888baff_Role\"}],\"eventType\":\"AwsApiCall\",\"managementEvent\":true,\"recipientAccountId\":\"123456\",\"sharedEventID\":\"a1c94275-884f-4c1f-b8dc-2e1bf4c94d29\",\"eventCategory\":\"Management\"}"
2326
}
2427
]
25-
}
28+
}

0 commit comments

Comments
 (0)