Skip to content

Commit 5ba0c65

Browse files
he2ssgithub-actions[bot]
authored andcommitted
Update python SDK 1.87.5
1 parent cdaecb2 commit 5ba0c65

File tree

10 files changed

+8
-667
lines changed

10 files changed

+8
-667
lines changed

crowdsec_service_api/__init__.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
from .services.info import Info
88
from .services.metrics import Metrics
99
from .services.hub import Hub
10-
from .services.cves import Cves
1110
from .http_client import ApiKeyAuth
1211

1312
class Server(Enum):
14-
production_server = 'https://admin.api.crowdsec.net/v1/'
13+
production_server = 'https://admin.api.crowdsec.net/v1'
1514

1615
__all__ = [
1716
'Allowlists',
@@ -20,7 +19,6 @@ class Server(Enum):
2019
'Info',
2120
'Metrics',
2221
'Hub',
23-
'Cves',
2422
'AllowlistCreateRequest',
2523
'AllowlistCreateResponse',
2624
'AllowlistGetItemsResponse',
@@ -106,21 +104,6 @@ class Server(Enum):
106104
'PostoverflowIndex',
107105
'ScenarioIndex',
108106
'VersionDetail',
109-
'AffectedComponent',
110-
'AttackDetail',
111-
'Behavior',
112-
'Classification',
113-
'Classifications',
114-
'GetCVEIPsResponsePage',
115-
'GetCVEResponse',
116-
'History',
117-
'IPItem',
118-
'Location',
119-
'MitreTechnique',
120-
'Reference',
121-
'ScoreBreakdown',
122-
'Scores',
123-
'SubscribeCVEIntegrationRequest',
124107
'ApiKeyAuth',
125108
'Server',
126109
'Page'
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

crowdsec_service_api/models.py

Lines changed: 3 additions & 283 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: <stdin>
3-
# timestamp: 2025-12-02T14:56:05+00:00
3+
# timestamp: 2025-12-04T09:15:39+00:00
44

55
from __future__ import annotations
66

@@ -537,158 +537,6 @@ class VersionDetail(BaseModelSdk):
537537
]
538538

539539

