crowdsec-tracker-api 1.95.2__py3-none-any.whl → 1.102.2__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.
@@ -41,6 +41,7 @@ __all__ = [
41
41
  'GetCVEIPsResponsePage',
42
42
  'GetCVEResponse',
43
43
  'GetCVESubscribedIntegrationsResponsePage',
44
+ 'GetCVEsFilterBy',
44
45
  'GetCVEsResponsePage',
45
46
  'GetCVEsSortBy',
46
47
  'GetCVEsSortOrder',
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: <stdin>
3
- # timestamp: 2026-01-06T15:34:27+00:00
3
+ # timestamp: 2026-01-29T15:05:21+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -161,6 +161,15 @@ class CVEResponseBase(BaseModelSdk):
161
161
  title='Crowdsec Score',
162
162
  ),
163
163
  ]
164
+ opportunity_score: Annotated[
165
+ Optional[int],
166
+ Field(
167
+ description="Opportunity score indicating if it's an opportunistic(0) or targeted(5) attack (between 0-5)",
168
+ ge=0,
169
+ le=5,
170
+ title='Opportunity Score',
171
+ ),
172
+ ] = 0
164
173
  first_seen: Annotated[
165
174
  Optional[datetime], Field(description='First seen date', title='First Seen')
166
175
  ] = None
@@ -251,6 +260,15 @@ class GetCVEResponse(BaseModelSdk):
251
260
  title='Crowdsec Score',
252
261
  ),
253
262
  ]
263
+ opportunity_score: Annotated[
264
+ Optional[int],
265
+ Field(
266
+ description="Opportunity score indicating if it's an opportunistic(0) or targeted(5) attack (between 0-5)",
267
+ ge=0,
268
+ le=5,
269
+ title='Opportunity Score',
270
+ ),
271
+ ] = 0
254
272
  first_seen: Annotated[
255
273
  Optional[datetime], Field(description='First seen date', title='First Seen')
256
274
  ] = None
@@ -302,6 +320,10 @@ class GetCVEResponse(BaseModelSdk):
302
320
  ] = None
303
321
 
304
322
 
323
+ class GetCVEsFilterBy(StrEnum):
324
+ IS_PUBLIC = 'is_public'
325
+
326
+
305
327
  class GetCVEsResponsePage(BaseModelSdk):
306
328
  items: Annotated[List[CVEResponseBase], Field(title='Items')]
307
329
  total: Annotated[int, Field(ge=0, title='Total')]
@@ -538,6 +560,10 @@ class CvesGetCvesQueryParameters(BaseModelSdk):
538
560
  Optional[GetCVEsSortOrder],
539
561
  Field(description='Sort order: ascending or descending', title='Sort Order'),
540
562
  ] = 'desc'
563
+ filters: Annotated[
564
+ Optional[List[GetCVEsFilterBy]],
565
+ Field(description='Filters to apply on the CVE list', title='Filters'),
566
+ ] = None
541
567
  page: Annotated[
542
568
  Optional[int], Field(description='Page number', ge=1, title='Page')
543
569
  ] = 1
@@ -1,89 +1,90 @@
1
1
  import json
2
2
  from types import NoneType
3
- from typing import Annotated, Optional, Union
3
+ from typing import Optional, Union, Annotated
4
4
 
5
- from httpx import Auth
5
+ from ..models import *
6
+ from ..base_model import Page, Service
6
7
  from pydantic import BaseModel, Field
7
8
  from pydantic.fields import FieldInfo
8
-
9
- from ..base_model import Page, Service
9
+ from httpx import Auth
10
10
  from ..http_client import HttpClient
11
- from ..models import *
12
-
13
11
 
14
12
  class Cves(Service):
15
- def __init__(
16
- self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1"
17
- ) -> None:
18
- super().__init__(
19
- base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.95.2"
20
- )
21
-
13
+ def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
14
+ super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.102.2")
15
+
22
16
  def get_cves(
23
17
  self,
24
18
  query: Optional[str] = None,
25
19
  sort_by: Optional[GetCVEsSortBy] = GetCVEsSortBy("rule_release_date"),
26
20
  sort_order: Optional[GetCVEsSortOrder] = GetCVEsSortOrder("desc"),
21
+ filters: Optional[list[GetCVEsFilterBy]] = None,
27
22
  page: int = 1,
28
23
  size: int = 50,
29
- ) -> GetCVEsResponsePage:
24
+ )-> GetCVEsResponsePage:
30
25
  endpoint_url = "/cves"
