-
Notifications
You must be signed in to change notification settings - Fork 652
aws.cloudtrail: Ingest pipeline & ECS mapping improvements #20040
Copy link
Copy link
Open
Labels
Category: Integration qualityCategory: Quality used for SI planningCategory: Quality used for SI planningIntegration:awsAWSAWSTeam:SDE-CrestCrest developers on the Security Integrations team [elastic/sit-crest-contractors]Crest developers on the Security Integrations team [elastic/sit-crest-contractors]Team:Security-Service IntegrationsSecurity Service Integrations team [elastic/security-service-integrations]Security Service Integrations team [elastic/security-service-integrations]enhancementNew feature or requestNew feature or request
Description
Activity
Metadata
Metadata
Assignees
Labels
Category: Integration qualityCategory: Quality used for SI planningCategory: Quality used for SI planningIntegration:awsAWSAWSTeam:SDE-CrestCrest developers on the Security Integrations team [elastic/sit-crest-contractors]Crest developers on the Security Integrations team [elastic/sit-crest-contractors]Team:Security-Service IntegrationsSecurity Service Integrations team [elastic/security-service-integrations]Security Service Integrations team [elastic/security-service-integrations]enhancementNew feature or requestNew feature or request
Summary
Improve the
cloudtraildata stream ingest pipeline (packages/aws/data_stream/cloudtrail/elasticsearch/ingest_pipeline/default.yml, ~2190 lines) so events are fully normalised and enriched, focusing on ECSrelated.*coverage and ECS version currency.Current state
source.ip→source.geoandsource.as(tagsgeoip_source_ip_to_source_geo_*,geoip_source_ip_to_source_as_*). Enrichment for source IP is present.tag:(99 tags) and_ingest.on_failure_processor_tagis surfaced in error handling (10on_failureblocks). Thepipeline-tagmodernisation is already done — do not re-do it.user_agentparsing is present.related.user(6) andrelated.hash(1) are populated, butrelated.ipandrelated.hostsare not populated at all (0 occurrences).Proposed changes
ECS & enrichment
related.ip— at minimum appendsource.ip(from CloudTrailsourceIPAddress) and any resolved destination/target IPs.related.hostswhere a hostname/host identifier is available (e.g. fromuser_identity/resources or EC2 instance context).related.usercovers all principal identities (root, IAM user, assumed role, federated).source.ipis only geo-enriched when it is a real IP —sourceIPAddressis often an AWS service DNS name (e.g.cloudtrail.amazonaws.com); ensure those are not fed to geoip and don't produce failures.Robustness (verify, likely already fine)
ignore_missingusages for redundantignore_missing: true+ifguards and simplify where found.error.messagewith the processor tag (already wired in 4 places) across allon_failureblocks.Exception-handling hygiene
The pipeline has 50
ignore_failure, 10script, and 2grokprocessors. The expensive part of a failure is the exception being thrown;ignore_failure: trueandon_failureboth catch an already-thrown exception, so converting between them is not a performance win (on_failureis marginally heavier — it allocates a wrapper exception and writes failure metadata). Optimise by not throwing, and by matching the handler to intent:ignore_failure: trueusages. Where the only expected failure is a missing field, replace withignore_missing: trueor anifguard so the processor doesn't throw on the common path.script/grokprocessors that fail on expected input, addifguards (or restructure) so the common path doesn't throw. Keepignore_failure: trueon these as a last-resort safety net: the guard removes the frequent throw cost, whileignore_failurecatches the rare unexpected throw so the pipeline continues instead of bubbling to the globalon_failurehandler.on_failurethat appends toerror.messageover silentignore_failure. Do not attach per-docerror.messagetogrok/scriptwhose failures are expected and frequent — that adds noise and cost.Rationale & impact
related.*fields power cross-source pivoting in Security; missingrelated.ip/related.hostsmeans CloudTrail events don't join IP/host-centric investigations. An ECS bump keeps mappings current and unlocks newly standardised fields.Acceptance criteria
related.ip/related.hostspopulation.elastic-package checkpasses with no ECS mapping errors.awspackage version bumped.References
ingest-pipelines,maintain-integration,ecs-field-mappings.