[aws.cloudtrail] Fix ARN partition grok pattern for aws-cn/aws-iso* (7.3.x backport) - #21180
[aws.cloudtrail] Fix ARN partition grok pattern for aws-cn/aws-iso* (7.3.x backport)#21180efd6 wants to merge 2 commits into
Conversation
…d aws-iso* The grok pattern used to extract the session name from aws.cloudtrail.user_identity.arn matched only arn:aws:... and arn:aws-us-gov:... partitions. Identities from aws-cn and aws-iso* partitions were silently ignored, leaving user.changes.name unpopulated. Widening the character class from (aws|aws-us-gov) to [a-z0-9-] covers all current and future AWS partition strings without requiring updates for new partition names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ 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. |
|
✅ All changelog entries have the correct PR link. |
|
✅ Package owners are in sync with |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
| field: aws.cloudtrail.user_identity.arn | ||
| patterns: | ||
| - "arn:(aws|aws-us-gov):sts:.*/%{GREEDYDATA:_tmp.session_name}$" | ||
| - "arn:[a-z0-9-]+:sts:.*/%{GREEDYDATA:_tmp.session_name}$" |
There was a problem hiding this comment.
Severity: 🟡 Medium confidence: high path: packages/aws/data_stream/cloudtrail/elasticsearch/ingest_pipeline/default.yml:1096
Backported grok pattern drops the leading ^ anchor that the main-branch fix (PR 20403) carries; restore it so the 7.3.x pipeline matches main.
Details
This PR describes itself as a backport of the ARN partition change from PR 20403. The diff of PR 20403 replaces the old arn:(aws|aws-us-gov):sts:... pattern with '^arn:[a-z0-9-]+:sts:.*/%{GREEDYDATA:_tmp.session_name}$', i.e. start-anchored. This backport lands "arn:[a-z0-9-]+:sts:.*/%{GREEDYDATA:_tmp.session_name}$" with no ^. Without the start anchor grok scans for arn: anywhere in the value, so the pattern is unanchored (pipeline checklist: missing grok anchoring) and differs from the fix it claims to backport. A faithful copy also keeps later cherry-picks onto the 7.3.x line conflict-free.
Recommendation:
Use the exact pattern merged on main, including the start anchor.
| - "arn:[a-z0-9-]+:sts:.*/%{GREEDYDATA:_tmp.session_name}$" | |
| - '^arn:[a-z0-9-]+:sts:.*/%{GREEDYDATA:_tmp.session_name}$' |
🤖 AI-Generated Review | Vera Review Bot - v0.4.1 | 📚 Knowledge base: integration-skills
⚠️ Automated review — verify suggestions before applying.
Review summaryIssues found across the latest commits ae4c979 — 2 medium, 1 low
Package-level:
🤖 AI-Generated Review | Vera Review Bot - v0.4.1 | 📚 Knowledge base: integration-skills
|
💔 Build Failed
Failed CI StepsHistorycc @efd6 |
TL;DRThe failure is not from the CloudTrail grok change itself; it fails during package installation because Kibana rejects uploading Remediation
Investigation detailsRoot Cause
On this Buildkite run, that install call failed with Kibana API Evidence
Verification
Follow-upIf you prefer to keep installation coverage, consider adding package-name-aware handling in CI for bundled packages so What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Backport of the fix from #20403 to the 7.3.x line.
The grok processor that extracts the session name from
aws.cloudtrail.user_identity.arnused the patternarn:(aws|aws-us-gov), which silently dropped aws-cn and aws-iso* partition ARNs, leavinguser.changes.nameunpopulated. This widens the pattern toarn:[a-z0-9-]+.