31
26
  loc = locals()
32
27
  headers = {}
33
28
  params = json.loads(
34
- CvesGetCvesQueryParameters(**loc).model_dump_json(exclude_none=True)
29
+ CvesGetCvesQueryParameters(**loc).model_dump_json(
30
+ exclude_none=True
31
+ )
35
32
  )
36
33
  path_params = {}
37
-
34
+
38
35
  response = self.http_client.get(
39
36
  url=endpoint_url, path_params=path_params, params=params, headers=headers
40
37
  )
41
-
38
+
42
39
  return GetCVEsResponsePage(_client=self, **response.json())
43
-
40
+
44
41
  def get_cve(
45
42
  self,
46
43
  cve_id: str,
47
- ) -> GetCVEResponse:
44
+ )-> GetCVEResponse:
48
45
  endpoint_url = "/cves/{cve_id}"
49
46
  loc = locals()
50
47
  headers = {}
51
48
  params = {}
52
49
  path_params = json.loads(
53
- CvesGetCvePathParameters(**loc).model_dump_json(exclude_none=True)
50
+ CvesGetCvePathParameters(**loc).model_dump_json(
51
+ exclude_none=True
52
+ )
54
53
  )
55
-
54
+
56
55
  response = self.http_client.get(
57
56
  url=endpoint_url, path_params=path_params, params=params, headers=headers
58
57
  )
59
-
58
+
60
59
  return GetCVEResponse(**response.json())
61
-
60
+
62
61
  def download_cve_ips(
63
62
  self,
64
63
  cve_id: str,
65
- ) -> str:
64
+ )-> str:
66
65
  endpoint_url = "/cves/{cve_id}/ips-download"
67
66
  loc = locals()
68
67
  headers = {}
69
68
  params = {}
70
69
  path_params = json.loads(
71
- CvesDownloadCveIpsPathParameters(**loc).model_dump_json(exclude_none=True)
70
+ CvesDownloadCveIpsPathParameters(**loc).model_dump_json(
71
+ exclude_none=True
72
+ )
72
73
  )
73
-
74
+
74
75
  response = self.http_client.get(
75
76
  url=endpoint_url, path_params=path_params, params=params, headers=headers
76
77
  )
77
-
78
+
78
79
  return response.text
79
-
80
+
80
81
  def get_cve_ips_details(
81
82
  self,
82
83
  cve_id: str,
83
84
  since: Optional[str] = "14d",
84
85
  page: int = 1,
85
86
  size: int = 50,
86
- ) -> GetCVEIPsResponsePage:
87
+ )-> GetCVEIPsResponsePage:
87
88
  endpoint_url = "/cves/{cve_id}/ips-details"
88
89
  loc = locals()
89
90
  headers = {}
@@ -93,21 +94,23 @@ class Cves(Service):
93
94
  )
94
95
  )
95
96
  path_params = json.loads(
96
- CvesGetCveIpsDetailsPathParameters(**loc).model_dump_json(exclude_none=True)
97
+ CvesGetCveIpsDetailsPathParameters(**loc).model_dump_json(
98
+ exclude_none=True
99
+ )
97
100
  )
98
-
101
+
99
102
  response = self.http_client.get(
100
103
  url=endpoint_url, path_params=path_params, params=params, headers=headers
101
104
  )
102
-
105
+
103
106
  return GetCVEIPsResponsePage(_client=self, **response.json())
104
-
107
+
105
108
  def get_cve_subscribed_integrations(
106
109
  self,
107
110
  cve_id: str,
108
111
  page: int = 1,
109
112
  size: int = 50,
110
- ) -> GetCVESubscribedIntegrationsResponsePage:
113
+ )-> GetCVESubscribedIntegrationsResponsePage:
111
114
  endpoint_url = "/cves/{cve_id}/integrations"
112
115
  loc = locals()
113
116
  headers = {}
@@ -121,13 +124,13 @@ class Cves(Service):
121
124
  exclude_none=True
122
125
  )
123
126
  )
124
-
127
+
125
128
  response = self.http_client.get(
126
129
  url=endpoint_url, path_params=path_params, params=params, headers=headers
127
130
  )
128
-
131
+
129
132
  return GetCVESubscribedIntegrationsResponsePage(_client=self, **response.json())
