diff --git a/README.md b/README.md index 1b69c74..7cc8ce3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# crowdsec_service_api - 1.16.0 +# crowdsec_service_api - 1.17.0 ## Installation @@ -7,105 +7,8 @@ pip install crowdsec_service_api ``` -## License - - - -## API Endpoint services - -[Blocklists](./doc/Blocklists.md) - -[Integrations](./doc/Integrations.md) - -[Info](./doc/Info.md) - -## API Endpoint models - -[ApiKeyCredentials](./doc/Models.md#apikeycredentials) - -[BasicAuthCredentials](./doc/Models.md#basicauthcredentials) - -[BlocklistAddIPsRequest](./doc/Models.md#blocklistaddipsrequest) - -[BlocklistContentStats](./doc/Models.md#blocklistcontentstats) - -[BlocklistCreateRequest](./doc/Models.md#blocklistcreaterequest) - -[BlocklistCreateResponse](./doc/Models.md#blocklistcreateresponse) - -[BlocklistDeleteIPsRequest](./doc/Models.md#blocklistdeleteipsrequest) - -[BlocklistGetResponse](./doc/Models.md#blocklistgetresponse) - -[BlocklistIncludeFilters](./doc/Models.md#blocklistincludefilters) - -[BlocklistResponse](./doc/Models.md#blocklistresponse) - -[BlocklistShareRequest](./doc/Models.md#blocklistsharerequest) - -[BlocklistSources](./doc/Models.md#blocklistsources) - -[BlocklistStats](./doc/Models.md#blockliststats) - -[BlocklistSubscriberEntity](./doc/Models.md#blocklistsubscriberentity) - -[BlocklistSubscribersResponse](./doc/Models.md#blocklistsubscribersresponse) - -[BlocklistSubscription](./doc/Models.md#blocklistsubscription) - -[BlocklistSubscriptionRequest](./doc/Models.md#blocklistsubscriptionrequest) - -[BlocklistSubscriptionResponse](./doc/Models.md#blocklistsubscriptionresponse) +# Usage +You can access the full usage documentation [here](https://github.com/crowdsecurity/crowdsec-service-api-sdk-python/tree/main/doc). -[BlocklistUpdateRequest](./doc/Models.md#blocklistupdaterequest) - -[BlocklistUsageStats](./doc/Models.md#blocklistusagestats) - -[Body_uploadBlocklistContent](./doc/Models.md#body_uploadblocklistcontent) - -[CtiAs](./doc/Models.md#ctias) - -[CtiBehavior](./doc/Models.md#ctibehavior) - -[CtiCategory](./doc/Models.md#cticategory) - -[CtiCountry](./doc/Models.md#cticountry) - -[CtiIp](./doc/Models.md#ctiip) - -[CtiScenario](./doc/Models.md#ctiscenario) - -[EntityType](./doc/Models.md#entitytype) - -[HTTPValidationError](./doc/Models.md#httpvalidationerror) - -[IntegrationCreateRequest](./doc/Models.md#integrationcreaterequest) - -[IntegrationCreateResponse](./doc/Models.md#integrationcreateresponse) - -[IntegrationGetResponse](./doc/Models.md#integrationgetresponse) - -[IntegrationType](./doc/Models.md#integrationtype) - -[IntegrationUpdateRequest](./doc/Models.md#integrationupdaterequest) - -[IntegrationUpdateResponse](./doc/Models.md#integrationupdateresponse) - -[Links](./doc/Models.md#links) - -[OutputFormat](./doc/Models.md#outputformat) - -[Page_BlocklistResponse_](./doc/Models.md#page_blocklistresponse_) - -[Page_IntegrationGetResponse_](./doc/Models.md#page_integrationgetresponse_) - -[Permission](./doc/Models.md#permission) - -[PricingTiers](./doc/Models.md#pricingtiers) - -[Share](./doc/Models.md#share) - -[Stats](./doc/Models.md#stats) +## License -[ValidationError](./doc/Models.md#validationerror) -``` \ No newline at end of file diff --git a/crowdsec_service_api/__pycache__/base_model.cpython-311.pyc b/crowdsec_service_api/__pycache__/base_model.cpython-311.pyc index 6681a4f..831dc47 100644 Binary files a/crowdsec_service_api/__pycache__/base_model.cpython-311.pyc and b/crowdsec_service_api/__pycache__/base_model.cpython-311.pyc differ diff --git a/crowdsec_service_api/__pycache__/http_client.cpython-311.pyc b/crowdsec_service_api/__pycache__/http_client.cpython-311.pyc index 52419f1..0f151fb 100644 Binary files a/crowdsec_service_api/__pycache__/http_client.cpython-311.pyc and b/crowdsec_service_api/__pycache__/http_client.cpython-311.pyc differ diff --git a/crowdsec_service_api/models.py b/crowdsec_service_api/models.py index 496c0d3..beeae8b 100644 --- a/crowdsec_service_api/models.py +++ b/crowdsec_service_api/models.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: -# timestamp: 2024-06-13T13:59:52+00:00 +# timestamp: 2024-06-18T14:56:09+00:00 from __future__ import annotations @@ -645,17 +645,12 @@ class BlocklistStats(BaseModelSdk): } ), ] - usage_stats: Annotated[ - Optional[BlocklistUsageStats], - Field( - { - 'engines_subscribed_directly': 0, - 'engines_subscribed_through_org': 0, - 'engines_subscribed_through_tag': 0, - 'total_subscribed_engines': 0, - } - ), - ] + usage_stats: Optional[BlocklistUsageStats] = { + 'engines_subscribed_directly': 0, + 'engines_subscribed_through_org': 0, + 'engines_subscribed_through_tag': 0, + 'total_subscribed_engines': 0, + } addition_2days: Annotated[Optional[int], Field(0, title='Addition 2Days')] addition_month: Annotated[Optional[int], Field(0, title='Addition Month')] suppression_2days: Annotated[Optional[int], Field(0, title='Suppression 2Days')] diff --git a/crowdsec_service_api/services/__pycache__/__init__.cpython-311.pyc b/crowdsec_service_api/services/__pycache__/__init__.cpython-311.pyc index 5e6d55c..08a312a 100644 Binary files a/crowdsec_service_api/services/__pycache__/__init__.cpython-311.pyc and b/crowdsec_service_api/services/__pycache__/__init__.cpython-311.pyc differ diff --git a/doc/Blocklists.md b/doc/Blocklists.md index 36b08fe..992e3e8 100644 --- a/doc/Blocklists.md +++ b/doc/Blocklists.md @@ -3,35 +3,22 @@ # Blocklists Methods | Method | Description | | ------ | ----------- | -| [get_blocklists](#get_blocklists) | Get multiple blocklists. Only blocklists owned by your organization, - shared with your organization or public blocklists are returned. Filters and pagination are available as query parameters. | -| [create_blocklist](#create_blocklist) | Create a new blocklist owned by your organization. The name must be unique within your organization. - The list will only be visible to your organization and organizations you shared the blocklist with. This operation is submitted to quotas | +| [get_blocklists](#get_blocklists) | Get multiple blocklists. Only blocklists owned by your organization, shared with your organization or public blocklists are returned. Filters and pagination are available as query parameters. | +| [create_blocklist](#create_blocklist) | Create a new blocklist owned by your organization. The name must be unique within your organization. The list will only be visible to your organization and organizations you shared the blocklist with. This operation is submitted to quotas | | [get_blocklist](#get_blocklist) | Get the details of a blocklist by ID. The content of the blocklist is not returned. | -| [delete_blocklist](#delete_blocklist) | Delete a blocklist by ID. If the blocklist is shared with other organizations or it has subscriptions, the operation will fail. - If you want to force delete the blocklist, you can use the force query parameter, so the blocklists will be unshared / unsubscribed. | +| [delete_blocklist](#delete_blocklist) | Delete a blocklist by ID. If the blocklist is shared with other organizations or it has subscriptions, the operation will fail. If you want to force delete the blocklist, you can use the force query parameter, so the blocklists will be unshared / unsubscribed. | | [update_blocklist](#update_blocklist) | Update a blocklist's details by ID. It is not possible to update the blocklist content using this operation. | | [add_ips_to_blocklist](#add_ips_to_blocklist) | Add IPs to a blocklist. If an IP is already in the blocklist, its expiration will be updated with the new expiration. | | [delete_ips_from_blocklist](#delete_ips_from_blocklist) | Delete IPs from a blocklist | -| [download_blocklist_content](#download_blocklist_content) | Download blocklist content as a list of ips as plain text separated by new lines. The response will include the ETag header for cache control. - If_Modified_Since and If_None_Match cache control headers are supported for conditional requests. | +| [download_blocklist_content](#download_blocklist_content) | Download blocklist content as a list of ips as plain text separated by new lines. The response will include the ETag header for cache control. If_Modified_Since and If_None_Match cache control headers are supported for conditional requests. | | [get_blocklist_subscribers](#get_blocklist_subscribers) | Get blocklist subscribers within your organization. | -| [subscribe_blocklist](#subscribe_blocklist) | Subscribe to a blocklist with a remediation type. If the entity type is the full organization or a Tag, - all the engines belonging to the organization or the Tag will be subscribed - and new engines that will join the organization or the Tag will also be automatically subscribed. - If the subscription has been done on an organization or Tag you cannot unsubscribe individual engines. - In case of errors for some subscribers, the operation will still succeed for the entities that were successfully subscribed - and you'll have the list of errors in the operation's result. - This operation is submitted to quotas. | +| [subscribe_blocklist](#subscribe_blocklist) | Subscribe to a blocklist with a remediation type. If the entity type is the full organization or a Tag, all the engines belonging to the organization or the Tag will be subscribed and new engines that will join the organization or the Tag will also be automatically subscribed. If the subscription has been done on an organization or Tag you cannot unsubscribe individual engines. In case of errors for some subscribers, the operation will still succeed for the entities that were successfully subscribed and you'll have the list of errors in the operation's result. This operation is submitted to quotas. | | [unsubscribe_blocklist](#unsubscribe_blocklist) | Unsubscribe from a blocklist. You cannot unsubscribe individual engines if the subscription has been done on an organization or Tag. | -| [share_blocklist](#share_blocklist) | Share a blocklist with other organizations given their IDs. The blocklist must be owned by your organization. - You can give read-only access or read-write access to the blocklist. Sharing a blocklist will not automatically subscribe the shared organizations to the blocklist. | -| [unshare_blocklist](#unshare_blocklist) | Unshare a blocklist with other organizations. If the blocklist is subscribed by the organization, the operation will fail. - Use force query parameter to unshare a blocklist even if subscriptions exists. | +| [share_blocklist](#share_blocklist) | Share a blocklist with other organizations given their IDs. The blocklist must be owned by your organization. You can give read-only access or read-write access to the blocklist. Sharing a blocklist will not automatically subscribe the shared organizations to the blocklist. | +| [unshare_blocklist](#unshare_blocklist) | Unshare a blocklist with other organizations. If the blocklist is subscribed by the organization, the operation will fail.Use force query parameter to unshare a blocklist even if subscriptions exists. | ## **get_blocklists** -### Get multiple blocklists. Only blocklists owned by your organization, - shared with your organization or public blocklists are returned. Filters and pagination are available as query parameters. +### Get multiple blocklists. Only blocklists owned by your organization, shared with your organization or public blocklists are returned. Filters and pagination are available as query parameters. - Endpoint: `/blocklists` - Method: `GET` @@ -73,8 +60,7 @@ print(response) ## **create_blocklist** -### Create a new blocklist owned by your organization. The name must be unique within your organization. - The list will only be visible to your organization and organizations you shared the blocklist with. This operation is submitted to quotas +### Create a new blocklist owned by your organization. The name must be unique within your organization. The list will only be visible to your organization and organizations you shared the blocklist with. This operation is submitted to quotas - Endpoint: `/blocklists` - Method: `POST` @@ -149,8 +135,7 @@ print(response) ## **delete_blocklist** -### Delete a blocklist by ID. If the blocklist is shared with other organizations or it has subscriptions, the operation will fail. - If you want to force delete the blocklist, you can use the force query parameter, so the blocklists will be unshared / unsubscribed. +### Delete a blocklist by ID. If the blocklist is shared with other organizations or it has subscriptions, the operation will fail. If you want to force delete the blocklist, you can use the force query parameter, so the blocklists will be unshared / unsubscribed. - Endpoint: `/blocklists/{blocklist_id}` - Method: `DELETE` @@ -306,8 +291,7 @@ print(response) ## **download_blocklist_content** -### Download blocklist content as a list of ips as plain text separated by new lines. The response will include the ETag header for cache control. - If_Modified_Since and If_None_Match cache control headers are supported for conditional requests. +### Download blocklist content as a list of ips as plain text separated by new lines. The response will include the ETag header for cache control. If_Modified_Since and If_None_Match cache control headers are supported for conditional requests. - Endpoint: `/blocklists/{blocklist_id}/download` - Method: `GET` @@ -379,13 +363,7 @@ print(response) ## **subscribe_blocklist** -### Subscribe to a blocklist with a remediation type. If the entity type is the full organization or a Tag, - all the engines belonging to the organization or the Tag will be subscribed - and new engines that will join the organization or the Tag will also be automatically subscribed. - If the subscription has been done on an organization or Tag you cannot unsubscribe individual engines. - In case of errors for some subscribers, the operation will still succeed for the entities that were successfully subscribed - and you'll have the list of errors in the operation's result. - This operation is submitted to quotas. +### Subscribe to a blocklist with a remediation type. If the entity type is the full organization or a Tag, all the engines belonging to the organization or the Tag will be subscribed and new engines that will join the organization or the Tag will also be automatically subscribed. If the subscription has been done on an organization or Tag you cannot unsubscribe individual engines. In case of errors for some subscribers, the operation will still succeed for the entities that were successfully subscribed and you'll have the list of errors in the operation's result. This operation is submitted to quotas. - Endpoint: `/blocklists/{blocklist_id}/subscribers` - Method: `POST` @@ -458,8 +436,7 @@ print(response) ## **share_blocklist** -### Share a blocklist with other organizations given their IDs. The blocklist must be owned by your organization. - You can give read-only access or read-write access to the blocklist. Sharing a blocklist will not automatically subscribe the shared organizations to the blocklist. +### Share a blocklist with other organizations given their IDs. The blocklist must be owned by your organization. You can give read-only access or read-write access to the blocklist. Sharing a blocklist will not automatically subscribe the shared organizations to the blocklist. - Endpoint: `/blocklists/{blocklist_id}/shares` - Method: `POST` @@ -496,8 +473,7 @@ print(response) ## **unshare_blocklist** -### Unshare a blocklist with other organizations. If the blocklist is subscribed by the organization, the operation will fail. - Use force query parameter to unshare a blocklist even if subscriptions exists. +### Unshare a blocklist with other organizations. If the blocklist is subscribed by the organization, the operation will fail.Use force query parameter to unshare a blocklist even if subscriptions exists. - Endpoint: `/blocklists/{blocklist_id}/shares/{unshare_organization_id}` - Method: `DELETE` diff --git a/doc/Integrations.md b/doc/Integrations.md index 04af57d..7f35b0d 100644 --- a/doc/Integrations.md +++ b/doc/Integrations.md @@ -4,16 +4,13 @@ | Method | Description | | ------ | ----------- | | [get_integrations](#get_integrations) | Get integrations owned by your organization | -| [create_integration](#create_integration) | Create an integration to a firewall or remediation component, owned by your organization. - The name should be unique within the organization. - This operation is submitted to quotas. | +| [create_integration](#create_integration) | Create an integration to a firewall or remediation component, owned by your organization. The name should be unique within the organization. This operation is submitted to quotas. | | [get_integration](#get_integration) | Get an integration by ID | | [delete_integration](#delete_integration) | Delete the integration by ID | | [update_integration](#update_integration) | Update the integration details | | [get_integration_content](#get_integration_content) | Get the ips associated to the integration in plain text format. The content can be paginated to accomodate limits in firewalls. | | [head_integration_content](#head_integration_content) | Check if the integration has content | -| [get_integration_content_stream](#get_integration_content_stream) | Get the ips associated to the integration in a format compatible with a remediation component. - As for the remediation components, you can fetch the full content with startup=true or only the changes since the last pull | +| [get_integration_content_stream](#get_integration_content_stream) | Get the ips associated to the integration in a format compatible with a remediation component. As for the remediation components, you can fetch the full content with startup=true or only the changes since the last pull | ## **get_integrations** ### Get integrations owned by your organization @@ -50,9 +47,7 @@ print(response) ## **create_integration** -### Create an integration to a firewall or remediation component, owned by your organization. - The name should be unique within the organization. - This operation is submitted to quotas. +### Create an integration to a firewall or remediation component, owned by your organization. The name should be unique within the organization. This operation is submitted to quotas. - Endpoint: `/integrations` - Method: `POST` @@ -258,8 +253,7 @@ print(response) ## **get_integration_content_stream** -### Get the ips associated to the integration in a format compatible with a remediation component. - As for the remediation components, you can fetch the full content with startup=true or only the changes since the last pull +### Get the ips associated to the integration in a format compatible with a remediation component. As for the remediation components, you can fetch the full content with startup=true or only the changes since the last pull - Endpoint: `/integrations/{integration_id}/v1/decisions/stream` - Method: `GET` diff --git a/doc/Models.md b/doc/Models.md index 87c85fe..ce1e9bf 100644 --- a/doc/Models.md +++ b/doc/Models.md @@ -1,4 +1,5 @@ + # **ApiKeyCredentials** ## Required: api_key @@ -6,6 +7,7 @@ api_key | Property | Type | Description | Example | |----------|------|-------------|---------| | api_key | str | API key for the integration || + # **BasicAuthCredentials** ## Required: username, password @@ -14,6 +16,7 @@ username, password |----------|------|-------------|---------| | username | str | Basic auth username for the integration || | password | str | Basic auth password for the integration || + # **BlocklistAddIPsRequest** ## Required: ips @@ -22,6 +25,7 @@ ips |----------|------|-------------|---------| | ips | list[str] | List of IPs or networks || | expiration | str | Expiration date || + # **BlocklistContentStats** ## Properties | Property | Type | Description | Example | @@ -39,6 +43,7 @@ ips | top_attacking_countries | list[CtiCountry] | None || | top_ips | list[CtiIp] | None || | updated_at | str | None || + # **BlocklistCreateRequest** ## Required: name, description @@ -52,6 +57,7 @@ name, description | tags | list[str] | Classification tags || | from_cti_query | str | CTI query (doc link available soon) || | since | str | Since duration for the CTI query (5m, 2h, 7d). Max is 30 days || + # **BlocklistCreateResponse** ## Required: id, created_at, updated_at, name, label, description, references, is_private, tags, pricing_tier, source, stats, from_cti_query, since, shared_with, organization_id, subscribers @@ -75,6 +81,7 @@ id, created_at, updated_at, name, label, description, references, is_private, ta | shared_with | list[Share] | List of organizations shared with || | organization_id | Optional[str] | Blocklists owner's organization id || | subscribers | list[BlocklistSubscriberEntity] | List of subscribers to the blocklist. Only subscribers belonging to your organization are returned || + # **BlocklistDeleteIPsRequest** ## Required: ips @@ -82,6 +89,7 @@ ips | Property | Type | Description | Example | |----------|------|-------------|---------| | ips | list[str] | List of IPs or networks || + # **BlocklistGetResponse** ## Required: id, created_at, updated_at, name, label, description, references, is_private, tags, pricing_tier, source, stats, from_cti_query, since, shared_with, organization_id, subscribers @@ -105,9 +113,11 @@ id, created_at, updated_at, name, label, description, references, is_private, ta | shared_with | list[Share] | List of organizations shared with || | organization_id | Optional[str] | Blocklists owner's organization id || | subscribers | list[BlocklistSubscriberEntity] | List of subscribers to the blocklist. Only subscribers belonging to your organization are returned || + # **BlocklistIncludeFilters** ## Enum: PUBLIC, PRIVATE, SHARED, ALL + # **BlocklistResponse** ## Required: id, created_at, updated_at, name, label, description, references, is_private, tags, pricing_tier, source, stats, from_cti_query, since, shared_with, organization_id, subscribers @@ -131,6 +141,7 @@ id, created_at, updated_at, name, label, description, references, is_private, ta | shared_with | list[Share] | List of organizations shared with || | organization_id | Optional[str] | Blocklists owner's organization id || | subscribers | list[BlocklistSubscriberEntity] | List of subscribers to the blocklist. Only subscribers belonging to your organization are returned || + # **BlocklistShareRequest** ## Required: organizations @@ -138,15 +149,17 @@ organizations | Property | Type | Description | Example | |----------|------|-------------|---------| | organizations | list[Share] | List of organizations to share the blocklist || + # **BlocklistSources** ## Enum: CROWDSEC, THIRD_PARTY, CUSTOM + # **BlocklistStats** ## Properties | Property | Type | Description | Example | |----------|------|-------------|---------| | content_stats | object | None || -| usage_stats | object | None || +| usage_stats | Optional[object] | None || | addition_2days | int | None || | addition_month | int | None || | suppression_2days | int | None || @@ -155,6 +168,7 @@ CROWDSEC, THIRD_PARTY, CUSTOM | change_month_percentage | float | None || | count | int | None || | updated_at | str | None || + # **BlocklistSubscriberEntity** ## Required: id, entity_type, remediation @@ -164,6 +178,7 @@ id, entity_type, remediation | id | str | Subscriber entity id || | entity_type | str | None || | remediation | str | Remediation || + # **BlocklistSubscribersResponse** ## Required: subscribers @@ -171,6 +186,7 @@ subscribers | Property | Type | Description | Example | |----------|------|-------------|---------| | subscribers | list[BlocklistSubscriberEntity] | List of subscribers || + # **BlocklistSubscription** ## Required: id, name, label @@ -180,6 +196,7 @@ id, name, label | id | str | None || | name | str | None || | label | str | None || + # **BlocklistSubscriptionRequest** ## Required: entity_type @@ -189,6 +206,7 @@ entity_type | ids | list[str] | List of subscriber entity id || | entity_type | str | None || | remediation | Optional[str] | Remediation || + # **BlocklistSubscriptionResponse** ## Required: updated, errors @@ -197,6 +215,7 @@ updated, errors |----------|------|-------------|---------| | updated | Optional[list[str]] | List of updated blocklist ids || | errors | Optional[list[object]] | List of errors if any || + # **BlocklistUpdateRequest** ## Properties | Property | Type | Description | Example | @@ -207,6 +226,7 @@ updated, errors | tags | list[str] | Blocklist tags || | from_cti_query | str | CTI query (doc link available soon) || | since | str | Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days || + # **BlocklistUsageStats** ## Properties | Property | Type | Description | Example | @@ -216,6 +236,7 @@ updated, errors | engines_subscribed_through_tag | int | None || | total_subscribed_engines | int | None || | updated_at | str | None || + # **Body_uploadBlocklistContent** ## Required: file @@ -223,6 +244,7 @@ file | Property | Type | Description | Example | |----------|------|-------------|---------| | file | str | Blocklist file in txt format || + # **CtiAs** ## Required: as_num, as_name, total_ips @@ -232,6 +254,7 @@ as_num, as_name, total_ips | as_num | str | None || | as_name | str | None || | total_ips | int | None || + # **CtiBehavior** ## Required: name, label, description, references, total_ips @@ -243,6 +266,7 @@ name, label, description, references, total_ips | description | str | None || | references | list[str] | None || | total_ips | int | None || + # **CtiCategory** ## Required: name, label, description, total_ips @@ -253,6 +277,7 @@ name, label, description, total_ips | label | str | None || | description | str | None || | total_ips | int | None || + # **CtiCountry** ## Required: country_short, total_ips @@ -261,6 +286,7 @@ country_short, total_ips |----------|------|-------------|---------| | country_short | str | None || | total_ips | int | None || + # **CtiIp** ## Required: ip, total_signals_1m @@ -270,6 +296,7 @@ ip, total_signals_1m | ip | str | None || | total_signals_1m | int | None || | reputation | str | None || + # **CtiScenario** ## Required: name, label, description, references, total_ips @@ -281,14 +308,17 @@ name, label, description, references, total_ips | description | str | None || | references | list[str] | None || | total_ips | int | None || + # **EntityType** ## Enum: ORG, TAG, ENGINE, FIREWALL_INTEGRATION, REMEDIATION_COMPONENT_INTEGRATION + # **HTTPValidationError** ## Properties | Property | Type | Description | Example | |----------|------|-------------|---------| | detail | list[ValidationError] | None || + # **IntegrationCreateRequest** ## Required: name, entity_type, output_format @@ -299,6 +329,7 @@ name, entity_type, output_format | description | str | Description of the integration || | entity_type | str | None || | output_format | str | None || + # **IntegrationCreateResponse** ## Required: id, name, organization_id, created_at, updated_at, entity_type, output_format, blocklists, endpoint, credentials @@ -318,6 +349,7 @@ id, name, organization_id, created_at, updated_at, entity_type, output_format, b | endpoint | str | Url that should be used by the firewall or the remediation component to fetch the integration's content || | stats | object | None || | credentials | Union[object, object] | Credentials that were generated for the integration || + # **IntegrationGetResponse** ## Required: id, name, organization_id, created_at, updated_at, entity_type, output_format, blocklists, endpoint @@ -336,9 +368,11 @@ id, name, organization_id, created_at, updated_at, entity_type, output_format, b | blocklists | list[BlocklistSubscription] | Blocklists that are subscribed by the integration || | endpoint | str | Url that should be used by the firewall or the remediation component to fetch the integration's content || | stats | object | None || + # **IntegrationType** ## Enum: FIREWALL_INTEGRATION, REMEDIATION_COMPONENT_INTEGRATION + # **IntegrationUpdateRequest** ## Properties | Property | Type | Description | Example | @@ -347,6 +381,7 @@ FIREWALL_INTEGRATION, REMEDIATION_COMPONENT_INTEGRATION | description | str | New description || | output_format | str | None || | regenerate_credentials | bool | Regenerate credentials for the integration || + # **IntegrationUpdateResponse** ## Required: id, name, organization_id, created_at, updated_at, entity_type, output_format, blocklists, endpoint @@ -366,6 +401,7 @@ id, name, organization_id, created_at, updated_at, entity_type, output_format, b | endpoint | str | Url that should be used by the firewall or the remediation component to fetch the integration's content || | stats | object | None || | credentials | Optional[object, object] | Credentials for the integration || + # **Links** ## Required: first, last, self, next, prev @@ -377,9 +413,11 @@ first, last, self, next, prev | self | Optional[str] | None || | next | Optional[str] | None || | prev | Optional[str] | None || + # **OutputFormat** ## Enum: PLAIN_TEXT, F5, REMEDIATION_COMPONENT, FORTIGATE, PALOALTO, CHECKPOINT, CISCO + # **Page_BlocklistResponse_** ## Required: items, total, page, size, links @@ -392,6 +430,7 @@ items, total, page, size, links | size | Optional[int] | None || | pages | Optional[int] | None || | links | object | None || + # **Page_IntegrationGetResponse_** ## Required: items, total, page, size, links @@ -404,12 +443,15 @@ items, total, page, size, links | size | Optional[int] | None || | pages | Optional[int] | None || | links | object | None || + # **Permission** ## Enum: READ, WRITE + # **PricingTiers** ## Enum: FREE, PREMIUM, PLATINUM + # **Share** ## Required: organization_id, permission @@ -418,6 +460,7 @@ organization_id, permission |----------|------|-------------|---------| | organization_id | str | None || | permission | str | None || + # **Stats** ## Required: count @@ -425,6 +468,7 @@ count | Property | Type | Description | Example | |----------|------|-------------|---------| | count | int | Number of total blocklists items the integration will pull || + # **ValidationError** ## Required: loc, msg, type diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 0000000..08e8ad7 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,97 @@ +## API Endpoint services + +[Blocklists](./Blocklists.md) + +[Integrations](./Integrations.md) + +[Info](./Info.md) + +## API Endpoint models + +[ApiKeyCredentials](./Models.md#apikeycredentials) + +[BasicAuthCredentials](./Models.md#basicauthcredentials) + +[BlocklistAddIPsRequest](./Models.md#blocklistaddipsrequest) + +[BlocklistContentStats](./Models.md#blocklistcontentstats) + +[BlocklistCreateRequest](./Models.md#blocklistcreaterequest) + +[BlocklistCreateResponse](./Models.md#blocklistcreateresponse) + +[BlocklistDeleteIPsRequest](./Models.md#blocklistdeleteipsrequest) + +[BlocklistGetResponse](./Models.md#blocklistgetresponse) + +[BlocklistIncludeFilters](./Models.md#blocklistincludefilters) + +[BlocklistResponse](./Models.md#blocklistresponse) + +[BlocklistShareRequest](./Models.md#blocklistsharerequest) + +[BlocklistSources](./Models.md#blocklistsources) + +[BlocklistStats](./Models.md#blockliststats) + +[BlocklistSubscriberEntity](./Models.md#blocklistsubscriberentity) + +[BlocklistSubscribersResponse](./Models.md#blocklistsubscribersresponse) + +[BlocklistSubscription](./Models.md#blocklistsubscription) + +[BlocklistSubscriptionRequest](./Models.md#blocklistsubscriptionrequest) + +[BlocklistSubscriptionResponse](./Models.md#blocklistsubscriptionresponse) + +[BlocklistUpdateRequest](./Models.md#blocklistupdaterequest) + +[BlocklistUsageStats](./Models.md#blocklistusagestats) + +[Body_uploadBlocklistContent](./Models.md#body_uploadblocklistcontent) + +[CtiAs](./Models.md#ctias) + +[CtiBehavior](./Models.md#ctibehavior) + +[CtiCategory](./Models.md#cticategory) + +[CtiCountry](./Models.md#cticountry) + +[CtiIp](./Models.md#ctiip) + +[CtiScenario](./Models.md#ctiscenario) + +[EntityType](./Models.md#entitytype) + +[HTTPValidationError](./Models.md#httpvalidationerror) + +[IntegrationCreateRequest](./Models.md#integrationcreaterequest) + +[IntegrationCreateResponse](./Models.md#integrationcreateresponse) + +[IntegrationGetResponse](./Models.md#integrationgetresponse) + +[IntegrationType](./Models.md#integrationtype) + +[IntegrationUpdateRequest](./Models.md#integrationupdaterequest) + +[IntegrationUpdateResponse](./Models.md#integrationupdateresponse) + +[Links](./Models.md#links) + +[OutputFormat](./Models.md#outputformat) + +[Page_BlocklistResponse_](./Models.md#page_blocklistresponse_) + +[Page_IntegrationGetResponse_](./Models.md#page_integrationgetresponse_) + +[Permission](./Models.md#permission) + +[PricingTiers](./Models.md#pricingtiers) + +[Share](./Models.md#share) + +[Stats](./Models.md#stats) + +[ValidationError](./Models.md#validationerror) \ No newline at end of file diff --git a/openapi.json b/openapi.json index e69210b..c17ab22 100644 --- a/openapi.json +++ b/openapi.json @@ -1 +1 @@ -{"openapi": "3.1.0", "info": {"title": "Crowdsec API", "description": "This is the API to manage Crowdsec services", "contact": {"name": "CrowdSec", "url": "https://crowdsec.net/", "email": "info@crowdsec.net"}, "version": "1.16.0"}, "paths": {"/blocklists": {"post": {"tags": ["Blocklists"], "summary": "Create Blocklist", "description": "Create a new blocklist owned by your organization. The name must be unique within your organization. \n The list will only be visible to your organization and organizations you shared the blocklist with. This operation is submitted to quotas", "operationId": "createBlocklist", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistCreateRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistCreateResponse"}}}}, "409": {"description": "Blocklist already exists"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["Blocklists"], "summary": "Get Blocklists", "description": "Get multiple blocklists. Only blocklists owned by your organization, \n shared with your organization or public blocklists are returned. Filters and pagination are available as query parameters.", "operationId": "getBlocklists", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page"}, "description": "Page number"}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "description": "Page size", "default": 100, "title": "Page Size"}, "description": "Page size"}, {"name": "subscribed_only", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Fetch only blocklists subscribed by your organization, engines or tags", "default": false, "title": "Subscribed Only"}, "description": "Fetch only blocklists subscribed by your organization, engines or tags"}, {"name": "exclude_subscribed", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Exclude subscribed blocklists", "default": false, "title": "Exclude Subscribed"}, "description": "Exclude subscribed blocklists"}, {"name": "include_filter", "in": "query", "required": false, "schema": {"type": "array", "items": {"$ref": "#/components/schemas/BlocklistIncludeFilters"}, "description": "Include blocklists with the specified filters", "default": ["private", "shared"], "title": "Include Filter"}, "description": "Include blocklists with the specified filters"}, {"name": "size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size"}, "description": "Page size"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Page_BlocklistResponse_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}": {"get": {"tags": ["Blocklists"], "summary": "Get Blocklist", "description": "Get the details of a blocklist by ID. The content of the blocklist is not returned.", "operationId": "getBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistGetResponse"}}}}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["Blocklists"], "summary": "Update Blocklist", "description": "Update a blocklist's details by ID. It is not possible to update the blocklist content using this operation.", "operationId": "updateBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistUpdateRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistResponse"}}}}, "403": {"description": "Blocklist is read-only"}, "404": {"description": "Blocklist not found"}, "500": {"description": "Internal server error"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["Blocklists"], "summary": "Delete Blocklist", "description": "Delete a blocklist by ID. If the blocklist is shared with other organizations or it has subscriptions, the operation will fail.\n If you want to force delete the blocklist, you can use the force query parameter, so the blocklists will be unshared / unsubscribed.", "operationId": "deleteBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Force delete the blocklist if it is shared or subscribed", "default": false, "title": "Force"}, "description": "Force delete the blocklist if it is shared or subscribed"}], "responses": {"204": {"description": "Successful Response"}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/upload": {"post": {"tags": ["Blocklists"], "summary": "Upload Blocklist Content", "description": "Upload a blocklist. The file must be in txt format with one IP per line. This operation will overwrite the existing blocklist content.", "operationId": "uploadBlocklistContent", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "expiration", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "description": "Blocklist expiration", "title": "Expiration"}, "description": "Blocklist expiration", "example": "2024-06-13T13:59:49.900204+00:00"}, {"name": "ignore_invalid_ips", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Ignore invalid IPs", "default": false, "title": "Ignore Invalid Ips"}, "description": "Ignore invalid IPs"}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_uploadBlocklistContent"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "400": {"description": "Invalid IP in blocklist file content"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/ips": {"post": {"tags": ["Blocklists"], "summary": "Add Ips To Blocklist", "description": "Add IPs to a blocklist. If an IP is already in the blocklist, its expiration will be updated with the new expiration.", "operationId": "addIpsToBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistAddIPsRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "403": {"description": "Blocklist is read-only"}, "404": {"description": "Blocklist not found"}, "412": {"description": "Payload too large for one operation, limit is 20000 IPs per request"}, "500": {"description": "Internal server error"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/ips/delete": {"post": {"tags": ["Blocklists"], "summary": "Delete Ips From Blocklist", "description": "Delete IPs from a blocklist", "operationId": "deleteIpsFromBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistDeleteIPsRequest"}}}}, "responses": {"204": {"description": "Successful Response"}, "403": {"description": "Blocklist is read-only"}, "404": {"description": "Blocklist not found"}, "500": {"description": "Internal server error"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/download": {"get": {"tags": ["Blocklists"], "summary": "Download Blocklist Content", "description": "Download blocklist content as a list of ips as plain text separated by new lines. The response will include the ETag header for cache control.\n If_Modified_Since and If_None_Match cache control headers are supported for conditional requests.", "operationId": "downloadBlocklistContent", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "if-modified-since", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "If_Modified_Since cache control header", "title": "If-Modified-Since"}, "description": "If_Modified_Since cache control header"}, {"name": "if-none-match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "If_None_Match cache control header", "title": "If-None-Match"}, "description": "If_None_Match cache control header"}], "responses": {"200": {"description": "Successful Response", "content": {"text/plain": {"schema": {"type": "string"}}}}, "404": {"description": "Blocklist not found"}, "204": {"description": "Blocklist is empty"}, "500": {"description": "Internal server error"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/subscribers": {"post": {"tags": ["Blocklists"], "summary": "Subscribe Blocklist", "description": "Subscribe to a blocklist with a remediation type. If the entity type is the full organization or a Tag, \n all the engines belonging to the organization or the Tag will be subscribed \n and new engines that will join the organization or the Tag will also be automatically subscribed.\n If the subscription has been done on an organization or Tag you cannot unsubscribe individual engines.\n In case of errors for some subscribers, the operation will still succeed for the entities that were successfully subscribed \n and you'll have the list of errors in the operation's result.\n This operation is submitted to quotas.", "operationId": "subscribeBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistSubscriptionRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistSubscriptionResponse"}}}}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["Blocklists"], "summary": "Get Blocklist Subscribers", "description": "Get blocklist subscribers within your organization.", "operationId": "getBlocklistSubscribers", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistSubscribersResponse"}}}}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/subscribers/{entity_id}": {"delete": {"tags": ["Blocklists"], "summary": "Unsubscribe Blocklist", "description": "Unsubscribe from a blocklist. You cannot unsubscribe individual engines if the subscription has been done on an organization or Tag.", "operationId": "unsubscribeBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "entity_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Entity Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/shares": {"post": {"tags": ["Blocklists"], "summary": "Share Blocklist", "description": "Share a blocklist with other organizations given their IDs. The blocklist must be owned by your organization.\n You can give read-only access or read-write access to the blocklist. Sharing a blocklist will not automatically subscribe the shared organizations to the blocklist.", "operationId": "shareBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistShareRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Blocklist not found"}, "409": {"description": "Blocklist is not private"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/shares/{unshare_organization_id}": {"delete": {"tags": ["Blocklists"], "summary": "Unshare Blocklist", "description": "Unshare a blocklist with other organizations. If the blocklist is subscribed by the organization, the operation will fail.\n Use force query parameter to unshare a blocklist even if subscriptions exists.", "operationId": "unshareBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "unshare_organization_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Unshare Organization Id"}}], "responses": {"204": {"description": "Successful Response"}, "404": {"description": "Blocklist not found"}, "409": {"description": "Blocklist is not private"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/integrations": {"post": {"tags": ["Integrations"], "summary": "Create Integration", "description": "Create an integration to a firewall or remediation component, owned by your organization. \n The name should be unique within the organization.\n This operation is submitted to quotas.", "operationId": "createIntegration", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationCreateRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationCreateResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["Integrations"], "summary": "Get Integrations", "description": "Get integrations owned by your organization", "operationId": "getIntegrations", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page"}, "description": "Page number"}, {"name": "size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size"}, "description": "Page size"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Page_IntegrationGetResponse_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/integrations/{integration_id}": {"get": {"tags": ["Integrations"], "summary": "Get Integration", "description": "Get an integration by ID", "operationId": "getIntegration", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Integration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationGetResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["Integrations"], "summary": "Update Integration", "description": "Update the integration details", "operationId": "updateIntegration", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Integration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationUpdateRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationUpdateResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["Integrations"], "summary": "Delete Integration", "description": "Delete the integration by ID", "operationId": "deleteIntegration", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Integration Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/integrations/{integration_id}/content": {"head": {"tags": ["Integrations"], "summary": "Head Integration Content", "description": "Check if the integration has content", "operationId": "headIntegrationContent", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Integration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Integration not found"}, "204": {"description": "Integration has no subscribed blocklists or no content available"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["Integrations"], "summary": "Get Integration Content", "description": "Get the ips associated to the integration in plain text format. The content can be paginated to accomodate limits in firewalls.", "operationId": "getIntegrationContent", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Integration Id"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "description": "Page number to return", "default": 1, "title": "Page"}, "description": "Page number to return"}, {"name": "page_size", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer", "minimum": 10000}, {"type": "null"}], "description": "Maximum number of items to return, 0 means no limit (default), should be greater than 10000", "title": "Page Size"}, "description": "Maximum number of items to return, 0 means no limit (default), should be greater than 10000"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Integration not found"}, "204": {"description": "Integration has no subscribed blocklists or no content available"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/integrations/{integration_id}/v1/decisions/stream": {"get": {"tags": ["Integrations"], "summary": "Get Integration Content Stream", "description": "Get the ips associated to the integration in a format compatible with a remediation component.\n As for the remediation components, you can fetch the full content with startup=true or only the changes since the last pull", "operationId": "getIntegrationContentStream", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Integration Id"}}, {"name": "startup", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Set to true if it's the first run to fetch all the content, otherwise only changes since the last pull.", "default": false, "title": "Startup"}, "description": "Set to true if it's the first run to fetch all the content, otherwise only changes since the last pull."}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Integration not found"}, "204": {"description": "Integration has no subscribed blocklists or no content available"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/info": {"get": {"tags": ["Info"], "summary": "Get Me Info", "description": "Get the current user and organization informations", "operationId": "getInfo", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}}, "components": {"schemas": {"ApiKeyCredentials": {"properties": {"api_key": {"type": "string", "title": "Api Key", "description": "API key for the integration"}}, "type": "object", "required": ["api_key"], "title": "ApiKeyCredentials"}, "BasicAuthCredentials": {"properties": {"username": {"type": "string", "title": "Username", "description": "Basic auth username for the integration"}, "password": {"type": "string", "title": "Password", "description": "Basic auth password for the integration"}}, "type": "object", "required": ["username", "password"], "title": "BasicAuthCredentials"}, "BlocklistAddIPsRequest": {"properties": {"ips": {"items": {"type": "string"}, "type": "array", "title": "Ips", "description": "List of IPs or networks"}, "expiration": {"type": "string", "format": "date-time", "title": "Expiration", "description": "Expiration date"}}, "additionalProperties": false, "type": "object", "required": ["ips"], "title": "BlocklistAddIPsRequest"}, "BlocklistContentStats": {"properties": {"total_seen": {"type": "integer", "title": "Total Seen", "default": 0}, "total_fire": {"type": "integer", "title": "Total Fire", "default": 0}, "total_seen_1m": {"type": "integer", "title": "Total Seen 1M", "default": 0}, "total_in_other_lists": {"type": "integer", "title": "Total In Other Lists", "default": 0}, "total_false_positive": {"type": "integer", "title": "Total False Positive", "default": 0}, "false_positive_removed_by_crowdsec": {"type": "integer", "title": "False Positive Removed By Crowdsec", "default": 0}, "most_present_behaviors": {"items": {"$ref": "#/components/schemas/CtiBehavior"}, "type": "array", "title": "Most Present Behaviors", "default": []}, "most_present_categories": {"items": {"$ref": "#/components/schemas/CtiCategory"}, "type": "array", "title": "Most Present Categories", "default": []}, "most_present_scenarios": {"items": {"$ref": "#/components/schemas/CtiScenario"}, "type": "array", "title": "Most Present Scenarios", "default": []}, "top_as": {"items": {"$ref": "#/components/schemas/CtiAs"}, "type": "array", "title": "Top As", "default": []}, "top_attacking_countries": {"items": {"$ref": "#/components/schemas/CtiCountry"}, "type": "array", "title": "Top Attacking Countries", "default": []}, "top_ips": {"items": {"$ref": "#/components/schemas/CtiIp"}, "type": "array", "title": "Top Ips", "default": []}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "additionalProperties": true, "type": "object", "title": "BlocklistContentStats"}, "BlocklistCreateRequest": {"properties": {"name": {"type": "string", "maxLength": 200, "minLength": 1, "title": "Name", "description": "Blocklist name, must be unique within the organization"}, "label": {"type": "string", "title": "Label", "description": "Blocklist human readable name (Default: name)"}, "description": {"type": "string", "minLength": 1, "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Useful references on the list's origins", "default": []}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Classification tags", "default": []}, "from_cti_query": {"type": "string", "title": "From Cti Query", "description": "CTI query (doc link available soon)"}, "since": {"type": "string", "title": "Since", "description": "Since duration for the CTI query (5m, 2h, 7d). Max is 30 days"}}, "additionalProperties": false, "type": "object", "required": ["name", "description"], "title": "BlocklistCreateRequest"}, "BlocklistCreateResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "Blocklist id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Blocklist creation date"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Blocklist update date"}, "name": {"type": "string", "title": "Name", "description": "Blocklist name, unique within the organization"}, "label": {"type": "string", "title": "Label", "description": "Blocklist human readable name"}, "description": {"type": "string", "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Blocklist references"}, "is_private": {"type": "boolean", "title": "Is Private", "description": "Private blocklist if True or public if False"}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Classification tags"}, "pricing_tier": {"allOf": [{"$ref": "#/components/schemas/PricingTiers"}], "description": "Pricing tier for Crowdsec blocklists only"}, "source": {"allOf": [{"$ref": "#/components/schemas/BlocklistSources"}], "description": "Blocklist source"}, "stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistStats"}], "description": "Blocklist stats"}, "from_cti_query": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "From Cti Query", "description": "CTI query from which the blocklist was created"}, "since": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Since", "description": "Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days"}, "shared_with": {"items": {"$ref": "#/components/schemas/Share"}, "type": "array", "title": "Shared With", "description": "List of organizations shared with"}, "organization_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Organization Id", "description": "Blocklists owner's organization id"}, "subscribers": {"items": {"$ref": "#/components/schemas/BlocklistSubscriberEntity"}, "type": "array", "title": "Subscribers", "description": "List of subscribers to the blocklist. Only subscribers belonging to your organization are returned"}}, "type": "object", "required": ["id", "created_at", "updated_at", "name", "label", "description", "references", "is_private", "tags", "pricing_tier", "source", "stats", "from_cti_query", "since", "shared_with", "organization_id", "subscribers"], "title": "BlocklistCreateResponse"}, "BlocklistDeleteIPsRequest": {"properties": {"ips": {"items": {"type": "string"}, "type": "array", "title": "Ips", "description": "List of IPs or networks"}}, "additionalProperties": false, "type": "object", "required": ["ips"], "title": "BlocklistDeleteIPsRequest"}, "BlocklistGetResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "Blocklist id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Blocklist creation date"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Blocklist update date"}, "name": {"type": "string", "title": "Name", "description": "Blocklist name, unique within the organization"}, "label": {"type": "string", "title": "Label", "description": "Blocklist human readable name"}, "description": {"type": "string", "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Blocklist references"}, "is_private": {"type": "boolean", "title": "Is Private", "description": "Private blocklist if True or public if False"}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Classification tags"}, "pricing_tier": {"allOf": [{"$ref": "#/components/schemas/PricingTiers"}], "description": "Pricing tier for Crowdsec blocklists only"}, "source": {"allOf": [{"$ref": "#/components/schemas/BlocklistSources"}], "description": "Blocklist source"}, "stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistStats"}], "description": "Blocklist stats"}, "from_cti_query": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "From Cti Query", "description": "CTI query from which the blocklist was created"}, "since": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Since", "description": "Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days"}, "shared_with": {"items": {"$ref": "#/components/schemas/Share"}, "type": "array", "title": "Shared With", "description": "List of organizations shared with"}, "organization_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Organization Id", "description": "Blocklists owner's organization id"}, "subscribers": {"items": {"$ref": "#/components/schemas/BlocklistSubscriberEntity"}, "type": "array", "title": "Subscribers", "description": "List of subscribers to the blocklist. Only subscribers belonging to your organization are returned"}}, "type": "object", "required": ["id", "created_at", "updated_at", "name", "label", "description", "references", "is_private", "tags", "pricing_tier", "source", "stats", "from_cti_query", "since", "shared_with", "organization_id", "subscribers"], "title": "BlocklistGetResponse"}, "BlocklistIncludeFilters": {"type": "string", "enum": ["public", "private", "shared", "all"], "title": "BlocklistIncludeFilters"}, "BlocklistResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "Blocklist id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Blocklist creation date"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Blocklist update date"}, "name": {"type": "string", "title": "Name", "description": "Blocklist name, unique within the organization"}, "label": {"type": "string", "title": "Label", "description": "Blocklist human readable name"}, "description": {"type": "string", "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Blocklist references"}, "is_private": {"type": "boolean", "title": "Is Private", "description": "Private blocklist if True or public if False"}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Classification tags"}, "pricing_tier": {"allOf": [{"$ref": "#/components/schemas/PricingTiers"}], "description": "Pricing tier for Crowdsec blocklists only"}, "source": {"allOf": [{"$ref": "#/components/schemas/BlocklistSources"}], "description": "Blocklist source"}, "stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistStats"}], "description": "Blocklist stats"}, "from_cti_query": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "From Cti Query", "description": "CTI query from which the blocklist was created"}, "since": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Since", "description": "Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days"}, "shared_with": {"items": {"$ref": "#/components/schemas/Share"}, "type": "array", "title": "Shared With", "description": "List of organizations shared with"}, "organization_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Organization Id", "description": "Blocklists owner's organization id"}, "subscribers": {"items": {"$ref": "#/components/schemas/BlocklistSubscriberEntity"}, "type": "array", "title": "Subscribers", "description": "List of subscribers to the blocklist. Only subscribers belonging to your organization are returned"}}, "type": "object", "required": ["id", "created_at", "updated_at", "name", "label", "description", "references", "is_private", "tags", "pricing_tier", "source", "stats", "from_cti_query", "since", "shared_with", "organization_id", "subscribers"], "title": "BlocklistResponse"}, "BlocklistShareRequest": {"properties": {"organizations": {"items": {"$ref": "#/components/schemas/Share"}, "type": "array", "title": "Organizations", "description": "List of organizations to share the blocklist"}}, "additionalProperties": false, "type": "object", "required": ["organizations"], "title": "BlocklistShareRequest"}, "BlocklistSources": {"type": "string", "enum": ["crowdsec", "third_party", "custom"], "title": "BlocklistSources"}, "BlocklistStats": {"properties": {"content_stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistContentStats"}], "default": {"total_seen": 0, "total_fire": 0, "total_seen_1m": 0, "total_in_other_lists": 0, "total_false_positive": 0, "false_positive_removed_by_crowdsec": 0, "most_present_behaviors": [], "most_present_categories": [], "most_present_scenarios": [], "top_as": [], "top_attacking_countries": [], "top_ips": []}}, "usage_stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistUsageStats"}], "default": {"engines_subscribed_directly": 0, "engines_subscribed_through_org": 0, "engines_subscribed_through_tag": 0, "total_subscribed_engines": 0}}, "addition_2days": {"type": "integer", "title": "Addition 2Days", "default": 0}, "addition_month": {"type": "integer", "title": "Addition Month", "default": 0}, "suppression_2days": {"type": "integer", "title": "Suppression 2Days", "default": 0}, "suppression_month": {"type": "integer", "title": "Suppression Month", "default": 0}, "change_2days_percentage": {"type": "number", "title": "Change 2Days Percentage", "default": 0.0}, "change_month_percentage": {"type": "number", "title": "Change Month Percentage", "default": 0.0}, "count": {"type": "integer", "title": "Count", "default": 0}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "additionalProperties": true, "type": "object", "title": "BlocklistStats"}, "BlocklistSubscriberEntity": {"properties": {"id": {"type": "string", "title": "Id", "description": "Subscriber entity id"}, "entity_type": {"$ref": "#/components/schemas/EntityType"}, "remediation": {"type": "string", "title": "Remediation", "description": "Remediation"}}, "type": "object", "required": ["id", "entity_type", "remediation"], "title": "BlocklistSubscriberEntity"}, "BlocklistSubscribersResponse": {"properties": {"subscribers": {"items": {"$ref": "#/components/schemas/BlocklistSubscriberEntity"}, "type": "array", "title": "Subscribers", "description": "List of subscribers"}}, "type": "object", "required": ["subscribers"], "title": "BlocklistSubscribersResponse"}, "BlocklistSubscription": {"properties": {"id": {"type": "string", "title": "Id"}, "name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}}, "type": "object", "required": ["id", "name", "label"], "title": "BlocklistSubscription"}, "BlocklistSubscriptionRequest": {"properties": {"ids": {"items": {"type": "string"}, "type": "array", "title": "Ids", "description": "List of subscriber entity id"}, "entity_type": {"$ref": "#/components/schemas/EntityType"}, "remediation": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Remediation", "description": "Remediation"}}, "additionalProperties": false, "type": "object", "required": ["entity_type"], "title": "BlocklistSubscriptionRequest"}, "BlocklistSubscriptionResponse": {"properties": {"updated": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Updated", "description": "List of updated blocklist ids", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"]}, "errors": {"anyOf": [{"items": {"additionalProperties": {"type": "string"}, "type": "object"}, "type": "array"}, {"type": "null"}], "title": "Errors", "description": "List of errors if any", "examples": [{"5f9d88b9e5c4f5b9a3d3e8b1": "error message"}]}}, "type": "object", "required": ["updated", "errors"], "title": "BlocklistSubscriptionResponse"}, "BlocklistUpdateRequest": {"properties": {"label": {"type": "string", "title": "Label", "description": "Blocklist human readable name"}, "description": {"type": "string", "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Blocklist references"}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Blocklist tags"}, "from_cti_query": {"type": "string", "title": "From Cti Query", "description": "CTI query (doc link available soon)"}, "since": {"type": "string", "title": "Since", "description": "Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days"}}, "additionalProperties": false, "type": "object", "title": "BlocklistUpdateRequest"}, "BlocklistUsageStats": {"properties": {"engines_subscribed_directly": {"type": "integer", "title": "Engines Subscribed Directly", "default": 0}, "engines_subscribed_through_org": {"type": "integer", "title": "Engines Subscribed Through Org", "default": 0}, "engines_subscribed_through_tag": {"type": "integer", "title": "Engines Subscribed Through Tag", "default": 0}, "total_subscribed_engines": {"type": "integer", "title": "Total Subscribed Engines", "default": 0}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "additionalProperties": true, "type": "object", "title": "BlocklistUsageStats"}, "Body_uploadBlocklistContent": {"properties": {"file": {"type": "string", "format": "binary", "title": "File", "description": "Blocklist file in txt format"}}, "type": "object", "required": ["file"], "title": "Body_uploadBlocklistContent"}, "CtiAs": {"properties": {"as_num": {"type": "string", "title": "As Num"}, "as_name": {"type": "string", "title": "As Name"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["as_num", "as_name", "total_ips"], "title": "CtiAs"}, "CtiBehavior": {"properties": {"name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}, "description": {"type": "string", "title": "Description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["name", "label", "description", "references", "total_ips"], "title": "CtiBehavior"}, "CtiCategory": {"properties": {"name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}, "description": {"type": "string", "title": "Description"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["name", "label", "description", "total_ips"], "title": "CtiCategory"}, "CtiCountry": {"properties": {"country_short": {"type": "string", "title": "Country Short"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["country_short", "total_ips"], "title": "CtiCountry"}, "CtiIp": {"properties": {"ip": {"type": "string", "title": "Ip"}, "total_signals_1m": {"type": "integer", "title": "Total Signals 1M"}, "reputation": {"type": "string", "title": "Reputation", "default": "unknown"}}, "additionalProperties": true, "type": "object", "required": ["ip", "total_signals_1m"], "title": "CtiIp"}, "CtiScenario": {"properties": {"name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}, "description": {"type": "string", "title": "Description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["name", "label", "description", "references", "total_ips"], "title": "CtiScenario"}, "EntityType": {"type": "string", "enum": ["org", "tag", "engine", "firewall_integration", "remediation_component_integration"], "title": "EntityType"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "IntegrationCreateRequest": {"properties": {"name": {"type": "string", "minLength": 1, "title": "Name", "description": "Name of the integration"}, "description": {"type": "string", "minLength": 1, "title": "Description", "description": "Description of the integration"}, "entity_type": {"allOf": [{"$ref": "#/components/schemas/IntegrationType"}], "description": "Type of the integration"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "Output format of the integration"}}, "additionalProperties": false, "type": "object", "required": ["name", "entity_type", "output_format"], "title": "IntegrationCreateRequest"}, "IntegrationCreateResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "ID of the integration"}, "name": {"type": "string", "title": "Name", "description": "Name of the integration. Should be unique within the organization"}, "organization_id": {"type": "string", "title": "Organization Id", "description": "ID of the owner organization"}, "description": {"type": "string", "title": "Description", "description": "Description of the integration"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Time the integration was created"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Last time the integration was updated"}, "entity_type": {"allOf": [{"$ref": "#/components/schemas/IntegrationType"}], "description": "Type of the integration"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "Output format of the integration"}, "last_pull": {"type": "string", "format": "date-time", "title": "Last Pull", "description": "Last time the integration pulled blocklists"}, "blocklists": {"items": {"$ref": "#/components/schemas/BlocklistSubscription"}, "type": "array", "title": "Blocklists", "description": "Blocklists that are subscribed by the integration"}, "endpoint": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Endpoint", "description": "Url that should be used by the firewall or the remediation component to fetch the integration's content"}, "stats": {"allOf": [{"$ref": "#/components/schemas/Stats"}], "description": "Stats of the integration", "default": {"count": 0}}, "credentials": {"anyOf": [{"$ref": "#/components/schemas/ApiKeyCredentials"}, {"$ref": "#/components/schemas/BasicAuthCredentials"}], "title": "Credentials", "description": "Credentials that were generated for the integration"}}, "type": "object", "required": ["id", "name", "organization_id", "created_at", "updated_at", "entity_type", "output_format", "blocklists", "endpoint", "credentials"], "title": "IntegrationCreateResponse"}, "IntegrationGetResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "ID of the integration"}, "name": {"type": "string", "title": "Name", "description": "Name of the integration. Should be unique within the organization"}, "organization_id": {"type": "string", "title": "Organization Id", "description": "ID of the owner organization"}, "description": {"type": "string", "title": "Description", "description": "Description of the integration"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Time the integration was created"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Last time the integration was updated"}, "entity_type": {"allOf": [{"$ref": "#/components/schemas/IntegrationType"}], "description": "Type of the integration"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "Output format of the integration"}, "last_pull": {"type": "string", "format": "date-time", "title": "Last Pull", "description": "Last time the integration pulled blocklists"}, "blocklists": {"items": {"$ref": "#/components/schemas/BlocklistSubscription"}, "type": "array", "title": "Blocklists", "description": "Blocklists that are subscribed by the integration"}, "endpoint": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Endpoint", "description": "Url that should be used by the firewall or the remediation component to fetch the integration's content"}, "stats": {"allOf": [{"$ref": "#/components/schemas/Stats"}], "description": "Stats of the integration", "default": {"count": 0}}}, "type": "object", "required": ["id", "name", "organization_id", "created_at", "updated_at", "entity_type", "output_format", "blocklists", "endpoint"], "title": "IntegrationGetResponse"}, "IntegrationType": {"type": "string", "enum": ["firewall_integration", "remediation_component_integration"], "title": "IntegrationType"}, "IntegrationUpdateRequest": {"properties": {"name": {"type": "string", "minLength": 1, "title": "Name", "description": "New name"}, "description": {"type": "string", "minLength": 1, "title": "Description", "description": "New description"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "New output format"}, "regenerate_credentials": {"type": "boolean", "title": "Regenerate Credentials", "description": "Regenerate credentials for the integration"}}, "additionalProperties": false, "type": "object", "title": "IntegrationUpdateRequest"}, "IntegrationUpdateResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "ID of the integration"}, "name": {"type": "string", "title": "Name", "description": "Name of the integration. Should be unique within the organization"}, "organization_id": {"type": "string", "title": "Organization Id", "description": "ID of the owner organization"}, "description": {"type": "string", "title": "Description", "description": "Description of the integration"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Time the integration was created"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Last time the integration was updated"}, "entity_type": {"allOf": [{"$ref": "#/components/schemas/IntegrationType"}], "description": "Type of the integration"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "Output format of the integration"}, "last_pull": {"type": "string", "format": "date-time", "title": "Last Pull", "description": "Last time the integration pulled blocklists"}, "blocklists": {"items": {"$ref": "#/components/schemas/BlocklistSubscription"}, "type": "array", "title": "Blocklists", "description": "Blocklists that are subscribed by the integration"}, "endpoint": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Endpoint", "description": "Url that should be used by the firewall or the remediation component to fetch the integration's content"}, "stats": {"allOf": [{"$ref": "#/components/schemas/Stats"}], "description": "Stats of the integration", "default": {"count": 0}}, "credentials": {"anyOf": [{"$ref": "#/components/schemas/ApiKeyCredentials"}, {"$ref": "#/components/schemas/BasicAuthCredentials"}, {"type": "null"}], "title": "Credentials", "description": "Credentials for the integration"}}, "type": "object", "required": ["id", "name", "organization_id", "created_at", "updated_at", "entity_type", "output_format", "blocklists", "endpoint"], "title": "IntegrationUpdateResponse"}, "Links": {"properties": {"first": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "First", "examples": ["/api/v1/users?limit=1&offset1"]}, "last": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Last", "examples": ["/api/v1/users?limit=1&offset1"]}, "self": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Self", "examples": ["/api/v1/users?limit=1&offset1"]}, "next": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Next", "examples": ["/api/v1/users?limit=1&offset1"]}, "prev": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Prev", "examples": ["/api/v1/users?limit=1&offset1"]}}, "type": "object", "required": ["first", "last", "self", "next", "prev"], "title": "Links"}, "OutputFormat": {"type": "string", "enum": ["plain_text", "f5", "remediation_component", "fortigate", "paloalto", "checkpoint", "cisco"], "title": "OutputFormat"}, "Page_BlocklistResponse_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BlocklistResponse"}, "type": "array", "title": "Items"}, "total": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Total"}, "page": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Page"}, "size": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Size"}, "pages": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Pages"}, "links": {"$ref": "#/components/schemas/Links"}}, "type": "object", "required": ["items", "total", "page", "size", "links"], "title": "Page[BlocklistResponse]"}, "Page_IntegrationGetResponse_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/IntegrationGetResponse"}, "type": "array", "title": "Items"}, "total": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Total"}, "page": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Page"}, "size": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Size"}, "pages": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Pages"}, "links": {"$ref": "#/components/schemas/Links"}}, "type": "object", "required": ["items", "total", "page", "size", "links"], "title": "Page[IntegrationGetResponse]"}, "Permission": {"type": "string", "enum": ["read", "write"], "title": "Permission"}, "PricingTiers": {"type": "string", "enum": ["free", "premium", "platinum"], "title": "PricingTiers"}, "Share": {"properties": {"organization_id": {"type": "string", "title": "Organization Id"}, "permission": {"$ref": "#/components/schemas/Permission"}}, "type": "object", "required": ["organization_id", "permission"], "title": "Share"}, "Stats": {"properties": {"count": {"type": "integer", "title": "Count", "description": "Number of total blocklists items the integration will pull"}}, "type": "object", "required": ["count"], "title": "Stats"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}, "securitySchemes": {"ApiKeyAuth": {"type": "apiKey", "in": "header", "name": "x-api-key", "description": "If integration key is provided, can also work to get integration content"}, "BasicAuth": {"type": "http", "scheme": "basic", "description": "Basic Auth for integration content endpoint only"}}}, "security": [{"ApiKeyAuth": []}, {"BasicAuth": []}], "servers": [{"url": "https://admin.api.crowdsec.net/v1/", "description": "Production server"}]} \ No newline at end of file +{"openapi": "3.1.0", "info": {"title": "Crowdsec API", "description": "This is the API to manage Crowdsec services", "contact": {"name": "CrowdSec", "url": "https://crowdsec.net/", "email": "info@crowdsec.net"}, "version": "1.17.0"}, "paths": {"/blocklists": {"post": {"tags": ["Blocklists"], "summary": "Create Blocklist", "description": "Create a new blocklist owned by your organization. The name must be unique within your organization. The list will only be visible to your organization and organizations you shared the blocklist with. This operation is submitted to quotas", "operationId": "createBlocklist", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistCreateRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistCreateResponse"}}}}, "409": {"description": "Blocklist already exists"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["Blocklists"], "summary": "Get Blocklists", "description": "Get multiple blocklists. Only blocklists owned by your organization, shared with your organization or public blocklists are returned. Filters and pagination are available as query parameters.", "operationId": "getBlocklists", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page"}, "description": "Page number"}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "description": "Page size", "default": 100, "title": "Page Size"}, "description": "Page size"}, {"name": "subscribed_only", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Fetch only blocklists subscribed by your organization, engines or tags", "default": false, "title": "Subscribed Only"}, "description": "Fetch only blocklists subscribed by your organization, engines or tags"}, {"name": "exclude_subscribed", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Exclude subscribed blocklists", "default": false, "title": "Exclude Subscribed"}, "description": "Exclude subscribed blocklists"}, {"name": "include_filter", "in": "query", "required": false, "schema": {"type": "array", "items": {"$ref": "#/components/schemas/BlocklistIncludeFilters"}, "description": "Include blocklists with the specified filters", "default": ["private", "shared"], "title": "Include Filter"}, "description": "Include blocklists with the specified filters"}, {"name": "size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size"}, "description": "Page size"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Page_BlocklistResponse_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}": {"get": {"tags": ["Blocklists"], "summary": "Get Blocklist", "description": "Get the details of a blocklist by ID. The content of the blocklist is not returned.", "operationId": "getBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistGetResponse"}}}}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["Blocklists"], "summary": "Update Blocklist", "description": "Update a blocklist's details by ID. It is not possible to update the blocklist content using this operation.", "operationId": "updateBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistUpdateRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistResponse"}}}}, "403": {"description": "Blocklist is read-only"}, "404": {"description": "Blocklist not found"}, "500": {"description": "Internal server error"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["Blocklists"], "summary": "Delete Blocklist", "description": "Delete a blocklist by ID. If the blocklist is shared with other organizations or it has subscriptions, the operation will fail. If you want to force delete the blocklist, you can use the force query parameter, so the blocklists will be unshared / unsubscribed.", "operationId": "deleteBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Force delete the blocklist if it is shared or subscribed", "default": false, "title": "Force"}, "description": "Force delete the blocklist if it is shared or subscribed"}], "responses": {"204": {"description": "Successful Response"}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/upload": {"post": {"tags": ["Blocklists"], "summary": "Upload Blocklist Content", "description": "Upload a blocklist. The file must be in txt format with one IP per line. This operation will overwrite the existing blocklist content.", "operationId": "uploadBlocklistContent", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "expiration", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "description": "Blocklist expiration", "title": "Expiration"}, "description": "Blocklist expiration", "example": "2024-06-18T14:56:06.864691+00:00"}, {"name": "ignore_invalid_ips", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Ignore invalid IPs", "default": false, "title": "Ignore Invalid Ips"}, "description": "Ignore invalid IPs"}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_uploadBlocklistContent"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "400": {"description": "Invalid IP in blocklist file content"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/ips": {"post": {"tags": ["Blocklists"], "summary": "Add Ips To Blocklist", "description": "Add IPs to a blocklist. If an IP is already in the blocklist, its expiration will be updated with the new expiration.", "operationId": "addIpsToBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistAddIPsRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "403": {"description": "Blocklist is read-only"}, "404": {"description": "Blocklist not found"}, "412": {"description": "Payload too large for one operation, limit is 20000 IPs per request"}, "500": {"description": "Internal server error"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/ips/delete": {"post": {"tags": ["Blocklists"], "summary": "Delete Ips From Blocklist", "description": "Delete IPs from a blocklist", "operationId": "deleteIpsFromBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistDeleteIPsRequest"}}}}, "responses": {"204": {"description": "Successful Response"}, "403": {"description": "Blocklist is read-only"}, "404": {"description": "Blocklist not found"}, "500": {"description": "Internal server error"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/download": {"get": {"tags": ["Blocklists"], "summary": "Download Blocklist Content", "description": "Download blocklist content as a list of ips as plain text separated by new lines. The response will include the ETag header for cache control. If_Modified_Since and If_None_Match cache control headers are supported for conditional requests.", "operationId": "downloadBlocklistContent", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "if-modified-since", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "If_Modified_Since cache control header", "title": "If-Modified-Since"}, "description": "If_Modified_Since cache control header"}, {"name": "if-none-match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "If_None_Match cache control header", "title": "If-None-Match"}, "description": "If_None_Match cache control header"}], "responses": {"200": {"description": "Successful Response", "content": {"text/plain": {"schema": {"type": "string"}}}}, "404": {"description": "Blocklist not found"}, "204": {"description": "Blocklist is empty"}, "500": {"description": "Internal server error"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/subscribers": {"post": {"tags": ["Blocklists"], "summary": "Subscribe Blocklist", "description": "Subscribe to a blocklist with a remediation type. If the entity type is the full organization or a Tag, all the engines belonging to the organization or the Tag will be subscribed and new engines that will join the organization or the Tag will also be automatically subscribed. If the subscription has been done on an organization or Tag you cannot unsubscribe individual engines. In case of errors for some subscribers, the operation will still succeed for the entities that were successfully subscribed and you'll have the list of errors in the operation's result. This operation is submitted to quotas.", "operationId": "subscribeBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistSubscriptionRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistSubscriptionResponse"}}}}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["Blocklists"], "summary": "Get Blocklist Subscribers", "description": "Get blocklist subscribers within your organization.", "operationId": "getBlocklistSubscribers", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistSubscribersResponse"}}}}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/subscribers/{entity_id}": {"delete": {"tags": ["Blocklists"], "summary": "Unsubscribe Blocklist", "description": "Unsubscribe from a blocklist. You cannot unsubscribe individual engines if the subscription has been done on an organization or Tag.", "operationId": "unsubscribeBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "entity_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Entity Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Blocklist not found"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/shares": {"post": {"tags": ["Blocklists"], "summary": "Share Blocklist", "description": "Share a blocklist with other organizations given their IDs. The blocklist must be owned by your organization. You can give read-only access or read-write access to the blocklist. Sharing a blocklist will not automatically subscribe the shared organizations to the blocklist.", "operationId": "shareBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BlocklistShareRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Blocklist not found"}, "409": {"description": "Blocklist is not private"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/blocklists/{blocklist_id}/shares/{unshare_organization_id}": {"delete": {"tags": ["Blocklists"], "summary": "Unshare Blocklist", "description": "Unshare a blocklist with other organizations. If the blocklist is subscribed by the organization, the operation will fail.Use force query parameter to unshare a blocklist even if subscriptions exists.", "operationId": "unshareBlocklist", "parameters": [{"name": "blocklist_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Blocklist Id"}}, {"name": "unshare_organization_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Unshare Organization Id"}}], "responses": {"204": {"description": "Successful Response"}, "404": {"description": "Blocklist not found"}, "409": {"description": "Blocklist is not private"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/integrations": {"post": {"tags": ["Integrations"], "summary": "Create Integration", "description": "Create an integration to a firewall or remediation component, owned by your organization. The name should be unique within the organization. This operation is submitted to quotas.", "operationId": "createIntegration", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationCreateRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationCreateResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["Integrations"], "summary": "Get Integrations", "description": "Get integrations owned by your organization", "operationId": "getIntegrations", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page"}, "description": "Page number"}, {"name": "size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size"}, "description": "Page size"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Page_IntegrationGetResponse_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/integrations/{integration_id}": {"get": {"tags": ["Integrations"], "summary": "Get Integration", "description": "Get an integration by ID", "operationId": "getIntegration", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Integration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationGetResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["Integrations"], "summary": "Update Integration", "description": "Update the integration details", "operationId": "updateIntegration", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Integration Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationUpdateRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationUpdateResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["Integrations"], "summary": "Delete Integration", "description": "Delete the integration by ID", "operationId": "deleteIntegration", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Integration Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/integrations/{integration_id}/content": {"head": {"tags": ["Integrations"], "summary": "Head Integration Content", "description": "Check if the integration has content", "operationId": "headIntegrationContent", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Integration Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Integration not found"}, "204": {"description": "Integration has no subscribed blocklists or no content available"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["Integrations"], "summary": "Get Integration Content", "description": "Get the ips associated to the integration in plain text format. The content can be paginated to accomodate limits in firewalls.", "operationId": "getIntegrationContent", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Integration Id"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "description": "Page number to return", "default": 1, "title": "Page"}, "description": "Page number to return"}, {"name": "page_size", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer", "minimum": 10000}, {"type": "null"}], "description": "Maximum number of items to return, 0 means no limit (default), should be greater than 10000", "title": "Page Size"}, "description": "Maximum number of items to return, 0 means no limit (default), should be greater than 10000"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Integration not found"}, "204": {"description": "Integration has no subscribed blocklists or no content available"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/integrations/{integration_id}/v1/decisions/stream": {"get": {"tags": ["Integrations"], "summary": "Get Integration Content Stream", "description": "Get the ips associated to the integration in a format compatible with a remediation component. As for the remediation components, you can fetch the full content with startup=true or only the changes since the last pull", "operationId": "getIntegrationContentStream", "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string", "format": "ObjectId", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"], "title": "Integration Id"}}, {"name": "startup", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Set to true if it's the first run to fetch all the content, otherwise only changes since the last pull.", "default": false, "title": "Startup"}, "description": "Set to true if it's the first run to fetch all the content, otherwise only changes since the last pull."}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "404": {"description": "Integration not found"}, "204": {"description": "Integration has no subscribed blocklists or no content available"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/info": {"get": {"tags": ["Info"], "summary": "Get Me Info", "description": "Get the current user and organization informations", "operationId": "getInfo", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}}, "components": {"schemas": {"ApiKeyCredentials": {"properties": {"api_key": {"type": "string", "title": "Api Key", "description": "API key for the integration"}}, "type": "object", "required": ["api_key"], "title": "ApiKeyCredentials"}, "BasicAuthCredentials": {"properties": {"username": {"type": "string", "title": "Username", "description": "Basic auth username for the integration"}, "password": {"type": "string", "title": "Password", "description": "Basic auth password for the integration"}}, "type": "object", "required": ["username", "password"], "title": "BasicAuthCredentials"}, "BlocklistAddIPsRequest": {"properties": {"ips": {"items": {"type": "string"}, "type": "array", "title": "Ips", "description": "List of IPs or networks"}, "expiration": {"type": "string", "format": "date-time", "title": "Expiration", "description": "Expiration date"}}, "additionalProperties": false, "type": "object", "required": ["ips"], "title": "BlocklistAddIPsRequest"}, "BlocklistContentStats": {"properties": {"total_seen": {"type": "integer", "title": "Total Seen", "default": 0}, "total_fire": {"type": "integer", "title": "Total Fire", "default": 0}, "total_seen_1m": {"type": "integer", "title": "Total Seen 1M", "default": 0}, "total_in_other_lists": {"type": "integer", "title": "Total In Other Lists", "default": 0}, "total_false_positive": {"type": "integer", "title": "Total False Positive", "default": 0}, "false_positive_removed_by_crowdsec": {"type": "integer", "title": "False Positive Removed By Crowdsec", "default": 0}, "most_present_behaviors": {"items": {"$ref": "#/components/schemas/CtiBehavior"}, "type": "array", "title": "Most Present Behaviors", "default": []}, "most_present_categories": {"items": {"$ref": "#/components/schemas/CtiCategory"}, "type": "array", "title": "Most Present Categories", "default": []}, "most_present_scenarios": {"items": {"$ref": "#/components/schemas/CtiScenario"}, "type": "array", "title": "Most Present Scenarios", "default": []}, "top_as": {"items": {"$ref": "#/components/schemas/CtiAs"}, "type": "array", "title": "Top As", "default": []}, "top_attacking_countries": {"items": {"$ref": "#/components/schemas/CtiCountry"}, "type": "array", "title": "Top Attacking Countries", "default": []}, "top_ips": {"items": {"$ref": "#/components/schemas/CtiIp"}, "type": "array", "title": "Top Ips", "default": []}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "additionalProperties": true, "type": "object", "title": "BlocklistContentStats"}, "BlocklistCreateRequest": {"properties": {"name": {"type": "string", "maxLength": 200, "minLength": 1, "title": "Name", "description": "Blocklist name, must be unique within the organization"}, "label": {"type": "string", "title": "Label", "description": "Blocklist human readable name (Default: name)"}, "description": {"type": "string", "minLength": 1, "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Useful references on the list's origins", "default": []}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Classification tags", "default": []}, "from_cti_query": {"type": "string", "title": "From Cti Query", "description": "CTI query (doc link available soon)"}, "since": {"type": "string", "title": "Since", "description": "Since duration for the CTI query (5m, 2h, 7d). Max is 30 days"}}, "additionalProperties": false, "type": "object", "required": ["name", "description"], "title": "BlocklistCreateRequest"}, "BlocklistCreateResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "Blocklist id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Blocklist creation date"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Blocklist update date"}, "name": {"type": "string", "title": "Name", "description": "Blocklist name, unique within the organization"}, "label": {"type": "string", "title": "Label", "description": "Blocklist human readable name"}, "description": {"type": "string", "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Blocklist references"}, "is_private": {"type": "boolean", "title": "Is Private", "description": "Private blocklist if True or public if False"}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Classification tags"}, "pricing_tier": {"allOf": [{"$ref": "#/components/schemas/PricingTiers"}], "description": "Pricing tier for Crowdsec blocklists only"}, "source": {"allOf": [{"$ref": "#/components/schemas/BlocklistSources"}], "description": "Blocklist source"}, "stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistStats"}], "description": "Blocklist stats"}, "from_cti_query": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "From Cti Query", "description": "CTI query from which the blocklist was created"}, "since": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Since", "description": "Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days"}, "shared_with": {"items": {"$ref": "#/components/schemas/Share"}, "type": "array", "title": "Shared With", "description": "List of organizations shared with"}, "organization_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Organization Id", "description": "Blocklists owner's organization id"}, "subscribers": {"items": {"$ref": "#/components/schemas/BlocklistSubscriberEntity"}, "type": "array", "title": "Subscribers", "description": "List of subscribers to the blocklist. Only subscribers belonging to your organization are returned"}}, "type": "object", "required": ["id", "created_at", "updated_at", "name", "label", "description", "references", "is_private", "tags", "pricing_tier", "source", "stats", "from_cti_query", "since", "shared_with", "organization_id", "subscribers"], "title": "BlocklistCreateResponse"}, "BlocklistDeleteIPsRequest": {"properties": {"ips": {"items": {"type": "string"}, "type": "array", "title": "Ips", "description": "List of IPs or networks"}}, "additionalProperties": false, "type": "object", "required": ["ips"], "title": "BlocklistDeleteIPsRequest"}, "BlocklistGetResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "Blocklist id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Blocklist creation date"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Blocklist update date"}, "name": {"type": "string", "title": "Name", "description": "Blocklist name, unique within the organization"}, "label": {"type": "string", "title": "Label", "description": "Blocklist human readable name"}, "description": {"type": "string", "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Blocklist references"}, "is_private": {"type": "boolean", "title": "Is Private", "description": "Private blocklist if True or public if False"}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Classification tags"}, "pricing_tier": {"allOf": [{"$ref": "#/components/schemas/PricingTiers"}], "description": "Pricing tier for Crowdsec blocklists only"}, "source": {"allOf": [{"$ref": "#/components/schemas/BlocklistSources"}], "description": "Blocklist source"}, "stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistStats"}], "description": "Blocklist stats"}, "from_cti_query": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "From Cti Query", "description": "CTI query from which the blocklist was created"}, "since": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Since", "description": "Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days"}, "shared_with": {"items": {"$ref": "#/components/schemas/Share"}, "type": "array", "title": "Shared With", "description": "List of organizations shared with"}, "organization_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Organization Id", "description": "Blocklists owner's organization id"}, "subscribers": {"items": {"$ref": "#/components/schemas/BlocklistSubscriberEntity"}, "type": "array", "title": "Subscribers", "description": "List of subscribers to the blocklist. Only subscribers belonging to your organization are returned"}}, "type": "object", "required": ["id", "created_at", "updated_at", "name", "label", "description", "references", "is_private", "tags", "pricing_tier", "source", "stats", "from_cti_query", "since", "shared_with", "organization_id", "subscribers"], "title": "BlocklistGetResponse"}, "BlocklistIncludeFilters": {"type": "string", "enum": ["public", "private", "shared", "all"], "title": "BlocklistIncludeFilters"}, "BlocklistResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "Blocklist id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Blocklist creation date"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Blocklist update date"}, "name": {"type": "string", "title": "Name", "description": "Blocklist name, unique within the organization"}, "label": {"type": "string", "title": "Label", "description": "Blocklist human readable name"}, "description": {"type": "string", "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Blocklist references"}, "is_private": {"type": "boolean", "title": "Is Private", "description": "Private blocklist if True or public if False"}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Classification tags"}, "pricing_tier": {"allOf": [{"$ref": "#/components/schemas/PricingTiers"}], "description": "Pricing tier for Crowdsec blocklists only"}, "source": {"allOf": [{"$ref": "#/components/schemas/BlocklistSources"}], "description": "Blocklist source"}, "stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistStats"}], "description": "Blocklist stats"}, "from_cti_query": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "From Cti Query", "description": "CTI query from which the blocklist was created"}, "since": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Since", "description": "Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days"}, "shared_with": {"items": {"$ref": "#/components/schemas/Share"}, "type": "array", "title": "Shared With", "description": "List of organizations shared with"}, "organization_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Organization Id", "description": "Blocklists owner's organization id"}, "subscribers": {"items": {"$ref": "#/components/schemas/BlocklistSubscriberEntity"}, "type": "array", "title": "Subscribers", "description": "List of subscribers to the blocklist. Only subscribers belonging to your organization are returned"}}, "type": "object", "required": ["id", "created_at", "updated_at", "name", "label", "description", "references", "is_private", "tags", "pricing_tier", "source", "stats", "from_cti_query", "since", "shared_with", "organization_id", "subscribers"], "title": "BlocklistResponse"}, "BlocklistShareRequest": {"properties": {"organizations": {"items": {"$ref": "#/components/schemas/Share"}, "type": "array", "title": "Organizations", "description": "List of organizations to share the blocklist"}}, "additionalProperties": false, "type": "object", "required": ["organizations"], "title": "BlocklistShareRequest"}, "BlocklistSources": {"type": "string", "enum": ["crowdsec", "third_party", "custom"], "title": "BlocklistSources"}, "BlocklistStats": {"properties": {"content_stats": {"allOf": [{"$ref": "#/components/schemas/BlocklistContentStats"}], "default": {"total_seen": 0, "total_fire": 0, "total_seen_1m": 0, "total_in_other_lists": 0, "total_false_positive": 0, "false_positive_removed_by_crowdsec": 0, "most_present_behaviors": [], "most_present_categories": [], "most_present_scenarios": [], "top_as": [], "top_attacking_countries": [], "top_ips": []}}, "usage_stats": {"anyOf": [{"$ref": "#/components/schemas/BlocklistUsageStats"}, {"type": "null"}], "default": {"engines_subscribed_directly": 0, "engines_subscribed_through_org": 0, "engines_subscribed_through_tag": 0, "total_subscribed_engines": 0}}, "addition_2days": {"type": "integer", "title": "Addition 2Days", "default": 0}, "addition_month": {"type": "integer", "title": "Addition Month", "default": 0}, "suppression_2days": {"type": "integer", "title": "Suppression 2Days", "default": 0}, "suppression_month": {"type": "integer", "title": "Suppression Month", "default": 0}, "change_2days_percentage": {"type": "number", "title": "Change 2Days Percentage", "default": 0.0}, "change_month_percentage": {"type": "number", "title": "Change Month Percentage", "default": 0.0}, "count": {"type": "integer", "title": "Count", "default": 0}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "additionalProperties": true, "type": "object", "title": "BlocklistStats"}, "BlocklistSubscriberEntity": {"properties": {"id": {"type": "string", "title": "Id", "description": "Subscriber entity id"}, "entity_type": {"$ref": "#/components/schemas/EntityType"}, "remediation": {"type": "string", "title": "Remediation", "description": "Remediation"}}, "type": "object", "required": ["id", "entity_type", "remediation"], "title": "BlocklistSubscriberEntity"}, "BlocklistSubscribersResponse": {"properties": {"subscribers": {"items": {"$ref": "#/components/schemas/BlocklistSubscriberEntity"}, "type": "array", "title": "Subscribers", "description": "List of subscribers"}}, "type": "object", "required": ["subscribers"], "title": "BlocklistSubscribersResponse"}, "BlocklistSubscription": {"properties": {"id": {"type": "string", "title": "Id"}, "name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}}, "type": "object", "required": ["id", "name", "label"], "title": "BlocklistSubscription"}, "BlocklistSubscriptionRequest": {"properties": {"ids": {"items": {"type": "string"}, "type": "array", "title": "Ids", "description": "List of subscriber entity id"}, "entity_type": {"$ref": "#/components/schemas/EntityType"}, "remediation": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Remediation", "description": "Remediation"}}, "additionalProperties": false, "type": "object", "required": ["entity_type"], "title": "BlocklistSubscriptionRequest"}, "BlocklistSubscriptionResponse": {"properties": {"updated": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Updated", "description": "List of updated blocklist ids", "examples": ["5f9d88b9e5c4f5b9a3d3e8b1"]}, "errors": {"anyOf": [{"items": {"additionalProperties": {"type": "string"}, "type": "object"}, "type": "array"}, {"type": "null"}], "title": "Errors", "description": "List of errors if any", "examples": [{"5f9d88b9e5c4f5b9a3d3e8b1": "error message"}]}}, "type": "object", "required": ["updated", "errors"], "title": "BlocklistSubscriptionResponse"}, "BlocklistUpdateRequest": {"properties": {"label": {"type": "string", "title": "Label", "description": "Blocklist human readable name"}, "description": {"type": "string", "title": "Description", "description": "Blocklist description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References", "description": "Blocklist references"}, "tags": {"items": {"type": "string"}, "type": "array", "title": "Tags", "description": "Blocklist tags"}, "from_cti_query": {"type": "string", "title": "From Cti Query", "description": "CTI query (doc link available soon)"}, "since": {"type": "string", "title": "Since", "description": "Since duration for the CTI query (eg. 5m, 2h, 7d). Max is 30 days"}}, "additionalProperties": false, "type": "object", "title": "BlocklistUpdateRequest"}, "BlocklistUsageStats": {"properties": {"engines_subscribed_directly": {"type": "integer", "title": "Engines Subscribed Directly", "default": 0}, "engines_subscribed_through_org": {"type": "integer", "title": "Engines Subscribed Through Org", "default": 0}, "engines_subscribed_through_tag": {"type": "integer", "title": "Engines Subscribed Through Tag", "default": 0}, "total_subscribed_engines": {"type": "integer", "title": "Total Subscribed Engines", "default": 0}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "additionalProperties": true, "type": "object", "title": "BlocklistUsageStats"}, "Body_uploadBlocklistContent": {"properties": {"file": {"type": "string", "format": "binary", "title": "File", "description": "Blocklist file in txt format"}}, "type": "object", "required": ["file"], "title": "Body_uploadBlocklistContent"}, "CtiAs": {"properties": {"as_num": {"type": "string", "title": "As Num"}, "as_name": {"type": "string", "title": "As Name"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["as_num", "as_name", "total_ips"], "title": "CtiAs"}, "CtiBehavior": {"properties": {"name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}, "description": {"type": "string", "title": "Description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["name", "label", "description", "references", "total_ips"], "title": "CtiBehavior"}, "CtiCategory": {"properties": {"name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}, "description": {"type": "string", "title": "Description"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["name", "label", "description", "total_ips"], "title": "CtiCategory"}, "CtiCountry": {"properties": {"country_short": {"type": "string", "title": "Country Short"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["country_short", "total_ips"], "title": "CtiCountry"}, "CtiIp": {"properties": {"ip": {"type": "string", "title": "Ip"}, "total_signals_1m": {"type": "integer", "title": "Total Signals 1M"}, "reputation": {"type": "string", "title": "Reputation", "default": "unknown"}}, "additionalProperties": true, "type": "object", "required": ["ip", "total_signals_1m"], "title": "CtiIp"}, "CtiScenario": {"properties": {"name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}, "description": {"type": "string", "title": "Description"}, "references": {"items": {"type": "string"}, "type": "array", "title": "References"}, "total_ips": {"type": "integer", "title": "Total Ips"}}, "additionalProperties": true, "type": "object", "required": ["name", "label", "description", "references", "total_ips"], "title": "CtiScenario"}, "EntityType": {"type": "string", "enum": ["org", "tag", "engine", "firewall_integration", "remediation_component_integration"], "title": "EntityType"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "IntegrationCreateRequest": {"properties": {"name": {"type": "string", "minLength": 1, "title": "Name", "description": "Name of the integration"}, "description": {"type": "string", "minLength": 1, "title": "Description", "description": "Description of the integration"}, "entity_type": {"allOf": [{"$ref": "#/components/schemas/IntegrationType"}], "description": "Type of the integration"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "Output format of the integration"}}, "additionalProperties": false, "type": "object", "required": ["name", "entity_type", "output_format"], "title": "IntegrationCreateRequest"}, "IntegrationCreateResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "ID of the integration"}, "name": {"type": "string", "title": "Name", "description": "Name of the integration. Should be unique within the organization"}, "organization_id": {"type": "string", "title": "Organization Id", "description": "ID of the owner organization"}, "description": {"type": "string", "title": "Description", "description": "Description of the integration"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Time the integration was created"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Last time the integration was updated"}, "entity_type": {"allOf": [{"$ref": "#/components/schemas/IntegrationType"}], "description": "Type of the integration"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "Output format of the integration"}, "last_pull": {"type": "string", "format": "date-time", "title": "Last Pull", "description": "Last time the integration pulled blocklists"}, "blocklists": {"items": {"$ref": "#/components/schemas/BlocklistSubscription"}, "type": "array", "title": "Blocklists", "description": "Blocklists that are subscribed by the integration"}, "endpoint": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Endpoint", "description": "Url that should be used by the firewall or the remediation component to fetch the integration's content"}, "stats": {"allOf": [{"$ref": "#/components/schemas/Stats"}], "description": "Stats of the integration", "default": {"count": 0}}, "credentials": {"anyOf": [{"$ref": "#/components/schemas/ApiKeyCredentials"}, {"$ref": "#/components/schemas/BasicAuthCredentials"}], "title": "Credentials", "description": "Credentials that were generated for the integration"}}, "type": "object", "required": ["id", "name", "organization_id", "created_at", "updated_at", "entity_type", "output_format", "blocklists", "endpoint", "credentials"], "title": "IntegrationCreateResponse"}, "IntegrationGetResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "ID of the integration"}, "name": {"type": "string", "title": "Name", "description": "Name of the integration. Should be unique within the organization"}, "organization_id": {"type": "string", "title": "Organization Id", "description": "ID of the owner organization"}, "description": {"type": "string", "title": "Description", "description": "Description of the integration"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Time the integration was created"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Last time the integration was updated"}, "entity_type": {"allOf": [{"$ref": "#/components/schemas/IntegrationType"}], "description": "Type of the integration"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "Output format of the integration"}, "last_pull": {"type": "string", "format": "date-time", "title": "Last Pull", "description": "Last time the integration pulled blocklists"}, "blocklists": {"items": {"$ref": "#/components/schemas/BlocklistSubscription"}, "type": "array", "title": "Blocklists", "description": "Blocklists that are subscribed by the integration"}, "endpoint": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Endpoint", "description": "Url that should be used by the firewall or the remediation component to fetch the integration's content"}, "stats": {"allOf": [{"$ref": "#/components/schemas/Stats"}], "description": "Stats of the integration", "default": {"count": 0}}}, "type": "object", "required": ["id", "name", "organization_id", "created_at", "updated_at", "entity_type", "output_format", "blocklists", "endpoint"], "title": "IntegrationGetResponse"}, "IntegrationType": {"type": "string", "enum": ["firewall_integration", "remediation_component_integration"], "title": "IntegrationType"}, "IntegrationUpdateRequest": {"properties": {"name": {"type": "string", "minLength": 1, "title": "Name", "description": "New name"}, "description": {"type": "string", "minLength": 1, "title": "Description", "description": "New description"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "New output format"}, "regenerate_credentials": {"type": "boolean", "title": "Regenerate Credentials", "description": "Regenerate credentials for the integration"}}, "additionalProperties": false, "type": "object", "title": "IntegrationUpdateRequest"}, "IntegrationUpdateResponse": {"properties": {"id": {"type": "string", "title": "Id", "description": "ID of the integration"}, "name": {"type": "string", "title": "Name", "description": "Name of the integration. Should be unique within the organization"}, "organization_id": {"type": "string", "title": "Organization Id", "description": "ID of the owner organization"}, "description": {"type": "string", "title": "Description", "description": "Description of the integration"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At", "description": "Time the integration was created"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At", "description": "Last time the integration was updated"}, "entity_type": {"allOf": [{"$ref": "#/components/schemas/IntegrationType"}], "description": "Type of the integration"}, "output_format": {"allOf": [{"$ref": "#/components/schemas/OutputFormat"}], "description": "Output format of the integration"}, "last_pull": {"type": "string", "format": "date-time", "title": "Last Pull", "description": "Last time the integration pulled blocklists"}, "blocklists": {"items": {"$ref": "#/components/schemas/BlocklistSubscription"}, "type": "array", "title": "Blocklists", "description": "Blocklists that are subscribed by the integration"}, "endpoint": {"type": "string", "maxLength": 2083, "minLength": 1, "format": "uri", "title": "Endpoint", "description": "Url that should be used by the firewall or the remediation component to fetch the integration's content"}, "stats": {"allOf": [{"$ref": "#/components/schemas/Stats"}], "description": "Stats of the integration", "default": {"count": 0}}, "credentials": {"anyOf": [{"$ref": "#/components/schemas/ApiKeyCredentials"}, {"$ref": "#/components/schemas/BasicAuthCredentials"}, {"type": "null"}], "title": "Credentials", "description": "Credentials for the integration"}}, "type": "object", "required": ["id", "name", "organization_id", "created_at", "updated_at", "entity_type", "output_format", "blocklists", "endpoint"], "title": "IntegrationUpdateResponse"}, "Links": {"properties": {"first": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "First", "examples": ["/api/v1/users?limit=1&offset1"]}, "last": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Last", "examples": ["/api/v1/users?limit=1&offset1"]}, "self": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Self", "examples": ["/api/v1/users?limit=1&offset1"]}, "next": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Next", "examples": ["/api/v1/users?limit=1&offset1"]}, "prev": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Prev", "examples": ["/api/v1/users?limit=1&offset1"]}}, "type": "object", "required": ["first", "last", "self", "next", "prev"], "title": "Links"}, "OutputFormat": {"type": "string", "enum": ["plain_text", "f5", "remediation_component", "fortigate", "paloalto", "checkpoint", "cisco"], "title": "OutputFormat"}, "Page_BlocklistResponse_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BlocklistResponse"}, "type": "array", "title": "Items"}, "total": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Total"}, "page": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Page"}, "size": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Size"}, "pages": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Pages"}, "links": {"$ref": "#/components/schemas/Links"}}, "type": "object", "required": ["items", "total", "page", "size", "links"], "title": "Page[BlocklistResponse]"}, "Page_IntegrationGetResponse_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/IntegrationGetResponse"}, "type": "array", "title": "Items"}, "total": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Total"}, "page": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Page"}, "size": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Size"}, "pages": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Pages"}, "links": {"$ref": "#/components/schemas/Links"}}, "type": "object", "required": ["items", "total", "page", "size", "links"], "title": "Page[IntegrationGetResponse]"}, "Permission": {"type": "string", "enum": ["read", "write"], "title": "Permission"}, "PricingTiers": {"type": "string", "enum": ["free", "premium", "platinum"], "title": "PricingTiers"}, "Share": {"properties": {"organization_id": {"type": "string", "title": "Organization Id"}, "permission": {"$ref": "#/components/schemas/Permission"}}, "type": "object", "required": ["organization_id", "permission"], "title": "Share"}, "Stats": {"properties": {"count": {"type": "integer", "title": "Count", "description": "Number of total blocklists items the integration will pull"}}, "type": "object", "required": ["count"], "title": "Stats"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}, "securitySchemes": {"ApiKeyAuth": {"type": "apiKey", "in": "header", "name": "x-api-key", "description": "If integration key is provided, can also work to get integration content"}, "BasicAuth": {"type": "http", "scheme": "basic", "description": "Basic Auth for integration content endpoint only"}}}, "security": [{"ApiKeyAuth": []}, {"BasicAuth": []}], "servers": [{"url": "https://admin.api.crowdsec.net/v1/", "description": "Production server"}]} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ce124d6..a680513 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "crowdsec_service_api" -version = "1.16.0" +version = "1.17.0" license = { text = "MIT" } authors = [ { name="crowdsec", email="info@crowdsec.net" }