Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crowdsec_service_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Server(Enum):
'Behavior',
'CVEEventOutput',
'CVEExploitationPhase',
'CVEResponseBase',
'CVEResponseDetailed',
'CVEsubscription',
'CWE',
'Classification',
Expand All @@ -149,7 +149,6 @@ class Server(Enum):
'FacetBucket',
'FingerprintEventOutput',
'FingerprintRuleResponse',
'FingerprintRuleSummary',
'FingerprintTimelineItem',
'GetCVEIPsResponsePage',
'GetCVEProtectRulesResponse',
Expand Down
Binary file modified crowdsec_service_api/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified crowdsec_service_api/__pycache__/base_model.cpython-311.pyc
Binary file not shown.
Binary file modified crowdsec_service_api/__pycache__/http_client.cpython-311.pyc
Binary file not shown.
Binary file modified crowdsec_service_api/__pycache__/models.cpython-311.pyc
Binary file not shown.
104 changes: 44 additions & 60 deletions crowdsec_service_api/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: <stdin>
# timestamp: 2026-06-11T08:42:40+00:00
# timestamp: 2026-06-22T13:24:22+00:00

from __future__ import annotations

Expand Down Expand Up @@ -1380,7 +1380,7 @@ class BlocklistsUploadBlocklistContentQueryParameters(BaseModelSdk):
Optional[datetime],
Field(
description='Blocklist expiration',
examples=['2026-06-11T08:40:13.370581+00:00'],
examples=['2026-06-19T08:54:44.914456+00:00'],
title='Expiration',
),
] = None
Expand Down Expand Up @@ -1749,6 +1749,14 @@ class CvesGetCvesQueryParameters(BaseModelSdk):
title='Exploitation Phase',
),
] = None
detailed: Annotated[
Optional[bool],
Field(
description='Include the heavy detail fields (description, crowdsec_analysis, cwes, references, events, tags) for each CVE in the list. Defaults to false to keep the response lightweight.',
examples=[True],
title='Detailed',
),
] = False
page: Annotated[
Optional[int], Field(description='Page number', ge=1, title='Page')
] = 1
Expand Down Expand Up @@ -2177,6 +2185,14 @@ class FingerprintsGetFingerprintRulesQueryParameters(BaseModelSdk):
title='Sort Order',
),
] = 'desc'
detailed: Annotated[
Optional[bool],
Field(
description='Include the heavy detail fields (description, crowdsec_analysis, references, events, tags) for each fingerprint rule in the list. Defaults to false to keep the response lightweight.',
examples=[True],
title='Detailed',
),
] = False
page: Annotated[
Optional[int], Field(description='Page number', ge=1, title='Page')
] = 1
Expand Down Expand Up @@ -3728,7 +3744,7 @@ class ScenarioIndex(BaseModelSdk):
] = None


class CVEResponseBase(BaseModelSdk):
class CVEResponseDetailed(BaseModelSdk):
id: Annotated[str, Field(description='ID of the CVE', title='Id')]
name: Annotated[str, Field(description='Name of the CVE', title='Name')]
title: Annotated[str, Field(description='Title of the CVE', title='Title')]
Expand Down Expand Up @@ -3808,6 +3824,29 @@ class CVEResponseBase(BaseModelSdk):
description='Threat context (attacker/defender countries, industries, objectives)'
),
] = None
tags: Annotated[
Optional[List[str]],
Field(description='Tags associated with the CVE', title='Tags'),
] = None
references: Annotated[
Optional[List[str]],
Field(description='List of references for the CVE', title='References'),
] = None
description: Annotated[
Optional[str], Field(description='Description of the CVE', title='Description')
] = None
crowdsec_analysis: Annotated[
Optional[str],
Field(description='CrowdSec analysis of the CVE', title='Crowdsec Analysis'),
] = None
cwes: Annotated[
Optional[List[CWE]],
Field(description='List of CWEs associated with the CVE', title='Cwes'),
] = None
events: Annotated[
Optional[List[CVEEventOutput]],
Field(description='List of events related to the CVE', title='Events'),
] = None


class FingerprintRuleResponse(BaseModelSdk):
Expand Down Expand Up @@ -3892,61 +3931,6 @@ class FingerprintRuleResponse(BaseModelSdk):
] = None


