Skip to content

Commit a99a0fe

Browse files
author
ZoccoCcs
committed
VPC Simplification
VLANs aren't allowed by AWS. Therefore, subnets and network interfaces must be used. The original network would require 5 distinct subnets. This would also require instance types with 8 interfaces since few others are available. Sadly, such instances have excessive CPU and memory, causing increased costs unnecessarily. Hence, I grouped the 3 VMs under one subnet which reduced the number of required interfaces to 3. Multiple ec2 instances with this quantity of interfaces are more economically feasible
1 parent e608c43 commit a99a0fe

File tree

1 file changed

+134
-22
lines changed

1 file changed

+134
-22
lines changed

KaliPurple-VPC.yml

+134-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AWSTemplateFormatVersion: 2010-09-09
2-
Description: This template creates a VPC for Kali Linux Purple SOC Lab
2+
Description: This template creates a VPC with it's subnets for the Kali Linux Purple SOC Lab.
33
Metadata:
44
'AWS::CloudFormation::Interface':
55
ParameterGroups:
@@ -12,6 +12,7 @@ Metadata:
1212
Parameters:
1313
- PublicSubnetCIDR
1414
- LANSubnetCIDR
15+
- SOCSubnetCIDR
1516
- Label:
1617
default: SSH
1718
Parameters:
@@ -32,11 +33,15 @@ Parameters:
3233
Type: String
3334
PublicSubnetCIDR:
3435
Default: 192.168.0.0/24
35-
Description: Please Enter the IP Range of the Private Subnet
36+
Description: Please Enter the IP Range of the Public Subnet
3637
Type: String
3738
LANSubnetCIDR:
3839
Default: 192.168.1.0/24
39-
Description: Please Enter the IP Range of the Public Subnet
40+
Description: Please Enter the IP Range of the LAN Subnet
41+
Type: String
42+
SOCSubnetCIDR:
43+
Default: 192.168.253.0/24
44+
Description: Please Enter the IP Range of the SOC Subnet
4045
Type: String
4146

4247

@@ -50,7 +55,7 @@ Resources:
5055
InstanceTenancy: default
5156
Tags:
5257
- Key: Name
53-
Value: KaliVPC
58+
Value: Kali VPC | KaliVPC
5459

5560
PublicSubnet:
5661
Type: 'AWS::EC2::Subnet'
@@ -62,7 +67,7 @@ Resources:
6267
MapPublicIpOnLaunch: true
6368
Tags:
6469
- Key: Name
65-
Value: Public
70+
Value: Kali VPC | Public Subnet
6671
VpcId: !Ref KaliVPC
6772

6873
LANSubnet:
@@ -75,15 +80,28 @@ Resources:
7580
MapPublicIpOnLaunch: false
7681
Tags:
7782
- Key: Name
78-
Value: LAN Subnet
83+
Value: Kali VPC | LAN Subnet
84+
VpcId: !Ref KaliVPC
85+
86+
SOCSubnet:
87+
Type: 'AWS::EC2::Subnet'
88+
Properties:
89+
AvailabilityZone: !Select
90+
- 0
91+
- !GetAZs ''
92+
CidrBlock: !Ref SOCSubnetCIDR
93+
MapPublicIpOnLaunch: false
94+
Tags:
95+
- Key: Name
96+
Value: Kali VPC | SOC Subnet
7997
VpcId: !Ref KaliVPC
8098

8199
IGW:
82100
Type: 'AWS::EC2::InternetGateway'
83101
Properties:
84102
Tags:
85103
- Key: Name
86-
Value: InternetGateway
104+
Value: Kali VPC | InternetGateway
87105

88106
IGWAttacment:
89107
Type: 'AWS::EC2::VPCGatewayAttachment'
@@ -96,7 +114,7 @@ Resources:
96114
Properties:
97115
Tags:
98116
- Key: Name
99-
Value: PublicRouteTable
117+
Value: Kali VPC | PublicRouteTable
100118
VpcId: !Ref KaliVPC
101119

102120
PublicRoute:
@@ -112,10 +130,11 @@ Resources:
112130
RouteTableId: !Ref PublicRouteTable
113131
SubnetId: !Ref PublicSubnet
114132

115-
SSHSecurityGroup:
133+
134+
OpenSecurityGroup:
116135
Type: 'AWS::EC2::SecurityGroup'
117136
Properties:
118-
GroupDescription: SSH Security Group
137+
GroupDescription: Open Security Group
119138
SecurityGroupIngress:
120139
- IpProtocol: tcp
121140
FromPort: 80
@@ -169,7 +188,7 @@ Resources:
169188
FromPort: 465
170189
ToPort: 465
171190
CidrIp: !Ref SSHLocation
172-
- IpProtocol: tcp
191+
- IpProtocol: tcp
173192
FromPort: 587
174193
ToPort: 587
175194
CidrIp: !Ref SSHLocation
@@ -189,25 +208,89 @@ Resources:
189208
FromPort: 8220
190209
ToPort: 8220
191210
CidrIp: !Ref SSHLocation
192-
193211
Tags:
194212
- Key: Name
195-
Value: SSH Security Group
213+
Value: Open Security Group
196214
VpcId: !Ref KaliVPC
197215