130
-
133
+
131
134
  def subscribe_integration_to_cve(
132
135
  self,
133
136
  request: SubscribeCVEIntegrationRequest,
@@ -142,22 +145,18 @@ class Cves(Service):
142
145
  exclude_none=True
143
146
  )
144
147
  )
145
-
146
- payload = (
147
- json.loads(request.model_dump_json(exclude_none=True))
148
- if "request" in loc
149
- else None
150
- )
148
+
149
+ payload = json.loads(
150
+ request.model_dump_json(
151
+ exclude_none=True
152
+ )
153
+ ) if "request" in loc else None
151
154
  response = self.http_client.post(
152
- url=endpoint_url,
153
- path_params=path_params,
154
- params=params,
155
- headers=headers,
156
- json=payload,
155
+ url=endpoint_url, path_params=path_params, params=params, headers=headers, json=payload
157
156
  )
158
-
157
+
159
158
  return None
160
-
159
+
161
160
  def unsubscribe_integration_from_cve(
162
161
  self,
163
162
  cve_id: str,
@@ -172,30 +171,35 @@ class Cves(Service):
172
171
  exclude_none=True
173
172
  )
174
173
  )
175
-
174
+
176
175
  response = self.http_client.delete(
177
176
  url=endpoint_url, path_params=path_params, params=params, headers=headers
178
177
  )
179
-
178
+
180
179
  return None
181
-
180
+
182
181
  def get_cve_timeline(
183
182
  self,
184
183
  cve_id: str,
185
184
  since_days: SinceOptions,
186
- ) -> list[TimelineItem]:
185
+ )-> list[TimelineItem]:
187
186
  endpoint_url = "/cves/{cve_id}/timeline"
188
187
  loc = locals()
189
188
  headers = {}
190
189
  params = json.loads(
191
- CvesGetCveTimelineQueryParameters(**loc).model_dump_json(exclude_none=True)
190
+ CvesGetCveTimelineQueryParameters(**loc).model_dump_json(
191
+ exclude_none=True
192
+ )
192
193
  )
193
194
  path_params = json.loads(
194
- CvesGetCveTimelinePathParameters(**loc).model_dump_json(exclude_none=True)
195
+ CvesGetCveTimelinePathParameters(**loc).model_dump_json(
196
+ exclude_none=True
197
+ )
195
198
  )
196
-
199
+
197
200
  response = self.http_client.get(
198
201
  url=endpoint_url, path_params=path_params, params=params, headers=headers
199
202
  )
200
-
203
+
201
204
  return [TimelineItem(**item) for item in response.json()]
205
+
@@ -1,28 +1,22 @@
1
1
  import json
2
2
  from types import NoneType
3
- from typing import Annotated, Optional, Union
3
+ from typing import Optional, Union, Annotated
4
4
 
5
- from httpx import Auth
5
+ from ..models import *
6
+ from ..base_model import Page, Service
6
7
  from pydantic import BaseModel, Field
7
8
  from pydantic.fields import FieldInfo
8
-
9
- from ..base_model import Page, Service
9
+ from httpx import Auth
10
10
  from ..http_client import HttpClient
11
- from ..models import *
12
-
13
11
 
14
12
  class Integrations(Service):
15
- def __init__(
16
- self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1"
17
- ) -> None:
18
- super().__init__(
19
- base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.95.2"
20
- )
21
-
13
+ def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
14
+ super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_tracker_api/1.102.2")
15
+
22
16
  def get_integrations(
23
17
  self,
24
18
  tag: Optional[list[str]] = None,
25
- ) -> IntegrationGetResponsePage:
19
+ )-> IntegrationGetResponsePage:
26
20
  endpoint_url = "/integrations"
27
21
  loc = locals()
28
22
  headers = {}
@@ -32,42 +26,38 @@ class Integrations(Service):
32
26
  )
33
27
  )
34
28
  path_params = {}
35
-
29
+
36
30
  response = self.http_client.get(
37
31
  url=endpoint_url, path_params=path_params, params=params, headers=headers
38
32
  )
39
-
33
+
40
34
  return IntegrationGetResponsePage(_client=self, **response.json())
41
-
35
+
42
36
  def create_integration(
43
37
  self,
44
38
  request: IntegrationCreateRequest,
45
- ) -> IntegrationCreateResponse:
39
+ )-> IntegrationCreateResponse:
46
40
  endpoint_url = "/integrations"
47
41
  loc = locals()