class FingerprintRuleSummary(BaseModelSdk):
id: Annotated[str, Field(description='Fingerprint rule identifier', title='Id')]
name: Annotated[str, Field(description='Fingerprint rule name', title='Name')]
title: Annotated[str, Field(description='Fingerprint rule title', title='Title')]
affected_components: Annotated[
List[AffectedComponent],
Field(description='List of affected components', title='Affected Components'),
]
crowdsec_score: Annotated[
int,
Field(
description='Live Exploit Tracker score for the fingerprint rule',
ge=0,
le=10,
title='Crowdsec Score',
),
]
opportunity_score: Annotated[
Optional[int],
Field(description='Opportunity score', ge=0, le=5, title='Opportunity Score'),
] = 0
momentum_score: Annotated[
Optional[int],
Field(description='Momentum score', ge=0, le=5, title='Momentum Score'),
] = 0
first_seen: Annotated[
Optional[datetime], Field(description='First seen date', title='First Seen')
] = None
last_seen: Annotated[
Optional[datetime], Field(description='Last seen date', title='Last Seen')
] = None
nb_ips: Annotated[
int, Field(description='Number of unique IPs observed', ge=0, title='Nb Ips')
]
rule_release_date: Annotated[
Optional[datetime],
Field(
description='Release date of the fingerprint rule',
title='Rule Release Date',
),
] = None
exploitation_phase: Annotated[
ExploitationPhase, Field(description='Current exploitation phase')
]
adjustment_score: Annotated[
Optional[AdjustmentScore], Field(description='Score adjustment details')
] = None
threat_context: Annotated[
Optional[ThreatContext],
Field(
description='Threat context (attacker/defender countries, industries, objectives)'
),
] = None


class GetCVEResponse(BaseModelSdk):
id: Annotated[str, Field(description='ID of the CVE', title='Id')]
name: Annotated[str, Field(description='Name of the CVE', title='Name')]
Expand Down Expand Up @@ -4062,7 +4046,7 @@ class GetCVESubscribedIntegrationsResponsePage(BaseModelSdk):