198216
LANNI:
199217
Type: 'AWS::EC2::NetworkInterface'
200218
Properties:
201-
Description: Network Interface for LAN
219+
Description: Bizantium Network Interface for LAN
202220
SourceDestCheck: false
203221
SubnetId: !Ref LANSubnet
204222
GroupSet:
205-
- !Ref SSHSecurityGroup
223+
- !Ref OpenSecurityGroup
206224
PrivateIpAddress: 192.168.1.10
207225
Tags:
208226
- Key: Name
209-
Value: Byzantium | LAN Subnet
210-
227+
Value: Kali SOC | Bizantium LAN Network Interface
228+
229+
SOCNI:
230+
Type: 'AWS::EC2::NetworkInterface'
231+
Properties:
232+
Description: Bizantium Network Interface for SOC
233+
SourceDestCheck: false
234+
SubnetId: !Ref SOCSubnet
235+
GroupSet:
236+
- !Ref OpenSecurityGroup
237+
PrivateIpAddress: 192.168.253.101
238+
Tags:
239+
- Key: Name
240+
Value: Kali SOC | Bizantium SOC Network Interface
241+
242+
HelioNI:
243+
Type: 'AWS::EC2::NetworkInterface'
244+
Properties:
245+
Description: Heliotrope Network Interface for LAN
246+
SourceDestCheck: false
247+
SubnetId: !Ref LANSubnet
248+
GroupSet:
249+
- !Ref OpenSecurityGroup
250+
PrivateIpAddress: 192.168.1.20
251+
Tags:
252+
- Key: Name
253+
Value: Kali SOC | Heliotrope LAN Network Interface
254+
255+
PurpleNI:
256+
Type: 'AWS::EC2::NetworkInterface'
257+
Properties:
258+
Description: Kali-Purple Network Interface for SOC
259+
SourceDestCheck: false
260+
SubnetId: !Ref SOCSubnet
261+
GroupSet:
262+
- !Ref OpenSecurityGroup
263+
PrivateIpAddress: 192.168.253.105
264+
Tags:
265+
- Key: Name
266+
Value: Kali SOC | Kali-Purple SOC Network Interface
267+
268+
VioletNI:
269+
Type: 'AWS::EC2::NetworkInterface'
270+
Properties:
271+
Description: Kali-Violet Network Interface for SOC
272+
SourceDestCheck: false
273+
SubnetId: !Ref SOCSubnet
274+
GroupSet:
275+
- !Ref OpenSecurityGroup
276+
PrivateIpAddress: 192.168.253.107
277+
Tags:
278+
- Key: Name
279+
Value: Kali SOC | Kali-Violet SOC Network Interface
280+
281+
EminenceNI:
282+
Type: 'AWS::EC2::NetworkInterface'
283+
Properties:
284+
Description: Eminence Network Interface for SOC
285+
SourceDestCheck: false
286+
SubnetId: !Ref SOCSubnet
287+
GroupSet:
288+
- !Ref OpenSecurityGroup
289+
PrivateIpAddress: 192.168.253.103
290+
Tags:
291+
- Key: Name
292+
Value: Kali SOC | Eminence SOC Network Interface
293+
211294
Outputs:
212295
KaliVPC:
213296
Description: KaliVPC ID
@@ -224,15 +307,44 @@ Outputs:
224307
Export:
225308
Name: !Sub '${AWS::StackName}-LANSubnet'
226309
Value: !Ref LANSubnet
310+
SOCSubnet:
311+
Description: Public ID
312+
Export:
313+
Name: !Sub '${AWS::StackName}-SOCSubnet'
314+
Value: !Ref SOCSubnet
227315
LANNI:
228316
Description: Network Interface for LAN
229317
Export:
230318
Name: !Sub '${AWS::StackName}-LANNI'
231319
Value: !Ref LANNI
232-
233-
SSHSecurityGroup:
234-
Description: SSHSecurityGroup ID
320+
SOCNI:
321+
Description: Network Interface for SOC
322+
Export:
323+
Name: !Sub '${AWS::StackName}-SOCNI'
324+
Value: !Ref SOCNI
325+
HelioNI:
326+
Description: Network Interface for Heliotrope
327+
Export:
328+
Name: !Sub '${AWS::StackName}-HelioNI'
329+
Value: !Ref HelioNI
330+
PurpleNI:
331+
Description: Network Interface for Kali-Purple
332+
Export:
333+
Name: !Sub '${AWS::StackName}-PurpleNI'
334+
Value: !Ref PurpleNI
335+
VioletNI:
336+
Description: Network Interface for Kali-Violet
337+
Export:
338+
Name: !Sub '${AWS::StackName}-VioletNI'
339+
Value: !Ref VioletNI
340+
EminenceNI:
341+
Description: Network Interface for Kali-Eminence
342+
Export:
343+
Name: !Sub '${AWS::StackName}-EminenceNI'
344+
Value: !Ref EminenceNI
345+
OpenSecurityGroup:
346+
Description: OpenSecurityGroup ID
235347
Export:
236-
Name: !Sub '${AWS::StackName}-SSHSecurityGroup'
237-
Value: !Ref SSHSecurityGroup
348+
Name: !Sub '${AWS::StackName}-OpenSecurityGroup'
349+
Value: !Ref OpenSecurityGroup
238350

0 commit comments

Comments
 (0)