540-
class AffectedComponent(BaseModelSdk):
541-
vendor: Annotated[
542-
Optional[str],
543-
Field(description='Vendor of the affected component', title='Vendor'),
544-
] = None
545-
product: Annotated[
546-
Optional[str],
547-
Field(description='Product name of the affected component', title='Product'),
548-
] = None
549-
550-
551-
class AttackDetail(BaseModelSdk):
552-
name: Annotated[str, Field(description='Attack detail name', title='Name')]
553-
label: Annotated[str, Field(description='Attack detail label', title='Label')]
554-
description: Annotated[
555-
str, Field(description='Attack detail description', title='Description')
556-
]
557-
references: Annotated[
558-
Optional[List[str]],
559-
Field(description='Attack detail references', title='References'),
560-
] = None
561-
562-
563-
class Behavior(BaseModelSdk):
564-
name: Annotated[str, Field(description='Behavior name', title='Name')]
565-
label: Annotated[str, Field(description='Behavior label', title='Label')]
566-
description: Annotated[
567-
str, Field(description='Behavior description', title='Description')
568-
]
569-
570-
571-
class Classification(BaseModelSdk):
572-
name: Annotated[str, Field(description='Classification name', title='Name')]
573-
label: Annotated[str, Field(description='Classification label', title='Label')]
574-
description: Annotated[
575-
str, Field(description='Classification description', title='Description')
576-
]
577-
578-
579-
class Classifications(BaseModelSdk):
580-
false_positives: Annotated[
581-
Optional[List[Classification]],
582-
Field(description='False positive classifications', title='False Positives'),
583-
] = None
584-
classifications: Annotated[
585-
Optional[List[Classification]],
586-
Field(description='Main classifications', title='Classifications'),
587-
] = None
588-
589-
590-
class GetCVEResponse(BaseModelSdk):
591-
id: Annotated[str, Field(description='ID of the CVE', title='Id')]
592-
name: Annotated[str, Field(description='Name of the CVE', title='Name')]
593-
affected_components: Annotated[
594-
List[AffectedComponent],
595-
Field(description='List of affected components', title='Affected Components'),
596-
]
597-
let_score: Annotated[
598-
int, Field(description='LET score of the CVE', ge=0, le=10, title='Let Score')
599-
]
600-
first_seen: Annotated[
601-
AwareDatetime, Field(description='First seen date', title='First Seen')
602-
]
603-
last_seen: Annotated[
604-
AwareDatetime, Field(description='Last seen date', title='Last Seen')
605-
]
606-
nb_ips: Annotated[
607-
int, Field(description='Number of unique IPs affected', ge=0, title='Nb Ips')
608-
]
609-
published_date: Annotated[
610-
AwareDatetime,
611-
Field(description='Published date of the CVE', title='Published Date'),
612-
]
613-
cvss_score: Annotated[
614-
float,
615-
Field(description='CVSS score of the CVE', ge=0.0, le=10.0, title='Cvss Score'),
616-
]
617-
references: Annotated[
618-
List[str],
619-
Field(description='List of references for the CVE', title='References'),
620-
]
621-
description: Annotated[
622-
str, Field(description='Description of the CVE', title='Description')
623-
]
624-
625-
626-
class History(BaseModelSdk):
627-
first_seen: Annotated[
628-
AwareDatetime, Field(description='First seen timestamp', title='First Seen')
629-
]
630-
last_seen: Annotated[
631-
AwareDatetime, Field(description='Last seen timestamp', title='Last Seen')
632-
]
633-
full_age: Annotated[int, Field(description='Full age in days', title='Full Age')]
634-
days_age: Annotated[int, Field(description='Days age', title='Days Age')]
635-
636-
637-
class Location(BaseModelSdk):
638-
country: Annotated[
639-
Optional[str], Field(description='Country code', title='Country')
640-
] = None
641-
city: Annotated[Optional[str], Field(description='City name', title='City')] = None
642-
latitude: Annotated[
643-
Optional[float], Field(description='Latitude coordinate', title='Latitude')
644-
] = None
645-
longitude: Annotated[
646-
Optional[float], Field(description='Longitude coordinate', title='Longitude')
647-
] = None
648-
649-
650-
class MitreTechnique(BaseModelSdk):
651-
name: Annotated[str, Field(description='MITRE technique ID', title='Name')]
652-
label: Annotated[str, Field(description='MITRE technique label', title='Label')]
653-
description: Annotated[
654-
str, Field(description='MITRE technique description', title='Description')
655-
]
656-
657-
658-
class Reference(BaseModelSdk):
659-
name: Annotated[str, Field(description='Reference name', title='Name')]
660-
label: Annotated[str, Field(description='Reference label', title='Label')]
661-
description: Annotated[
662-
str, Field(description='Reference description', title='Description')
663-
]
664-
665-
666-
class ScoreBreakdown(BaseModelSdk):
667-
aggressiveness: Annotated[
668-
int, Field(description='Aggressiveness score', title='Aggressiveness')
669-
]
670-
threat: Annotated[int, Field(description='Threat score', title='Threat')]
671-
trust: Annotated[int, Field(description='Trust score', title='Trust')]
672-
anomaly: Annotated[int, Field(description='Anomaly score', title='Anomaly')]
673-
total: Annotated[int, Field(description='Total score', title='Total')]
674-
675-
676-
class Scores(BaseModelSdk):
677-
overall: Annotated[ScoreBreakdown, Field(description='Overall scores')]
678-
last_day: Annotated[ScoreBreakdown, Field(description='Last day scores')]
679-
last_week: Annotated[ScoreBreakdown, Field(description='Last week scores')]
680-
last_month: Annotated[ScoreBreakdown, Field(description='Last month scores')]
681-
682-
683-
class SubscribeCVEIntegrationRequest(BaseModelSdk):
684-
model_config = ConfigDict(
685-
extra='forbid',
686-
)
687-
name: Annotated[
688-
str, Field(description='Name of the integration to subscribe', title='Name')
689-
]
690-
691-
692540
class AllowlistsListAllowlistsQueryParameters(BaseModelSdk):
693541
page: Annotated[
694542
Optional[int], Field(description='Page number', ge=1, title='Page')
@@ -874,7 +722,7 @@ class BlocklistsUploadBlocklistContentQueryParameters(BaseModelSdk):
874722
Optional[AwareDatetime],
875723
Field(
876724
description='Blocklist expiration',
877-
examples='2025-12-02T14:55:58.773978+00:00',
725+
examples='2025-12-04T09:15:27.141136+00:00',
878726
title='Expiration',
879727
),
880728
] = None
@@ -1114,50 +962,6 @@ class HubHeadItemContentPathParameters(BaseModelSdk):
1114962
tenant: Annotated[str, Field(title='Tenant')]
1115963

