elastic / integrations

Elastic Integrations
https://www.elastic.co/integrations
Other
30 stars 447 forks source link

cisco_duo: Make retry options configurable in CEL-based datastreams #11822

Closed kcreddy closed 6 hours ago

kcreddy commented 9 hours ago

Proposed commit message

Cisco Duo Admin API has very low API request limit (Ex: not more than 1 request per minute for Authentication logs). Reaching this limit would lead to 42901 from the API. The response also doesn't include a Retry-After header, which leads to a default back-off retry attempts. This subsequently leads to further 42901 as the limit is already reached.

This PR allows users to set optional retry configuration allowed by CEL input for CEL-based data-streams. When number of retries are reduces, this helps in reducing the number retry requests being made when already reached 429.

Reference: https://help.duo.com/s/article/1338?language=en_US https://duo.com/docs/adminapi#authentication-logs https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-cel.html#_resource_retry_max_attempts

[!NOTE] This only reduces 42901 Too Many Requests from the retry attempts. The users have to tune Interval and Rate limit to avoid the 42901 from the initial request (non-retry).

Checklist

Screenshots

Screenshot 2024-11-22 at 11 52 29 AM
elastic-vault-github-plugin-prod[bot] commented 8 hours ago

:rocket: Benchmarks report

Package cisco_duo :+1:(3) :green_heart:(2) :broken_heart:(3)

Expand to view Data stream | Previous EPS | New EPS | Diff (%) | Result ----------- | ------------ | ------- | -------- | ------ `activity` | 3649.64 | 2857.14 | -792.5 (-21.71%) | :broken_heart: `telephony_v2` | 22222.22 | 14925.37 | -7296.85 (-32.84%) | :broken_heart: `trust_monitor` | 16393.44 | 9345.79 | -7047.65 (-42.99%) | :broken_heart:

To see the full report comment with /test benchmark fullreport

elasticmachine commented 8 hours ago

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

kcreddy commented 7 hours ago

It may be worthy to include the same options for the rest of the data streams using CEL

Agreed. Will do

elastic-sonarqube[bot] commented 6 hours ago

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube

elasticmachine commented 6 hours ago

:green_heart: Build Succeeded

History

cc @kcreddy

elastic-vault-github-plugin-prod[bot] commented 6 hours ago

Package cisco_duo - 2.2.6 containing this change is available at https://epr.elastic.co/package/cisco_duo/2.2.6/