forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
protect-web-applications-with-WAF.yml
160 lines (160 loc) · 4.67 KB
/
protect-web-applications-with-WAF.yml
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
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Protect web applications with WAF
zh-cn: 高效防护 Web 应用
Parameters:
CommonName:
Type: String
Default: waf-solution
VSwitchZoneId:
Type: String
Label:
en: Availability zone
zh-cn: 可用区
Description:
en: Available area id, <a href='https://help.aliyun.com/document_detail/123712.html'
target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.
zh-cn: 可用区ID,</font><a href='https://help.aliyun.com/document_detail/123712.html'
target='_blank'><b> 查看可用区信息</b><font color='blue'></a>。
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
EcsInstanceType:
Type: String
Label:
en: Instance type
zh-cn: 实例规格
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSwitchZoneId
Default: ecs.g6.large
InstancePassword:
Type: String
Label:
en: Instance Password
zh-cn: 实例密码
Description:
en: >-
Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special
symbol in)
zh-cn: >-
服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
中的特殊符号),不能以特殊字符开头。
ConstraintDescription:
en: >-
Length 8-30, must contain three(Capital letters, lowercase letters,
numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: '长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ 中的特殊符号),不能以特殊字符开头。'
AssociationProperty: 'ALIYUN::ECS::Instance::Password'
NoEcho: true
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock: 192.168.0.0/16
VpcName:
Fn::Sub: vpc_${CommonName}
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVpc
CidrBlock: 192.168.1.0/24
VSwitchName:
Fn::Sub: vsw_${CommonName}
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupIngress:
- PortRange: 80/80
IpProtocol: tcp
NicType: intranet
SourceCidrIp: 0.0.0.0/0
- PortRange: 22/22
IpProtocol: tcp
NicType: intranet
SourceCidrIp: 0.0.0.0/0
- PortRange: 3306/3306
IpProtocol: tcp
NicType: intranet
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Sub: sg_${CommonName}
SecurityGroupType: normal
EcsInstance:
Type: ALIYUN::ECS::InstanceGroup
Properties:
InstanceName:
Fn::Sub: ecs_${CommonName}
InstanceChargeType: PostPaid
InstanceType:
Ref: EcsInstanceType
ImageId: aliyun_3_9_x64_20G_alibase_
SystemDiskCategory: cloud_essd
SystemDiskSize: 40
AllocatePublicIP: true
InternetChargeType: PayByTraffic
InternetMaxBandwidthOut: 10
ZoneId:
Ref: VSwitchZoneId
SecurityGroupId:
Ref: EcsSecurityGroup
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
SpotStrategy: SpotAsPriceGo
MaxAmount: 1
Password:
Ref: InstancePassword
InstallWeb:
Type: ALIYUN::OOS::Execution
Properties:
TemplateName: ACS-ECS-BulkyConfigureOOSPackageWithTemporaryURL
SafetyCheck: Skip
Parameters:
regionId:
Ref: ALIYUN::Region
targets:
ResourceIds:
Fn::GetAtt:
- EcsInstance
- InstanceIds
RegionId:
Ref: ALIYUN::Region
Type: ResourceIds
action: install
packageName: ACS-Extension-LNMP-One-Click-1853370294850618
Waf3:
Type: ALIYUN::WAF3::Instance
Properties:
PayType: PayAsYouGo
Region: ChineseMainland
TrafficBillingProtectionThreshold: 100000
IgnoreExisting: true
Outputs:
EipAddress:
Description: Web Address.
Value:
Fn::Sub:
- http://${IP}
- IP:
Fn::Select:
- 0
- Fn::GetAtt:
- EcsInstance
- PublicIps
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VSwitchZoneId
- EcsInstanceType
- InstancePassword
Hidden:
- CommonName
TemplateTags:
- acs:technical-solution:security-and-compliance:高效防护 Web 应用-tech_solu_106