Skip to content

Commit 27e26eb

Browse files
committed
CFT template for VM Workload Scanning
1 parent 57c2dcc commit 27e26eb

File tree

3 files changed

+391
-4
lines changed

3 files changed

+391
-4
lines changed

modules/Makefile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ PARAM_TRUSTED_IDENTITY ?= arn:aws:iam:::role/$(PARAM_NAME_SUFFIX)
1111
PARAM_TARGET_EVENT_BUS_ARN ?= arn:aws:events:us-east-1::event-bus/default
1212
PARAM_BUCKET_ARN ?= arn:aws:s3:::cloudtrail-$(PARAM_NAME_SUFFIX)
1313
PARAM_REGIONS ?= us-east-1
14+
PARAM_LAMBDA_SCANNING_ENABLED ?= true
1415

1516
.PHONY: validate lint deploy test clean
1617
validate: export AWS_PAGER=""
1718
validate:
18-
aws cloudformation validate-template --template-body file://./foundational.cft.yaml
19-
aws cloudformation validate-template --template-body file://./log_ingestion.events.cft.yaml
20-
aws cloudformation validate-template --template-body file://./log_ingestion.s3.cft.yaml
21-
aws cloudformation validate-template --template-body file://./volume_access.cft.yaml
19+
aws --region us-east-1 cloudformation validate-template --template-body file://./foundational.cft.yaml
20+
aws --region us-east-1 cloudformation validate-template --template-body file://./log_ingestion.events.cft.yaml
21+
aws --region us-east-1 cloudformation validate-template --template-body file://./log_ingestion.s3.cft.yaml
22+
aws --region us-east-1 cloudformation validate-template --template-body file://./volume_access.cft.yaml
23+
aws --region us-east-1 cloudformation validate-template --template-body file://./vm_workload_scanning.cft.yaml
2224

2325
lint:
2426
cfn-lint *.cft.yaml
@@ -28,12 +30,15 @@ lint:
2830
yq '.Resources.OrganizationRuleStackSet.Properties.TemplateBody' log_ingestion.events.cft.yaml | cfn-lint -
2931
yq '.Resources.AccountStackSet.Properties.TemplateBody' volume_access.cft.yaml | cfn-lint -
3032
yq '.Resources.OrganizationStackSet.Properties.TemplateBody' volume_access.cft.yaml | cfn-lint -
33+
yq '.Resources.ScanningOrgNoLambdaRoleStackSet.Properties.TemplateBody' vm_workload_scanning.cft.yaml | cfn-lint -
34+
yq '.Resources.ScanningOrgWithLambdaRoleStackSet.Properties.TemplateBody' vm_workload_scanning.cft.yaml | cfn-lint -
3135

3236
publish:
3337
aws s3 cp foundational.cft.yaml s3://$(S3_BUCKET)/modules/$(S3_PREFIX)/foundational.cft.yaml
3438
aws s3 cp log_ingestion.s3.cft.yaml s3://$(S3_BUCKET)/modules/$(S3_PREFIX)/log_ingestion.s3.cft.yaml
3539
aws s3 cp log_ingestion.events.cft.yaml s3://$(S3_BUCKET)/modules/$(S3_PREFIX)/log_ingestion.events.cft.yaml
3640
aws s3 cp volume_access.cft.yaml s3://$(S3_BUCKET)/modules/$(S3_PREFIX)/volume_access.cft.yaml
41+
aws s3 cp vm_workload_scanning.cft.yaml s3://$(S3_BUCKET)/modules/$(S3_PREFIX)/vm_workload_scanning.cft.yaml
3742

3843
deploy:
3944
aws cloudformation deploy \
@@ -83,10 +88,23 @@ deploy:
8388
"IsOrganizational=$(PARAM_IS_ORGANIZATIONAL)" \
8489
"OrganizationalUnitIDs=$(PARAM_ORGANIZATIONAL_UNIT_IDS)"
8590

91+
aws cloudformation deploy \
92+
--stack-name $(STACK_NAME)-VMWorkloadScanning-$(PARAM_NAME_SUFFIX) \
93+
--template-file vm_workload_scanning.cft.yaml \
94+
--capabilities "CAPABILITY_NAMED_IAM" "CAPABILITY_AUTO_EXPAND" \
95+
--parameter-overrides \
96+
"NameSuffix=$(PARAM_NAME_SUFFIX)" \
97+
"ExternalID=$(PARAM_EXTERNAL_ID)" \
98+
"TrustedIdentity=$(PARAM_TRUSTED_IDENTITY)" \
99+
"LambdaScanningEnabled"=$(PARAM_LAMBDA_SCANNING_ENABLED) \
100+
"IsOrganizational=$(PARAM_IS_ORGANIZATIONAL)" \
101+
"OrganizationalUnitIDs=$(PARAM_ORGANIZATIONAL_UNIT_IDS)"
102+
86103
clean:
87104
aws cloudformation delete-stack --stack-name $(STACK_NAME)-Foundational-$(PARAM_NAME_SUFFIX)
88105
aws cloudformation delete-stack --stack-name $(STACK_NAME)-LogIngestion-EventBridge-$(PARAM_NAME_SUFFIX)
89106
aws cloudformation delete-stack --stack-name $(STACK_NAME)-LogIngestion-S3-$(PARAM_NAME_SUFFIX)
90107
aws cloudformation delete-stack --stack-name $(STACK_NAME)-VolumeAccess-$(PARAM_NAME_SUFFIX)
108+
aws cloudformation delete-stack --stack-name $(STACK_NAME)-VMWorkloadScanning-$(PARAM_NAME_SUFFIX)
91109

92110

0 commit comments

Comments
 (0)