Skip to content

Commit 479a95a

Browse files
Merge branch 'main' into sumo_247335
2 parents 00fb758 + 63317cb commit 479a95a

File tree

19 files changed

+206
-60
lines changed

19 files changed

+206
-60
lines changed

awsautoenableS3Logging/packaged.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Metadata:
2424
- s3logging
2525
- flowlogs
2626
Name: sumologic-s3-logging-auto-enable
27-
SemanticVersion: 1.0.14
27+
SemanticVersion: 1.0.16
2828
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/awsautoenableS3Logging
29-
LicenseUrl: s3://appdevstore/AutoEnableS3Logs/v1.0.14/978602b5b9ec16f8bab0e38fd6b3998f
30-
ReadmeUrl: s3://appdevstore/AutoEnableS3Logs/v1.0.14/d05d411471e0bb4db3389f2523f515f0
29+
LicenseUrl: s3://appdevstore/AutoEnableS3Logs/v1.0.16/978602b5b9ec16f8bab0e38fd6b3998f
30+
ReadmeUrl: s3://appdevstore/AutoEnableS3Logs/v1.0.16/d05d411471e0bb4db3389f2523f515f0
3131
SpdxLicenseId: Apache-2.0
3232
Mappings:
3333
Region2ELBAccountId:
@@ -229,9 +229,9 @@ Resources:
229229
Type: AWS::Serverless::Function
230230
Condition: auto_enable_new
231231
Properties:
232-
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.17/sumo_app_utils.zip
232+
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.19/sumo_app_utils.zip
233233
Handler: awsresource.enable_s3_logs
234-
Runtime: python3.12
234+
Runtime: python3.13
235235
Role:
236236
Fn::GetAtt:
237237
- SumoLambdaRole
@@ -466,8 +466,8 @@ Resources:
466466
Condition: auto_enable_existing
467467
Properties:
468468
Handler: main.handler
469-
Runtime: python3.12
470-
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.17/sumo_app_utils.zip
469+
Runtime: python3.13
470+
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.19/sumo_app_utils.zip
471471
MemorySize: 128
472472
Timeout: 900
473473
Role:

awsautoenableS3Logging/sumologic-s3-logging-auto-enable.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Metadata:
2424
- s3logging
2525
- flowlogs
2626
Name: sumologic-s3-logging-auto-enable
27-
SemanticVersion: 1.0.14
27+
SemanticVersion: 1.0.16
2828
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/awsautoenableS3Logging
2929
LicenseUrl: ./LICENSE
3030
ReadmeUrl: ./README.md
@@ -208,9 +208,9 @@ Resources:
208208
Type: 'AWS::Serverless::Function'
209209
Condition: auto_enable_new
210210
Properties:
211-
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.17/sumo_app_utils.zip
211+
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.19/sumo_app_utils.zip
212212
Handler: "awsresource.enable_s3_logs"
213-
Runtime: python3.12
213+
Runtime: python3.13
214214
Role: !GetAtt SumoLambdaRole.Arn
215215
Description: "Lambda Function for auto enable s3 logs for AWS Resources."
216216
MemorySize: 128
@@ -384,8 +384,8 @@ Resources:
384384
Condition: auto_enable_existing
385385
Properties:
386386
Handler: main.handler
387-
Runtime: python3.12
388-
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.17/sumo_app_utils.zip
387+
Runtime: python3.13
388+
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.19/sumo_app_utils.zip
389389
MemorySize: 128
390390
Timeout: 900
391391
Role:

awsautoenableS3Logging/test/Publishsam.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ do
2929
export version=`grep AWS::ServerlessRepo::Application: ../${VALUE} -A 20 | grep SemanticVersion | cut -d ':' -f 2 | xargs`
3030
echo "Package and publish the Template file ${VALUE} with version ${version}."
3131

32-
echo `sam validate -t ../${VALUE} --lint`
32+
## ignoring lint command as errors can't fix
33+
# echo `sam validate -t ../${VALUE} --lint`
3334

3435
sam package --profile ${AWS_PROFILE} --template-file ../${VALUE} --s3-bucket ${SAM_S3_BUCKET} --output-template-file ../packaged.yaml \
3536
--s3-prefix "${KEY}/v${version}" --region ${AWS_REGION}

cloudformation-telemetry/install_python_dependencies.sh

100644100755
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
#!/bin/bash
22

33
# Pull the Amazon Linux image from Docker Hub
4-
docker pull amazonlinux
4+
# aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
5+
docker pull public.ecr.aws/lambda/python:3.13-x86_64
56

