Skip to content

[aws.cloudtrail] Backport ingest pipeline improvements and bugfixes to backport-aws-7.1 - #21129

Open
brijesh-elastic wants to merge 4 commits into
elastic:backport-aws-7.1from
brijesh-elastic:backport-aws-7.1-cloudtrail-pipeline
Open

brijesh-elastic wants to merge 4 commits into
elastic:backport-aws-7.1from
brijesh-elastic:backport-aws-7.1-cloudtrail-pipeline

Conversation

@brijesh-elastic

@brijesh-elastic brijesh-elastic commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

What

Backport of #20403 to backport-aws-7.1 so that users on the 9.4.x–9.5.x Kibana
stacks (AWS package 7.1.x line, kibana: ^9.4.0) receive the CloudTrail ingest
pipeline improvements and bugfixes. This brings the cloudtrail data stream to
parity with main.

Why

main has moved on to the 7.2+/8.x line (kibana: ^9.6.0), and the 6.x
backport (#20972) covers Kibana 8.19.4/9.2–9.3. Users pinned to the 7.1.x
line — Kibana 9.4.x and 9.5.x — currently resolve to 7.1.2, which predates
#20403, so they do not get these CloudTrail fixes. This PR closes that gap.

What this includes vs. main

  • The cloudtrail ingest pipeline, fields.yml, sample_event.json, data-stream
    manifest, docs, and pipeline test fixtures are byte-identical to the merged
    main change (a3291a9 / [aws.cloudtrail] Ingest Pipeline Improvments and Bugfixes #20403).
  • Package version bumped to 7.1.3 (format_version kept at 3.6.1).
  • SVR00009 kept excluded in validation.yml (pre-existing pipeline predates
    that check).

Scope

Enhancements

  • Replace every ignore_failure: true with an ignore_missing flag, a condition
    guard, or an explicit on_failure handler reporting to error.message, so real
    faults surface instead of being silently swallowed.
  • Add support for CloudTrail fields that were previously dropped.
  • Populate the cloud.provider, cloud.service.name and related.* ECS fields.

Bugfixes

  • Stop populating file.hash.sha256 on digest records, where it held the hash of
    the previous digest file while file.path pointed at the current one. The value
    is still available as aws.cloudtrail.digest.previous_hash_value and in
    related.hash.
  • Fix DeleteObject using event.type: delete, which is not a valid ECS value.
    It is now deletion.
  • Fix Publish, SendCommand and Converse producing no event.type. They now
    use info, start and info respectively.
  • Fix retain: none behaving like retain: all. It now drops both the keyword and
    the flattened copies as documented.
  • Fix retain: keyword and retain: minimal discarding digest and Insights records.
    The setting governs API call payloads and no longer affects either record type.
  • Fix aws.cloudtrail.service_event_details surviving retain: flattened and
    retain: none. It is now governed like the other payload fields.

How to test this PR locally

  • Check out this branch and start a stack on a supported 9.4+ version, e.g.
    elastic-package stack up -d --version 9.4.0.
  • From packages/aws, run: elastic-package test pipeline --data-streams cloudtrail -v

Related

This commit updates the aws.cloudtrail ingest pipeline with the following enhancements and bug fixes:

Enhancements:
- Replace every `ignore_failure: true` with an `ignore_missing` flag, a condition guard, or
  an explicit `on_failure` handler reporting to `error.message`, so real faults surface
  instead of being silently swallowed.
- Add support for CloudTrail fields that were previously dropped.
- Populate the `cloud.provider`, `cloud.service.name` and `related.*` ECS fields.

Bugfixes:
- Stop populating `file.hash.sha256` on digest records, where it held the hash of the previous
  digest file while `file.path` pointed at the current one. The value is still available as
  `aws.cloudtrail.digest.previous_hash_value` and in `related.hash`.
- Fix `DeleteObject` using `event.type: delete`, which is not a valid ECS value. It is now `deletion`.
- Fix `Publish`, `SendCommand` and `Converse` producing no `event.type`. They now use
  `info`, `start` and `info` respectively.
- Fix `retain: none` behaving like `retain: all`. It now drops both the keyword and the
  flattened copies as documented.
- Fix `retain: keyword` and `retain: minimal` discarding digest and Insights records. The setting
  governs API call payloads and no longer affects either record type.
- Fix `aws.cloudtrail.service_event_details` surviving `retain: flattened` and `retain: none`. It is
  now governed like the other payload fields.
@brijesh-elastic brijesh-elastic self-assigned this Sep 8, 2026
@brijesh-elastic
brijesh-elastic requested review from a team as code owners September 8, 2026 11:53
@brijesh-elastic brijesh-elastic added documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request Integration:aws AWS bugfix Pull request that fixes a bug issue Category: Integration quality Category: Quality used for SI planning Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels Sep 8, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

@brijesh-elastic
brijesh-elastic requested a review from efd6 September 8, 2026 11:55
@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

Package aws 👍(10) 💚(6) 💔(6)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
firewall_logs 4464.29 3571.43 -892.86 (-20%) 💔
lambda_logs 10000 8130.08 -1869.92 (-18.7%) 💔
rds 33333.33 27777.78 -5555.55 (-16.67%) 💔
s3access 4830.92 3508.77 -1322.15 (-27.37%) 💔
apigateway_logs 28571.43 15384.62 -13186.81 (-46.15%) 💔
ec2_logs 41666.67 33333.33 -8333.34 (-20%) 💔

To see the full report comment with /test benchmark fullreport

Comment thread packages/aws/data_stream/cloudtrail/agent/stream/aws-s3.yml.hbs
@vera-review-bot

Copy link
Copy Markdown

Review summary

Issues found across the latest commits 00af686 — 1 medium

Package-level:

  • 🟡 external_id is added to the aws-s3 template but not to the CloudWatch template (aws-cloudwatch.yml.hbs) for the cloudtrail data stream

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot - v0.3.0 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ Package owners are in sync with main.

@brijesh-elastic

Copy link
Copy Markdown
Contributor Author

Review summary

Issues found across the latest commits 00af686 — 1 medium
Package-level:

  • 🟡 external_id is added to the aws-s3 template but not to the CloudWatch template (aws-cloudwatch.yml.hbs) for the cloudtrail data stream

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot - v0.3.0 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

The reason for adding external_id to aws-s3.yml.hbs is that it was mistakenly removed in earlier commits. For aws-cloudwatch.yml.hbs, it was never there in the first place.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @brijesh-elastic

@efd6 efd6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This backport is wider than justified. It should only include the bugfixes.

@brijesh-elastic

Copy link
Copy Markdown
Contributor Author

This backport is wider than justified. It should only include the bugfixes.

I've been asked to backport the entire change related to the ingest pipeline quality work.

I've already raised a PR targeting the backport-aws-6x branch, which covers users on 8.19.x and 9.3.x. This PR will cover users on 9.4.x through 9.5.x.

So, this change also addresses the SDH alongside the other work.

- append:
tag: append_error_message_extract_session_name_from_arn
field: error.message
value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.on_failure_pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.on_failure_pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'
value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'

(throughout)

We are in default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Category: Integration quality Category: Quality used for SI planning documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request Integration:aws AWS Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants