Skip to content

[aws] cloudtrail: move assumed-role session name from user.changes.* to related.user#20318

Open
chemamartinez wants to merge 3 commits into
elastic:mainfrom
chemamartinez:aws-cloudtrail-remove-user-changes-field
Open

[aws] cloudtrail: move assumed-role session name from user.changes.* to related.user#20318
chemamartinez wants to merge 3 commits into
elastic:mainfrom
chemamartinez:aws-cloudtrail-remove-user-changes-field

Conversation

@chemamartinez

Copy link
Copy Markdown
Contributor

Proposed commit message

[aws] cloudtrail: move assumed-role session name from user.changes.* to related.user

For AssumedRole and FederatedUser events, the ARN session name was
previously stored in user.changes.name. That field is defined by ECS
for modifications made to a user account during the event, which the
session name is not; storing it there was a semantic mismatch.

Additionally, when the session name is an email address (the pattern
used by AWS Identity Center / SSO), customers needed both the full
email and the local-part prefix available for cross-source user
correlation, since other log sources may store only the short username.

The ARN session name is now extracted into a temporary scratch field
and appended to related.user directly, without writing to
user.changes.*. When the session name is an email, both the full
address and the prefix before @ are appended, enabling correlation
with sources that store only the short username. user.name continues
to hold the IAM role name, preserving existing SIEM detection rule
behaviour.

A new pipeline test fixture covers the SSO/Identity Center email
session name pattern.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Related issues

@chemamartinez chemamartinez self-assigned this Jul 23, 2026
@chemamartinez chemamartinez added enhancement New feature or request Integration:aws AWS Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Jul 23, 2026
@github-actions

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.

@chemamartinez
chemamartinez marked this pull request as ready for review July 23, 2026 08:56
@chemamartinez
chemamartinez requested review from a team as code owners July 23, 2026 08:56
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@andrewkroh andrewkroh added the Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] label Jul 23, 2026
@chemamartinez

Copy link
Copy Markdown
Contributor Author

Failed build seems unrelated.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@vera-review-bot

Copy link
Copy Markdown

No issues across the latest commits 617ad3dff5593c (37 commits).

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 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @chemamartinez

# newer versions go on top
- version: "7.1.0"
changes:
- description: "[CloudTrail] Stop storing the assumed-role ARN session name in `user.changes.*` (which conflicts with ECS semantics). The session name is now added to `related.user` for cross-source correlation; when it is an email, both the full email and the local-part prefix are added. `user.name` continues to hold the IAM role name for detection rules."

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
- description: "[CloudTrail] Stop storing the assumed-role ARN session name in `user.changes.*` (which conflicts with ECS semantics). The session name is now added to `related.user` for cross-source correlation; when it is an email, both the full email and the local-part prefix are added. `user.name` continues to hold the IAM role name for detection rules."
- description: "Stop storing the assumed-role ARN session name in `user.changes.*`. The session name is now added to `related.user` for cross-source correlation; when it is an email, both the full email and the local-part prefix are added. `user.name` continues to hold the IAM role name for detection rules."

Comment on lines +1107 to +1113
- grok:
tag: extract_session_name_email_prefix
field: _tmp.session_name
patterns:
- "%{DATA:_tmp.session_name_prefix}@"
ignore_missing: true
if: ctx._tmp?.session_name != null && ctx._tmp.session_name.contains('@')

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.

Using grok for this is quite expensive.

Suggested change
- grok:
tag: extract_session_name_email_prefix
field: _tmp.session_name
patterns:
- "%{DATA:_tmp.session_name_prefix}@"
ignore_missing: true
if: ctx._tmp?.session_name != null && ctx._tmp.session_name.contains('@')
- dissect:
tag: extract_session_name_email_prefix
field: _tmp.session_name
pattern: '%{_tmp.session_name_prefix}@%{}'
if: ctx._tmp?.session_name != null && ctx._tmp.session_name.contains('@')

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

Labels

enhancement New feature or request Integration:aws AWS Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] 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.

[aws_cloudtrail] Extract human-readable identity from ARN session name

3 participants