67
# Run the Amazon Linux container in detached mode
7-
docker run -d --name telemetry amazonlinux tail -f /dev/null
8+
docker run -d --name telemetry public.ecr.aws/lambda/python:3.13-x86_64 lambda_function.lambda_handler
89

9-
# Install Python, pip, and other dependencies inside the container
10-
docker exec -it telemetry /bin/bash -c "yum update -y && yum install -y python3-pip zip && python3 -m pip install virtualenv"
10+
# Install dependencies inside the container
11+
docker exec -it telemetry /bin/bash -c "dnf install -y zip"
1112

1213
# Create a virtual environment and install dependencies
1314
docker exec -it telemetry /bin/bash -c "python3 -m venv temp-venv && source temp-venv/bin/activate && mkdir telemetry && cd telemetry && pip install crhelper sumologic-appclient-sdk future_fstrings setuptools -t ."
1415

1516
# Copy python file from host to container
16-
docker cp ./lambda_function.py telemetry:/telemetry
17+
docker cp ./lambda_function.py telemetry:/var/task/telemetry
18+
docker cp ./metadata.yaml telemetry:/var/task/telemetry
1719

1820
# Zip the contents of the telemetry directory
1921
docker exec -it telemetry /bin/bash -c "cd telemetry && ls -l && zip -r ../telemetry.zip ."
2022

2123
# Copy the telemetry.zip file from the container to the host
22-
docker cp telemetry:/telemetry.zip ./telemetry.zip
24+
docker cp telemetry:/var/task/telemetry.zip ./telemetry.zip
2325

2426
# Stop and remove the container
2527
docker stop telemetry
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Logging:
2+
LOG_FORMAT: "%(levelname)s | %(asctime)s | %(threadName)s | %(name)s | %(message)s"
3+
ROTATION_TYPE: D
4+
ROTATION_INTERVAL: 10
5+
ENABLE_CONSOLE_LOG: true
6+
ENABLE_LOGFILE: false
7+
LOG_FILEPATH: /tmp/cloudformation-telemetry/telemetry.log
8+
LOG_LEVEL: "DEBUG"
9+
10+
Collection:
11+
MAX_PAYLOAD_BYTESIZE: 500000
12+
MAX_RETRY: 5
13+
BACKOFF_FACTOR: 1
14+
COMPRESSED: true
15+
TIMEOUT: 60
16+
17+
DeployMetaData:
18+
PACKAGENAME: "cloudformation-telemetry"
19+
20+
SumoLogic:
21+
SUMO_ENDPOINT: null
4.09 MB
Binary file not shown.

cloudtrailbenchmark/packaged.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Metadata:
4343
- benchmark
4444
- cloudtrail
4545
Name: sumologic-aws-cloudtrail-benchmark
46-
LicenseUrl: s3://appdevstore/cloudtrailbenchmark/v1.0.17/cac1a6df52c685e0f6ebe4ae72078c80
47-
ReadmeUrl: s3://appdevstore/cloudtrailbenchmark/v1.0.17/8a901bb4fbbe82f128fc502dd3077508
48-
SemanticVersion: 1.0.17
46+
LicenseUrl: s3://appdevstore/cloudtrailbenchmark/v1.0.18/cac1a6df52c685e0f6ebe4ae72078c80
47+
ReadmeUrl: s3://appdevstore/cloudtrailbenchmark/v1.0.18/8a901bb4fbbe82f128fc502dd3077508
48+
SemanticVersion: 1.0.18
4949
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/cloudtrailbenchmark
5050
Parameters:
5151
CollectorName:
@@ -129,7 +129,7 @@ Resources:
129129
Properties:
130130
Location:
131131
ApplicationId: arn:aws:serverlessrepo:us-east-1:956882708938:applications/sumologic-app-utils
132-
SemanticVersion: 2.0.17
132+
SemanticVersion: 2.0.19
133133
Metadata:
134134
SamResourceId: SumoAppUtils
135135
SumoRole:

cloudtrailbenchmark/template.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Metadata:
4949
Name: sumologic-aws-cloudtrail-benchmark
5050
LicenseUrl: ./LICENSE
5151
ReadmeUrl: ./README.md
52-
SemanticVersion: 1.0.17
52+
SemanticVersion: 1.0.19
5353
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/cloudtrailbenchmark
5454

5555

@@ -125,7 +125,8 @@ Resources:
125125
Properties:
126126
Location:
127127
ApplicationId: arn:aws:serverlessrepo:us-east-1:956882708938:applications/sumologic-app-utils
128-
SemanticVersion: 2.0.17
128+
SemanticVersion: 2.0.19
129+
129130