48
42
  headers = {}
49
43
  params = {}
50
44
  path_params = {}
51
-
52
- payload = (
53
- json.loads(request.model_dump_json(exclude_none=True))
54
- if "request" in loc
55
- else None
56
- )
45
+
46
+ payload = json.loads(
47
+ request.model_dump_json(
48
+ exclude_none=True
49
+ )
50
+ ) if "request" in loc else None
57
51
  response = self.http_client.post(
58
- url=endpoint_url,
59
- path_params=path_params,
60
- params=params,
61
- headers=headers,
62
- json=payload,
52
+ url=endpoint_url, path_params=path_params, params=params, headers=headers, json=payload
63
53
  )
64
-
54
+
65
55
  return IntegrationCreateResponse(**response.json())
66
-
56
+
67
57
  def get_integration(
68
58
  self,
69
59
  integration_id: str,
70
- ) -> IntegrationGetResponse:
60
+ )-> IntegrationGetResponse:
71
61
  endpoint_url = "/integrations/{integration_id}"
72
62
  loc = locals()
73
63
  headers = {}
@@ -77,13 +67,13 @@ class Integrations(Service):
77
67
  exclude_none=True
78
68
  )
79
69
  )
80
-
70
+
81
71
  response = self.http_client.get(
82
72
  url=endpoint_url, path_params=path_params, params=params, headers=headers
83
73
  )
84
-
74
+
85
75
  return IntegrationGetResponse(**response.json())
86
-
76
+
87
77
  def delete_integration(
88
78
  self,
89
79
  integration_id: str,
@@ -102,18 +92,18 @@ class Integrations(Service):
102
92
  exclude_none=True
103
93
  )
104
94
  )
105
-
95
+
106
96
  response = self.http_client.delete(
107
97
  url=endpoint_url, path_params=path_params, params=params, headers=headers
108
98
  )
109
-
99
+
110
100
  return None
111
-
101
+
112
102
  def update_integration(
113
103
  self,
114
104
  request: IntegrationUpdateRequest,
115
105
  integration_id: str,
116
- ) -> IntegrationUpdateResponse:
106
+ )-> IntegrationUpdateResponse:
117
107
  endpoint_url = "/integrations/{integration_id}"
118
108
  loc = locals()
119
109
  headers = {}
@@ -123,23 +113,23 @@ class Integrations(Service):
123
113
  exclude_none=True
124
114
  )
125
115
  )
126
-
116
+
127
117
  response = self.http_client.patch(
128
- url=endpoint_url,
129
- path_params=path_params,
130
- params=params,
131
- headers=headers,
132
- json=json.loads(request.model_dump_json(exclude_unset=True)),
118
+ url=endpoint_url, path_params=path_params, params=params, headers=headers, json=json.loads(
119
+ request.model_dump_json(
120
+ exclude_unset=True
121
+ )
122
+ )
133
123
  )
134
-
124
+
135
125
  return IntegrationUpdateResponse(**response.json())
136
-
126
+
137
127
  def get_integration_content(
138
128
  self,
139
129
  integration_id: str,
140
130
  page: int = 1,
141
131
  page_size: Optional[int] = None,
142
- ) -> str:
132
+ )-> str:
143
133
  endpoint_url = "/integrations/{integration_id}/content"
144
134
  loc = locals()
145
135
  headers = {}
@@ -153,13 +143,13 @@ class Integrations(Service):
153
143
  exclude_none=True
154
144
  )
155
145
  )
156
-
146
+
157
147
  response = self.http_client.get(
158
148
  url=endpoint_url, path_params=path_params, params=params, headers=headers
159
149
  )
160
-
150
+
161
151
  return response.text