1116964

1117-
class CvesGetCvePathParameters(BaseModelSdk):
1118-
cve_id: Annotated[str, Field(title='Cve Id')]
1119-
1120-
1121-
class Since(RootModel[str]):
1122-
root: Annotated[
1123-
str,
1124-
Field(
1125-
description='Filter IPs seen since this date, format duration (e.g., 7d, 24h)',
1126-
pattern='^\\d+[hd]$',
1127-
title='Since',
1128-
),
1129-
]
1130-
1131-
1132-
class CvesGetCveIpsQueryParameters(BaseModelSdk):
1133-
since: Annotated[
1134-
Optional[Since],
1135-
Field(
1136-
description='Filter IPs seen since this date, format duration (e.g., 7d, 24h)',
1137-
title='Since',
1138-
),
1139-
] = None
1140-
page: Annotated[
1141-
Optional[int], Field(description='Page number', ge=1, title='Page')
1142-
] = 1
1143-
size: Annotated[
1144-
Optional[int], Field(description='Page size', ge=1, le=100, title='Size')
1145-
] = 50
1146-
1147-
1148-
class CvesGetCveIpsPathParameters(BaseModelSdk):
1149-
cve_id: Annotated[str, Field(title='Cve Id')]
1150-
1151-
1152-
class CvesSubscribeIntegrationToCvePathParameters(BaseModelSdk):
1153-
cve_id: Annotated[str, Field(title='Cve Id')]
1154-
1155-
1156-
class CvesUnsubscribeIntegrationFromCvePathParameters(BaseModelSdk):
1157-
cve_id: Annotated[str, Field(title='Cve Id')]
1158-
integration_name: Annotated[str, Field(title='Integration Name')]
1159-
1160-
1161965
class AllowlistSubscriberEntity(BaseModelSdk):
1162966
id: Annotated[str, Field(description='Subscriber entity id', title='Id')]
1163967
entity_type: SubscriberEntityType
@@ -1380,7 +1184,7 @@ class BlocklistStats(BaseModelSdk):
13801184
'top_attacking_countries': [],
13811185
'top_ips': [],
13821186
}
1383-
usage_stats: Optional[BlocklistUsageStats] = {
1187+
usage_stats: Annotated[Optional[BlocklistUsageStats], Field()] = {
13841188
'engines_subscribed_directly': 0,
13851189
'engines_subscribed_through_org': 0,
13861190
'engines_subscribed_through_tag': 0,
@@ -2400,81 +2204,6 @@ class ScenarioIndex(BaseModelSdk):
24002204
] = None
24012205

24022206

2403-
class IPItem(BaseModelSdk):
2404-
ip: Annotated[str, Field(description='IP address', title='Ip')]
2405-
reputation: Annotated[
2406-
Optional[str], Field(description='Reputation of the IP', title='Reputation')
2407-
] = None
2408-
ip_range: Annotated[
2409-
Optional[str], Field(description='IP range', title='Ip Range')
2410-
] = None
2411-
ip_range_score: Annotated[
2412-
Optional[int], Field(description='IP range score', title='Ip Range Score')
2413-
] = None
2414-
ip_range_24: Annotated[
2415-
Optional[str], Field(description='IP range /24', title='Ip Range 24')
2416-
] = None
2417-
ip_range_24_reputation: Annotated[
2418-
Optional[str],
2419-
Field(description='IP range /24 reputation', title='Ip Range 24 Reputation'),
2420-
] = None
2421-
ip_range_24_score: Annotated[
2422-
Optional[int],
2423-
Field(description='IP range /24 score', title='Ip Range 24 Score'),
2424-
] = None
2425-
as_name: Annotated[Optional[str], Field(description='AS name', title='As Name')] = (
2426-
None
2427-
)
2428-
as_num: Annotated[Optional[int], Field(description='AS number', title='As Num')] = (
2429-
None
2430-
)
2431-
background_noise_score: Annotated[
2432-
Optional[int],
2433-
Field(description='Background noise score', title='Background Noise Score'),
2434-
] = None
2435-
background_noise: Annotated[
2436-
Optional[str],
2437-
Field(description='Background noise level', title='Background Noise'),
2438-
] = None
2439-
confidence: Annotated[
2440-
Optional[str], Field(description='Confidence level', title='Confidence')
2441-
] = None
2442-
location: Annotated[
2443-
Optional[Location], Field(description='IP location information')
2444-
] = None
2445-
reverse_dns: Annotated[
2446-
Optional[str], Field(description='Reverse DNS', title='Reverse Dns')
2447-
] = None
2448-
behaviors: Annotated[
2449-
Optional[List[Behavior]],
2450-
Field(description='List of behaviors', title='Behaviors'),
2451-
] = None
2452-
references: Annotated[
2453-
Optional[List[Reference]],
2454-
Field(description='List of references', title='References'),
2455-
] = None
2456-
history: Annotated[Optional[History], Field(description='Historical data')] = None
2457-
classifications: Annotated[
2458-
Optional[Classifications], Field(description='Classification data')
2459-
] = None
2460-
mitre_techniques: Annotated[
2461-
Optional[List[MitreTechnique]],
2462-
Field(description='MITRE techniques', title='Mitre Techniques'),
2463-
] = None
2464-
cves: Annotated[
2465-
Optional[List[str]], Field(description='List of CVEs', title='Cves')
2466-
] = None
2467-
attack_details: Annotated[
2468-
Optional[List[AttackDetail]],
2469-
Field(description='Attack details', title='Attack Details'),
2470-
] = None
2471-
target_countries: Annotated[
2472-
Optional[Dict[str, int]],
2473-
Field(description='Target countries', title='Target Countries'),
2474-
] = None
2475-
scores: Annotated[Optional[Scores], Field(description='Scoring information')] = None
2476-
2477-
24782207
class AllowlistGetItemsResponse(BaseModelSdk):
24792208
id: Annotated[
24802209
str,
@@ -2692,15 +2421,6 @@ class Index(BaseModelSdk):
26922421
] = None
26932422

26942423

2695-
class GetCVEIPsResponsePage(BaseModelSdk):
2696-
items: Annotated[List[IPItem], Field(title='Items')]
2697-
total: Annotated[int, Field(ge=0, title='Total')]
2698-
page: Annotated[int, Field(ge=1, title='Page')]
2699-
size: Annotated[int, Field(ge=1, title='Size')]
2700-
pages: Annotated[int, Field(ge=0, title='Pages')]
2701-
links: Links
2702-
2703-
27042424
class ComputedMetrics(BaseModelSdk):
27052425
saved: Annotated[ComputedSavedMetrics, Field(description='estimated saved metrics')]
27062426
dropped: Annotated[
Binary file not shown.

0 commit comments

Comments
 (0)