130131
SumoRole:
131132
Condition: SetupSumoResources

cloudtrailbenchmark/testdeploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ else
1212
fi
1313
uid=$(cat /dev/random | LC_CTYPE=C tr -dc "[:lower:]" | head -c 6)
1414

15-
version="1.0.17"
15+
version="1.0.19"
1616

1717
sam package --template-file template.yaml --s3-bucket $SAM_S3_BUCKET --output-template-file packaged.yaml --s3-prefix "cloudtrailbenchmark/v$version" --region $AWS_REGION --profile $AWS_PROFILE
1818

securityhub-org/sumologic-securityhub-collector-awsorg/sam/packaged.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Metadata:
2121
- cloudwatchevents
2222
- securityhub
2323
Name: sumologic-securityhub-connector-aws-org
24-
LicenseUrl: s3://appdevstore/SecurityHubCollectorAWSOrg/v1.0.7/6092dd6c323e33634657102f570628e0
25-
ReadmeUrl: s3://appdevstore/SecurityHubCollectorAWSOrg/v1.0.7/eb911876461845db8f3113dbace6d454
26-
SemanticVersion: 1.0.7
24+
LicenseUrl: s3://appdevstore/SecurityHubCollectorAWSOrg/v1.0.8/6092dd6c323e33634657102f570628e0
25+
ReadmeUrl: s3://appdevstore/SecurityHubCollectorAWSOrg/v1.0.8/eb911876461845db8f3113dbace6d454
26+
SemanticVersion: 1.0.8
2727
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/securityhub-org/sumologic-securityhub-collector-awsorg/src
2828
SpdxLicenseId: Apache-2.0
2929
Parameters:
@@ -42,8 +42,8 @@ Resources:
4242
Type: AWS::Serverless::Function
4343
Properties:
4444
Handler: securityhub_collector_org.lambda_handler
45-
Runtime: python3.11
46-
CodeUri: s3://appdevstore/SecurityHubCollectorAWSOrg/v1.0.7/72d8a9923335d52f948cbd3f99d8b91d
45+
Runtime: python3.13
46+
CodeUri: s3://appdevstore/SecurityHubCollectorAWSOrg/v1.0.8/72d8a9923335d52f948cbd3f99d8b91d
4747
MemorySize: 128
4848
Timeout: 300
4949
Environment:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ else
1010
AWS_REGION="us-east-1"
1111
fi
1212

13-
version="1.0.6"
13+
version="1.0.8"
1414

1515
echo "Creating package.yaml"
1616
sam package --template-file template.yaml --s3-bucket $SAM_S3_BUCKET --output-template-file packaged.yaml --s3-prefix "SecurityHubCollectorAWSOrg/v"$version --region $AWS_REGION --profile $AWS_PROFILE

securityhub-org/sumologic-securityhub-collector-awsorg/sam/template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Metadata:
2020
Name: sumologic-securityhub-connector-aws-org
2121
LicenseUrl: ../LICENSE
2222
ReadmeUrl: ../README.md
23-
SemanticVersion: 1.0.7
23+
SemanticVersion: 1.0.8
2424
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/securityhub-org/sumologic-securityhub-collector-awsorg/src
2525
SpdxLicenseId: Apache-2.0
2626

@@ -41,7 +41,7 @@ Resources:
4141
Type: 'AWS::Serverless::Function'
4242
Properties:
4343
Handler: securityhub_collector_org.lambda_handler
44-
Runtime: python3.11
44+
Runtime: python3.13
4545
CodeUri: ../src/src.zip
4646
MemorySize: 128
4747
Timeout: 300

sumologic-app-utils/build.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Pull the Amazon lambda Linux image from Docker Hub
4+
docker pull public.ecr.aws/lambda/python:3.13-x86_64
5+
6+
# Run the Amazon lambda Linux container in detached mode
7+
docker run -d --name sumologic-app-utils public.ecr.aws/lambda/python:3.13-x86_64 lambda_function.lambda_handler
8+
9+
# Install dependencies inside the container
10+
docker exec -it sumologic-app-utils /bin/bash -c "dnf install -y zip"
11+
12+
# Create a virtual environment and install dependencies
13+
docker exec -it sumologic-app-utils /bin/bash -c "python3 -m venv temp-venv && source temp-venv/bin/activate && mkdir sumo_app_utils && cd sumo_app_utils && pip install crhelper jsonschema requests retrying -t ."
14+
15+
# Copy python file from host to container
16+
docker cp src/. sumologic-app-utils:/var/task/sumo_app_utils
17+
18+
# Zip the contents of the sumologic-app-utils directory
19+
docker exec -it sumologic-app-utils /bin/bash -c "cd sumo_app_utils && ls -l && zip -r ../sumo_app_utils.zip ."
20+
21+
# Copy the sumologic-app-utils.zip file from the container to the host
22+
docker cp sumologic-app-utils://var/task/sumo_app_utils.zip ./sumo_app_utils.zip
23+
24+
# Stop and remove the container
25+
docker stop sumologic-app-utils
26+
docker rm sumologic-app-utils

