File tree 4 files changed +20
-5
lines changed
deploy/test-environments/cis
4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,22 @@ jobs:
11
11
runs-on : ubuntu-latest
12
12
outputs :
13
13
deployment_name : ${{ steps.set_deployment_name.outputs.date-name }}
14
+ stack_version : ${{ steps.set_deployment_name.outputs.stack-version }}
14
15
steps :
16
+ - name : Check out the repo
17
+ uses : actions/checkout@v4
18
+
19
+ - name : Hermit Environment
20
+ uses : ./.github/actions/hermit
21
+
15
22
- name : Set deployment name
16
23
id : set_deployment_name
24
+ env :
25
+ STACK_VERSION : ${{ env.ELK_VERSION }}
17
26
run : |
18
27
date_name=$(echo "prd-env-$(date +'%d%b%H%M')" | tr '[:upper:]' '[:lower:]')
19
28
echo "date-name=$date_name" >> $GITHUB_OUTPUT
29
+ echo "stack-version=$STACK_VERSION" >> $GITHUB_OUTPUT
20
30
21
31
deploy :
22
32
needs : naming
30
40
deployment_name : ${{ needs.naming.outputs.deployment_name }}
31
41
# For now, the region is not used because it's overridden in the tf, but it's here for future compatibility.
32
42
ess-region : " aws-us-east-1"
33
- elk-stack-version : 9.0.0-SNAPSHOT
43
+ elk-stack-version : ${{ needs.naming.outputs.stack_version }}
34
44
serverless_mode : true
35
45
run-sanity-tests : true
36
46
expiration_days : 0
Original file line number Diff line number Diff line change 1
1
provider "aws" {
2
- region = var. region
2
+ region = var. region
3
+ max_retries = 30
3
4
}
4
5
5
6
locals {
Original file line number Diff line number Diff line change 30
30
COMPONENTS_BACKOFF = 10
31
31
32
32
AGENT_VERSION = elasticsearch .agent_version
33
+ if AGENT_VERSION .endswith ("SNAPSHOT" ):
34
+ AGENT_VERSION = AGENT_VERSION .split ("-" )[0 ]
33
35
34
36
# Check if AGENT_VERSION is provided
35
37
if not AGENT_VERSION :
@@ -181,7 +183,6 @@ def test_cspm_aws_findings(
181
183
query_list = build_query_list (
182
184
benchmark_id = "cis_aws" ,
183
185
match_type = match_type ,
184
- version = AGENT_VERSION ,
185
186
agent = agent ,
186
187
)
187
188
query , sort = cspm_client .build_es_must_match_query (must_query_list = query_list , time_range = "now-24h" )
@@ -244,7 +245,6 @@ def test_cspm_gcp_findings(
244
245
query_list = build_query_list (
245
246
benchmark_id = "cis_gcp" ,
246
247
match_type = match_type ,
247
- version = AGENT_VERSION ,
248
248
agent = agent ,
249
249
)
250
250
query , sort = cspm_client .build_es_must_match_query (must_query_list = query_list , time_range = "now-24h" )
@@ -279,7 +279,6 @@ def test_cspm_azure_findings(
279
279
for agent in azure_agents :
280
280
query_list = build_query_list (
281
281
benchmark_id = "cis_azure" ,
282
- version = AGENT_VERSION ,
283
282
match_type = match_type ,
284
283
agent = agent ,
285
284
)
Original file line number Diff line number Diff line change 29
29
"Key=project,Value=test-environments"
30
30
)
31
31
32
+ DOCKER_ARTIFACTORY_AGENT = "docker.elastic.co/elastic-agent/elastic-agent"
32
33
33
34
elk_config = Munch ()
34
35
elk_config .user = os .getenv ("ES_USER" , "NA" )
40
41
41
42
kspm_config = Munch ()
42
43
kspm_config .docker_image_override = os .getenv ("DOCKER_IMAGE_OVERRIDE" , "" )
44
+ if not kspm_config .docker_image_override and elk_config .stack_version .endswith ("SNAPSHOT" ):
45
+ kspm_config .docker_image_override = f"{ DOCKER_ARTIFACTORY_AGENT } :{ elk_config .stack_version } "
46
+ if elk_config .agent_version :
47
+ kspm_config .docker_image_override = f"{ DOCKER_ARTIFACTORY_AGENT } :{ elk_config .agent_version } "
43
48
44
49
aws_config = Munch ()
45
50
aws_config .access_key_id = os .getenv ("AWS_ACCESS_KEY_ID" , "NA" )
You can’t perform that action at this time.
0 commit comments