Skip to content

Commit

Permalink
[cisco_duo] Make the rate limit configurable (#11471)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisberkhout authored Oct 18, 2024
1 parent 1b17467 commit 63854f0
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 22 deletions.
5 changes: 5 additions & 0 deletions packages/cisco_duo/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "2.0.5"
changes:
- description: Make the rate limit configurable.
type: bugfix
link: https://github.com/elastic/integrations/pull/11471
- version: "2.0.4"
changes:
- description: Fix auth CEL cursor handling.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ request.tracer.maxbackups: 5
{{/if}}
request.method: GET
request.url: {{hostname}}/admin/v1/logs/administrator
request.rate_limit.limit: "0.5"
request.rate_limit.limit: "{{rate_limit}}"
request.transforms:
- set:
target: url.params.mintime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config_version: 2
interval: {{interval}}
resource.url: {{hostname}}
resource.rate_limit.burst: 1
resource.rate_limit.limit: 0.5
resource.rate_limit.limit: {{rate_limit}}

{{#if enable_request_tracer}}
resource.tracer.filename: "../../logs/cel/http-request-trace-*.ndjson"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ request.tracer.maxbackups: 5
{{/if}}
request.method: GET
request.url: {{hostname}}/admin/v2/logs/authentication
request.rate_limit.limit: "0.5"
request.rate_limit.limit: "{{rate_limit}}"
request.transforms:
- set:
target: url.params.limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ request.tracer.filename: "../../logs/httpjson/http-request-trace-*.ndjson"
request.tracer.maxbackups: 5
{{/if}}
request.url: {{hostname}}/admin/v1/logs/offline_enrollment
request.rate_limit.limit: "0.5"
request.rate_limit.limit: "{{rate_limit}}"
request.transforms:
- set:
target: url.params.mintime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ request.tracer.maxbackups: 5
{{/if}}
request.method: GET
request.url: {{hostname}}/admin/v1/info/summary
request.rate_limit.limit: "0.5"
request.rate_limit.limit: "{{rate_limit}}"
request.transforms:
- set:
target: header.Date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ request.tracer.maxbackups: 5
{{/if}}
request.method: GET
request.url: {{hostname}}/admin/v1/logs/telephony
request.rate_limit.limit: "0.5"
request.rate_limit.limit: "{{rate_limit}}"
request.transforms:
- set:
target: url.params.mintime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config_version: 2
interval: {{interval}}
resource.url: {{hostname}}
resource.rate_limit.burst: 1
resource.rate_limit.limit: 0.5
resource.rate_limit.limit: {{rate_limit}}

{{#if enable_request_tracer}}
resource.tracer.filename: "../../logs/cel/http-request-trace-*.ndjson"
Expand Down
46 changes: 31 additions & 15 deletions packages/cisco_duo/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: "3.0.2"
name: cisco_duo
title: Cisco Duo
version: "2.0.4"
version: "2.0.5"
description: Collect logs from Cisco Duo with Elastic Agent.
type: integration
categories:
Expand Down Expand Up @@ -48,13 +48,6 @@ policy_templates:
title: Hostname
description: Hostname for the Cisco Duo Admin API (Add https:// before the hostname).
required: true
- name: enable_request_tracer
type: bool
title: Enable request tracing
multi: false
required: false
show_user: false
description: The request tracer logs requests and responses to the agent's local file-system for debugging configurations. Enabling this request tracing compromises security and should only be used for debugging. See [documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-httpjson.html#_request_tracer_filename) for details.
- name: integration_key
type: text
title: Integration Key
Expand All @@ -74,22 +67,30 @@ policy_templates:
required: true
show_user: true
default: 1m
title: Collect Cisco Duo logs via API v1
description: Collect Cisco Duo Administrator, Offline Enrollment, Summary, and Telephony (legacy) logs
- type: cel
vars:
- name: hostname
- name: rate_limit
type: text
title: Hostname
description: Hostname for the Cisco Duo Admin API. All API methods use your API hostname, https://api-XXXXXXXX.duosecurity.com. Obtain this value from the Duo Admin Panel and use it exactly as shown there.
title: Rate limit
description: "The maximum per endpoint request rate, in requests per second (e.g. 0.5 reqs/sec for 30 reqs/min)."
default: "0.5"
multi: false
required: true
show_user: false
- name: enable_request_tracer
type: bool
title: Enable request tracing
multi: false
required: false
show_user: false
description: The request tracer logs requests and responses to the agent's local file-system for debugging configurations. Enabling this request tracing compromises security and should only be used for debugging. See [documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-httpjson.html#_request_tracer_filename) for details.
title: Collect Cisco Duo logs via API v1
description: Collect Cisco Duo Administrator, Offline Enrollment, Summary, and Telephony (legacy) logs
- type: cel
vars:
- name: hostname
type: text
title: Hostname
description: Hostname for the Cisco Duo Admin API. All API methods use your API hostname, https://api-XXXXXXXX.duosecurity.com. Obtain this value from the Duo Admin Panel and use it exactly as shown there.
required: true
- name: integration_key
type: text
title: Integration Key
Expand All @@ -109,6 +110,21 @@ policy_templates:
required: true
show_user: true
default: 1m
- name: rate_limit
type: text
title: Rate limit
description: "The maximum per endpoint request rate, in requests per second (e.g. 0.5 reqs/sec for 30 reqs/min)."
default: "0.5"
multi: false
required: true
show_user: false
- name: enable_request_tracer
type: bool
title: Enable request tracing
multi: false
required: false
show_user: false
description: The request tracer logs requests and responses to the agent's local file-system for debugging configurations. Enabling this request tracing compromises security and should only be used for debugging. See [documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-httpjson.html#_request_tracer_filename) for details.
title: Collect Cisco Duo logs via API v2
description: Collect Cisco Duo Authentication, and Telephony logs
owner:
Expand Down

0 comments on commit 63854f0

Please sign in to comment.