This repository was archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathdsm-mp.template.yaml
More file actions
985 lines (985 loc) · 33.4 KB
/
Copy pathdsm-mp.template.yaml
File metadata and controls
985 lines (985 loc) · 33.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
---
AWSTemplateFormatVersion: 2010-09-09
Description: 'v5.70: Deploys Deep Security Manager to AWS. This template is designed
to be nested in a stack, and requires several passed parameters to launch. **WARNING**
This template creates Amazon EC2 instances and related resources. You will be billed
for the AWS resources used if you create a stack from this template. (qs-1ngr590jo)'
Metadata:
cfn-lint:
config:
ignore_checks: [W2001,W4002,E9010]
ignore_reasons:
W2001:'Parameters are referenced by other template'
W4002:'Using NoEcho parameters as the scripte input'
E9010:'Definition is used by another template'
Parameters:
AWSIKeyPairName:
Description: Existing key pair to use for connecting to your Deep Security Manager
Instance
Type: AWS::EC2::KeyPair::KeyName
ConstraintDescription: Select an existing EC2 Key Pair.
AWSIVPC:
Description: Existing VPC to deploy Deep Security Manager
Type: AWS::EC2::VPC::Id
AllowedPattern: '[-_a-zA-Z0-9]*'
DSCAdminName:
Default: admin
Description: The Deep Security Manager administrator account username for Web
Console Access
Type: String
MinLength: 1
MaxLength: 16
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
ConstraintDescription: must begin with a letter and contain only alphanumeric
characters.
DSCAdminPassword:
NoEcho: true
Description: The Deep Security Manager administrator account password
Type: String
MinLength: 8
MaxLength: 41
AllowedPattern: '[a-zA-Z0-9!^*\-_+]*'
ConstraintDescription: Can only contain alphanumeric characters or the following
special characters !^*-_+ Min length 8, max length 41
DSIPLicenseKey:
Description: Deep Security License key including dashes (e.g. AP-E9RM-99WHE-B5UR5-BV8YB-HVYM8-HYYVG)
Type: String
MinLength: 37
MaxLength: 37
AllowedPattern: '[A-Z0-9]{2}-[A-Z0-9]{4}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}'
ConstraintDescription: Key can only contain ASCII characters.
Default: XX-XXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
DSIPHeartbeatPort:
Description: The heartbeat port used by Deep Security Agents and appliances to
communicate with the Deep Security Manager.
Type: Number
MinValue: 0
MaxValue: 65535
Default: '4120'
ConstraintDescription: Must be a valid TCP port.
DSIPGUIPort:
Description: The Deep Security Manager application and GUI port.
Type: Number
MinValue: 0
MaxValue: 65535
Default: '4119'
ConstraintDescription: Must be a valid TCP port.
DSIPInstanceType:
Description: Amazon EC2 instance type for the Deep Security Manager Node Instances
Type: String
Default: m5.large
AllowedValues:
- m4.large
- m4.xlarge
- m4.2xlarge
- m4.4xlarge
- m4.10xlarge
- m5.large
- m5.xlarge
- m5.2xlarge
- m5.4xlarge
- m5.8xlarge
- c3.xlarge
- c3.2xlarge
- c3.4xlarge
- c3.8xlarge
- c4.xlarge
- c4.2xlarge
- c4.4xlarge
- c4.8xlarge
- c5.4xlarge
- c5.9xlarge
- r3.large
- r3.xlarge
- r3.2xlarge
- r3.4xlarge
- r3.8xlarge
- i2.xlarge
- i2.2xlarge
- i2.4xlarge
- i2.8xlarge
- g3.4xlarge
- g3.8xlarge
- r4.large
- r4.xlarge
- r4.2xlarge
- r4.4xlarge
- r4.8xlarge
DBICAdminName:
Default: dsadmin
Description: Admin account username to be used for the database instance
Type: String
MinLength: 1
MaxLength: 16
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
ConstraintDescription: must begin with a letter and contain only alphanumeric
characters.
DBICAdminPassword:
NoEcho: true
Description: Password to be used for the database admin account
Type: String
MinLength: 8
MaxLength: 41
AllowedPattern: '[a-zA-Z0-9!^*\-_+]*'
ConstraintDescription: Can only contain alphanumeric characters or the following
special characters !^*-_+ Min length 8, max length 41
DBPName:
Default: dsm
Description: Name to be assigned to the database
Type: String
MinLength: 1
MaxLength: 64
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
ConstraintDescription: must begin with a letter and contain only alphanumeric
characters.
DBPRDSEndpoint:
Default: RDS.FQDN.domain
Description: FQDN or IP of RDS Endpoint
Type: String
MinLength: '1'
MaxLength: '254'
DSMSG:
Type: AWS::EC2::SecurityGroup::Id
DBPEngine:
Default: Embedded
Type: String
AllowedValues:
- Embedded
- Oracle
- SQL
- PostgreSQL
- AuroraPostgreSQL
DSISubnetID:
Description: Existing Subnet for Deep Security Manager. Must be a public subnet
contained the in VPC chosen above.
Type: AWS::EC2::Subnet::Id
AllowedPattern: '[-_a-zA-Z0-9]*'
ConstraintDescription: Subnet ID must exist in the chosen VPC
DSMPMNode:
Description: Select whether this is an additional node to be added to an existing
Deep Security Manager Infrastructure
Type: String
AllowedValues:
- 'Yes'
- 'No'
Default: 'No'
DSIPLicense:
Description: Choose License Model. If choosing BYOL you may enter the license
below
Type: String
AllowedValues:
- PerHost
- BYOL
CreateEIP:
Description: Allocate an EIP and associate it with this Deep Security Manager
Instance. Recommend set to true unless deploying behind an ELB
Type: String
AllowedValues:
- 'True'
- 'False'
Default: 'True'
DSIELB:
Type: String
Default: ''
DSIELBFQDN:
Type: String
Default: ''
DSM1CompleteWaitHandle:
Type: String
Default: ''
DSELBPosture:
Description: Use internal or internet-facing ELB
Type: String
AllowedValues:
- Internet-facing
- Internal
Default: Internet-facing
QSS3BucketName:
AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$
ConstraintDescription: Quick Start bucket name can include numbers, lowercase
letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen
(-).
Default: aws-quickstart
Description: S3 bucket name for the Quick Start assets. Quick Start bucket name
can include numbers, lowercase letters, uppercase letters, and hyphens (-).
It cannot start or end with a hyphen (-).
Type: String
QSS3BucketRegion:
Default: 'us-east-1'
Description: 'The AWS Region where the Quick Start S3 bucket (QSS3BucketName) is hosted. When using your own bucket, you must specify this value.'
Type: String
QSS3KeyPrefix:
AllowedPattern: ^[0-9a-zA-Z-/]*$
ConstraintDescription: Quick Start key prefix can include numbers, lowercase letters,
uppercase letters, hyphens (-), and forward slash (/).
Default: quickstart-trendmicro-deepsecurity/
Description: S3 key prefix for the Quick Start assets. Quick Start key prefix
can include numbers, lowercase letters, uppercase letters, hyphens (-), and
forward slash (/).
Type: String
DSCLicenseType:
Type: String
Default: Enterprise
AllowedValues:
- Enterprise
- Network
DSProxyUrl:
Type: String
Default: ''
Mappings:
DSMAMI:
us-east-1:
PerHost: ami-034f769377f7600f7
BYOL: ami-0234a9b4821792670
us-east-2:
PerHost: ami-0ad325570989f2eb0
BYOL: ami-0369f9d6c9258bf96
us-west-1:
PerHost: ami-012c69edbd2fc568c
BYOL: ami-09b212b624834f1ea
us-west-2:
PerHost: ami-02b7fcc81ed04663c
BYOL: ami-073519563394b9174
ca-central-1:
PerHost: ami-06c5042b42af9f5b0
BYOL: ami-0d431be1885797ed9
eu-central-1:
PerHost: ami-05181b7f2953377ca
BYOL: ami-03bb0ed788b2d2aa8
eu-west-1:
PerHost: ami-0e6ba44dd5e9b76ce
BYOL: ami-003b5b82ebe97f2a0
eu-west-2:
PerHost: ami-08f7c6cb4dc625e08
BYOL: ami-0789ad2f4ae459a17
eu-west-3:
PerHost: ami-0069fc7685c4dea2f
BYOL: ami-08142aec8f827d5d2
ap-southeast-1:
PerHost: ami-029d7876d4b075d67
BYOL: ami-025ed67e5b1c2c372
ap-southeast-2:
PerHost: ami-058ad83f3606d246c
BYOL: ami-0138699752651aa57
ap-southeast-3:
PerHost: ami-09cf228c246ead07d
BYOL: ami-052293a24be70ed39
ap-south-1:
PerHost: ami-0a36d0ce21b69d566
BYOL: ami-05ac2ec60f79961fa
ap-northeast-1:
PerHost: ami-009a1b5c2d9baea92
BYOL: ami-0f1c7f71f55269286
ap-northeast-2:
PerHost: ami-0bef8d4b607ffbccf
BYOL: ami-01964c86d39320dc4
ap-northeast-3:
PerHost: ami-022275afb93e46931
BYOL: ami-0d77c9f4820f22a06
sa-east-1:
PerHost: ami-09a7aad794f9032df
BYOL: ami-01d475281518d0f2c
eu-north-1:
PerHost: ami-01fb27db0a9e7df76
BYOL: ami-0565744dbec53c908
me-south-1:
PerHost: ami-0933b305daf275bc5
BYOL: ami-061a34138c50553de
eu-south-1:
PerHost: ami-0a931d0fa89e1984e
BYOL: ami-071408025d5068b73
us-gov-east-1:
PerHost: ami-00a1fe22e94834117
BYOL: ami-0cdc14f21d01aff88
us-gov-west-1:
PerHost: ami-0739737bdbafe9335
BYOL: ami-0b8415fcacf24c467
DSMSIZE:
us-east-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
us-east-2:
PerHost: m5.xlarge
BYOL: m5.xlarge
us-west-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
us-west-2:
PerHost: m5.xlarge
BYOL: m5.xlarge
ca-central-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
ap-south-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
ap-northeast-2:
PerHost: m5.xlarge
BYOL: m5.xlarge
ap-northeast-3:
PerHost: m5.xlarge
BYOL: m5.xlarge
ap-southeast-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
ap-southeast-2:
PerHost: m5.xlarge
BYOL: m5.xlarge
ap-southeast-3:
PerHost: m5.xlarge
BYOL: m5.xlarge
ap-northeast-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
eu-north-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
eu-central-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
eu-west-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
eu-west-2:
PerHost: m5.xlarge
BYOL: m5.xlarge
eu-west-3:
PerHost: m5.xlarge
BYOL: m5.xlarge
eu-south-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
sa-east-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
us-gov-west-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
me-south-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
us-gov-east-1:
PerHost: m5.xlarge
BYOL: m5.xlarge
DSMDBMap:
SQL:
DbTypeString: Microsoft SQL Server
Oracle:
DbTypeString: Oracle
Embedded:
DbTypeString: Embedded
PostgreSQL:
DbTypeString: PostgreSQL
AuroraPostgreSQL:
DbTypeString: PostgreSQL
Resources:
DSMRole:
Type: AWS::IAM::Role
Metadata:
cfn-lint:
config:
ignore_checks: [EIAMPolicyWildcardResource]
ignore_reasons:
EIAMPolicyWildcardResource: 'Those actions of ec2, iam and elasticloadbalancing:DescribeLoadBalancers does not support resource-level permissions, it only supports the ”*” in the resource element.'
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service:
- ec2.amazonaws.com
Action:
- sts:AssumeRole
ManagedPolicyArns:
!If
- UsePerHost
- - arn:aws:iam::aws:policy/AWSMarketplaceMeteringFullAccess
- !Ref AWS::NoValue
Path: /
Policies:
- PolicyName: aws-quick-start-s3-policy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- s3:GetObject
Resource: !Sub
- arn:${AWS::Partition}:s3:::${S3Bucket}/${QSS3KeyPrefix}*
- S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
- !If
- AddToELB
- PolicyName: DeepSecurityManagerInstancePolicy
PolicyDocument:
Statement:
- Effect: Allow
Action:
- ec2:DescribeLicenses
- ec2:DescribeInstances
- ec2:DescribeImages
- ec2:DescribeRegions
- ec2:DescribeVpcs
- ec2:DescribeSubnets
- ec2:DescribeTags
- ec2:DescribeAvailabilityZones
- ec2:DescribeSecurityGroups
- iam:ListAccountAliases
- elasticloadbalancing:DescribeLoadBalancers
Resource: '*'
- Effect: Allow
Action:
- elasticloadbalancing:RegisterInstancesWithLoadBalancer
- elasticloadbalancing:CreateLoadBalancerListeners
- elasticloadbalancing:CreateLoadBalancerPolicy
- elasticloadbalancing:SetLoadBalancerPoliciesOfListener
Resource:
!Join
- ''
- - !If
- GovCloudCondition
- 'arn:aws-us-gov:elasticloadbalancing:'
- 'arn:aws:elasticloadbalancing:'
- !Ref AWS::Region
- ':'
- !Ref AWS::AccountId
- :loadbalancer/
- !Ref DSIELB
- Effect: Allow
Action:
- sts:AssumeRole
Resource:
!Join
- ''
- - !If
- GovCloudCondition
- 'arn:aws-us-gov:iam::'
- 'arn:aws:iam::'
- !Ref AWS::AccountId
- :role/*
- Effect: Allow
Action:
- iam:UploadServerCertificate
- iam:GetServerCertificate
Resource:
!Join
- ''
- - !If
- GovCloudCondition
- 'arn:aws-us-gov:iam::'
- 'arn:aws:iam::'
- !Ref AWS::AccountId
- :server-certificate/DeepSecurityElbCertificate-
- !Ref AWS::StackName
- PolicyName: DeepSecurityManagerInstancePolicy
PolicyDocument:
Statement:
- Effect: Allow
Action:
- ec2:DescribeLicenses
- ec2:DescribeImages
- ec2:DescribeInstances
- ec2:DescribeRegions
- ec2:DescribeSubnets
- ec2:DescribeTags
- ec2:DescribeVpcs
- iam:ListAccountAliases
- ec2:DescribeAvailabilityZones
- ec2:DescribeSecurityGroups
- iam:ListAccountAliases
Resource: '*'
- Effect: Allow
Action:
- sts:AssumeRole
Resource:
!Join
- ''
- - !If
- GovCloudCondition
- 'arn:aws-us-gov:iam::'
- 'arn:aws:iam::'
- !Ref AWS::AccountId
- :role/*
DSMProfile:
Type: AWS::IAM::InstanceProfile
Properties:
Path: /
Roles:
- !Ref DSMRole
DSMLaunchTemplate:
Type: AWS::EC2::LaunchTemplate
Properties:
LaunchTemplateData:
MetadataOptions:
HttpTokens: 'required'
DSM:
Type: AWS::EC2::Instance
Metadata:
AWS::CloudFormation::Authentication:
S3AccessCreds:
type: S3
roleName: !Ref DSMRole
buckets: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
AWS::CloudFormation::Init:
configSets:
default:
- setup
- prepDSMInstall
- installDSM
- addCloudAccount
- fixManagerHostObject
doSqlSetup:
- sqlSetup
fixManagerLbSettings:
- fixManagerLoadBalancerSettings
fixManagerLocalLbAddress:
- fixManagerLocalLoadBalancerHostsFile
fixManagerHostObject:
- fixManagerHostObject
addDsmNode:
- setup
- prepDSMInstall
- installDSM
- fixManagerHostObject
setupLocalELB:
- addToELB
- fixManagerLocalLoadBalancerHostsFile
setupGlobalELB:
- fixManagerLoadBalancerSettings
setup:
files:
/etc/cfn/cfn-hup.conf:
content:
Fn::Sub: |
[main]
stack=${AWS::StackId}
region=${AWS::Region}
mode: '000400'
owner: root
group: root
/etc/cfn/hooks.d/cfn-auto-reloader.conf:
content:
Fn::Sub: |
[cfn-auto-reloader-hook]
triggers=post.update
path=Resources.DSM.Metadata.AWS::CloudFormation::Init
action=/opt/aws/bin/cfn-init -v -c updateDSM --stack ${AWS::StackId} --resource DSM1 --region ${AWS::Region} runas=root
services:
sysvinit:
cfn-hup:
enabled: 'true'
ensureRunning: 'true'
files:
- /etc/cfn/cfn-hup.conf
- /etc/cfn/hooks.d/cfn-auto-reloader.conf
prepDSMInstall:
files:
/etc/cfn/dsmConfiguration.properties:
content:
Fn::Sub:
- |
${LicenseConfig}
CredentialsScreen.Administrator.Username=${DSCAdminName}
CredentialsScreen.Administrator.Password=${DSCAdminPassword}
CredentialsScreen.UseStrongPasswords=False
Dinstall4j.language=en
DatabaseScreen.DatabaseType=${DBTypeConfig}
DatabaseScreen.Hostname=${DBPRDSEndpoint}
DatabaseScreen.DatabaseName=${DBPName}
DatabaseScreen.Transport=TCP
DatabaseScreen.Username=${DBICAdminName}
DatabaseScreen.Password=${DBICAdminPassword}
AddressAndPortsScreen.ManagerPort=${DSIPGUIPort}
AddressAndPortsScreen.HeartbeatPort=${DSIPHeartbeatPort}
${NodeConfig}
SecurityUpdateScreen.UpdateComponents=true
SoftwareUpdateScreen.UpdateSoftware=True
SmartProtectionNetworkScreen.EnableFeedback=false
SmartProtectionNetworkScreen.IndustryType=blank
RelayScreen.Install=True
${softwareUpdateScreenProxyConfig}
${securityUpdateScreenProxyConfig}
Override.Automation=True
Cloudformation.QSS3BucketName=${QSS3BucketName}
Cloudformation.QSS3BucketRegion=${QSS3BucketRegion}
Cloudformation.QSS3KeyPrefix=${QSS3KeyPrefix}
- LicenseConfig:
!If
- AddAcAnswer
- !If
- NetworkOnlyLicense
- Fn::Sub: LicenseScreen.License.1=${DSIPLicenseKey}
- Fn::Sub: LicenseScreen.License.-1=${DSIPLicenseKey}
- ''
DBTypeConfig:
!FindInMap
- DSMDBMap
- !Ref DBPEngine
- DbTypeString
NodeConfig:
!If
- IsFirstNode
- AddressAndPortsScreen.NewNode=false
- |
AddressAndPortsScreen.NewNode=true
UpgradeVerificationScreen.Overwrite=False
softwareUpdateScreenProxyConfig:
!If
- UseProxy
- Fn::Sub:
- |
SoftwareUpdateScreen.Proxy=True
SoftwareUpdateScreen.ProxyType=HTTP
SoftwareUpdateScreen.ProxyAddress=${softwareUpdateScreenProxyHost}
SoftwareUpdateScreen.ProxyPort=${softwareUpdateScreenProxyPort}
SoftwareUpdateScreen.ProxyAuthentication="False"
SoftwareUpdateScreen.ProxyUsername=""
SoftwareUpdateScreen.ProxyPassword=""
- softwareUpdateScreenProxyHost: !Select
- 0
- Fn::Split:
- ":"
- Fn::Sub: "${DSProxyUrl}"
softwareUpdateScreenProxyPort: !Select
- 1
- Fn::Split:
- ":"
- Fn::Sub: "${DSProxyUrl}"
- ''
securityUpdateScreenProxyConfig:
!If
- UseProxy
- Fn::Sub:
- |
SecurityUpdateScreen.Proxy=True
SecurityUpdateScreen.ProxyType=HTTP
SecurityUpdateScreen.ProxyAddress=${securityUpdateScreenProxyHost}
SecurityUpdateScreen.ProxyPort=${securityUpdateScreenProxyPort}
SecurityUpdateScreen.ProxyAuthentication="False"
SecurityUpdateScreen.ProxyUsername=""
SecurityUpdateScreen.ProxyPassword=""
- securityUpdateScreenProxyHost: !Select
- 0
- Fn::Split:
- ":"
- Fn::Sub: "${DSProxyUrl}"
securityUpdateScreenProxyPort: !Select
- 1
- Fn::Split:
- ":"
- Fn::Sub: "${DSProxyUrl}"
- ''
owner: root
mode: '000600'
installDSM:
commands:
0-sethostnameinprops:
command: |
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60"`
managerAddress=`curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/local-ipv4/`
echo "AddressAndPortsScreen.ManagerAddress=$managerAddress" >> /etc/cfn/dsmConfiguration.properties
ignoreErrors: 'false'
1-install-DSM:
command: cd /opt/trend/packages/dsm/default/; sh /opt/trend/packages/dsm/default/ManagerAWS.sh
-q -console -varfile /etc/cfn/dsmConfiguration.properties >> /tmp/dsmInstallLog
ignoreErrors: 'false'
6-install-xml_grep:
command: yum -y install perl-XML-Twig
addCloudAccount:
files:
/etc/cfn/set-aia-settings.sh:
source:
Fn::Sub:
- https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}scripts/set-aia-settings.sh
- S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion]
S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
owner: root
mode: '000700'
authentication: S3AccessCreds
/etc/cfn/end-mp-web-installer.sh:
source:
Fn::Sub:
- https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}scripts/end-mp-web-installer.sh
- S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion]
S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
owner: root
mode: '000700'
authentication: S3AccessCreds
/etc/cfn/add-aws-account-with-instance-role.sh:
source:
Fn::Sub:
- https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}scripts/add-aws-account-with-instance-role.sh
- S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion]
S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
owner: root
mode: '000700'
authentication: S3AccessCreds
commands:
5-check-service:
command:
Fn::Sub: until curl -vk https://127.0.0.1:${DSIPGUIPort}/rest/status/manager/current/ping;
do echo "manager not started yet" >> /tmp/4-check-service; service
dsm_s start >> /tmp/4-check-service;sleep 30; done
7-set-aia-settings:
command:
Fn::Sub: /etc/cfn/set-aia-settings.sh ${DSCAdminName} ${DSCAdminPassword}
- ${DSIPGUIPort} >> /tmp/set-aia-settings.log
8-addCloudAccount:
command:
Fn::Sub: /etc/cfn/add-aws-account-with-instance-role.sh ${DSCAdminName}
${DSCAdminPassword} localhost ${DSIPGUIPort} ${AWS::Region}
ignoreErrors: 'False'
10-endWebInstaller:
command: /etc/cfn/end-mp-web-installer.sh
sqlSetup:
files:
/etc/cfn/rhel-scripts/create-dsm-db.py:
source:
Fn::Sub:
- https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}scripts/create-dsm-db.py
- S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion]
S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
owner: root
mode: '000755'
authentication: S3AccessCreds
commands:
1-create-db:
command:
Fn::Sub: cd /etc/cfn/rhel-scripts; python create-dsm-db.py --user
${DBICAdminName} --pass ${DBICAdminPassword} --endpoint ${DBPRDSEndpoint}
--dbname ${DBPName}
ignoreErrors: 'false'
addToELB:
commands:
0-add-instance-to-elb:
command:
Fn::Sub: |
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60"`
aws elb register-instances-with-load-balancer --load-balancer ${DSIELB} --instances $(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id/) --region ${AWS::Region}
ignoreErrors: 'false'
fixManagerLoadBalancerSettings:
files:
/etc/cfn/create-console-listener.sh:
source:
Fn::Sub:
- https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}scripts/create-console-listener.sh
- S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion]
S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
owner: root
mode: '000700'
authentication: S3AccessCreds
/etc/cfn/set-lb-settings.sh:
source:
Fn::Sub:
- https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}scripts/set-lb-settings.sh
- S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion]
S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
owner: root
mode: '000700'
authentication: S3AccessCreds
commands:
1-setup-elb-listener:
command:
Fn::Sub: /etc/cfn/create-console-listener.sh ${DSIELB} ${DSIELBFQDN}
${DSIPGUIPort} ${AWS::StackName} 1 ${AWS::Region} >> /tmp/listener.log
4-set-load-balancer-settings:
command:
Fn::Sub: /etc/cfn/set-lb-settings.sh ${DSCAdminName} ${DSCAdminPassword}
${DSIELBFQDN} ${DSIPGUIPort} ${DSIPHeartbeatPort} >> /tmp/set-lb-settings.log
fixManagerLocalLoadBalancerHostsFile:
commands:
1-setHostsFileELB:
command:
Fn::Sub: |
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60"`
echo "$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/local-ipv4/) ${DSIELBFQDN}" >> /etc/hosts
fixManagerHostObject:
files:
/etc/cfn/reactivate-manager.sh:
source:
Fn::Sub:
- https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}scripts/reactivate-manager.sh
- S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion]
S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName]
owner: root
mode: '000700'
authentication: S3AccessCreds
commands:
1-reactivate-manager.sh:
command:
Fn::Sub: /etc/cfn/reactivate-manager.sh >> /etc/cfn/reactivate-manager.log
${DSCAdminName} ${DSCAdminPassword} ${DSIPGUIPort}
Properties:
IamInstanceProfile: !Ref DSMProfile
LaunchTemplate:
LaunchTemplateId: !Ref DSMLaunchTemplate
Version: '1'
ImageId:
!FindInMap
- DSMAMI
- !Ref AWS::Region
- !Ref DSIPLicense
InstanceType:
!If
- PPUNotSelected
- !Ref DSIPInstanceType
- !FindInMap
- DSMSIZE
- !Ref AWS::Region
- !Ref DSIPLicense
NetworkInterfaces:
- DeviceIndex: '0'
SubnetId: !Ref DSISubnetID
AssociatePublicIpAddress:
!If
- InternetFacingELB
- true
- false
GroupSet:
- !Ref DSMSG
Tags:
- Key: Name
Value: Deep Security Manager
KeyName: !Ref AWSIKeyPairName
UserData:
!Base64
Fn::Sub:
- |
#!/bin/bash -x
# cloud-init
${ProxyConfig}
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource DSM --region ${AWS::Region}${ConfigSetOption1}${ConfigSetOption2}${ProxyOption1}
/opt/aws/bin/cfn-signal ${CFNSignalOption}${ProxyOption2}
- ProxyConfig:
!If
- UseProxy
- Fn::Sub: |
export HTTPS_PROXY="https://${DSProxyUrl}"
export HTTP_PROXY="http://${DSProxyUrl}"
export NO_PROXY="169.254.169.254,localhost,127.0.0.1"
echo -e "proxy=http://${DSProxyUrl}" >> /etc/yum.conf
- ''
ConfigSetOption1:
!If
- SQLplusELB
- ' -c doSqlSetup,default,setupLocalELB,setupGlobalELB'
- !If
- DoSQLSetup
- ' -c doSqlSetup,default'
- !If
- IsFirstNodePlusELB
- ' -c default,setupLocalELB,setupGlobalELB'
- ''
ConfigSetOption2:
!If
- AddNodePlusELB
- ' -c fixManagerLocalLbAddress,addDsmNode,setupLocalELB'
- !If
- IsFirstNode
- ''
- ' -c addDsmNode'
ProxyOption1:
!If
- UseProxy
- Fn::Sub: ' --https-proxy https://${DSProxyUrl}'
- ''
CFNSignalOption:
!If
- WaitNotProvided
- -e $? -r "Complete"
- !Join
- ''
- - '-e $? -r "DSM Node configuration complete" '
- !Base64
Ref: DSM1CompleteWaitHandle
ProxyOption2:
!If
- UseProxy
- Fn::Sub: ' --https-proxy https://${DSProxyUrl}'
- ''
Conditions:
UsingDefaultBucket: !Equals [!Ref QSS3BucketName, 'aws-quickstart']
DBTypeIsSQL:
!Equals
- !Ref DBPEngine
- SQL
IsFirstNode:
!Equals
- !Ref DSMPMNode
- 'No'
DoSQLSetup:
!And
- !Condition DBTypeIsSQL
- !Condition IsFirstNode
UseBYOL:
!Equals
- !Ref DSIPLicense
- BYOL
UsePerHost:
!Equals
- !Ref DSIPLicense
- PerHost
PPUNotSelected:
!Or
- !Condition UsePerHost
- !Condition UseBYOL
AddToELB:
!Not
- !Equals
- !Ref DSIELB
- ''
WaitNotProvided:
!Equals
- DSM1CompleteWaitHandle
- ''
SQLplusELB:
!And
- !Condition AddToELB
- !Condition DoSQLSetup
AddNodePlusELB:
!And
- !Not
- !Condition IsFirstNode
- !Condition AddToELB
KeyProvided:
!Not
- !Equals
- !Ref DSIPLicenseKey
- XX-XXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
IsFirstNodePlusELB:
!And
- !Condition IsFirstNode
- !Condition AddToELB
AddAcAnswer:
!And
- !Condition KeyProvided
- !Condition PPUNotSelected
InternetFacingELB:
!Equals
- !Ref DSELBPosture
- Internet-facing
NetworkOnlyLicense:
!Equals
- !Ref DSCLicenseType
- Network
UseProxy:
!Not
- !Equals
- !Ref DSProxyUrl
- ''
GovCloudCondition:
!Or
- !Equals
- !Ref AWS::Region
- us-gov-west-1
- !Equals
- !Ref AWS::Region
- us-gov-east-1
Outputs:
DSMFQDN:
Value: !GetAtt DSM.PublicDnsName
DSMURL:
Value:
Fn::Sub: https://${DSM.PublicDnsName}:${DSIPGUIPort}
DSMInstanceId:
Value: !Ref DSM
...