sumologic-app-utils/deploy.sh

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,29 @@ rm src/external/*.pyc
1515
rm src/*.pyc
1616
rm sumo_app_utils.zip
1717

18-
if [ ! -f sumo_app_utils.zip ]; then
19-
echo "creating zip file"
20-
mkdir python
21-
cd python
22-
pip3 install crhelper -t .
23-
pip3 install requests -t .
24-
pip3 install retrying -t .
25-
cp -v ../src/*.py .
26-
zip -r ../sumo_app_utils.zip .
27-
cd ..
28-
rm -r python
29-
fi
30-
31-
version="2.0.15"
18+
#if [ ! -f sumo_app_utils.zip ]; then
19+
# echo "creating zip file"
20+
# mkdir python
21+
# cd python
22+
# pip3 install crhelper -t .
23+
# pip3 install jsonschema==4.17.3 -t .
24+
# pip3 install requests -t .
25+
# pip3 install retrying -t .
26+
# cp -v ../src/*.py .
27+
# zip -r ../sumo_app_utils.zip .
28+
# cd ..
29+
# rm -r python
30+
#fi
31+
32+
./build.sh
33+
34+
version="2.0.19"
3235

3336
aws s3 cp sumo_app_utils.zip s3://$SAM_S3_BUCKET/sumo_app_utils/v"$version"/sumo_app_utils.zip --region $AWS_REGION --acl public-read
3437

3538
sam package --template-file sumo_app_utils.yaml --s3-bucket $SAM_S3_BUCKET --output-template-file packaged_sumo_app_utils.yaml --s3-prefix "sumo_app_utils/v"$version --region $AWS_REGION --profile $AWS_PROFILE
3639

3740
sam publish --template packaged_sumo_app_utils.yaml --region $AWS_REGION --semantic-version $version
3841

39-
# sam deploy --template-file packaged_sumo_app_utils.yaml --stack-name testingsumoapputils --capabilities CAPABILITY_IAM --region $AWS_REGION
42+
#sam deploy --template-file packaged_sumo_app_utils.yaml --stack-name testingsumoapputils --capabilities CAPABILITY_IAM --region $AWS_REGION
4043

sumologic-app-utils/packaged_sumo_app_utils.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ Metadata:
2020
- sumologic
2121
- serverless
2222
Name: sumologic-app-utils
23-
SemanticVersion: 2.0.17
23+
SemanticVersion: 2.0.19
2424
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/sumologic-app-utils
2525
SpdxLicenseId: Apache-2.0
26-
ReadmeUrl: s3://appdevstore/sumo_app_utils/v2.0.17/4d5a92c06a7fa9d956a900e51a1f6be4
26+
ReadmeUrl: s3://appdevstore/sumo_app_utils/v2.0.19/4d5a92c06a7fa9d956a900e51a1f6be4
2727
Resources:
2828
SumoAppUtilsFunction:
2929
Type: AWS::Serverless::Function
3030
Properties:
3131
Handler: main.handler
32-
Runtime: python3.12
33-
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.17/sumo_app_utils.zip
32+
Runtime: python3.13
33+
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.19/sumo_app_utils.zip
3434
MemorySize: 128
3535
Timeout: 300
3636
Policies:

sumologic-app-utils/src/constants.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
3+
# Define the JSON schema
4+
AWS_TAG_FILTERS_SCHEMA = {
5+
"$schema": "http://json-schema.org/draft-07/schema#",
6+
"type": "object",
7+
"patternProperties": {
8+
"^[A-Za-z0-9_/]+$": {
9+
"type": "object",
10+
"properties": {
11+
"tags": {
12+
"type": "array",
13+
"items": {
14+
"type": "string"
15+
}
16+
}
17+
},
18+
"required": ["tags"],
19+
"additionalProperties": False
20+
}
21+
},
22+
"additionalProperties": False
23+
}

0 commit comments

Comments
 (0)