162
-
152
+
163
153
  def get_integration_content_stream(
164
154
  self,
165
155
  integration_id: str,
@@ -169,18 +159,19 @@ class Integrations(Service):
169
159
  loc = locals()
170
160
  headers = {}
171
161
  params = json.loads(
172
- IntegrationsGetIntegrationContentStreamQueryParameters(
173
- **loc
174
- ).model_dump_json(exclude_none=True)
162
+ IntegrationsGetIntegrationContentStreamQueryParameters(**loc).model_dump_json(
163
+ exclude_none=True
164
+ )
175
165
  )
176
166
  path_params = json.loads(
177
- IntegrationsGetIntegrationContentStreamPathParameters(
178
- **loc
179
- ).model_dump_json(exclude_none=True)
167
+ IntegrationsGetIntegrationContentStreamPathParameters(**loc).model_dump_json(
168
+ exclude_none=True
169
+ )
180
170
  )
181
-
171
+
182
172
  response = self.http_client.get(
183
173
  url=endpoint_url, path_params=path_params, params=params, headers=headers
184
174
  )
185
-
175
+
186
176
  return None
177
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crowdsec_tracker_api
3
- Version: 1.95.2
3
+ Version: 1.102.2
4
4
  Summary: This is the API to manage Crowdsec Live Exploit Tracker service
5
5
  Author-email: crowdsec <info@crowdsec.net>
6
6
  License: MIT
@@ -0,0 +1,12 @@
1
+ crowdsec_tracker_api/__init__.py,sha256=42XsiTFcmamQkuNRPN9PNAKT9X_3cQJotEhS3yfoy84,1422
2
+ crowdsec_tracker_api/base_model.py,sha256=z6dOHObB9zrdrBvt1sEymqWkTo2jKVo3tj0rtQmah9A,1978
3
+ crowdsec_tracker_api/http_client.py,sha256=HdEn7rolYXCSVZDy2l5AejO9mYdHVjuXWAPt_5W7xT0,4794
4
+ crowdsec_tracker_api/models.py,sha256=DtfeJQQSZSC50xEuNoOh6q1uUrfAMBB036hl7oQTQ-A,33166
5
+ crowdsec_tracker_api/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ crowdsec_tracker_api/services/cves.py,sha256=_x6Y92XvTIca3KeKoR75ITr_tfVocGO4xcVHgS5Ze4U,6253
7
+ crowdsec_tracker_api/services/integrations.py,sha256=bGRD7O6cO7buCuh7T0KIDm0UddgBwzwTmUkixc8KPd4,5485
8
+ crowdsec_tracker_api-1.102.2.dist-info/licenses/LICENSE,sha256=j45pumtJxZpjQgYGZmkayxGnQpy6a28TqtJvTzxoPRE,1064
9
+ crowdsec_tracker_api-1.102.2.dist-info/METADATA,sha256=eGzCFKr150T92yTI72jd515srhLlqRl_lvQSVGzI1FM,1207
10
+ crowdsec_tracker_api-1.102.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
11
+ crowdsec_tracker_api-1.102.2.dist-info/top_level.txt,sha256=PjzuJQNS-E2cYLihw-evV3MrsY9OWAb8QNKEFEg1hhE,21
12
+ crowdsec_tracker_api-1.102.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,12 +0,0 @@
1
- crowdsec_tracker_api/__init__.py,sha256=XgaHpBnezKpBtVwH_rgdfnCGhpH0l9mhjIdvNKEFzxg,1399
2
- crowdsec_tracker_api/base_model.py,sha256=z6dOHObB9zrdrBvt1sEymqWkTo2jKVo3tj0rtQmah9A,1978
3
- crowdsec_tracker_api/http_client.py,sha256=HdEn7rolYXCSVZDy2l5AejO9mYdHVjuXWAPt_5W7xT0,4794
4
- crowdsec_tracker_api/models.py,sha256=CFziIrGpQUAKuw9phkONGHwF06dNl1jhu-7YJBvfaNM,32370
5
- crowdsec_tracker_api/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- crowdsec_tracker_api/services/cves.py,sha256=wOyeFVGJ9idzNMnQRXg-Et3uMZb49KUF4H1abThi4Xo,5940
7
- crowdsec_tracker_api/services/integrations.py,sha256=hd0zfRY4RoMl4G4EFZ5AUcyYWW-6fT8QrfK3R7x51CY,5409
8
- crowdsec_tracker_api-1.95.2.dist-info/licenses/LICENSE,sha256=j45pumtJxZpjQgYGZmkayxGnQpy6a28TqtJvTzxoPRE,1064
9
- crowdsec_tracker_api-1.95.2.dist-info/METADATA,sha256=vJ9L-bn0syMAy7pJbvxN5wQba7HWsY6rIUk77lj4G7Y,1206
10
- crowdsec_tracker_api-1.95.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- crowdsec_tracker_api-1.95.2.dist-info/top_level.txt,sha256=PjzuJQNS-E2cYLihw-evV3MrsY9OWAb8QNKEFEg1hhE,21
12
- crowdsec_tracker_api-1.95.2.dist-info/RECORD,,