urlquery-api 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- urlquery_api/__init__.py +29 -0
- urlquery_api/_client.py +560 -0
- urlquery_api/_errors.py +50 -0
- urlquery_api/models.py +1911 -0
- urlquery_api/py.typed +0 -0
- urlquery_api-0.8.0.dist-info/METADATA +109 -0
- urlquery_api-0.8.0.dist-info/RECORD +9 -0
- urlquery_api-0.8.0.dist-info/WHEEL +4 -0
- urlquery_api-0.8.0.dist-info/licenses/LICENSE +21 -0
urlquery_api/models.py
ADDED
|
@@ -0,0 +1,1911 @@
|
|
|
1
|
+
# Code generated by public/codegen/generate.sh from the urlquery v2 API description; DO NOT EDIT.
|
|
2
|
+
# Source: openapi.yaml sha256 bf160b8ab34376a8ee28ef385cc50771b615c1fcab18a49e5bdc4affd8beb4e2
|
|
3
|
+
# generated by datamodel-codegen:
|
|
4
|
+
# filename: openapi.yaml
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from datetime import date as date_aliased
|
|
9
|
+
from typing import Annotated, Any, Literal
|
|
10
|
+
|
|
11
|
+
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel
|
|
12
|
+
from typing_extensions import TypeAliasType
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Error(BaseModel):
|
|
16
|
+
http_code: int
|
|
17
|
+
"""
|
|
18
|
+
Equals the HTTP status code.
|
|
19
|
+
"""
|
|
20
|
+
error: str
|
|
21
|
+
"""
|
|
22
|
+
Stable error code to match on.
|
|
23
|
+
"""
|
|
24
|
+
message: str
|
|
25
|
+
"""
|
|
26
|
+
Human-readable detail.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ErrorResponse(BaseModel):
|
|
31
|
+
success: Literal[False]
|
|
32
|
+
error: Error
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class EmptyResponse(BaseModel):
|
|
36
|
+
success: Literal[True]
|
|
37
|
+
data: dict[str, Any]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ReportURL(BaseModel):
|
|
41
|
+
schema_: Annotated[str, Field(alias='schema', examples=['https'])]
|
|
42
|
+
addr: Annotated[str, Field(examples=['example.com/login'])]
|
|
43
|
+
"""
|
|
44
|
+
URL without the scheme.
|
|
45
|
+
"""
|
|
46
|
+
fqdn: Annotated[str, Field(examples=['example.com'])]
|
|
47
|
+
domain: Annotated[str, Field(examples=['example.com'])]
|
|
48
|
+
"""
|
|
49
|
+
Registrable domain.
|
|
50
|
+
"""
|
|
51
|
+
tld: Annotated[str, Field(examples=['com'])]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class ReportIP(BaseModel):
|
|
55
|
+
addr: Annotated[str, Field(examples=['192.0.2.10'])]
|
|
56
|
+
port: Annotated[int | None, Field(examples=[443])] = None
|
|
57
|
+
"""
|
|
58
|
+
Omitted when unknown or when the address is not one connection
|
|
59
|
+
"""
|
|
60
|
+
asn: Annotated[int, Field(examples=[64500])]
|
|
61
|
+
as_: Annotated[str, Field(alias='as')]
|
|
62
|
+
country: str
|
|
63
|
+
country_code: Annotated[str, Field(examples=['NO'])]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class ComparedFact(BaseModel):
|
|
67
|
+
name: Literal[
|
|
68
|
+
'Final URL',
|
|
69
|
+
'Title',
|
|
70
|
+
'HTTP status',
|
|
71
|
+
'IP',
|
|
72
|
+
'ASN',
|
|
73
|
+
'Certificate',
|
|
74
|
+
'Issuer',
|
|
75
|
+
'DOM hash',
|
|
76
|
+
]
|
|
77
|
+
a: str
|
|
78
|
+
b: str
|
|
79
|
+
changed: bool
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class ComparedReport(BaseModel):
|
|
83
|
+
report_id: str
|
|
84
|
+
date: str
|
|
85
|
+
url: str
|
|
86
|
+
title: str
|
|
87
|
+
"""
|
|
88
|
+
The final page's title.
|
|
89
|
+
"""
|
|
90
|
+
verdict: Literal['phishing', 'malicious', 'suspicious', '']
|
|
91
|
+
"""
|
|
92
|
+
From its urlquery alerts; empty without any.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class Similarity(BaseModel):
|
|
97
|
+
"""
|
|
98
|
+
How alike a changed file's versions are: ssdeep 0–100 (100 identical) or TLSH distance (0 identical); null when they cannot be compared.
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
method: Literal['ssdeep', 'TLSH']
|
|
102
|
+
score: int
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class ComparedFile(BaseModel):
|
|
106
|
+
sha256: str
|
|
107
|
+
mime_type: str
|
|
108
|
+
ssdeep: str
|
|
109
|
+
tlsh: str
|
|
110
|
+
size: int
|
|
111
|
+
available: bool
|
|
112
|
+
"""
|
|
113
|
+
The content was captured; read it with the resource content route.
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class ComparedItem(BaseModel):
|
|
118
|
+
kind: Literal['new', 'changed', 'missing']
|
|
119
|
+
value: str
|
|
120
|
+
detail: str
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class User(BaseModel):
|
|
124
|
+
user_id: str | None = None
|
|
125
|
+
team_id: str | None = None
|
|
126
|
+
country: str | None = None
|
|
127
|
+
country_code: str | None = None
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class ReportSubmit(BaseModel):
|
|
131
|
+
"""
|
|
132
|
+
How the report was submitted. `meta` and `user` are only returned to the report's owner and team.
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
url: ReportURL
|
|
136
|
+
ip: ReportIP
|
|
137
|
+
tags: list[str]
|
|
138
|
+
"""
|
|
139
|
+
Tags chosen by the submitter.
|
|
140
|
+
"""
|
|
141
|
+
meta: Annotated[dict[str, str] | None, Field(...)]
|
|
142
|
+
user: User | None = None
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class ReportSettings(BaseModel):
|
|
146
|
+
"""
|
|
147
|
+
The settings the analysis ran with.
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
access: Literal['public', 'restricted', 'private']
|
|
151
|
+
"""
|
|
152
|
+
Report visibility.
|
|
153
|
+
"""
|
|
154
|
+
device_type: str
|
|
155
|
+
expires_at: str
|
|
156
|
+
"""
|
|
157
|
+
When the report expires (RFC 3339), if it does.
|
|
158
|
+
"""
|
|
159
|
+
useragent: str
|
|
160
|
+
referer: str
|
|
161
|
+
cookies: Annotated[dict[str, str] | None, Field(...)]
|
|
162
|
+
"""
|
|
163
|
+
Cookies supplied at submission
|
|
164
|
+
"""
|
|
165
|
+
exit_node: str
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class ReportFingerprint(BaseModel):
|
|
169
|
+
name: Annotated[str | None, Field(examples=['nginx'])] = None
|
|
170
|
+
description: str | None = None
|
|
171
|
+
website: str | None = None
|
|
172
|
+
common_platform_enumeration: str | None = None
|
|
173
|
+
"""
|
|
174
|
+
CPE 2.3 identifier
|
|
175
|
+
"""
|
|
176
|
+
icon: str | None = None
|
|
177
|
+
categories: list[str] | None = None
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class ReportIDSAlert(BaseModel):
|
|
181
|
+
"""
|
|
182
|
+
An alert from network intrusion-detection signatures.
|
|
183
|
+
"""
|
|
184
|
+
|
|
185
|
+
sensor_name: str
|
|
186
|
+
title: str
|
|
187
|
+
description: str
|
|
188
|
+
date: str
|
|
189
|
+
timestamp: int
|
|
190
|
+
ip_dst: ReportIP
|
|
191
|
+
ip_src: ReportIP
|
|
192
|
+
severity: str
|
|
193
|
+
alert: str
|
|
194
|
+
source: str
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class ReportURLQueryAlert(BaseModel):
|
|
198
|
+
"""
|
|
199
|
+
An alert from urlquery's own detection rules.
|
|
200
|
+
"""
|
|
201
|
+
|
|
202
|
+
sensor_name: str
|
|
203
|
+
alert: str
|
|
204
|
+
trigger: str
|
|
205
|
+
"""
|
|
206
|
+
The FQDN of the host the alert fired on; empty when the evidence has no host.
|
|
207
|
+
"""
|
|
208
|
+
verdict: str
|
|
209
|
+
severity: str
|
|
210
|
+
comment: str
|
|
211
|
+
tags: list[str]
|
|
212
|
+
meta: Annotated[dict[str, Any] | None, Field(...)]
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class ReportFinalDOM(BaseModel):
|
|
216
|
+
size: int
|
|
217
|
+
mime_type: str
|
|
218
|
+
magic: str
|
|
219
|
+
md5: str
|
|
220
|
+
sha1: str
|
|
221
|
+
sha256: str
|
|
222
|
+
sha512: str
|
|
223
|
+
ssdeep: str
|
|
224
|
+
tlshash: str
|
|
225
|
+
dom_hash: str
|
|
226
|
+
first_seen: str
|
|
227
|
+
last_seen: str
|
|
228
|
+
times_seen: int
|
|
229
|
+
resource_available: bool
|
|
230
|
+
data: Annotated[str | None, Field(...)]
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class ReportHTTPTimings(BaseModel):
|
|
234
|
+
"""
|
|
235
|
+
How long each phase of the transaction took, in milliseconds; -1 when a phase does not apply.
|
|
236
|
+
"""
|
|
237
|
+
|
|
238
|
+
blocked: int
|
|
239
|
+
dns: int
|
|
240
|
+
connect: int
|
|
241
|
+
send: int
|
|
242
|
+
wait: int
|
|
243
|
+
receive: int
|
|
244
|
+
ssl: int
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
class ReportConsoleMessage(BaseModel):
|
|
248
|
+
level: str
|
|
249
|
+
text: str
|
|
250
|
+
filename: str
|
|
251
|
+
line_number: int
|
|
252
|
+
column_number: int
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class ReportClipboard(BaseModel):
|
|
256
|
+
source: str
|
|
257
|
+
content: str
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
class ReportDetectionMeta(BaseModel):
|
|
261
|
+
user_id: str | None = None
|
|
262
|
+
team_id: str | None = None
|
|
263
|
+
detection_id: str
|
|
264
|
+
visibility: str
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class ReportHTTPHeader(BaseModel):
|
|
268
|
+
name: str
|
|
269
|
+
value: str
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
class ReportHTTPPostData(BaseModel):
|
|
273
|
+
size: int | None = None
|
|
274
|
+
data: str | None = None
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
class ReportHTTPCookie(BaseModel):
|
|
278
|
+
name: str
|
|
279
|
+
value: str
|
|
280
|
+
quoted: bool
|
|
281
|
+
path: str | None = None
|
|
282
|
+
domain: str | None = None
|
|
283
|
+
expires: AwareDatetime | None = None
|
|
284
|
+
raw_expires: str | None = None
|
|
285
|
+
max_age: int | None = None
|
|
286
|
+
secure: bool
|
|
287
|
+
http_only: bool
|
|
288
|
+
same_site: str
|
|
289
|
+
partitioned: bool
|
|
290
|
+
raw: str
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
class ReportTechFingerprint(BaseModel):
|
|
294
|
+
name: str
|
|
295
|
+
description: str
|
|
296
|
+
website: str
|
|
297
|
+
common_platform_enumeration: str
|
|
298
|
+
icon: str
|
|
299
|
+
categories: list[str]
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
class ReportHTTPContent(BaseModel):
|
|
303
|
+
"""
|
|
304
|
+
Captured content: its hashes, type, size and prevalence across urlquery reports. `data` is empty; download the content by `sha256` when `resource_available` is `true`. A body seen in many reports is common library code; one seen a handful of times is distinctive.
|
|
305
|
+
"""
|
|
306
|
+
|
|
307
|
+
size: int
|
|
308
|
+
size_decoded: int
|
|
309
|
+
mime_type: str
|
|
310
|
+
magic: str
|
|
311
|
+
"""
|
|
312
|
+
The detected file type.
|
|
313
|
+
"""
|
|
314
|
+
md5: str
|
|
315
|
+
sha1: str
|
|
316
|
+
sha256: str
|
|
317
|
+
sha512: str
|
|
318
|
+
ssdeep: str
|
|
319
|
+
"""
|
|
320
|
+
Fuzzy hash for near-identical content.
|
|
321
|
+
"""
|
|
322
|
+
tlshash: str
|
|
323
|
+
"""
|
|
324
|
+
TLSH fuzzy hash for near-identical content.
|
|
325
|
+
"""
|
|
326
|
+
first_seen: str
|
|
327
|
+
last_seen: str
|
|
328
|
+
times_seen: int
|
|
329
|
+
"""
|
|
330
|
+
How many urlquery reports have this content.
|
|
331
|
+
"""
|
|
332
|
+
resource_available: bool
|
|
333
|
+
"""
|
|
334
|
+
Whether the content is stored and can be downloaded.
|
|
335
|
+
"""
|
|
336
|
+
data: Annotated[str | None, Field(...)]
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
class ReportWindowsShortcutShellLinkHeaderSection(BaseModel):
|
|
340
|
+
link_clsid: str
|
|
341
|
+
link_flags: list[str]
|
|
342
|
+
file_attributes: list[str]
|
|
343
|
+
creation_time: str
|
|
344
|
+
access_time: str
|
|
345
|
+
write_time: str
|
|
346
|
+
target_file_size: int
|
|
347
|
+
icon_index: int
|
|
348
|
+
show_command: str
|
|
349
|
+
hot_key: str
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
class ReportWindowsShortcutStringDataSection(BaseModel):
|
|
353
|
+
name_string: str
|
|
354
|
+
relative_path: str
|
|
355
|
+
working_dir: str
|
|
356
|
+
command_line_arguments: str
|
|
357
|
+
icon_location: str
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
class ReportPDFMeta(BaseModel):
|
|
361
|
+
version: str
|
|
362
|
+
author: str
|
|
363
|
+
title: str
|
|
364
|
+
subject: str
|
|
365
|
+
producer: str
|
|
366
|
+
creator: str
|
|
367
|
+
page_count: int
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
class ReportExtractedURL(BaseModel):
|
|
371
|
+
page: int
|
|
372
|
+
url: ReportURL
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
class ReportSubjectInfo(BaseModel):
|
|
376
|
+
common_name: Annotated[str, Field(alias='commonName')]
|
|
377
|
+
organization: str
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
class ReportIssuerInfo(BaseModel):
|
|
381
|
+
common_name: Annotated[str, Field(alias='commonName')]
|
|
382
|
+
organization: str
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
class ReportValidityInfo(BaseModel):
|
|
386
|
+
start: str
|
|
387
|
+
end: str
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
class ReportFingerprintInfo(BaseModel):
|
|
391
|
+
sha1: str
|
|
392
|
+
sha256: str
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
class ReportEnvironmentVariableDataBlock(BaseModel):
|
|
396
|
+
target_ansi: str
|
|
397
|
+
target_unicode: str
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
class ReportTelegramChatActiveMember(BaseModel):
|
|
401
|
+
user_id: int
|
|
402
|
+
username: str
|
|
403
|
+
first_name: str
|
|
404
|
+
last_name: str
|
|
405
|
+
is_bot: bool
|
|
406
|
+
language_code: str
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
class ReportTelegramChatAdmin(BaseModel):
|
|
410
|
+
user_id: int
|
|
411
|
+
username: str
|
|
412
|
+
first_name: str
|
|
413
|
+
last_name: str
|
|
414
|
+
is_bot: bool
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
class ListPage(BaseModel):
|
|
418
|
+
"""
|
|
419
|
+
A cursor page. Pass `next_cursor` as `cursor`, with the same other parameters, while `has_more` is `true`.
|
|
420
|
+
"""
|
|
421
|
+
|
|
422
|
+
limit: int
|
|
423
|
+
next_cursor: str | None = None
|
|
424
|
+
"""
|
|
425
|
+
Present only when `has_more` is `true`.
|
|
426
|
+
"""
|
|
427
|
+
has_more: bool
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
class Page(BaseModel):
|
|
431
|
+
limit: int
|
|
432
|
+
offset: int
|
|
433
|
+
total_hits: int
|
|
434
|
+
"""
|
|
435
|
+
Number of matches.
|
|
436
|
+
"""
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
class Tag(RootModel[str]):
|
|
440
|
+
root: Annotated[str, Field(pattern='^[A-Za-z0-9_]{1,64}$')]
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
MetaAdditionalProperty = TypeAliasType(
|
|
444
|
+
"MetaAdditionalProperty", Annotated[str, Field(max_length=1024)]
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
class SubmissionRequest(BaseModel):
|
|
449
|
+
model_config = ConfigDict(
|
|
450
|
+
extra='forbid',
|
|
451
|
+
)
|
|
452
|
+
url: Annotated[str, Field(examples=['https://example.com/login'], max_length=8192)]
|
|
453
|
+
"""
|
|
454
|
+
Absolute http or https URL to analyze.
|
|
455
|
+
"""
|
|
456
|
+
access: Literal['public', 'restricted', 'private'] = 'public'
|
|
457
|
+
"""
|
|
458
|
+
Who can see the report. Also sets how long it is kept.
|
|
459
|
+
"""
|
|
460
|
+
run_time: Annotated[int, Field(ge=20, le=200)] = 26
|
|
461
|
+
"""
|
|
462
|
+
Seconds the browser stays on the page.
|
|
463
|
+
"""
|
|
464
|
+
useragent: Annotated[str | None, Field(max_length=512)] = None
|
|
465
|
+
"""
|
|
466
|
+
Browser user agent. Defaults to a current desktop Firefox.
|
|
467
|
+
"""
|
|
468
|
+
device_type: Literal['desktop', 'mobile', 'tablet'] = 'desktop'
|
|
469
|
+
tags: Annotated[list[Tag] | None, Field(max_length=20)] = None
|
|
470
|
+
"""
|
|
471
|
+
Your own labels, stored as `submit.tags`.
|
|
472
|
+
"""
|
|
473
|
+
meta: Annotated[dict[str, MetaAdditionalProperty] | None, Field(max_length=20)] = (
|
|
474
|
+
None
|
|
475
|
+
)
|
|
476
|
+
"""
|
|
477
|
+
Your own key-value context, visible only to you and your team. Keys are 1 to 64 characters. Never put secrets here.
|
|
478
|
+
"""
|
|
479
|
+
sanitize_url: bool = False
|
|
480
|
+
"""
|
|
481
|
+
Replace a base64-encoded email address at the end of the URL path with a placeholder.
|
|
482
|
+
"""
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
class Submission(BaseModel):
|
|
486
|
+
queue_id: str
|
|
487
|
+
report_id: str
|
|
488
|
+
"""
|
|
489
|
+
ID of the report the analysis produces.
|
|
490
|
+
"""
|
|
491
|
+
status: Literal['queued', 'processing', 'analyzing', 'done', 'failed']
|
|
492
|
+
url: ReportURL
|
|
493
|
+
ip: ReportIP
|
|
494
|
+
access: Literal['public', 'restricted', 'private']
|
|
495
|
+
run_time: int
|
|
496
|
+
device_type: Literal['desktop', 'mobile', 'tablet']
|
|
497
|
+
useragent: str
|
|
498
|
+
sanitize_url: bool
|
|
499
|
+
tags: list[str]
|
|
500
|
+
meta: dict[str, str]
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
class SubmissionResponse(BaseModel):
|
|
504
|
+
success: Literal[True]
|
|
505
|
+
data: Submission
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
class ReputationLookup(BaseModel):
|
|
509
|
+
input: str
|
|
510
|
+
"""
|
|
511
|
+
The submitted URL, unchanged.
|
|
512
|
+
"""
|
|
513
|
+
verdict: Literal['malicious', 'suspicious', 'benign', 'unknown']
|
|
514
|
+
applied_to: Literal['url', 'fqdn']
|
|
515
|
+
"""
|
|
516
|
+
Which exact result supplied the verdict.
|
|
517
|
+
"""
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
class RelationType(RootModel[Literal['redirects_to', 'loads_from', 'calls', 'embeds']]):
|
|
521
|
+
root: Literal['redirects_to', 'loads_from', 'calls', 'embeds']
|
|
522
|
+
"""
|
|
523
|
+
`redirects_to`: an HTTP redirect to the target. `loads_from`: a passive resource
|
|
524
|
+
loaded from the target. `calls`: an active browser request to the target.
|
|
525
|
+
`embeds`: the target was framed or embedded.
|
|
526
|
+
|
|
527
|
+
"""
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
class CursorPage(BaseModel):
|
|
531
|
+
limit: int
|
|
532
|
+
sort: str
|
|
533
|
+
order: Literal['asc', 'desc']
|
|
534
|
+
next_cursor: str | None = None
|
|
535
|
+
"""
|
|
536
|
+
Present only when `has_more` is `true`.
|
|
537
|
+
"""
|
|
538
|
+
has_more: bool
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
class Host(BaseModel):
|
|
542
|
+
id: int
|
|
543
|
+
host_type: Literal['fqdn', 'ip']
|
|
544
|
+
"""
|
|
545
|
+
Whether the host is an FQDN or an IP.
|
|
546
|
+
"""
|
|
547
|
+
host: str
|
|
548
|
+
registrable_domain: str | None = None
|
|
549
|
+
public_suffix: str | None = None
|
|
550
|
+
subdomain: str | None = None
|
|
551
|
+
registered_at: AwareDatetime | None = None
|
|
552
|
+
first_seen: AwareDatetime
|
|
553
|
+
last_seen: AwareDatetime
|
|
554
|
+
times_seen: int
|
|
555
|
+
"""
|
|
556
|
+
Deduplicated processed reports containing the host.
|
|
557
|
+
"""
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
class Observation(BaseModel):
|
|
561
|
+
first_seen: AwareDatetime
|
|
562
|
+
last_seen: AwareDatetime
|
|
563
|
+
times_seen: int
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
class Ip(Observation):
|
|
567
|
+
ip: str
|
|
568
|
+
asn: int | None = None
|
|
569
|
+
as_name: str | None = None
|
|
570
|
+
country_code: str | None = None
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
class Technology(Observation):
|
|
574
|
+
technology: str
|
|
575
|
+
confidence: float | None = None
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
class Certificate(Observation):
|
|
579
|
+
sha256: str
|
|
580
|
+
subject_common_name: str | None = None
|
|
581
|
+
subject_organization: str | None = None
|
|
582
|
+
issuer_common_name: str | None = None
|
|
583
|
+
issuer_organization: str | None = None
|
|
584
|
+
valid_from: AwareDatetime | None = None
|
|
585
|
+
valid_to: AwareDatetime | None = None
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
class Cookie(Observation):
|
|
589
|
+
name: str
|
|
590
|
+
secure: bool
|
|
591
|
+
http_only: bool
|
|
592
|
+
same_site: str
|
|
593
|
+
partitioned: bool
|
|
594
|
+
host_only: bool
|
|
595
|
+
path: str
|
|
596
|
+
persistent: bool
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
class Header(Observation):
|
|
600
|
+
name: str
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
class MimeType(Observation):
|
|
604
|
+
mime_type: str
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
class RelationCount(BaseModel):
|
|
608
|
+
incoming: int
|
|
609
|
+
outgoing: int
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
class HostDetails(BaseModel):
|
|
613
|
+
host: Host
|
|
614
|
+
ips: list[Ip]
|
|
615
|
+
technologies: list[Technology]
|
|
616
|
+
certificates: list[Certificate]
|
|
617
|
+
cookies: list[Cookie]
|
|
618
|
+
headers: list[Header]
|
|
619
|
+
mime_types: list[MimeType]
|
|
620
|
+
relation_count: RelationCount
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
class HostSummary(BaseModel):
|
|
624
|
+
ips: int
|
|
625
|
+
technologies: int
|
|
626
|
+
certificates: int
|
|
627
|
+
cookies: int
|
|
628
|
+
headers: int
|
|
629
|
+
mime_types: int
|
|
630
|
+
incoming: int
|
|
631
|
+
outgoing: int
|
|
632
|
+
incoming_has_more: bool
|
|
633
|
+
outgoing_has_more: bool
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
class HostListItem(BaseModel):
|
|
637
|
+
host: Host
|
|
638
|
+
fact_first_seen: AwareDatetime
|
|
639
|
+
fact_last_seen: AwareDatetime
|
|
640
|
+
fact_times_seen: int
|
|
641
|
+
summary: HostSummary
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
class Metrics(BaseModel):
|
|
645
|
+
incoming_total: int
|
|
646
|
+
incoming_relation_count: int
|
|
647
|
+
incoming_relation_ratio: float
|
|
648
|
+
outgoing_total: int
|
|
649
|
+
outgoing_relation_count: int
|
|
650
|
+
outgoing_relation_ratio: float
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
class HostSearchItem(BaseModel):
|
|
654
|
+
host: Host
|
|
655
|
+
metrics: Metrics
|
|
656
|
+
summary: HostSummary
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
class Relation(Observation):
|
|
660
|
+
source: Host
|
|
661
|
+
target: Host
|
|
662
|
+
relation_type: RelationType
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
class YARASetRequest(BaseModel):
|
|
666
|
+
model_config = ConfigDict(
|
|
667
|
+
extra='forbid',
|
|
668
|
+
)
|
|
669
|
+
name: Annotated[str, Field(max_length=255)]
|
|
670
|
+
"""
|
|
671
|
+
At most 255 bytes.
|
|
672
|
+
"""
|
|
673
|
+
description: Annotated[str | None, Field(max_length=2000)] = None
|
|
674
|
+
"""
|
|
675
|
+
At most 2000 bytes.
|
|
676
|
+
"""
|
|
677
|
+
visibility: Literal['private', 'team'] | None = None
|
|
678
|
+
"""
|
|
679
|
+
`team` shares the set with your team. Omitted, it is `team` when you are in a team and `private` otherwise.
|
|
680
|
+
"""
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
class YARASetUpdateRequest(BaseModel):
|
|
684
|
+
model_config = ConfigDict(
|
|
685
|
+
extra='forbid',
|
|
686
|
+
)
|
|
687
|
+
name: Annotated[str, Field(max_length=255)]
|
|
688
|
+
"""
|
|
689
|
+
At most 255 bytes.
|
|
690
|
+
"""
|
|
691
|
+
description: Annotated[str | None, Field(max_length=2000)] = None
|
|
692
|
+
"""
|
|
693
|
+
At most 2000 bytes.
|
|
694
|
+
"""
|
|
695
|
+
visibility: Literal['private', 'team'] | None = None
|
|
696
|
+
"""
|
|
697
|
+
Omitted or empty keeps the current visibility.
|
|
698
|
+
"""
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
class YARASet(BaseModel):
|
|
702
|
+
id: str
|
|
703
|
+
name: str
|
|
704
|
+
description: str
|
|
705
|
+
visibility: Literal['private', 'team']
|
|
706
|
+
rules: int
|
|
707
|
+
"""
|
|
708
|
+
Number of YARA rules in the set that you can see.
|
|
709
|
+
"""
|
|
710
|
+
created_by: str
|
|
711
|
+
"""
|
|
712
|
+
User ID of the owner.
|
|
713
|
+
"""
|
|
714
|
+
created_at: AwareDatetime
|
|
715
|
+
updated_at: AwareDatetime
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
class YARASetList(BaseModel):
|
|
719
|
+
items: list[YARASet]
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
class YARARuleRequest(BaseModel):
|
|
723
|
+
model_config = ConfigDict(
|
|
724
|
+
extra='forbid',
|
|
725
|
+
)
|
|
726
|
+
name: Annotated[str, Field(max_length=255)]
|
|
727
|
+
"""
|
|
728
|
+
At most 255 bytes.
|
|
729
|
+
"""
|
|
730
|
+
description: Annotated[str | None, Field(max_length=2000)] = None
|
|
731
|
+
"""
|
|
732
|
+
At most 2000 bytes.
|
|
733
|
+
"""
|
|
734
|
+
content: str
|
|
735
|
+
"""
|
|
736
|
+
YARA source, at most 1 MiB. Includes are not allowed.
|
|
737
|
+
"""
|
|
738
|
+
visibility: Literal['private', 'team'] | None = None
|
|
739
|
+
"""
|
|
740
|
+
Who can see and use the rule. Required on replace. Omitted on create, it is `team` when you are in a team and `private` otherwise.
|
|
741
|
+
"""
|
|
742
|
+
alert_visibility: Literal['private', 'team'] | None = None
|
|
743
|
+
"""
|
|
744
|
+
Who sees the rule's alerts on matching reports. Required on replace. Omitted on create, it is `team` when you are in a team and `private` otherwise.
|
|
745
|
+
"""
|
|
746
|
+
can_team_edit: bool | None = None
|
|
747
|
+
"""
|
|
748
|
+
Let teammates edit a team-visible rule. Omitted, it is `true` on create when `visibility` is `team`, and `false` on replace.
|
|
749
|
+
"""
|
|
750
|
+
enabled: bool | None = None
|
|
751
|
+
"""
|
|
752
|
+
On replace, switches the rule off or on; omitted keeps its state. New rules are always enabled, so `false` on create returns `400`.
|
|
753
|
+
"""
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
class YARARule(BaseModel):
|
|
757
|
+
id: str
|
|
758
|
+
set_id: str
|
|
759
|
+
name: str
|
|
760
|
+
description: str
|
|
761
|
+
content: str
|
|
762
|
+
rule_count: int
|
|
763
|
+
"""
|
|
764
|
+
Number of YARA rules the source compiled to.
|
|
765
|
+
"""
|
|
766
|
+
enabled: bool
|
|
767
|
+
visibility: Literal['private', 'team']
|
|
768
|
+
alert_visibility: Literal['private', 'team']
|
|
769
|
+
can_team_edit: bool
|
|
770
|
+
created_by: str
|
|
771
|
+
"""
|
|
772
|
+
User ID of the owner.
|
|
773
|
+
"""
|
|
774
|
+
created_at: AwareDatetime
|
|
775
|
+
updated_at: AwareDatetime
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
class YARARuleList(BaseModel):
|
|
779
|
+
items: list[YARARule]
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
class YARAMatchedRule(BaseModel):
|
|
783
|
+
name: str
|
|
784
|
+
matches: int
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
class YARADailyMatches(BaseModel):
|
|
788
|
+
date: date_aliased
|
|
789
|
+
matches: int
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
class YARARuleMatch(BaseModel):
|
|
793
|
+
report_id: str
|
|
794
|
+
matched_at: AwareDatetime
|
|
795
|
+
url: str
|
|
796
|
+
fqdn: str
|
|
797
|
+
domain: str
|
|
798
|
+
ip: str
|
|
799
|
+
matched_rules: list[str]
|
|
800
|
+
"""
|
|
801
|
+
The YARA rules inside the source that matched the report.
|
|
802
|
+
"""
|
|
803
|
+
severity: str
|
|
804
|
+
"""
|
|
805
|
+
The highest severity of the matching YARA rules.
|
|
806
|
+
"""
|
|
807
|
+
verdict: str
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
class YARAValidateRequest(BaseModel):
|
|
811
|
+
model_config = ConfigDict(
|
|
812
|
+
extra='forbid',
|
|
813
|
+
)
|
|
814
|
+
content: str
|
|
815
|
+
"""
|
|
816
|
+
YARA source, at most 1 MiB.
|
|
817
|
+
"""
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
class YARATestRequest(BaseModel):
|
|
821
|
+
model_config = ConfigDict(
|
|
822
|
+
extra='forbid',
|
|
823
|
+
)
|
|
824
|
+
content: str
|
|
825
|
+
"""
|
|
826
|
+
YARA source, at most 1 MiB.
|
|
827
|
+
"""
|
|
828
|
+
report_id: str
|
|
829
|
+
"""
|
|
830
|
+
A report you can read.
|
|
831
|
+
"""
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
class Skipped(BaseModel):
|
|
835
|
+
"""
|
|
836
|
+
What was not scanned.
|
|
837
|
+
"""
|
|
838
|
+
|
|
839
|
+
unavailable: int
|
|
840
|
+
"""
|
|
841
|
+
Response bodies that aren't stored.
|
|
842
|
+
"""
|
|
843
|
+
archived: int
|
|
844
|
+
"""
|
|
845
|
+
Files inside archives.
|
|
846
|
+
"""
|
|
847
|
+
limit: int
|
|
848
|
+
"""
|
|
849
|
+
Resources past 200 or 32 MiB in total.
|
|
850
|
+
"""
|
|
851
|
+
timeout: int
|
|
852
|
+
"""
|
|
853
|
+
Scans that timed out.
|
|
854
|
+
"""
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
class Match1(BaseModel):
|
|
858
|
+
offset: int
|
|
859
|
+
length: int
|
|
860
|
+
data: str
|
|
861
|
+
"""
|
|
862
|
+
Up to 64 bytes of the match; bytes outside printable ASCII are shown as ".".
|
|
863
|
+
"""
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
class String(BaseModel):
|
|
867
|
+
name: str
|
|
868
|
+
count: int
|
|
869
|
+
"""
|
|
870
|
+
How often the string matched.
|
|
871
|
+
"""
|
|
872
|
+
matches: list[Match1]
|
|
873
|
+
"""
|
|
874
|
+
The first three matches.
|
|
875
|
+
"""
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
class Rule(BaseModel):
|
|
879
|
+
name: str
|
|
880
|
+
"""
|
|
881
|
+
The YARA rule that matched.
|
|
882
|
+
"""
|
|
883
|
+
strings: list[String]
|
|
884
|
+
"""
|
|
885
|
+
Up to 20 of the rule's strings that matched.
|
|
886
|
+
"""
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
class Match(BaseModel):
|
|
890
|
+
kind: Literal['dom', 'script', 'response']
|
|
891
|
+
url: str
|
|
892
|
+
sha256: str
|
|
893
|
+
rules: list[Rule]
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
class YARADiagnostic(BaseModel):
|
|
897
|
+
line: int
|
|
898
|
+
"""
|
|
899
|
+
Source line, or 0 when unknown.
|
|
900
|
+
"""
|
|
901
|
+
message: str
|
|
902
|
+
level: Literal['error', 'warning']
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
class PageMonitorCreateRequest(BaseModel):
|
|
906
|
+
report_id: str
|
|
907
|
+
"""
|
|
908
|
+
The baseline report. Its URL and scan settings are the monitor's.
|
|
909
|
+
"""
|
|
910
|
+
name: Annotated[str | None, Field(max_length=100)] = None
|
|
911
|
+
"""
|
|
912
|
+
Defaults to the report's title
|
|
913
|
+
"""
|
|
914
|
+
interval: Literal['hourly', '6h', 'daily', 'weekly'] = 'daily'
|
|
915
|
+
"""
|
|
916
|
+
The shortest intervals may not be available to your account.
|
|
917
|
+
"""
|
|
918
|
+
access: Literal['public', 'restricted', 'private'] = 'restricted'
|
|
919
|
+
"""
|
|
920
|
+
The access of the scans' reports.
|
|
921
|
+
"""
|
|
922
|
+
checks: (
|
|
923
|
+
list[
|
|
924
|
+
Literal[
|
|
925
|
+
'redirect', 'http_status', 'new_hosts', 'certificate', 'new_detections'
|
|
926
|
+
]
|
|
927
|
+
]
|
|
928
|
+
| None
|
|
929
|
+
) = None
|
|
930
|
+
"""
|
|
931
|
+
Page-level differences that count. Default `redirect`, `new_hosts`, `new_detections`.
|
|
932
|
+
"""
|
|
933
|
+
new: list[Literal['script', 'style', 'image', 'font', 'media', 'frame']] | None = (
|
|
934
|
+
None
|
|
935
|
+
)
|
|
936
|
+
"""
|
|
937
|
+
Resource types whose new URLs count. Default `script`, `frame`.
|
|
938
|
+
"""
|
|
939
|
+
changed: dict[str, Literal['exact', 'minor', 'moderate', 'major']] | None = None
|
|
940
|
+
"""
|
|
941
|
+
Resource types (`page`, `script`, `style`, `image`, `font`, `media`, `frame`) whose changed
|
|
942
|
+
content counts, and how much it must change. `page` takes `minor` to `major`; `image`, `font`
|
|
943
|
+
and `media` only `exact`. Default `{"page": "minor", "script": "minor"}`.
|
|
944
|
+
|
|
945
|
+
"""
|
|
946
|
+
scope: Literal['site', 'all'] = 'site'
|
|
947
|
+
"""
|
|
948
|
+
The resources compared: those of the site only, or all.
|
|
949
|
+
"""
|
|
950
|
+
only: list[str] | None = None
|
|
951
|
+
"""
|
|
952
|
+
When set, the only resource URLs compared, whatever their type: exact `http` or `https` URLs, without `*`.
|
|
953
|
+
"""
|
|
954
|
+
ignore: list[str] | None = None
|
|
955
|
+
"""
|
|
956
|
+
Resource URLs never compared: `http` or `https` URLs that name a host, such as `https://www.google-analytics.com/*`; `*` matches any text. Not used with `only`.
|
|
957
|
+
"""
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
class PageMonitorUpdateRequest(BaseModel):
|
|
961
|
+
"""
|
|
962
|
+
Only the fields sent change. A list or `changed` sent replaces the monitor's; `[]` clears it, and `null` keeps it.
|
|
963
|
+
"""
|
|
964
|
+
|
|
965
|
+
name: Annotated[str | None, Field(max_length=100)] = None
|
|
966
|
+
interval: Literal['hourly', '6h', 'daily', 'weekly'] | None = None
|
|
967
|
+
access: Literal['public', 'restricted', 'private'] | None = None
|
|
968
|
+
checks: list[str] | None = None
|
|
969
|
+
new: list[str] | None = None
|
|
970
|
+
changed: dict[str, str] | None = None
|
|
971
|
+
scope: Literal['site', 'all'] | None = None
|
|
972
|
+
only: list[str] | None = None
|
|
973
|
+
ignore: list[str] | None = None
|
|
974
|
+
enabled: bool | None = None
|
|
975
|
+
"""
|
|
976
|
+
`false` pauses the monitor; `true` resumes it, with you as the user its scans run as.
|
|
977
|
+
"""
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
class BaselineRequest(BaseModel):
|
|
981
|
+
report_id: str
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
class ScanSettings(BaseModel):
|
|
985
|
+
"""
|
|
986
|
+
The baseline report's scan settings, which every scan reuses.
|
|
987
|
+
"""
|
|
988
|
+
|
|
989
|
+
user_agent: str | None = None
|
|
990
|
+
device_type: str | None = None
|
|
991
|
+
exit_node: str | None = None
|
|
992
|
+
referer: str | None = None
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
class PageMonitor(BaseModel):
|
|
996
|
+
id: str
|
|
997
|
+
name: str
|
|
998
|
+
url: str
|
|
999
|
+
"""
|
|
1000
|
+
The URL the baseline report was submitted with. It never changes.
|
|
1001
|
+
"""
|
|
1002
|
+
owner: Literal['user', 'team']
|
|
1003
|
+
"""
|
|
1004
|
+
`team` for a monitor every member of your team manages.
|
|
1005
|
+
"""
|
|
1006
|
+
created_by: str
|
|
1007
|
+
"""
|
|
1008
|
+
User ID of its creator.
|
|
1009
|
+
"""
|
|
1010
|
+
interval: Literal['hourly', '6h', 'daily', 'weekly']
|
|
1011
|
+
access: Literal['public', 'restricted', 'private']
|
|
1012
|
+
checks: list[str]
|
|
1013
|
+
new: list[str]
|
|
1014
|
+
changed: dict[str, str]
|
|
1015
|
+
scope: Literal['site', 'all']
|
|
1016
|
+
only: list[str]
|
|
1017
|
+
ignore: list[str]
|
|
1018
|
+
scan_settings: ScanSettings
|
|
1019
|
+
"""
|
|
1020
|
+
The baseline report's scan settings, which every scan reuses.
|
|
1021
|
+
"""
|
|
1022
|
+
baseline_report_id: str
|
|
1023
|
+
baseline_at: AwareDatetime
|
|
1024
|
+
enabled: bool
|
|
1025
|
+
paused_reason: Literal['submitter_disabled', 'submitter_left_team'] | None = None
|
|
1026
|
+
"""
|
|
1027
|
+
Set when the service paused the monitor. Resume it with `enabled true`.
|
|
1028
|
+
"""
|
|
1029
|
+
next_run_at: AwareDatetime
|
|
1030
|
+
last_run_at: Annotated[AwareDatetime | None, Field(...)]
|
|
1031
|
+
last_change_at: Annotated[AwareDatetime | None, Field(...)]
|
|
1032
|
+
created_at: AwareDatetime
|
|
1033
|
+
updated_at: AwareDatetime
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
class PageMonitorList(BaseModel):
|
|
1037
|
+
items: list[PageMonitor]
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
class Resource(BaseModel):
|
|
1041
|
+
url: str
|
|
1042
|
+
previous_url: str | None = None
|
|
1043
|
+
"""
|
|
1044
|
+
The baseline URL of a renamed file
|
|
1045
|
+
"""
|
|
1046
|
+
type: str
|
|
1047
|
+
change: Literal['new', 'changed', 'missing']
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
class PageMonitorRun(BaseModel):
|
|
1051
|
+
id: str
|
|
1052
|
+
report_id: str | None = None
|
|
1053
|
+
"""
|
|
1054
|
+
Absent when the scan could not be submitted.
|
|
1055
|
+
"""
|
|
1056
|
+
status: Literal['scanning', 'done', 'failed']
|
|
1057
|
+
error: str | None = None
|
|
1058
|
+
"""
|
|
1059
|
+
Why the run failed.
|
|
1060
|
+
"""
|
|
1061
|
+
submitted_at: AwareDatetime
|
|
1062
|
+
completed_at: Annotated[AwareDatetime | None, Field(...)]
|
|
1063
|
+
changes: list[str]
|
|
1064
|
+
"""
|
|
1065
|
+
How the report differs from the baseline, such as `new_hosts` or `changed_resources`. Empty when it does not.
|
|
1066
|
+
"""
|
|
1067
|
+
final_url: str | None = None
|
|
1068
|
+
"""
|
|
1069
|
+
The final URL
|
|
1070
|
+
"""
|
|
1071
|
+
http_status: str | None = None
|
|
1072
|
+
"""
|
|
1073
|
+
The HTTP status
|
|
1074
|
+
"""
|
|
1075
|
+
resources: list[Resource]
|
|
1076
|
+
new_hosts: list[str]
|
|
1077
|
+
new_detections: list[str]
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
class WatchlistUpdateRequest(BaseModel):
|
|
1081
|
+
"""
|
|
1082
|
+
Send `name`, `enabled` or both.
|
|
1083
|
+
"""
|
|
1084
|
+
|
|
1085
|
+
name: Annotated[str | None, Field(max_length=100)] = None
|
|
1086
|
+
enabled: bool | None = None
|
|
1087
|
+
"""
|
|
1088
|
+
`false` pauses the watchlist; a paused watchlist records nothing.
|
|
1089
|
+
"""
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
class Indicator(RootModel[str]):
|
|
1093
|
+
root: Annotated[str, Field(max_length=4096)]
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
class Indicators(RootModel[list[Indicator]]):
|
|
1097
|
+
"""
|
|
1098
|
+
One value per entry, without spaces: a SHA256, IP, domain, FQDN, URL, or URL pattern with `*`
|
|
1099
|
+
such as `*/gate.php`. A registered domain also matches its subdomains. Defanged values are
|
|
1100
|
+
accepted. IP ranges and hashes other than SHA256 are not.
|
|
1101
|
+
|
|
1102
|
+
"""
|
|
1103
|
+
|
|
1104
|
+
root: Annotated[
|
|
1105
|
+
list[Indicator],
|
|
1106
|
+
Field(
|
|
1107
|
+
examples=[
|
|
1108
|
+
[
|
|
1109
|
+
'evil.example',
|
|
1110
|
+
'203.0.113.7',
|
|
1111
|
+
'hxxps://login[.]example.org/verify',
|
|
1112
|
+
'*/wp-content/plugins/kit/*',
|
|
1113
|
+
]
|
|
1114
|
+
],
|
|
1115
|
+
max_length=500,
|
|
1116
|
+
),
|
|
1117
|
+
]
|
|
1118
|
+
"""
|
|
1119
|
+
One value per entry, without spaces: a SHA256, IP, domain, FQDN, URL, or URL pattern with `*`
|
|
1120
|
+
such as `*/gate.php`. A registered domain also matches its subdomains. Defanged values are
|
|
1121
|
+
accepted. IP ranges and hashes other than SHA256 are not.
|
|
1122
|
+
|
|
1123
|
+
"""
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
class Watchlist(BaseModel):
|
|
1127
|
+
id: str
|
|
1128
|
+
name: str
|
|
1129
|
+
owner: Literal['user', 'team']
|
|
1130
|
+
created_by: str
|
|
1131
|
+
"""
|
|
1132
|
+
User ID of its creator.
|
|
1133
|
+
"""
|
|
1134
|
+
enabled: bool
|
|
1135
|
+
indicators: int
|
|
1136
|
+
"""
|
|
1137
|
+
How many indicators it has.
|
|
1138
|
+
"""
|
|
1139
|
+
last_report_at: Annotated[AwareDatetime | None, Field(...)]
|
|
1140
|
+
"""
|
|
1141
|
+
When it last matched a report.
|
|
1142
|
+
"""
|
|
1143
|
+
created_at: AwareDatetime
|
|
1144
|
+
updated_at: AwareDatetime
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
class WatchlistList(BaseModel):
|
|
1148
|
+
items: list[Watchlist]
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
class Indicator1(BaseModel):
|
|
1152
|
+
kind: Literal['sha256', 'fqdn', 'domain', 'ip', 'url', 'url_pattern']
|
|
1153
|
+
value: str
|
|
1154
|
+
"""
|
|
1155
|
+
Normalised: lowercased, and a URL without its scheme.
|
|
1156
|
+
"""
|
|
1157
|
+
created_at: AwareDatetime | None = None
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
class IndicatorList(BaseModel):
|
|
1161
|
+
items: list[Indicator1]
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
class SkippedIndicator(BaseModel):
|
|
1165
|
+
input: str
|
|
1166
|
+
"""
|
|
1167
|
+
The value as it was sent.
|
|
1168
|
+
"""
|
|
1169
|
+
kind: str | None = None
|
|
1170
|
+
"""
|
|
1171
|
+
Set when the value was recognised.
|
|
1172
|
+
"""
|
|
1173
|
+
value: str | None = None
|
|
1174
|
+
"""
|
|
1175
|
+
Set when the value was recognised.
|
|
1176
|
+
"""
|
|
1177
|
+
code: Literal['invalid', 'exists', 'limit']
|
|
1178
|
+
"""
|
|
1179
|
+
`invalid`, see `reason`; `exists`, already in the watchlist; `limit`, your indicator limit was reached.
|
|
1180
|
+
"""
|
|
1181
|
+
reason: str | None = None
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
class Match2(BaseModel):
|
|
1185
|
+
kind: str
|
|
1186
|
+
value: str
|
|
1187
|
+
seen_as: list[Literal['sha256', 'host', 'ip', 'url', 'final_url', 'request']]
|
|
1188
|
+
"""
|
|
1189
|
+
Where the report observed it: a content hash, a contacted host or IP, the submitted or final URL, or a URL the page loaded.
|
|
1190
|
+
"""
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
class WatchlistReport(BaseModel):
|
|
1194
|
+
report_id: str
|
|
1195
|
+
url: str
|
|
1196
|
+
"""
|
|
1197
|
+
The submitted URL without its scheme.
|
|
1198
|
+
"""
|
|
1199
|
+
fqdn: str
|
|
1200
|
+
ip: str
|
|
1201
|
+
access: Literal['public', 'restricted', 'private']
|
|
1202
|
+
observed_at: AwareDatetime
|
|
1203
|
+
matches: list[Match2]
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
class WatchlistTopIndicator(BaseModel):
|
|
1207
|
+
kind: str
|
|
1208
|
+
value: str
|
|
1209
|
+
reports: int
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
class WatchlistDailyReports(BaseModel):
|
|
1213
|
+
date: date_aliased
|
|
1214
|
+
reports: int
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
class ComparedResource(BaseModel):
|
|
1218
|
+
kind: Literal['new', 'changed', 'renamed', 'missing']
|
|
1219
|
+
type: str
|
|
1220
|
+
"""
|
|
1221
|
+
The resource type, such as script, style, image or document.
|
|
1222
|
+
"""
|
|
1223
|
+
url: str
|
|
1224
|
+
"""
|
|
1225
|
+
The URL without its query.
|
|
1226
|
+
"""
|
|
1227
|
+
previous_url: str | None = None
|
|
1228
|
+
"""
|
|
1229
|
+
The URL in A of a renamed or moved file.
|
|
1230
|
+
"""
|
|
1231
|
+
a: Annotated[ComparedFile | None, Field(...)]
|
|
1232
|
+
"""
|
|
1233
|
+
The file in A; null for a new file.
|
|
1234
|
+
"""
|
|
1235
|
+
b: Annotated[ComparedFile | None, Field(...)]
|
|
1236
|
+
"""
|
|
1237
|
+
The file in B; null for a missing file.
|
|
1238
|
+
"""
|
|
1239
|
+
similarity: Annotated[Similarity | None, Field(...)]
|
|
1240
|
+
"""
|
|
1241
|
+
How alike a changed file's versions are: ssdeep 0–100 (100 identical) or TLSH distance (0 identical); null when they cannot be compared.
|
|
1242
|
+
"""
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
class ReportFinal(BaseModel):
|
|
1246
|
+
"""
|
|
1247
|
+
The page the analysis ended on.
|
|
1248
|
+
"""
|
|
1249
|
+
|
|
1250
|
+
url: ReportURL
|
|
1251
|
+
title: str
|
|
1252
|
+
dom: ReportFinalDOM | None = None
|
|
1253
|
+
"""
|
|
1254
|
+
The final page's DOM: size, MIME type, hashes, and when it was first and last
|
|
1255
|
+
seen. Only in the full report; overviews leave it out.
|
|
1256
|
+
|
|
1257
|
+
"""
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
class ReportHost(BaseModel):
|
|
1261
|
+
"""
|
|
1262
|
+
One host the analysis contacted. Alerts are not stored on the host; they are in the
|
|
1263
|
+
report's `detection` lists, where each alert's `trigger` identifies the host it fired on.
|
|
1264
|
+
|
|
1265
|
+
"""
|
|
1266
|
+
|
|
1267
|
+
fqdn: Annotated[str, Field(examples=['login.example.com'])]
|
|
1268
|
+
ips: list[ReportIP]
|
|
1269
|
+
"""
|
|
1270
|
+
Distinct addresses the host answered from, in first-seen order.
|
|
1271
|
+
"""
|
|
1272
|
+
domain_rank: int
|
|
1273
|
+
"""
|
|
1274
|
+
Popularity rank of the domain among the top million sites; 0 when unranked.
|
|
1275
|
+
"""
|
|
1276
|
+
domain_registered: str
|
|
1277
|
+
"""
|
|
1278
|
+
Domain registration date; empty when unknown.
|
|
1279
|
+
"""
|
|
1280
|
+
first_seen: str
|
|
1281
|
+
"""
|
|
1282
|
+
First sighting in urlquery reports, or in passive DNS for a host new to urlquery; empty when unknown.
|
|
1283
|
+
"""
|
|
1284
|
+
last_seen: str
|
|
1285
|
+
"""
|
|
1286
|
+
Last sighting before this report, from urlquery reports or passive DNS; empty when unknown.
|
|
1287
|
+
"""
|
|
1288
|
+
request_count: int
|
|
1289
|
+
"""
|
|
1290
|
+
Requests made to the host.
|
|
1291
|
+
"""
|
|
1292
|
+
sent_data: int
|
|
1293
|
+
"""
|
|
1294
|
+
Bytes sent to the host.
|
|
1295
|
+
"""
|
|
1296
|
+
received_data: int
|
|
1297
|
+
"""
|
|
1298
|
+
Bytes received from the host.
|
|
1299
|
+
"""
|
|
1300
|
+
fingerprints: list[ReportFingerprint]
|
|
1301
|
+
"""
|
|
1302
|
+
Technologies fingerprinted on the host, unique by name.
|
|
1303
|
+
"""
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
class ReportAnalyzerAlert(BaseModel):
|
|
1307
|
+
"""
|
|
1308
|
+
An alert from urlquery's analyzers: blocklists, file reputation and YARA rules, including your own. A YARA alert's `detection_meta` names the detection rule.
|
|
1309
|
+
"""
|
|
1310
|
+
|
|
1311
|
+
sensor_name: str
|
|
1312
|
+
sensor_type: str
|
|
1313
|
+
title: str
|
|
1314
|
+
description: str
|
|
1315
|
+
scan_date: str
|
|
1316
|
+
alert: str
|
|
1317
|
+
trigger: str
|
|
1318
|
+
"""
|
|
1319
|
+
What the source checked: a domain or URL, or a value on no host, such as a file hash.
|
|
1320
|
+
"""
|
|
1321
|
+
verdict: str
|
|
1322
|
+
severity: str
|
|
1323
|
+
comment: str
|
|
1324
|
+
link: Annotated[str | None, Field(...)]
|
|
1325
|
+
meta: Annotated[dict[str, str] | None, Field(...)]
|
|
1326
|
+
detection_meta: ReportDetectionMeta | None = None
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
class ReportHTTPRequest(BaseModel):
|
|
1330
|
+
raw: str
|
|
1331
|
+
headers: list[ReportHTTPHeader]
|
|
1332
|
+
cookies: list[ReportHTTPHeader]
|
|
1333
|
+
method: str
|
|
1334
|
+
post_data: ReportHTTPPostData | None = None
|
|
1335
|
+
"""
|
|
1336
|
+
Data the page submitted, such as form fields.
|
|
1337
|
+
"""
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
class ReportHTTPResponse(BaseModel):
|
|
1341
|
+
raw: str
|
|
1342
|
+
headers: list[ReportHTTPHeader]
|
|
1343
|
+
cookies: list[ReportHTTPCookie]
|
|
1344
|
+
status_code: str
|
|
1345
|
+
status_text: str
|
|
1346
|
+
fingerprints: list[ReportTechFingerprint]
|
|
1347
|
+
"""
|
|
1348
|
+
Technologies fingerprinted from the response.
|
|
1349
|
+
"""
|
|
1350
|
+
data: ReportHTTPContent
|
|
1351
|
+
"""
|
|
1352
|
+
The body's hashes, type, size and prevalence; the content itself is downloaded separately.
|
|
1353
|
+
"""
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
class ReportAlerts(BaseModel):
|
|
1357
|
+
"""
|
|
1358
|
+
Alerts by source, as in the report's `detection`.
|
|
1359
|
+
"""
|
|
1360
|
+
|
|
1361
|
+
ids: list[ReportIDSAlert]
|
|
1362
|
+
analyzer: list[ReportAnalyzerAlert]
|
|
1363
|
+
urlquery: list[ReportURLQueryAlert]
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
class ReportScript(BaseModel):
|
|
1367
|
+
"""
|
|
1368
|
+
One script, with its content hashes, prevalence and alerts. Download its content by `sha256`.
|
|
1369
|
+
"""
|
|
1370
|
+
|
|
1371
|
+
url: ReportURL
|
|
1372
|
+
ip: ReportIP
|
|
1373
|
+
introduction_type: str
|
|
1374
|
+
is_inline: bool
|
|
1375
|
+
md5: str
|
|
1376
|
+
sha1: str
|
|
1377
|
+
sha256: str
|
|
1378
|
+
sha512: str
|
|
1379
|
+
ssdeep: str
|
|
1380
|
+
tlshash: str
|
|
1381
|
+
size: int
|
|
1382
|
+
data: str
|
|
1383
|
+
first_seen: str
|
|
1384
|
+
last_seen: str
|
|
1385
|
+
times_seen: int
|
|
1386
|
+
alerts: ReportAlerts
|
|
1387
|
+
|
|
1388
|
+
|
|
1389
|
+
class ReportJSCode(BaseModel):
|
|
1390
|
+
md5: str
|
|
1391
|
+
sha1: str
|
|
1392
|
+
sha256: str
|
|
1393
|
+
sha512: str
|
|
1394
|
+
ssdeep: str
|
|
1395
|
+
tlshash: str
|
|
1396
|
+
size: int
|
|
1397
|
+
data: str
|
|
1398
|
+
first_seen: str
|
|
1399
|
+
last_seen: str
|
|
1400
|
+
times_seen: int
|
|
1401
|
+
alerts: ReportAlerts
|
|
1402
|
+
|
|
1403
|
+
|
|
1404
|
+
class ReportCertificate(BaseModel):
|
|
1405
|
+
"""
|
|
1406
|
+
The server certificate. Its `fingerprint.sha256` is a strong pivot.
|
|
1407
|
+
"""
|
|
1408
|
+
|
|
1409
|
+
subject: ReportSubjectInfo
|
|
1410
|
+
issuer: ReportIssuerInfo
|
|
1411
|
+
validity: ReportValidityInfo
|
|
1412
|
+
fingerprint: ReportFingerprintInfo
|
|
1413
|
+
|
|
1414
|
+
|
|
1415
|
+
class ReportExtraDataSection(BaseModel):
|
|
1416
|
+
environment_variable: ReportEnvironmentVariableDataBlock | None = None
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
class ReportArtifactAlerts(BaseModel):
|
|
1420
|
+
urlquery: list[ReportURLQueryAlert]
|
|
1421
|
+
analyzer: list[ReportAnalyzerAlert]
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
class ReportFileArchiveContent(BaseModel):
|
|
1425
|
+
path: str
|
|
1426
|
+
filename: str
|
|
1427
|
+
modified: str
|
|
1428
|
+
modified_deprecated: Annotated[str, Field(alias='Modified', deprecated=True)]
|
|
1429
|
+
"""
|
|
1430
|
+
Older spelling of `modified`.
|
|
1431
|
+
"""
|
|
1432
|
+
magic: str
|
|
1433
|
+
size: int
|
|
1434
|
+
md5: str
|
|
1435
|
+
sha1: str
|
|
1436
|
+
sha256: str
|
|
1437
|
+
sha512: str
|
|
1438
|
+
alerts: ReportArtifactAlerts
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
class ReportTelegramBotChat(BaseModel):
|
|
1442
|
+
chat_id: str
|
|
1443
|
+
title: str
|
|
1444
|
+
type: str
|
|
1445
|
+
bot_is: str
|
|
1446
|
+
total_users: int
|
|
1447
|
+
active_members: list[ReportTelegramChatActiveMember]
|
|
1448
|
+
admins: list[ReportTelegramChatAdmin]
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
class HostPage(BaseModel):
|
|
1452
|
+
items: list[HostListItem]
|
|
1453
|
+
page: CursorPage
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
class HostSearchPage(BaseModel):
|
|
1457
|
+
items: list[HostSearchItem]
|
|
1458
|
+
page: CursorPage
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
class RelationPage(BaseModel):
|
|
1462
|
+
items: list[Relation]
|
|
1463
|
+
page: CursorPage
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
class YARARuleStats(BaseModel):
|
|
1467
|
+
rule_id: str
|
|
1468
|
+
days: int
|
|
1469
|
+
"""
|
|
1470
|
+
Length of the window in UTC days.
|
|
1471
|
+
"""
|
|
1472
|
+
enabled: bool
|
|
1473
|
+
matches: int
|
|
1474
|
+
"""
|
|
1475
|
+
Reports the rule matched in the window.
|
|
1476
|
+
"""
|
|
1477
|
+
fqdns: int
|
|
1478
|
+
"""
|
|
1479
|
+
Distinct FQDNs of those reports.
|
|
1480
|
+
"""
|
|
1481
|
+
domains: int
|
|
1482
|
+
"""
|
|
1483
|
+
Distinct registrable domains of those reports.
|
|
1484
|
+
"""
|
|
1485
|
+
own_matches: int
|
|
1486
|
+
"""
|
|
1487
|
+
Matching reports submitted by the rule's owner or the owner's team.
|
|
1488
|
+
"""
|
|
1489
|
+
first_match_at: Annotated[AwareDatetime | None, Field(...)]
|
|
1490
|
+
"""
|
|
1491
|
+
First stored match, in any window; null without one.
|
|
1492
|
+
"""
|
|
1493
|
+
last_match_at: Annotated[AwareDatetime | None, Field(...)]
|
|
1494
|
+
"""
|
|
1495
|
+
Latest stored match, in any window; null without one.
|
|
1496
|
+
"""
|
|
1497
|
+
daily: list[YARADailyMatches]
|
|
1498
|
+
"""
|
|
1499
|
+
One entry per UTC day of the window, oldest first.
|
|
1500
|
+
"""
|
|
1501
|
+
severity: dict[str, int]
|
|
1502
|
+
"""
|
|
1503
|
+
Matching reports per severity. A report whose matching YARA rules differ in severity counts under each.
|
|
1504
|
+
"""
|
|
1505
|
+
matched_rules: list[YARAMatchedRule]
|
|
1506
|
+
"""
|
|
1507
|
+
The YARA rules inside the source that matched the most reports, at most 10.
|
|
1508
|
+
"""
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
class YARARuleMatchList(BaseModel):
|
|
1512
|
+
items: list[YARARuleMatch]
|
|
1513
|
+
hidden: int
|
|
1514
|
+
"""
|
|
1515
|
+
Matching reports in the window that you cannot open.
|
|
1516
|
+
"""
|
|
1517
|
+
page: ListPage
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
class YARAValidation(BaseModel):
|
|
1521
|
+
valid: bool
|
|
1522
|
+
rule_count: int
|
|
1523
|
+
diagnostics: list[YARADiagnostic]
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
class PageMonitorRunList(BaseModel):
|
|
1527
|
+
items: list[PageMonitorRun]
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
class WatchlistCreateRequest(BaseModel):
|
|
1531
|
+
name: Annotated[str, Field(max_length=100)]
|
|
1532
|
+
indicators: Indicators | None = None
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
class IndicatorsRequest(BaseModel):
|
|
1536
|
+
indicators: Indicators
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
class IndicatorBatch(BaseModel):
|
|
1540
|
+
added: list[Indicator1]
|
|
1541
|
+
skipped: list[SkippedIndicator]
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
class CreatedWatchlist(IndicatorBatch):
|
|
1545
|
+
watchlist: Watchlist
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
class WatchlistReportList(BaseModel):
|
|
1549
|
+
items: list[WatchlistReport]
|
|
1550
|
+
hidden: int
|
|
1551
|
+
"""
|
|
1552
|
+
Matched reports you cannot open. Counted on the first page only.
|
|
1553
|
+
"""
|
|
1554
|
+
page: ListPage
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
class WatchlistStats(BaseModel):
|
|
1558
|
+
days: int
|
|
1559
|
+
reports: int
|
|
1560
|
+
sites: int
|
|
1561
|
+
"""
|
|
1562
|
+
Distinct hosts of the reports' URLs.
|
|
1563
|
+
"""
|
|
1564
|
+
matched: int
|
|
1565
|
+
"""
|
|
1566
|
+
Distinct indicators the reports matched.
|
|
1567
|
+
"""
|
|
1568
|
+
last_report_at: Annotated[AwareDatetime | None, Field(...)]
|
|
1569
|
+
daily: list[WatchlistDailyReports]
|
|
1570
|
+
top_indicators: Annotated[list[WatchlistTopIndicator], Field(max_length=20)]
|
|
1571
|
+
|
|
1572
|
+
|
|
1573
|
+
class ReportComparison(BaseModel):
|
|
1574
|
+
"""
|
|
1575
|
+
What differs from report A, the earlier or baseline, to report B.
|
|
1576
|
+
"""
|
|
1577
|
+
|
|
1578
|
+
a: ComparedReport
|
|
1579
|
+
b: ComparedReport
|
|
1580
|
+
page: list[ComparedFact]
|
|
1581
|
+
"""
|
|
1582
|
+
The final page's facts in each report.
|
|
1583
|
+
"""
|
|
1584
|
+
dom: Annotated[ComparedResource | None, Field(...)]
|
|
1585
|
+
"""
|
|
1586
|
+
The final DOM's two files when it changed, else null.
|
|
1587
|
+
"""
|
|
1588
|
+
resources: list[ComparedResource]
|
|
1589
|
+
"""
|
|
1590
|
+
The files that differ, new first, then changed, renamed and missing.
|
|
1591
|
+
"""
|
|
1592
|
+
same_resources: int
|
|
1593
|
+
"""
|
|
1594
|
+
How many files are identical in both.
|
|
1595
|
+
"""
|
|
1596
|
+
hosts: list[ComparedItem]
|
|
1597
|
+
"""
|
|
1598
|
+
Hosts new in B, missing from B, or with other IPs (detail "old → new").
|
|
1599
|
+
"""
|
|
1600
|
+
cookies: list[ComparedItem]
|
|
1601
|
+
"""
|
|
1602
|
+
Response cookies by name, domain and path, new, missing or with other flags. Values are not compared.
|
|
1603
|
+
"""
|
|
1604
|
+
detections: list[ComparedItem]
|
|
1605
|
+
"""
|
|
1606
|
+
Detections new in B or missing from B, as "sensor: alert", with the severity as detail.
|
|
1607
|
+
"""
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
class ReportDetection(BaseModel):
|
|
1611
|
+
"""
|
|
1612
|
+
The alerts raised on the report, by source. Count a list for that source's alert
|
|
1613
|
+
count. `urlquery` holds one alert per rule and trigger host. A urlquery alert's
|
|
1614
|
+
`trigger` is the FQDN of the host it fired on (empty when the evidence has no host),
|
|
1615
|
+
which matches a `hosts` entry's `fqdn`. An analyzer alert's `trigger` is what the
|
|
1616
|
+
source checked: a domain or URL, whose host links it to `hosts`, or a value on no
|
|
1617
|
+
host, such as a file hash.
|
|
1618
|
+
|
|
1619
|
+
"""
|
|
1620
|
+
|
|
1621
|
+
ids: list[ReportIDSAlert]
|
|
1622
|
+
analyzer: list[ReportAnalyzerAlert]
|
|
1623
|
+
urlquery: list[ReportURLQueryAlert]
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
class ReportJavaScript(BaseModel):
|
|
1627
|
+
"""
|
|
1628
|
+
The JavaScript the page ran.
|
|
1629
|
+
"""
|
|
1630
|
+
|
|
1631
|
+
script: list[ReportScript]
|
|
1632
|
+
"""
|
|
1633
|
+
Every script that loaded: external scripts with their `url` and `ip`, and inline scripts (`is_inline`).
|
|
1634
|
+
"""
|
|
1635
|
+
eval: list[ReportJSCode]
|
|
1636
|
+
"""
|
|
1637
|
+
Code passed to `eval`, recorded in older reports.
|
|
1638
|
+
"""
|
|
1639
|
+
write: list[ReportJSCode]
|
|
1640
|
+
"""
|
|
1641
|
+
Content injected with `document.write`, a common obfuscation step.
|
|
1642
|
+
"""
|
|
1643
|
+
console: list[ReportConsoleMessage]
|
|
1644
|
+
"""
|
|
1645
|
+
Browser console messages.
|
|
1646
|
+
"""
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
class ReportTLSInfo(BaseModel):
|
|
1650
|
+
"""
|
|
1651
|
+
The TLS connection: protocol, cipher suite and the server certificate.
|
|
1652
|
+
"""
|
|
1653
|
+
|
|
1654
|
+
cipher_suite: str
|
|
1655
|
+
key_group_name: str
|
|
1656
|
+
signature_name: str
|
|
1657
|
+
protocol: str
|
|
1658
|
+
cert: ReportCertificate
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
class ReportWindowsShortcut(BaseModel):
|
|
1662
|
+
url: ReportURL
|
|
1663
|
+
ip: ReportIP
|
|
1664
|
+
md5: str
|
|
1665
|
+
sha1: str
|
|
1666
|
+
sha256: str
|
|
1667
|
+
sha512: str
|
|
1668
|
+
magic: str
|
|
1669
|
+
size: int
|
|
1670
|
+
shell_link_header: ReportWindowsShortcutShellLinkHeaderSection
|
|
1671
|
+
string_data: ReportWindowsShortcutStringDataSection
|
|
1672
|
+
extra_data: Annotated[ReportExtraDataSection | None, Field(...)]
|
|
1673
|
+
alerts: ReportArtifactAlerts
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
class ReportFile(BaseModel):
|
|
1677
|
+
md5: str
|
|
1678
|
+
sha1: str
|
|
1679
|
+
sha256: str
|
|
1680
|
+
sha512: str
|
|
1681
|
+
magic: str
|
|
1682
|
+
size: int
|
|
1683
|
+
url: ReportURL
|
|
1684
|
+
ip: ReportIP
|
|
1685
|
+
archive: list[ReportFileArchiveContent]
|
|
1686
|
+
alerts: ReportArtifactAlerts
|
|
1687
|
+
|
|
1688
|
+
|
|
1689
|
+
class ReportPDF(BaseModel):
|
|
1690
|
+
url: ReportURL
|
|
1691
|
+
ip: ReportIP
|
|
1692
|
+
md5: str
|
|
1693
|
+
sha1: str
|
|
1694
|
+
sha256: str
|
|
1695
|
+
sha512: str
|
|
1696
|
+
magic: str
|
|
1697
|
+
size: int
|
|
1698
|
+
meta: ReportPDFMeta
|
|
1699
|
+
extracted_urls: list[ReportExtractedURL]
|
|
1700
|
+
alerts: ReportArtifactAlerts
|
|
1701
|
+
|
|
1702
|
+
|
|
1703
|
+
class ReportTelegramBot(BaseModel):
|
|
1704
|
+
token: str
|
|
1705
|
+
user_id: str
|
|
1706
|
+
username: str
|
|
1707
|
+
first_name: str
|
|
1708
|
+
last_name: str
|
|
1709
|
+
chat: ReportTelegramBotChat
|
|
1710
|
+
pending_messages: int
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
class YARAReportTest(YARAValidation):
|
|
1714
|
+
scanned: int
|
|
1715
|
+
"""
|
|
1716
|
+
Scripts and response bodies scanned.
|
|
1717
|
+
"""
|
|
1718
|
+
skipped: Skipped
|
|
1719
|
+
"""
|
|
1720
|
+
What was not scanned.
|
|
1721
|
+
"""
|
|
1722
|
+
matches: list[Match]
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
class ReportOverview(BaseModel):
|
|
1726
|
+
"""
|
|
1727
|
+
The stored report's overview fields, without the final page's DOM and the deprecated
|
|
1728
|
+
`summary`.
|
|
1729
|
+
|
|
1730
|
+
"""
|
|
1731
|
+
|
|
1732
|
+
report_id: str
|
|
1733
|
+
version: int
|
|
1734
|
+
"""
|
|
1735
|
+
Report document version.
|
|
1736
|
+
"""
|
|
1737
|
+
status: Annotated[str, Field(examples=['done'])]
|
|
1738
|
+
tags: list[str]
|
|
1739
|
+
date: AwareDatetime
|
|
1740
|
+
"""
|
|
1741
|
+
When the analysis ran.
|
|
1742
|
+
"""
|
|
1743
|
+
url: ReportURL
|
|
1744
|
+
ip: ReportIP
|
|
1745
|
+
final: ReportFinal
|
|
1746
|
+
submit: ReportSubmit
|
|
1747
|
+
settings: ReportSettings
|
|
1748
|
+
detection: ReportDetection
|
|
1749
|
+
hosts: list[ReportHost]
|
|
1750
|
+
"""
|
|
1751
|
+
Every host the analysis contacted, in the order each was first requested.
|
|
1752
|
+
"""
|
|
1753
|
+
|
|
1754
|
+
|
|
1755
|
+
class ReportHTTPTransaction(BaseModel):
|
|
1756
|
+
"""
|
|
1757
|
+
One HTTP transaction, in the order the browser made them. A redirect is a transaction with a 3xx `status_code` and a `Location` response header; the next transaction is its target.
|
|
1758
|
+
"""
|
|
1759
|
+
|
|
1760
|
+
url: ReportURL
|
|
1761
|
+
"""
|
|
1762
|
+
Where the request went.
|
|
1763
|
+
"""
|
|
1764
|
+
ip: ReportIP
|
|
1765
|
+
"""
|
|
1766
|
+
The server that answered.
|
|
1767
|
+
"""
|
|
1768
|
+
is_navigation_request: bool
|
|
1769
|
+
"""
|
|
1770
|
+
`true` for page navigations, as opposed to images, scripts and other resources.
|
|
1771
|
+
"""
|
|
1772
|
+
resource_type: str
|
|
1773
|
+
"""
|
|
1774
|
+
What the browser loaded, for example a document, script or image.
|
|
1775
|
+
"""
|
|
1776
|
+
requested_by: str
|
|
1777
|
+
"""
|
|
1778
|
+
What triggered the request.
|
|
1779
|
+
"""
|
|
1780
|
+
date: str
|
|
1781
|
+
"""
|
|
1782
|
+
When the request was made.
|
|
1783
|
+
"""
|
|
1784
|
+
timestamp: int
|
|
1785
|
+
"""
|
|
1786
|
+
When the request was made, in Unix seconds.
|
|
1787
|
+
"""
|
|
1788
|
+
http_version: str
|
|
1789
|
+
security_state: str
|
|
1790
|
+
"""
|
|
1791
|
+
`secure`, `insecure` or `broken` TLS.
|
|
1792
|
+
"""
|
|
1793
|
+
security_info: Annotated[ReportTLSInfo | None, Field(...)]
|
|
1794
|
+
"""
|
|
1795
|
+
TLS details; `null` without TLS.
|
|
1796
|
+
"""
|
|
1797
|
+
request: ReportHTTPRequest
|
|
1798
|
+
response: ReportHTTPResponse
|
|
1799
|
+
time_used: int
|
|
1800
|
+
"""
|
|
1801
|
+
Total time of the request and response, in milliseconds.
|
|
1802
|
+
"""
|
|
1803
|
+
timings: ReportHTTPTimings
|
|
1804
|
+
alerts: ReportAlerts
|
|
1805
|
+
"""
|
|
1806
|
+
Alerts raised on this transaction, by source.
|
|
1807
|
+
"""
|
|
1808
|
+
|
|
1809
|
+
|
|
1810
|
+
class ReportTelegramToken(BaseModel):
|
|
1811
|
+
url: ReportURL | None = None
|
|
1812
|
+
ip: ReportIP | None = None
|
|
1813
|
+
md5: str
|
|
1814
|
+
sha1: str
|
|
1815
|
+
sha256: str
|
|
1816
|
+
sha512: str
|
|
1817
|
+
size: int
|
|
1818
|
+
token: str
|
|
1819
|
+
is_revoked: bool
|
|
1820
|
+
bot: Annotated[ReportTelegramBot | None, Field(...)]
|
|
1821
|
+
|
|
1822
|
+
|
|
1823
|
+
class ReportPage(BaseModel):
|
|
1824
|
+
"""
|
|
1825
|
+
A page of recent or related reports.
|
|
1826
|
+
"""
|
|
1827
|
+
|
|
1828
|
+
items: list[ReportOverview]
|
|
1829
|
+
page: ListPage
|
|
1830
|
+
|
|
1831
|
+
|
|
1832
|
+
class ReportSearchResult(BaseModel):
|
|
1833
|
+
query: str
|
|
1834
|
+
items: list[ReportOverview]
|
|
1835
|
+
page: Page
|
|
1836
|
+
|
|
1837
|
+
|
|
1838
|
+
class ReportArtifacts(BaseModel):
|
|
1839
|
+
"""
|
|
1840
|
+
Objects extracted from the traffic, each with the URL and IP it came from, content hashes and its own alerts.
|
|
1841
|
+
"""
|
|
1842
|
+
|
|
1843
|
+
windows_shortcuts: list[ReportWindowsShortcut]
|
|
1844
|
+
"""
|
|
1845
|
+
Windows `.lnk` files, with header details and `string_data`, including `command_line_arguments`: often the payload command.
|
|
1846
|
+
"""
|
|
1847
|
+
files: list[ReportFile]
|
|
1848
|
+
"""
|
|
1849
|
+
Downloaded files. Archives list their contents in `archive`.
|
|
1850
|
+
"""
|
|
1851
|
+
telegram: list[ReportTelegramToken]
|
|
1852
|
+
"""
|
|
1853
|
+
Telegram bot tokens found in page code, and, when resolved, the bot and its chat.
|
|
1854
|
+
"""
|
|
1855
|
+
pdfs: list[ReportPDF]
|
|
1856
|
+
"""
|
|
1857
|
+
PDF documents, with their metadata and the links on each page.
|
|
1858
|
+
"""
|
|
1859
|
+
clipboard: list[ReportClipboard]
|
|
1860
|
+
"""
|
|
1861
|
+
Text the page wrote to the clipboard, with its `source`.
|
|
1862
|
+
"""
|
|
1863
|
+
|
|
1864
|
+
|
|
1865
|
+
class ReportListResponse(BaseModel):
|
|
1866
|
+
success: Literal[True]
|
|
1867
|
+
data: ReportPage
|
|
1868
|
+
|
|
1869
|
+
|
|
1870
|
+
class Report(BaseModel):
|
|
1871
|
+
"""
|
|
1872
|
+
The full stored report document: the overview's fields, including the final page's
|
|
1873
|
+
`dom`, plus `http` (HTTP transactions), `javascript`, and `artifacts`. Visibility is
|
|
1874
|
+
`settings.access`. Captured bodies carry `resource_available`, which says whether
|
|
1875
|
+
the content can be downloaded. A list with no entries is `[]`, never `null`; objects
|
|
1876
|
+
keyed by name, such as `submit.meta` and `settings.cookies`, can be `null`. New fields
|
|
1877
|
+
can be added; ignore fields you do not recognize.
|
|
1878
|
+
|
|
1879
|
+
"""
|
|
1880
|
+
|
|
1881
|
+
report_id: str
|
|
1882
|
+
version: int
|
|
1883
|
+
"""
|
|
1884
|
+
Report document version.
|
|
1885
|
+
"""
|
|
1886
|
+
status: str
|
|
1887
|
+
tags: list[str]
|
|
1888
|
+
date: AwareDatetime
|
|
1889
|
+
"""
|
|
1890
|
+
When the analysis ran.
|
|
1891
|
+
"""
|
|
1892
|
+
url: ReportURL
|
|
1893
|
+
ip: ReportIP
|
|
1894
|
+
final: ReportFinal
|
|
1895
|
+
submit: ReportSubmit
|
|
1896
|
+
settings: ReportSettings
|
|
1897
|
+
detection: ReportDetection
|
|
1898
|
+
hosts: list[ReportHost]
|
|
1899
|
+
"""
|
|
1900
|
+
Every host the analysis contacted, in the order each was first requested.
|
|
1901
|
+
"""
|
|
1902
|
+
http: list[ReportHTTPTransaction]
|
|
1903
|
+
"""
|
|
1904
|
+
Every HTTP transaction, in the order the browser made them.
|
|
1905
|
+
"""
|
|
1906
|
+
javascript: ReportJavaScript
|
|
1907
|
+
artifacts: ReportArtifacts
|
|
1908
|
+
summary: Annotated[list[dict[str, Any]] | None, Field(deprecated=True)] = None
|
|
1909
|
+
"""
|
|
1910
|
+
Older per-host view; replaced by `hosts`.
|
|
1911
|
+
"""
|