-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yaml
186 lines (170 loc) · 4.28 KB
/
serverless.yaml
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
service: scout
useDotenv: true
provider:
name: aws
stage: dev
region: ${env:AWS_REGION}
runtime: go1.x
memorySize: 128
timeout: 600
lambdaHashingVersion: "20201221"
iam:
role:
statements:
- Effect: "Allow"
Action:
- "sqs:SendMessage"
Resource:
- Fn::GetAtt: [ScanTargetQueue, Arn]
- Fn::GetAtt: [ScanDomainQueue, Arn]
- Fn::GetAtt: [ScanUrlQueue, Arn]
- Fn::GetAtt: [ScanNucleiTemplateQueue, Arn]
- Fn::GetAtt: [ScanPortQueue, Arn]
functions:
# Scan a target
scan-target:
image:
uri: ${env:AWS_ECR_REPO}:latest
command:
- -f
- scan-target
events:
- sqs:
batchSize: 1
arn:
Fn::GetAtt: [ScanTargetQueue, Arn]
environment:
# Send domain scan requests here
SCAN_DOMAIN_QUEUE:
Ref: ScanDomainQueue
# Scan a domain
scan-domain:
image:
uri: ${env:AWS_ECR_REPO}:latest
command:
- -f
- scan-domain
events:
- sqs:
batchSize: 1
arn:
Fn::GetAtt: [ScanDomainQueue, Arn]
environment:
# Send url scan requests here
SCAN_URL_QUEUE:
Ref: ScanUrlQueue
# Scan a url
scan-url:
image:
uri: ${env:AWS_ECR_REPO}:latest
command:
- -f
- scan-url
events:
- sqs:
batchSize: 1
arn:
Fn::GetAtt: [ScanUrlQueue, Arn]
environment:
# Send nuclei scan requests here
SCAN_NUCLEI_TEMPLATE_QUEUE:
Ref: ScanNucleiTemplateQueue
# Send port scan requests here
SCAN_PORT_QUEUE:
Ref: ScanPortQueue
# Scan a webserver with nuclei
scan-nuclei:
image:
uri: ${env:AWS_ECR_REPO}:latest
command:
- -f
- scan-nuclei
events:
- sqs:
batchSize: 1
arn:
Fn::GetAtt: [ScanNucleiTemplateQueue, Arn]
# Scan a host for open ports
scan-port:
image:
uri: ${env:AWS_ECR_REPO}:latest
command:
- -f
- scan-port
events:
- sqs:
batchSize: 1
arn:
Fn::GetAtt: [ScanPortQueue, Arn]
resources:
Resources:
ScanTargetQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-target"
VisibilityTimeout: 1080
RedrivePolicy:
maxReceiveCount: 5
deadLetterTargetArn:
Fn::GetAtt: [ScanTargetDLQ, Arn]
ScanDomainQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-domain"
VisibilityTimeout: 1080
RedrivePolicy:
maxReceiveCount: 5
deadLetterTargetArn:
Fn::GetAtt: [ScanDomainDLQ, Arn]
ScanUrlQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-url"
VisibilityTimeout: 1080
RedrivePolicy:
maxReceiveCount: 5
deadLetterTargetArn:
Fn::GetAtt: [ScanUrlDLQ, Arn]
ScanNucleiTemplateQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-nuclei"
VisibilityTimeout: 1080
RedrivePolicy:
maxReceiveCount: 5
deadLetterTargetArn:
Fn::GetAtt: [ScanNucleiTemplateDLQ, Arn]
ScanPortQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-port"
VisibilityTimeout: 1080
RedrivePolicy:
maxReceiveCount: 5
deadLetterTargetArn:
Fn::GetAtt: [ScanPortDLQ, Arn]
ScanTargetDLQ:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-target-dlq"
MessageRetentionPeriod: 1209600 # 14 days
ScanDomainDLQ:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-domain-dlq"
MessageRetentionPeriod: 1209600 # 14 days
ScanUrlDLQ:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-url-dlq"
MessageRetentionPeriod: 1209600 # 14 days
ScanNucleiTemplateDLQ:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-nuclei-dlq"
MessageRetentionPeriod: 1209600 # 14 days
ScanPortDLQ:
Type: AWS::SQS::Queue
Properties:
QueueName: "scout-scan-port-dlq"
MessageRetentionPeriod: 1209600 # 14 days