Skip to content

Commit 52e8db6

Browse files
authored
Merge pull request #155 from SumoLogic/sechub-layers
Updating security hub layers in new aws regions
2 parents 75e5dfa + 51171a2 commit 52e8db6

File tree

3 files changed

+60
-17
lines changed

3 files changed

+60
-17
lines changed

cloudwatchlogs-with-dlq/test_cwl_lambda.py

+47-17
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,26 @@ def _parse_template(self, template):
167167

168168
def upload_code_in_multiple_regions():
169169
regions = [
170-
"us-east-2",
171-
"us-east-1",
172-
"us-west-1",
173-
"us-west-2",
174-
"ap-south-1",
175-
"ap-northeast-2",
176-
"ap-southeast-1",
177-
"ap-southeast-2",
178-
"ap-northeast-1",
179-
"ca-central-1",
180-
# "cn-north-1",
181-
"eu-central-1",
182-
"eu-west-1",
183-
"eu-west-2",
184-
"eu-west-3",
185-
"sa-east-1"
170+
"me-central-1",
171+
"eu-central-2",
172+
"ap-northeast-3",
173+
"ap-southeast-3"
174+
# "us-east-2",
175+
# "us-east-1",
176+
# "us-west-1",
177+
# "us-west-2",
178+
# "ap-south-1",
179+
# "ap-northeast-2",
180+
# "ap-southeast-1",
181+
# "ap-southeast-2",
182+
# "ap-northeast-1",
183+
# "ca-central-1",
184+
# # "cn-north-1",
185+
# "eu-central-1",
186+
# "eu-west-1",
187+
# "eu-west-2",
188+
# "eu-west-3",
189+
# "sa-east-1"
186190
]
187191

188192
# for region in regions:
@@ -191,9 +195,35 @@ def upload_code_in_multiple_regions():
191195
for region in regions:
192196
upload_code_in_S3(region)
193197

198+
region_map = {
199+
"us-east-1" : "appdevzipfiles-us-east-1",
200+
"us-east-2" : "appdevzipfiles-us-east-2",
201+
"us-west-1" : "appdevzipfiles-us-west-1",
202+
"us-west-2" : "appdevzipfiles-us-west-2",
203+
"ap-south-1": "appdevzipfiles-ap-south-1",
204+
"ap-northeast-2":"appdevzipfiles-ap-northeast-2",
205+
"ap-southeast-1":"appdevzipfiles-ap-southeast-1",
206+
"ap-southeast-2":"appdevzipfiles-ap-southeast-2",
207+
"ap-northeast-1":"appdevzipfiles-ap-northeast-1",
208+
"ca-central-1": "appdevzipfiles-ca-central-1",
209+
"eu-central-1":"appdevzipfiles-eu-central-1",
210+
"eu-west-1":"appdevzipfiles-eu-west-1",
211+
"eu-west-2":"appdevzipfiles-eu-west-2",
212+
"eu-west-3":"appdevzipfiles-eu-west-3",
213+
"eu-north-1":"appdevzipfiles-eu-north-1s",
214+
"sa-east-1":"appdevzipfiles-sa-east-1",
215+
"ap-east-1":"appdevzipfiles-ap-east-1s",
216+
"af-south-1":"appdevzipfiles-af-south-1s",
217+
"eu-south-1":"appdevzipfiles-eu-south-1",
218+
"me-south-1":"appdevzipfiles-me-south-1s",
219+
"me-central-1": "appdevzipfiles-me-central-1",
220+
"eu-central-2":"appdevzipfiles-eu-central-2ss",
221+
"ap-northeast-3" :"appdevzipfiles-ap-northeast-3s",
222+
"ap-southeast-3": "appdevzipfiles-ap-southeast-3"
223+
}
194224

195225
def get_bucket_name(region):
196-
return '%s-%s' % (BUCKET_PREFIX, region)
226+
return region_map[region]
197227

198228

199229
def create_bucket(region):

securityhub-org/sumologic-securityhub-collector-awsorg/sam/create_layer.sh

+11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ fi
1111

1212
declare -a regions=("us-east-2" "us-east-1" "us-west-1" "us-west-2" "ap-south-1" "ap-northeast-2" "ap-southeast-1" "ap-southeast-2" "ap-northeast-1" "ca-central-1" "eu-central-1" "eu-west-1" "eu-west-2" "eu-west-3" "sa-east-1")
1313

14+
# Some buckets names have 's' or 'ss' in the region suffix. It is kept intentional as bucket names were not available.
15+
# Buckets names which are intentional -
16+
# 1. appdevzipfiles-eu-north-1s
17+
# 2. appdevzipfiles-ap-east-1s
18+
# 3. appdevzipfiles-af-south-1s
19+
# 4. appdevzipfiles-me-south-1s
20+
# 5. appdevzipfiles-me-central-1
21+
# 6. appdevzipfiles-eu-central-2ss
22+
# 7. appdevzipfiles-ap-northeast-3s
23+
# 8. appdevzipfiles-ap-southeast-3"
24+
1425
for i in "${regions[@]}"
1526
do
1627
echo "Deploying layer in $i"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
boto3==1.9.60
2+
requests==2.7.0

0 commit comments

Comments
 (0)