class GetCVEsResponsePage(BaseModelSdk):
items: Annotated[List[CVEResponseBase], Field(title='Items')]
items: Annotated[List[CVEResponseDetailed], 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')]
Expand All @@ -4071,7 +4055,7 @@ class GetCVEsResponsePage(BaseModelSdk):


class GetFingerprintRulesResponsePage(BaseModelSdk):
items: Annotated[List[FingerprintRuleSummary], Field(title='Items')]
items: Annotated[List[FingerprintRuleResponse], 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')]
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified crowdsec_service_api/services/__pycache__/cves.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified crowdsec_service_api/services/__pycache__/hub.cpython-311.pyc
Binary file not shown.
Binary file modified crowdsec_service_api/services/__pycache__/info.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/allowlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Allowlists(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def list_allowlists(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/blocklists.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Blocklists(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_blocklists(
self,
Expand Down
3 changes: 2 additions & 1 deletion crowdsec_service_api/services/cves.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@

class Cves(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_cves(
self,
query: Optional[str] = None,
sort_by: Optional[GetCVEsSortBy] = GetCVEsSortBy("rule_release_date"),
sort_order: Optional[GetCVEsSortOrder] = GetCVEsSortOrder("desc"),
exploitation_phase: Optional[CVEExploitationPhase] = None,
detailed: bool = False,
page: int = 1,
size: int = 50,
)-> GetCVEsResponsePage:
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/decisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Decisions(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_decisions(
self,
Expand Down
3 changes: 2 additions & 1 deletion crowdsec_service_api/services/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

class Fingerprints(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_fingerprint_rules(
self,
query: Optional[str] = None,
sort_by: Optional[GetCVEsSortBy] = GetCVEsSortBy("rule_release_date"),
sort_order: Optional[GetCVEsSortOrder] = GetCVEsSortOrder("desc"),
detailed: bool = False,
page: int = 1,
size: int = 50,
)-> GetFingerprintRulesResponsePage:
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Hub(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_index(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Info(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_info(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Integrations(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_integrations(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Metrics(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_metrics_remediation(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Products(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_products(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/tracker_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class TrackerEvents(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_exploitation_phase_change_events(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/tracker_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class TrackerTags(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_tags(
self,
Expand Down
2 changes: 1 addition & 1 deletion crowdsec_service_api/services/vendors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Vendors(Service):
def __init__(self, auth: Auth, base_url: str = "https://admin.api.crowdsec.net/v1") -> None:
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/1.128.0")
super().__init__(base_url=base_url, auth=auth, user_agent="crowdsec_service_api/v0.16.0")

def get_vendors(
self,
Expand Down
6 changes: 4 additions & 2 deletions doc/Cves.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Cves Methods
| Method | Description |
| ------ | ----------- |
| [get_cves](#get_cves) | Get a paginated list of CVEs that CrowdSec is tracking |
| [get_cves](#get_cves) | Get a paginated list of CVEs that CrowdSec is tracking. Pass detailed=true to also include the heavy detail fields (description, crowdsec_analysis, cwes, references, events, tags) for each CVE; they are omitted by default to keep the list light. |
| [get_cve](#get_cve) | Get information about a specific CVE ID |
| [get_cve_protect_rules](#get_cve_protect_rules) | Get protection/detection rules associated with a specific CVE ID |
| [download_cve_ips](#download_cve_ips) | Download the list of IPs exploiting a specific CVE ID in raw format |
Expand All @@ -16,7 +16,7 @@
| [get_cve_timeline](#get_cve_timeline) | Get timeline data of occurrences for a specific CVE ID |

## **get_cves**
### Get a paginated list of CVEs that CrowdSec is tracking
### Get a paginated list of CVEs that CrowdSec is tracking. Pass detailed=true to also include the heavy detail fields (description, crowdsec_analysis, cwes, references, events, tags) for each CVE; they are omitted by default to keep the list light.
- Endpoint: `/cves`
- Method: `GET`

Expand All @@ -27,6 +27,7 @@
| sort_by | Optional[GetCVEsSortBy] | Field to sort by | False | GetCVEsSortBy("rule_release_date") |
| sort_order | Optional[GetCVEsSortOrder] | Sort order: ascending or descending | False | GetCVEsSortOrder("desc") |
| exploitation_phase | Optional[CVEExploitationPhase] | Filter by exploitation phase | False | None |
| detailed | bool | Include the heavy detail fields (description, crowdsec_analysis, cwes, references, events, tags) for each CVE in the list. Defaults to false to keep the response lightweight. | False | False |
| page | int | Page number | False | 1 |
| size | int | Page size | False | 50 |
### Returns:
Expand All @@ -51,6 +52,7 @@ try:
sort_by=rule_release_date,
sort_order=desc,
exploitation_phase=None,
detailed=True,
page=1,
size=50,
)
Expand Down
6 changes: 4 additions & 2 deletions doc/Fingerprints.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Fingerprints Methods
| Method | Description |
| ------ | ----------- |
| [get_fingerprint_rules](#get_fingerprint_rules) | Get a paginated list of fingerprint rules |
| [get_fingerprint_rules](#get_fingerprint_rules) | Get a paginated list of fingerprint rules. Pass detailed=true to also include the heavy detail fields (description, crowdsec_analysis, references, events, tags) for each rule; they are omitted by default to keep the list light. |
| [download_fingerprint_ips](#download_fingerprint_ips) | Download the list of IPs exploiting a specific fingerprint rule in raw format |
| [get_fingerprint_ips_details](#get_fingerprint_ips_details) | Get detailed information about IPs exploiting a specific fingerprint rule |
| [get_fingerprint_ips_details_stats](#get_fingerprint_ips_details_stats) | Get aggregated statistics about IPs exploiting a specific fingerprint rule |
Expand All @@ -15,7 +15,7 @@
| [get_fingerprint_rule](#get_fingerprint_rule) | Get information about a specific fingerprint rule |

## **get_fingerprint_rules**
### Get a paginated list of fingerprint rules
### Get a paginated list of fingerprint rules. Pass detailed=true to also include the heavy detail fields (description, crowdsec_analysis, references, events, tags) for each rule; they are omitted by default to keep the list light.
- Endpoint: `/fingerprints`
- Method: `GET`

Expand All @@ -25,6 +25,7 @@
| query | Optional[str] | Search query for fingerprint rules | False | None |
| sort_by | Optional[GetCVEsSortBy] | Field to sort by | False | GetCVEsSortBy("rule_release_date") |
| sort_order | Optional[GetCVEsSortOrder] | Sort order: ascending or descending | False | GetCVEsSortOrder("desc") |
| detailed | bool | Include the heavy detail fields (description, crowdsec_analysis, references, events, tags) for each fingerprint rule in the list. Defaults to false to keep the response lightweight. | False | False |
| page | int | Page number | False | 1 |
| size | int | Page size | False | 50 |
### Returns:
Expand All @@ -48,6 +49,7 @@ try:
query=None,
sort_by=rule_release_date,
sort_order=desc,
detailed=True,
page=1,
size=50,
)
Expand Down
Loading