Skip to content

Commit

Permalink
Merge pull request #1184 from SEKOIA-IO/fix/SophosXDRRateLimit
Browse files Browse the repository at this point in the history
Sophos: add ratelimit per day
  • Loading branch information
squioc authored Nov 20, 2024
2 parents 0062bff + 6e889d6 commit db0001e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions Sophos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## 2024-11-20 - 1.17.2

### Fixed

- Add the ratelimit per day
- Increase the frequency to 5 minutes

## 2024-10-08 - 1.17.1

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions Sophos/connector_sophos_xdr_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"frequency": {
"type": "integer",
"description": "Batch frequency in seconds",
"default": 60
"default": 300
},
"chunk_size": {
"type": "integer",
Expand All @@ -33,4 +33,4 @@
"type": "object"
},
"uuid": "d7052d5e-0ccc-403f-928a-f63cb71b2e0c"
}
}
2 changes: 1 addition & 1 deletion Sophos/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"name": "Sophos",
"uuid": "0de5216e-19b0-4ad3-9b91-a547cfaf52ca",
"slug": "sophos",
"version": "1.17.1",
"version": "1.17.2",
"categories": [
"Endpoint"
]
Expand Down
4 changes: 4 additions & 0 deletions Sophos/sophos_module/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ def __init__(
ratelimit_per_second: int = 10,
ratelimit_per_minute: int = 100,
ratelimit_per_hour: int = 1000,
ratelimit_per_day: int = 200000,
):
super().__init__()
self.auth = auth
adapter = LimiterAdapter(
per_second=ratelimit_per_second,
per_minute=ratelimit_per_minute,
per_hour=ratelimit_per_hour,
per_day=ratelimit_per_day,
max_retries=Retry(total=nb_retries, backoff_factor=1, status_forcelist=[429, 500, 502, 503, 504]),
)
self.mount("http://", adapter)
Expand All @@ -39,13 +41,15 @@ def __init__(
ratelimit_per_second: int = 10,
ratelimit_per_minute: int = 100,
ratelimit_per_hour: int = 1000,
ratelimit_per_day: int = 200000,
) -> None:
super().__init__(
auth=auth,
nb_retries=nb_retries,
ratelimit_per_second=ratelimit_per_second,
ratelimit_per_minute=ratelimit_per_minute,
ratelimit_per_hour=ratelimit_per_hour,
ratelimit_per_day=ratelimit_per_day,
)

def list_siem_events(self, parameters: dict[str, Any] | None = None) -> requests.Response:
Expand Down
4 changes: 2 additions & 2 deletions Sophos/trigger_sophos_xdr_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"frequency": {
"type": "integer",
"description": "Batch frequency in seconds",
"default": 60
"default": 300
},
"chunk_size": {
"type": "integer",
Expand All @@ -34,4 +34,4 @@
},
"results": {},
"uuid": "d7052d5e-0ccc-403f-928a-f63cb71b2e0c"
}
}

0 comments on commit db0001e

Please sign in to comment.