diff --git a/crowdsec-docs/sidebarsUnversioned.ts b/crowdsec-docs/sidebarsUnversioned.ts index 6f9c2e6aa..5b07cdd2b 100644 --- a/crowdsec-docs/sidebarsUnversioned.ts +++ b/crowdsec-docs/sidebarsUnversioned.ts @@ -165,9 +165,9 @@ const sidebarsUnversionedConfig: SidebarConfig = { id: "tracker_api/api_sdks", }, { - type: "doc", + type: "link", label: "API Reference", - id: "tracker_api/api_reference", + href: "https://admin.api.crowdsec.net/v1/docs#tag/Cves", }, ], }, diff --git a/crowdsec-docs/unversioned/tracker_api/api_authentication.mdx b/crowdsec-docs/unversioned/tracker_api/api_authentication.mdx index 6974f3641..9e55468f0 100644 --- a/crowdsec-docs/unversioned/tracker_api/api_authentication.mdx +++ b/crowdsec-docs/unversioned/tracker_api/api_authentication.mdx @@ -38,14 +38,14 @@ CrowdSec provides official SDKs for convenient API access with typed models, aut **Quick start with the Python SDK:** ```bash -pip install crowdsec-tracker-api +pip install crowdsec_service_api ``` ```python import os -from crowdsec_tracker_api import Cves, ApiKeyAuth +from crowdsec_service_api import Cves, ApiKeyAuth -auth = ApiKeyAuth(api_key=os.getenv("CROWDSEC_TRACKER_API_KEY")) +auth = ApiKeyAuth(api_key=os.getenv("CROWDSEC_SERVICE_API_KEY")) cve = Cves(auth=auth).get_cve("CVE-2024-25600") print(f"{cve.title}: Score {cve.crowdsec_score}, Phase: {cve.exploitation_phase.label}") ``` @@ -71,4 +71,4 @@ The API returns standard HTTP status codes: - [Integrations & Blocklists](./api_integrations) — Create firewall integrations and subscribe to CVEs - [Browse by Vendor, Product, or Tag](./api_lookups) — Explore the coverage landscape - [SDKs & Libraries](./api_sdks) — Official SDKs for Python and more -- [API Reference (Swagger)](./api_reference) — Full interactive API documentation +- [API Reference](https://admin.api.crowdsec.net/v1/docs#tag/Cves) — Full interactive API documentation diff --git a/crowdsec-docs/unversioned/tracker_api/api_cves.mdx b/crowdsec-docs/unversioned/tracker_api/api_cves.mdx index 1e124bed7..801154aad 100644 --- a/crowdsec-docs/unversioned/tracker_api/api_cves.mdx +++ b/crowdsec-docs/unversioned/tracker_api/api_cves.mdx @@ -53,10 +53,10 @@ curl -X 'GET' \ ```python import os -from crowdsec_tracker_api import Cves, ApiKeyAuth +from crowdsec_service_api import Cves, ApiKeyAuth from httpx import HTTPStatusError -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) cves_service = Cves(auth=auth) @@ -126,10 +126,10 @@ curl -X 'GET' \ ```python import os -from crowdsec_tracker_api import Cves, ApiKeyAuth +from crowdsec_service_api import Cves, ApiKeyAuth from httpx import HTTPStatusError -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) cves_service = Cves(auth=auth) @@ -247,10 +247,10 @@ curl -X 'GET' \ ```python import os -from crowdsec_tracker_api import Cves, ApiKeyAuth +from crowdsec_service_api import Cves, ApiKeyAuth from httpx import HTTPStatusError -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) cves_service = Cves(auth=auth) diff --git a/crowdsec-docs/unversioned/tracker_api/api_fingerprints.mdx b/crowdsec-docs/unversioned/tracker_api/api_fingerprints.mdx index 057a6d871..1519fd88e 100644 --- a/crowdsec-docs/unversioned/tracker_api/api_fingerprints.mdx +++ b/crowdsec-docs/unversioned/tracker_api/api_fingerprints.mdx @@ -55,7 +55,7 @@ curl -X 'GET' \ import os import httpx -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") headers = {"x-api-key": KEY, "accept": "application/json"} response = httpx.get( @@ -128,7 +128,7 @@ curl -X 'GET' \ import os import httpx -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") headers = {"x-api-key": KEY, "accept": "application/json"} response = httpx.get( diff --git a/crowdsec-docs/unversioned/tracker_api/api_integrations.mdx b/crowdsec-docs/unversioned/tracker_api/api_integrations.mdx index 13bf3b0d9..f58b2d53f 100644 --- a/crowdsec-docs/unversioned/tracker_api/api_integrations.mdx +++ b/crowdsec-docs/unversioned/tracker_api/api_integrations.mdx @@ -66,13 +66,13 @@ curl -X 'POST' \ ```python import os -from crowdsec_tracker_api import ( +from crowdsec_service_api import ( Integrations, IntegrationCreateRequest, IntegrationType, OutputFormat, ApiKeyAuth, ) from httpx import HTTPStatusError -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) integrations_service = Integrations(auth=auth) @@ -155,10 +155,10 @@ curl -X 'GET' \ ```python import os -from crowdsec_tracker_api import Integrations, ApiKeyAuth +from crowdsec_service_api import Integrations, ApiKeyAuth from httpx import HTTPStatusError -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) integrations_service = Integrations(auth=auth) @@ -216,12 +216,12 @@ curl -X 'PATCH' \ ```python import os -from crowdsec_tracker_api import ( +from crowdsec_service_api import ( Integrations, IntegrationUpdateRequest, ApiKeyAuth, ) from httpx import HTTPStatusError -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) integrations_service = Integrations(auth=auth) @@ -279,10 +279,10 @@ curl -X 'DELETE' \ ```python import os -from crowdsec_tracker_api import Integrations, ApiKeyAuth +from crowdsec_service_api import Integrations, ApiKeyAuth from httpx import HTTPStatusError -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) integrations_service = Integrations(auth=auth) diff --git a/crowdsec-docs/unversioned/tracker_api/api_lookups.mdx b/crowdsec-docs/unversioned/tracker_api/api_lookups.mdx index 65085e789..7a5b757a4 100644 --- a/crowdsec-docs/unversioned/tracker_api/api_lookups.mdx +++ b/crowdsec-docs/unversioned/tracker_api/api_lookups.mdx @@ -42,7 +42,7 @@ curl -X 'GET' \ import os import httpx -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") headers = {"x-api-key": KEY, "accept": "application/json"} response = httpx.get("https://admin.api.crowdsec.net/v1/tags", headers=headers) @@ -150,7 +150,7 @@ curl -X 'POST' \ import os import httpx -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") headers = {"x-api-key": KEY, "accept": "application/json", "Content-Type": "application/json"} response = httpx.post( diff --git a/crowdsec-docs/unversioned/tracker_api/api_reference.mdx b/crowdsec-docs/unversioned/tracker_api/api_reference.mdx deleted file mode 100644 index 5d47d4714..000000000 --- a/crowdsec-docs/unversioned/tracker_api/api_reference.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -id: api_reference -title: API Reference ---- - -import SwaggerUI from "swagger-ui-react"; -import "swagger-ui-react/swagger-ui.css"; - - diff --git a/crowdsec-docs/unversioned/tracker_api/api_sdks.mdx b/crowdsec-docs/unversioned/tracker_api/api_sdks.mdx index 64b864f93..809b8bf28 100644 --- a/crowdsec-docs/unversioned/tracker_api/api_sdks.mdx +++ b/crowdsec-docs/unversioned/tracker_api/api_sdks.mdx @@ -15,20 +15,20 @@ The official Python SDK is the recommended way to interact with the API from Pyt ### Installation ```bash -pip install crowdsec-tracker-api +pip install crowdsec_service_api ``` -**Requirements**: Python 3.8+ +**Requirements**: Python 3.11+ -**Source**: [github.com/crowdsecurity/crowdsec-tracker-api-sdk-python](https://github.com/crowdsecurity/crowdsec-tracker-api-sdk-python) +**Source**: [github.com/crowdsecurity/crowdsec-service-api-sdk-python](https://github.com/crowdsecurity/crowdsec-service-api-sdk-python) ### Authentication ```python import os -from crowdsec_tracker_api import ApiKeyAuth, Server +from crowdsec_service_api import ApiKeyAuth, Server -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") # Configure authentication auth = ApiKeyAuth(api_key=KEY) @@ -53,10 +53,10 @@ The SDK provides typed service classes for each API domain: ```python import os -from crowdsec_tracker_api import Cves, ApiKeyAuth +from crowdsec_service_api import Cves, ApiKeyAuth from httpx import HTTPStatusError -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) cves_service = Cves(auth=auth) @@ -98,7 +98,7 @@ except HTTPStatusError as e: #### Create and manage a firewall integration ```python -from crowdsec_tracker_api import ( +from crowdsec_service_api import ( Integrations, IntegrationCreateRequest, IntegrationType, OutputFormat, ApiKeyAuth, ) @@ -119,6 +119,6 @@ print(f"Integration ID: {response.id}") ## Other Languages -Need the API in another language? The REST API is straightforward to call from any HTTP client — see [Authentication & Setup](./api_authentication) for the base URL and authentication details, and the [API Reference (Swagger)](./api_reference) for the full OpenAPI specification. +Need the API in another language? The REST API is straightforward to call from any HTTP client — see [Authentication & Setup](./api_authentication) for the base URL and authentication details, and the [API Reference](https://admin.api.crowdsec.net/v1/docs#tag/Cves) for the full OpenAPI specification. If you'd like to see an official SDK for your language, let us know on [GitHub](https://github.com/crowdsecurity) or [Discord](https://discord.gg/crowdsec). diff --git a/crowdsec-docs/unversioned/tracker_api/guide_proactive.mdx b/crowdsec-docs/unversioned/tracker_api/guide_proactive.mdx index 39fafe60a..0d5e6232d 100644 --- a/crowdsec-docs/unversioned/tracker_api/guide_proactive.mdx +++ b/crowdsec-docs/unversioned/tracker_api/guide_proactive.mdx @@ -116,9 +116,9 @@ Here's a template for a daily check that surfaces new and trending threats for y ```python import os -from crowdsec_tracker_api import Cves, ApiKeyAuth +from crowdsec_service_api import Cves, ApiKeyAuth -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) cves_service = Cves(auth=auth) diff --git a/crowdsec-docs/unversioned/tracker_api/guide_triage.mdx b/crowdsec-docs/unversioned/tracker_api/guide_triage.mdx index a40b6a2d5..1629923ce 100644 --- a/crowdsec-docs/unversioned/tracker_api/guide_triage.mdx +++ b/crowdsec-docs/unversioned/tracker_api/guide_triage.mdx @@ -100,9 +100,9 @@ For teams handling many alerts, consider automating the lookup: ```python import os -from crowdsec_tracker_api import Cves, ApiKeyAuth +from crowdsec_service_api import Cves, ApiKeyAuth -KEY = os.getenv("CROWDSEC_TRACKER_API_KEY") +KEY = os.getenv("CROWDSEC_SERVICE_API_KEY") auth = ApiKeyAuth(api_key=KEY) cves_service = Cves(auth=auth) diff --git a/crowdsec-docs/unversioned/tracker_api/overview.mdx b/crowdsec-docs/unversioned/tracker_api/overview.mdx index a2831130f..80bd5dda1 100644 --- a/crowdsec-docs/unversioned/tracker_api/overview.mdx +++ b/crowdsec-docs/unversioned/tracker_api/overview.mdx @@ -52,7 +52,7 @@ Not all threats map to a single CVE. The tracker also monitors **Reconnaissance The Live Exploit Tracker is available through two interfaces: - **[Web Interface](https://tracker.crowdsec.net)**: A dashboard for browsing CVEs, viewing timelines and attacker IPs, managing integrations, and reading CrowdSec Analysis reports. Ideal for SOC analysts and security managers. -- **[REST API](./api_authentication)**: Programmatic access for automation, SIEM/SOAR integration, and custom tooling. A [Python SDK](https://github.com/crowdsecurity/crowdsec-tracker-api-sdk-python) is also available. +- **[REST API](./api_authentication)**: Programmatic access for automation, SIEM/SOAR integration, and custom tooling. A [Python SDK](https://github.com/crowdsecurity/crowdsec-service-api-sdk-python) is also available. Both interfaces require an API key. Contact the CrowdSec team to obtain yours if you haven't already.