-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
4464 lines (3932 loc) · 145 KB
/
models.py
File metadata and controls
4464 lines (3932 loc) · 145 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
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# generated by datamodel-codegen:
# filename: <stdin>
# timestamp: 2026-04-21T09:59:01+00:00
from __future__ import annotations
from datetime import datetime
from enum import IntEnum, StrEnum
from typing import Annotated, Dict, List, Literal, Optional, Union
from pydantic import AnyUrl, ConfigDict, Field, RootModel
from .base_model import BaseModelSdk, RootModelSdk
class AllowlistCreateRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
name: Annotated[
str,
Field(
description='Name of the allowlist',
max_length=200,
min_length=1,
title='Name',
),
]
description: Annotated[
Optional[str],
Field(description='Description of the allowlist', title='Description'),
] = None
class AllowlistCreateResponse(BaseModelSdk):
id: Annotated[
str,
Field(
description='ID of the allowlist',
examples=['5f9d88b9e5c4f5b9a3d3e8b1'],
title='Id',
),
]
organization_id: Annotated[
str, Field(description='ID of the owner organization', title='Organization Id')
]
name: Annotated[str, Field(description='Name of the allowlist', title='Name')]
description: Annotated[
Optional[str],
Field(description='Description of the allowlist', title='Description'),
] = None
created_at: Annotated[
datetime,
Field(description='Time the allowlist was created', title='Created At'),
]
updated_at: Annotated[
Optional[datetime],
Field(description='Time the allowlist was updated', title='Updated At'),
] = None
from_cti_query: Annotated[
Optional[str],
Field(
description='CTI query from which the blocklist was created',
title='From Cti Query',
),
] = None
since: Annotated[
Optional[str],
Field(
description='Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days',
title='Since',
),
] = None
total_items: Annotated[
int, Field(description='Number of items in the allowlist', title='Total Items')
]
class AllowlistItemUpdateRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
description: Annotated[
Optional[str],
Field(description='Description of the allowlist entry', title='Description'),
] = None
expiration: Annotated[
Optional[datetime],
Field(description='Time the allowlist entry will expire', title='Expiration'),
] = None
class AllowlistItemsCreateRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
items: Annotated[
List[str],
Field(description='List of values to add to the allowlist', title='Items'),
]
description: Annotated[
str,
Field(description='Description of the allowlist entry', title='Description'),
]
expiration: Annotated[
Optional[datetime],
Field(description='Time the allowlist entry will expire', title='Expiration'),
] = None
class AllowlistScope(StrEnum):
IP = 'ip'
RANGE = 'range'
class AllowlistSubscriptionResponse(BaseModelSdk):
updated: Annotated[
Optional[List[str]],
Field(
description='List of updated allowlist ids',
examples=['5f9d88b9e5c4f5b9a3d3e8b1'],
title='Updated',
),
] = None
errors: Annotated[
Optional[List[Dict[str, str]]],
Field(
description='List of errors if any',
examples=[{'5f9d88b9e5c4f5b9a3d3e8b1': 'error message'}],
title='Errors',
),
] = None
class Name(RootModelSdk[str]):
root: Annotated[
str,
Field(
description='Name of the allowlist',
max_length=200,
min_length=1,
title='Name',
),
]
class AllowlistUpdateRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
name: Annotated[
Optional[Name], Field(description='Name of the allowlist', title='Name')
] = None
description: Annotated[
Optional[str],
Field(description='Description of the allowlist', title='Description'),
] = None
class ApiKeyCredentials(BaseModelSdk):
api_key: Annotated[
str, Field(description='API key for the integration', title='Api Key')
]
class BasicAuthCredentials(BaseModelSdk):
username: Annotated[
str,
Field(description='Basic auth username for the integration', title='Username'),
]
password: Annotated[
str,
Field(description='Basic auth password for the integration', title='Password'),
]
class BlocklistAddIPsRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
ips: Annotated[List[str], Field(description='List of IPs or networks', title='Ips')]
expiration: Annotated[
Optional[datetime],
Field(
description='Expiration date',
examples=['2030-01-01T00:00:00.000Z'],
title='Expiration',
),
] = None
class BlocklistCategory(BaseModelSdk):
name: Annotated[str, Field(title='Name')]
label: Annotated[str, Field(title='Label')]
description: Annotated[str, Field(title='Description')]
priority: Annotated[int, Field(title='Priority')]
class BlocklistCreateRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
name: Annotated[
str,
Field(
description='Blocklist name, must be unique within the organization',
max_length=200,
min_length=1,
title='Name',
),
]
label: Annotated[
Optional[str],
Field(
description='Blocklist human readable name (Default: name)', title='Label'
),
] = None
description: Annotated[
str,
Field(description='Blocklist description', min_length=1, title='Description'),
]
references: Annotated[
Optional[List[str]],
Field(
description="Useful references on the list's origins", title='References'
),
] = []
tags: Annotated[
Optional[List[str]], Field(description='Classification tags', title='Tags')
] = []
class BlocklistDeleteIPsRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
ips: Annotated[List[str], Field(description='List of IPs or networks', title='Ips')]
class BlocklistIncludeFilters(StrEnum):
PUBLIC = 'public'
PRIVATE = 'private'
SHARED = 'shared'
ALL = 'all'
class BlocklistSources(StrEnum):
CROWDSEC = 'crowdsec'
THIRD_PARTY = 'third_party'
CUSTOM = 'custom'
class BlocklistSubscription(BaseModelSdk):
id: Annotated[str, Field(title='Id')]
remediation: Annotated[Optional[str], Field(title='Remediation')] = None
name: Annotated[str, Field(title='Name')]
label: Annotated[str, Field(title='Label')]
class BlocklistSubscriptionResponse(BaseModelSdk):
updated: Annotated[
Optional[List[str]],
Field(
description='List of updated blocklist ids',
examples=['5f9d88b9e5c4f5b9a3d3e8b1'],
title='Updated',
),
] = None
errors: Annotated[
Optional[List[Dict[str, str]]],
Field(
description='List of errors if any',
examples=[{'5f9d88b9e5c4f5b9a3d3e8b1': 'error message'}],
title='Errors',
),
] = None
class BlocklistUpdateRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
label: Annotated[
Optional[str], Field(description='Blocklist human readable name', title='Label')
] = None
description: Annotated[
Optional[str], Field(description='Blocklist description', title='Description')
] = None
references: Annotated[
Optional[List[str]],
Field(description='Blocklist references', title='References'),
] = None
tags: Annotated[
Optional[List[str]], Field(description='Blocklist tags', title='Tags')
] = None
from_cti_query: Annotated[
Optional[str],
Field(
description='CTI query (doc link available soon)', title='From Cti Query'
),
] = None
since: Annotated[
Optional[str],
Field(
description='Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days',
title='Since',
),
] = None
class BlocklistUsageStats(BaseModelSdk):
model_config = ConfigDict(
extra='allow',
)
engines_subscribed_directly: Annotated[
Optional[int], Field(title='Engines Subscribed Directly')
] = 0
engines_subscribed_through_org: Annotated[
Optional[int], Field(title='Engines Subscribed Through Org')
] = 0
engines_subscribed_through_tag: Annotated[
Optional[int], Field(title='Engines Subscribed Through Tag')
] = 0
total_subscribed_engines: Annotated[
Optional[int], Field(title='Total Subscribed Engines')
] = 0
total_subscribed_organizations: Annotated[
Optional[int], Field(title='Total Subscribed Organizations')
] = 0
updated_at: Annotated[Optional[datetime], Field(title='Updated At')] = None
class BodyUploadBlocklistContent(BaseModelSdk):
file: Annotated[
bytes, Field(description='Blocklist file in txt format', title='File')
]
class CVESubscription(BaseModelSdk):
id: Annotated[str, Field(description='CVE ID', title='Id')]
class CtiAs(BaseModelSdk):
model_config = ConfigDict(
extra='allow',
)
as_num: Annotated[str, Field(title='As Num')]
as_name: Annotated[str, Field(title='As Name')]
total_ips: Annotated[int, Field(title='Total Ips')]
class CtiBehavior(BaseModelSdk):
model_config = ConfigDict(
extra='allow',
)
name: Annotated[str, Field(title='Name')]
label: Annotated[str, Field(title='Label')]
description: Annotated[str, Field(title='Description')]
references: Annotated[List[str], Field(title='References')]
total_ips: Annotated[int, Field(title='Total Ips')]
class CtiCategory(BaseModelSdk):
model_config = ConfigDict(
extra='allow',
)
name: Annotated[str, Field(title='Name')]
label: Annotated[str, Field(title='Label')]
description: Annotated[str, Field(title='Description')]
total_ips: Annotated[int, Field(title='Total Ips')]
class CtiCountry(BaseModelSdk):
model_config = ConfigDict(
extra='allow',
)
country_short: Annotated[str, Field(title='Country Short')]
total_ips: Annotated[int, Field(title='Total Ips')]
class CtiIp(BaseModelSdk):
model_config = ConfigDict(
extra='allow',
)
ip: Annotated[str, Field(title='Ip')]
total_signals_1m: Annotated[int, Field(title='Total Signals 1M')]
reputation: Annotated[Optional[str], Field(title='Reputation')] = 'unknown'
class CtiScenario(BaseModelSdk):
model_config = ConfigDict(
extra='allow',
)
name: Annotated[str, Field(title='Name')]
label: Annotated[str, Field(title='Label')]
description: Annotated[str, Field(title='Description')]
references: Annotated[List[str], Field(title='References')]
total_ips: Annotated[int, Field(title='Total Ips')]
class DecisionCreateResponse(BaseModelSdk):
uuid: Annotated[
str, Field(description='UUID of the created decision', title='Uuid')
]
class DecisionTargetType(StrEnum):
ORG = 'org'
TAG = 'tag'
ENTITY = 'entity'
class DecisionsSortBy(StrEnum):
CREATED_AT = 'created_at'
EXPIRE_AT = 'expire_at'
class DecisionsSortOrder(StrEnum):
ASC = 'asc'
DESC = 'desc'
class EntityType(StrEnum):
ORG = 'org'
TAG = 'tag'
ENGINE = 'engine'
FIREWALL_INTEGRATION = 'firewall_integration'
REMEDIATION_COMPONENT_INTEGRATION = 'remediation_component_integration'
REMEDIATION_COMPONENT = 'remediation_component'
LOG_PROCESSOR = 'log_processor'
class FingerprintSubscription(BaseModelSdk):
id: Annotated[str, Field(description='Fingerprint ID', title='Id')]
class InfoResponse(BaseModelSdk):
organization_id: Annotated[
str, Field(description='The organization ID', title='Organization Id')
]
subscription_type: Annotated[
str,
Field(
description='The organization subscription type', title='Subscription Type'
),
]
api_key_name: Annotated[
str, Field(description='The API key name that is used', title='Api Key Name')
]
class IntegrationType(StrEnum):
FIREWALL_INTEGRATION = 'firewall_integration'
REMEDIATION_COMPONENT_INTEGRATION = 'remediation_component_integration'
class Links(BaseModelSdk):
first: Annotated[
Optional[str], Field(examples=['/api/v1/users?limit=1&offset1'], title='First')
] = None
last: Annotated[
Optional[str], Field(examples=['/api/v1/users?limit=1&offset1'], title='Last')
] = None
self: Annotated[
Optional[str], Field(examples=['/api/v1/users?limit=1&offset1'], title='Self')
] = None
next: Annotated[
Optional[str], Field(examples=['/api/v1/users?limit=1&offset1'], title='Next')
] = None
prev: Annotated[
Optional[str], Field(examples=['/api/v1/users?limit=1&offset1'], title='Prev')
] = None
class MetricUnits(StrEnum):
BYTE = 'byte'
PACKET = 'packet'
REQUEST = 'request'
IP = 'ip'
LINE = 'line'
EVENT = 'event'
class OutputFormat(StrEnum):
PLAIN_TEXT = 'plain_text'
F5 = 'f5'
REMEDIATION_COMPONENT = 'remediation_component'
FORTIGATE = 'fortigate'
PALOALTO = 'paloalto'
CHECKPOINT = 'checkpoint'
CISCO = 'cisco'
JUNIPER = 'juniper'
MIKROTIK = 'mikrotik'
PFSENSE = 'pfsense'
OPNSENSE = 'opnsense'
SOPHOS = 'sophos'
class Permission(StrEnum):
READ = 'read'
WRITE = 'write'
class PricingTiers(StrEnum):
FREE = 'free'
PREMIUM = 'premium'
PLATINUM = 'platinum'
class RemediationMetricsData(BaseModelSdk):
value: Annotated[
Union[int, float], Field(description='Value of the metric', title='Value')
]
timestamp: Annotated[
datetime, Field(description='Timestamp of the metric', title='Timestamp')
]
class Share(BaseModelSdk):
organization_id: Annotated[str, Field(title='Organization Id')]
permission: Permission
class SourceType(StrEnum):
USER = 'user'
APIKEY = 'apikey'
class Stats(BaseModelSdk):
count: Annotated[
int,
Field(
description='Number of total blocklists items the integration will pull',
title='Count',
),
]
class SubscriberEntityType(StrEnum):
ORG = 'org'
TAG = 'tag'
ENGINE = 'engine'
FIREWALL_INTEGRATION = 'firewall_integration'
REMEDIATION_COMPONENT_INTEGRATION = 'remediation_component_integration'
class ValidationError(BaseModelSdk):
loc: Annotated[List[Union[str, int]], Field(title='Location')]
msg: Annotated[str, Field(title='Message')]
type: Annotated[str, Field(title='Error Type')]
class VendorSubscription(BaseModelSdk):
id: Annotated[str, Field(description='Vendor ID', title='Id')]
class VersionDetail(BaseModelSdk):
deprecated: Annotated[
Optional[bool],
Field(
description='Indicates whether this version is deprecated.',
title='Deprecated',
),
] = False
digest: Annotated[
str,
Field(
description='The SHA256 digest of the versioned file.',
examples=['Detect FTP bruteforce (vsftpd)'],
title='Digest',
),
]
class AdjustmentScore(BaseModelSdk):
total: Annotated[
Optional[int], Field(description='Total score adjustment', title='Total')
] = 0
recency: Annotated[
Optional[int], Field(description='Recency score adjustment', title='Recency')
] = 0
low_info: Annotated[
Optional[int],
Field(description='Low information score adjustment', title='Low Info'),
] = 0
class AffectedComponent(BaseModelSdk):
vendor: Annotated[
Optional[str],
Field(description='Vendor of the affected component', title='Vendor'),
] = None
product: Annotated[
Optional[str],
Field(description='Product name of the affected component', title='Product'),
] = None
class AllowlistSubscription(BaseModelSdk):
id: Annotated[str, Field(title='Id')]
class AttackDetail(BaseModelSdk):
name: Annotated[str, Field(description='Attack detail name', title='Name')]
label: Annotated[str, Field(description='Attack detail label', title='Label')]
description: Annotated[
str, Field(description='Attack detail description', title='Description')
]
references: Annotated[
Optional[List[str]],
Field(description='Attack detail references', title='References'),
] = None
class AttackerObjective(StrEnum):
INFRASTRUCTURE_TAKEOVER = 'infrastructure_takeover'
RANSOMWARE = 'ransomware'
DATA_EXFILTRATION = 'data_exfiltration'
class Behavior(BaseModelSdk):
name: Annotated[str, Field(description='Behavior name', title='Name')]
label: Annotated[str, Field(description='Behavior label', title='Label')]
description: Annotated[
str, Field(description='Behavior description', title='Description')
]
class CVEEventOutput(BaseModelSdk):
name: Annotated[str, Field(title='Name')]
date: Annotated[str, Field(title='Date')]
description: Annotated[str, Field(title='Description')]
label: Annotated[str, Field(title='Label')]
sorting_priority: Annotated[int, Field(title='Sorting Priority')]
class CVEExploitationPhase(StrEnum):
INSUFFICIENT_DATA = 'insufficient_data'
EARLY_EXPLOITATION = 'early_exploitation'
FRESH_AND_POPULAR = 'fresh_and_popular'
TARGETED_EXPLOITATION = 'targeted_exploitation'
MASS_EXPLOITATION = 'mass_exploitation'
BACKGROUND_NOISE = 'background_noise'
UNPOPULAR = 'unpopular'
WEARING_OUT = 'wearing_out'
UNCLASSIFIED = 'unclassified'
class CvssScore(RootModelSdk[float]):
root: Annotated[
float,
Field(description='CVSS score of the CVE', ge=0.0, le=10.0, title='Cvss Score'),
]
class CVEsubscription(BaseModelSdk):
id: Annotated[str, Field(title='Id')]
class CWE(BaseModelSdk):
name: Annotated[str, Field(description='Name of the CWE', title='Name')]
label: Annotated[str, Field(description='Label of the CWE', title='Label')]
description: Annotated[
str, Field(description='Description of the CWE', title='Description')
]
class Classification(BaseModelSdk):
name: Annotated[str, Field(description='Classification name', title='Name')]
label: Annotated[str, Field(description='Classification label', title='Label')]
description: Annotated[
str, Field(description='Classification description', title='Description')
]
class Classifications(BaseModelSdk):
false_positives: Annotated[
Optional[List[Classification]],
Field(description='False positive classifications', title='False Positives'),
] = None
classifications: Annotated[
Optional[List[Classification]],
Field(description='Main classifications', title='Classifications'),
] = None
class ExploitationPhase(BaseModelSdk):
name: Annotated[
str, Field(description='Name of the exploitation phase', title='Name')
]
label: Annotated[
str, Field(description='Label of the exploitation phase', title='Label')
]
description: Annotated[
str,
Field(description='Description of the exploitation phase', title='Description'),
]
class ExploitationPhaseChangeEventItem(BaseModelSdk):
cve_id: Annotated[str, Field(description='CVE identifier', title='Cve Id')]
name: Annotated[str, Field(description='Event type name', title='Name')]
date: Annotated[str, Field(description='Date of the phase change', title='Date')]
label: Annotated[
str, Field(description='Human-readable event label', title='Label')
]
description: Annotated[
str, Field(description='Rendered event description', title='Description')
]
previous_phase: Annotated[
str,
Field(description='Previous exploitation phase label', title='Previous Phase'),
]
new_phase: Annotated[
str, Field(description='New exploitation phase label', title='New Phase')
]
class ExploitationPhaseChangeEventsResponsePage(BaseModelSdk):
items: Annotated[List[ExploitationPhaseChangeEventItem], Field(title='Items')]
total: Annotated[int, Field(ge=0, title='Total')]
page: Annotated[int, Field(ge=1, title='Page')]
size: Annotated[int, Field(ge=1, title='Size')]
pages: Annotated[int, Field(ge=0, title='Pages')]
links: Links
class FacetBucket(BaseModelSdk):
value: Annotated[str, Field(description='Facet value', title='Value')]
count: Annotated[
int, Field(description='Number of IPs matching this value', ge=0, title='Count')
]
class FingerprintEventOutput(BaseModelSdk):
name: Annotated[str, Field(title='Name')]
date: Annotated[str, Field(title='Date')]
description: Annotated[str, Field(title='Description')]
label: Annotated[str, Field(title='Label')]
class FingerprintTimelineItem(BaseModelSdk):
timestamp: Annotated[
datetime,
Field(description='Timestamp of the timeline event', title='Timestamp'),
]
count: Annotated[
int, Field(description='Count of occurrences at the timestamp', title='Count')
]
class GetCVEsSortBy(StrEnum):
RULE_RELEASE_DATE = 'rule_release_date'
TRENDING = 'trending'
NB_IPS = 'nb_ips'
NAME = 'name'
FIRST_SEEN = 'first_seen'
class GetCVEsSortOrder(StrEnum):
ASC = 'asc'
DESC = 'desc'
class History(BaseModelSdk):
first_seen: Annotated[
datetime, Field(description='First seen timestamp', title='First Seen')
]
last_seen: Annotated[
datetime, Field(description='Last seen timestamp', title='Last Seen')
]
full_age: Annotated[int, Field(description='Full age in days', title='Full Age')]
days_age: Annotated[int, Field(description='Days age', title='Days Age')]
class IndustryRiskProfile(StrEnum):
TECHNOLOGY_BUSINESS = 'technology_business'
TRADITIONAL_BUSINESS = 'traditional_business'
CRITICAL_INFRASTRUCTURE = 'critical_infrastructure'
PUBLIC_SERVICE = 'public_service'
SOHO = 'SOHO'
class IndustryType(StrEnum):
COMMERCE = 'commerce'
FINANCIAL_SERVICES = 'financial_services'
HEALTHCARE = 'healthcare'
GOVERNMENT = 'government'
NON_PROFIT = 'non_profit'
INDUSTRY = 'industry'
MEDIA = 'media'
EDUCATION = 'education'
SOHO = 'SOHO'
class IntegrationResponse(BaseModelSdk):
tags: Annotated[Optional[List[str]], Field(title='Tags')] = []
organization_id: Annotated[str, Field(title='Organization Id')]
created_at: Annotated[
Optional[datetime],
Field(description='Time the integration was created', title='Created At'),
] = None
entity_type: Annotated[EntityType, Field(description='Type of the integration')]
id: Annotated[
Optional[str], Field(description='ID of the integration', title='Id')
] = None
blocklists: Annotated[
Optional[List[BlocklistSubscription]], Field(title='Blocklists')
] = []
allowlists: Annotated[
Optional[List[AllowlistSubscription]], Field(title='Allowlists')
] = []
cves: Annotated[Optional[List[CVEsubscription]], Field(title='Cves')] = None
fingerprints: Annotated[
Optional[List[FingerprintSubscription]], Field(title='Fingerprints')
] = None
vendors: Annotated[Optional[List[VendorSubscription]], Field(title='Vendors')] = (
None
)
name: Annotated[str, Field(description='Name of the integration', title='Name')]
updated_at: Annotated[
Optional[datetime],
Field(description='Last time the integration was updated', title='Updated At'),
] = None
description: Annotated[
Optional[str],
Field(description='Description of the integration', title='Description'),
] = None
output_format: Annotated[
OutputFormat, Field(description='Output format of the integration')
]
last_pull: Annotated[
Optional[datetime],
Field(
description='Last time the integration pulled blocklists', title='Last Pull'
),
] = None
pull_limit: Annotated[
Optional[int],
Field(description='Maximum number of items to pull', title='Pull Limit'),
] = None
enable_ip_aggregation: Annotated[
Optional[bool],
Field(
description='Whether to enable IP aggregation into ranges',
title='Enable Ip Aggregation',
),
] = False
class IntervalOptions(StrEnum):
HOUR = 'hour'
DAY = 'day'
WEEK = 'week'
class IpsDetailsStats(BaseModelSdk):
total: Annotated[
int, Field(description='Total number of matching IPs', ge=0, title='Total')
]
reputation: Annotated[
List[FacetBucket],
Field(description='IP count by reputation', title='Reputation'),
]
country: Annotated[
List[FacetBucket],
Field(description='IP count by country (top 5)', title='Country'),
]
as_name: Annotated[
List[FacetBucket],
Field(description='IP count by AS name (top 5)', title='As Name'),
]
cves: Annotated[
List[FacetBucket], Field(description='IP count by CVE (top 5)', title='Cves')
]
classifications: Annotated[
List[FacetBucket],
Field(
description='IP count by classification (top 5)', title='Classifications'
),
]
class Location(BaseModelSdk):
country: Annotated[
Optional[str], Field(description='Country code', title='Country')
] = None
city: Annotated[Optional[str], Field(description='City name', title='City')] = None
latitude: Annotated[
Optional[float], Field(description='Latitude coordinate', title='Latitude')
] = None
longitude: Annotated[
Optional[float], Field(description='Longitude coordinate', title='Longitude')
] = None
class LookupListItemWithStats(BaseModelSdk):
value: Annotated[str, Field(description='Lookup entry value', title='Value')]
nb_cves: Annotated[
Optional[int], Field(description='Number of CVEs', ge=0, title='Nb Cves')
] = 0
nb_fingerprints: Annotated[
Optional[int],
Field(description='Number of fingerprint rules', ge=0, title='Nb Fingerprints'),
] = 0
nb_ips: Annotated[
Optional[int],
Field(
description='Total number of unique IPs targeting this entry',
ge=0,
title='Nb Ips',
),
] = 0
nb_ips_cves: Annotated[
Optional[int],
Field(description='Number of IPs across CVEs', ge=0, title='Nb Ips Cves'),
] = 0
nb_ips_fingerprints: Annotated[
Optional[int],
Field(
description='Number of IPs across fingerprint rules',
ge=0,
title='Nb Ips Fingerprints',
),
] = 0
latest_rule_release: Annotated[
Optional[datetime],
Field(
description='Most recent rule release date for this entry',
title='Latest Rule Release',
),
] = None
class LookupListWithStatsResponsePage(BaseModelSdk):
items: Annotated[List[LookupListItemWithStats], Field(title='Items')]
total: Annotated[int, Field(ge=0, title='Total')]
page: Annotated[int, Field(ge=1, title='Page')]
size: Annotated[int, Field(ge=1, title='Size')]
pages: Annotated[int, Field(ge=0, title='Pages')]
links: Links
class MitreTechnique(BaseModelSdk):
name: Annotated[str, Field(description='MITRE technique ID', title='Name')]
label: Annotated[str, Field(description='MITRE technique label', title='Label')]
description: Annotated[
str, Field(description='MITRE technique description', title='Description')
]
class ProtectRuleTag(BaseModelSdk):
tag: Annotated[str, Field(description='Tag identifier', title='Tag')]
label: Annotated[str, Field(description='Human-readable tag label', title='Label')]
class Reference(BaseModelSdk):
name: Annotated[str, Field(description='Reference name', title='Name')]
label: Annotated[str, Field(description='Reference label', title='Label')]
description: Annotated[
str, Field(description='Reference description', title='Description')
]
class ScoreBreakdown(BaseModelSdk):
aggressiveness: Annotated[
int, Field(description='Aggressiveness score', title='Aggressiveness')
]
threat: Annotated[int, Field(description='Threat score', title='Threat')]
trust: Annotated[int, Field(description='Trust score', title='Trust')]
anomaly: Annotated[int, Field(description='Anomaly score', title='Anomaly')]
total: Annotated[int, Field(description='Total score', title='Total')]
class Scores(BaseModelSdk):
overall: Annotated[ScoreBreakdown, Field(description='Overall scores')]
last_day: Annotated[ScoreBreakdown, Field(description='Last day scores')]
last_week: Annotated[ScoreBreakdown, Field(description='Last week scores')]
last_month: Annotated[ScoreBreakdown, Field(description='Last month scores')]
class SinceOptions(IntEnum):
INTEGER_1 = 1
INTEGER_7 = 7
INTEGER_30 = 30
class SubscribeCVEIntegrationRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)
name: Annotated[
str, Field(description='Name of the integration to subscribe', title='Name')
]
class SubscribeFingerprintIntegrationRequest(BaseModelSdk):
model_config = ConfigDict(
extra='forbid',
)