[aws.cloudtrail] Fix ARN partition grok pattern for aws-cn/aws-iso* (7.2.x backport) - #21179
[aws.cloudtrail] Fix ARN partition grok pattern for aws-cn/aws-iso* (7.2.x backport)#21179efd6 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. |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
|
✅ All changelog entries have the correct PR link. |
|
✅ Package owners are in sync with |
💔 Build Failed
Failed CI StepsHistorycc @efd6 |
| 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: 🔵 Low confidence: high path: packages/aws/data_stream/cloudtrail/elasticsearch/ingest_pipeline/default.yml:1096
No handwritten fixture exercises the widened partition pattern; add an AssumedRole event with an aws-cn (or aws-iso*) sts ARN so the fix is covered by pipeline tests.
Details
The grok pattern now accepts any arn:[a-z0-9-]+:sts: partition, but a grep over the handwritten .log inputs under data_stream/cloudtrail/_dev/test/pipeline/ finds only arn:aws:sts: and arn:aws-us-gov:sts: session ARNs (the latter in test-us-gov-arn.log). The behaviour this PR fixes is therefore never exercised by pipeline tests, so a regression back to the narrower alternation would pass CI unnoticed.
Recommendation:
Add one AssumedRole event with a China-partition session ARN, either appended to an existing multi-line fixture such as test-assume-role-json.log or as a small new fixture alongside test-us-gov-arn.log, so related.user receives the session name; then regenerate expected output with elastic-package test pipeline -g. Example record:
{"eventVersion":"1.08","userIdentity":{"type":"AssumedRole","principalId":"AROAEXAMPLEID:cn-session","arn":"arn:aws-cn:sts::123456789012:assumed-role/ExampleRole/cn-session","accountId":"123456789012","sessionContext":{"sessionIssuer":{"type":"Role","principalId":"AROAEXAMPLEID","arn":"arn:aws-cn:iam::123456789012:role/ExampleRole","accountId":"123456789012","userName":"ExampleRole"}}},"eventTime":"2024-01-01T00:00:00Z","eventSource":"sts.amazonaws.com","eventName":"GetCallerIdentity","awsRegion":"cn-north-1","sourceIPAddress":"192.0.2.10","userAgent":"aws-cli/2.0","eventType":"AwsApiCall","recipientAccountId":"123456789012"}🤖 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 fa47672 — 2 low
Package-level:
🤖 AI-Generated Review | Vera Review Bot - v0.4.1 | 📚 Knowledge base: integration-skills
|
This comment has been minimized.
This comment has been minimized.
TL;DRThe Buildkite step Check integrations aws failed, but the prefetched log only contains teardown output and a generic Remediation
Investigation detailsRoot CauseInconclusive with current artifacts. The only available Buildkite log file is truncated to post-failure cleanup and does not include the original command output that triggered the non-zero exit. Evidence
Verification
Follow-upIf you share the full step output (or the JUnit XML content), I can map the exact failing assertion to a specific file/line and provide a concrete patch-level remediation. 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.2.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-]+.