Skip to content
Merged
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
4 changes: 2 additions & 2 deletions crowdsec-docs/sidebarsUnversioned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
},
Expand Down
8 changes: 4 additions & 4 deletions crowdsec-docs/unversioned/tracker_api/api_authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
```
Expand All @@ -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
12 changes: 6 additions & 6 deletions crowdsec-docs/unversioned/tracker_api/api_cves.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions crowdsec-docs/unversioned/tracker_api/api_fingerprints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
16 changes: 8 additions & 8 deletions crowdsec-docs/unversioned/tracker_api/api_integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions crowdsec-docs/unversioned/tracker_api/api_lookups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
9 changes: 0 additions & 9 deletions crowdsec-docs/unversioned/tracker_api/api_reference.mdx

This file was deleted.

18 changes: 9 additions & 9 deletions crowdsec-docs/unversioned/tracker_api/api_sdks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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,
)
Expand All @@ -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).
4 changes: 2 additions & 2 deletions crowdsec-docs/unversioned/tracker_api/guide_proactive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions crowdsec-docs/unversioned/tracker_api/guide_triage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion crowdsec-docs/unversioned/tracker_api/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading