-
Notifications
You must be signed in to change notification settings - Fork 621
[New Integration] Add Datadog Audit Logs integration #20526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hnguyen-coreweave
wants to merge
5
commits into
elastic:main
Choose a base branch
from
hnguyen-coreweave:datadog_integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6759fdc
[New Integration] Add Datadog Audit Logs integration
hnguyen-coreweave fa5c04a
Merge branch 'main' into datadog_integration
hnguyen-coreweave 4ef3e04
fix: changelog
hnguyen-coreweave a5fb497
fix: address comments
hnguyen-coreweave c973818
Merge branch 'main' into datadog_integration
hnguyen-coreweave File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| dependencies: | ||
| ecs: | ||
| reference: "git@v9.4.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Datadog Audit Logs | ||
|
|
||
| Collects the Datadog audit trail from an S3 bucket written by | ||
| [Datadog Log Archives](https://docs.datadoghq.com/logs/log_configuration/archives/), | ||
| using SQS object-created notifications for near-real-time delivery. | ||
|
|
||
| ## Data flow | ||
|
|
||
| 1. In Datadog, configure a Logs Archive with the query `source:audit`, targeting | ||
| an S3 bucket. Datadog writes gzipped NDJSON objects to a date-partitioned | ||
| prefix (`dt=YYYYMMDD/hour=HH/archive_*.json.gz`), one audit event per line. | ||
| 2. Configure an S3 event notification on that bucket for `s3:ObjectCreated:*`, | ||
| delivering to an SQS queue. | ||
| 3. Point this integration at the bucket ARN and the SQS queue URL. | ||
|
|
||
| If no queue URL is supplied, the integration falls back to polling the bucket on | ||
| the configured interval. SQS is strongly preferred — polling re-lists the bucket | ||
| on every interval and does not scale with archive volume. | ||
|
|
||
| ## Required AWS permissions | ||
|
|
||
| - `s3:GetObject` on the archive prefix | ||
| - `s3:ListBucket` on the bucket (polling mode only) | ||
| - `sqs:ReceiveMessage`, `sqs:DeleteMessage`, `sqs:GetQueueAttributes` on the queue | ||
|
|
||
| Prefer `role_arn` over static access keys. | ||
|
|
||
| ## Data stream | ||
|
|
||
| `datadog.audit` — all audit surfaces (API requests, workflows, agent | ||
| configuration changes, dashboards, organization management, MCP server calls, | ||
| audit-trail queries) in one stream. | ||
|
|
||
| ## Notable fields | ||
|
|
||
| | Field | Description | | ||
| |---|---| | ||
| | `datadog.event.name` | Datadog product surface (`Request`, `Workflows`, `Dashboard`, …) | | ||
| | `datadog.action` | Raw Datadog verb (`accessed`, `modified`, `created`, …) | | ||
| | `event.action` | Composite `<surface>_<verb>`, e.g. `dashboard_modified` | | ||
| | `datadog.route.path` | Templated API route — aggregate on this, not `url.path`, which contains IDs | | ||
| | `datadog.actor.type` | `USER`, `SYSTEM`, or `SERVICE_ACCOUNT` | | ||
| | `datadog.auth_method` | `SESSION`, `SYSTEM`, `API_AND_APP_KEY`, `OAUTH_TOKEN` | | ||
| | `datadog.threat_intel.*` | Datadog's Spur-sourced IP enrichment, including VPN/proxy tunnel detail | | ||
| | `datadog.asset.new_value` / `.prev_value` | `flattened` before/after blobs for configuration changes | | ||
| | `datadog.metadata` | `flattened` catch-all for surface-specific metadata | | ||
| | `related.user` | Every actor identifier in the event, including API key and OAuth client IDs | | ||
|
|
||
| `datadog.asset.new_value`, `datadog.asset.prev_value`, `datadog.metadata`, and `datadog.threat_intel` are | ||
| `flattened`. They are queryable in KQL and DSL by subkey, but **not** in ES|QL, | ||
| which hard-errors on `flattened`. Stable dimensions are lifted into typed | ||
| sibling fields for that reason. | ||
|
|
||
| ## Dashboard | ||
|
|
||
|  | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| - version: "0.1.0" | ||
| changes: | ||
| - description: Initial release of the Datadog audit logs integration (S3 via SQS, full ECS mapping) | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/20526 | ||
|
hnguyen-coreweave marked this conversation as resolved.
hnguyen-coreweave marked this conversation as resolved.
|
||
76 changes: 76 additions & 0 deletions
76
packages/datadog/data_stream/audit/_dev/test/pipeline/test-events.json
Large diffs are not rendered by default.
Oops, something went wrong.
6,953 changes: 6,953 additions & 0 deletions
6,953
packages/datadog/data_stream/audit/_dev/test/pipeline/test-events.json-expected.json
Large diffs are not rendered by default.
Oops, something went wrong.
102 changes: 102 additions & 0 deletions
102
packages/datadog/data_stream/audit/agent/stream/aws-s3.yml.hbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| {{#if bucket_list_prefix}} | ||
| bucket_list_prefix: {{bucket_list_prefix}} | ||
| {{/if}} | ||
| {{#if region}} | ||
| region: {{region}} | ||
| {{/if}} | ||
|
|
||
| # Collection mode | ||
| {{#if collection_mode}} | ||
| {{#contains "sqs" collection_mode}} | ||
| # SQS Configuration (real-time mode) | ||
| {{#if queue_url}} | ||
| queue_url: {{queue_url}} | ||
| {{/if}} | ||
| {{#if visibility_timeout}} | ||
| visibility_timeout: {{visibility_timeout}} | ||
| {{/if}} | ||
| {{#if max_number_of_messages}} | ||
| max_number_of_messages: {{max_number_of_messages}} | ||
| {{/if}} | ||
| {{/contains}} | ||
| {{#contains "polling" collection_mode}} | ||
| # Polling Configuration (interval mode) | ||
| # S3 Bucket Configuration | ||
| {{#if bucket_arn}} | ||
| bucket_arn: {{bucket_arn}} | ||
| {{/if}} | ||
| {{#if interval}} | ||
| bucket_list_interval: {{bucket_list_interval}} | ||
| {{/if}} | ||
| {{/contains}} | ||
| {{else}} | ||
| # Backward-compatible fallback when collection_mode is not present. | ||
| {{#if queue_url}} | ||
| # SQS Configuration (real-time mode) | ||
| queue_url: {{queue_url}} | ||
| {{#if visibility_timeout}} | ||
| visibility_timeout: {{visibility_timeout}} | ||
| {{/if}} | ||
| {{#if max_number_of_messages}} | ||
| max_number_of_messages: {{max_number_of_messages}} | ||
| {{/if}} | ||
| {{else}} | ||
| # Polling Configuration (interval mode) | ||
| {{#if interval}} | ||
| bucket_list_interval: {{bucket_list_interval}} | ||
| {{/if}} | ||
| {{/if}} | ||
| {{/if}} | ||
|
|
||
| # AWS Credentials | ||
| {{#if access_key_id}} | ||
| access_key_id: {{access_key_id}} | ||
| {{/if}} | ||
| {{#if secret_access_key}} | ||
| secret_access_key: {{secret_access_key}} | ||
| {{/if}} | ||
| {{#if session_token}} | ||
| session_token: {{session_token}} | ||
| {{/if}} | ||
| {{#if role_arn}} | ||
| role_arn: {{role_arn}} | ||
| {{/if}} | ||
|
|
||
| # File Processing | ||
| {{#if file_selectors}} | ||
| file_selectors: | ||
| {{{file_selectors}}} | ||
| {{else}} | ||
| file_selectors: | ||
| - regex: '.*\.json\.gz$' | ||
| {{#if max_bytes}} | ||
| max_bytes: {{max_bytes}} | ||
| {{/if}} | ||
| {{/if}} | ||
|
|
||
| # Performance & Concurrency | ||
| {{#if number_of_workers}} | ||
| number_of_workers: {{number_of_workers}} | ||
| {{/if}} | ||
| {{#if api_timeout}} | ||
| api_timeout: {{api_timeout}} | ||
| {{/if}} | ||
| {{#if fips_enabled}} | ||
| fips_enabled: {{fips_enabled}} | ||
| {{/if}} | ||
|
|
||
| tags: | ||
| {{#each tags as |tag|}} | ||
| - {{tag}} | ||
| {{/each}} | ||
| {{#if preserve_original_event}} | ||
| - preserve_original_event | ||
| {{/if}} | ||
|
|
||
| processors: | ||
|
hnguyen-coreweave marked this conversation as resolved.
|
||
| {{#if processors}} | ||
| {{processors}} | ||
| {{/if}} | ||
|
|
||
| # Disable host enrichment | ||
| publisher_pipeline.disable_host: true | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.