Skip to content

amazon_security_lake: fix handling of invalid '-' ip values - #14585

Merged
efd6 merged 2 commits into
elastic:mainfrom
efd6:s6140-amazon_security_lake-bad_ip
Jul 22, 2025
Merged

amazon_security_lake: fix handling of invalid '-' ip values#14585
efd6 merged 2 commits into
elastic:mainfrom
efd6:s6140-amazon_security_lake-bad_ip

Conversation

@efd6

@efd6 efd6 commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

Proposed commit message

amazon_security_lake: fix handling of invalid '-' ip values

IP values are specified to be ocsf ip_t, which does not allow '-', but
these are sent, so remove them if they are present. For tls.sans.name_ips
it is not clear whether name_ips is a scalar or a list, so punt and use
a recursive cleaner.

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

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@efd6 efd6 self-assigned this Jul 17, 2025
@efd6 efd6 added bugfix Pull request that fixes a bug issue Integration:amazon_security_lake Amazon Security Lake Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Jul 17, 2025
IP values are specified to be ocsf ip_t, which does not allow '-', but
these are sent, so remove them if they are present. tls.sans.name_ips
it is not clear whether name_ips is a scalar or a list, so punt and use
a recursive cleaner.
@efd6
efd6 force-pushed the s6140-amazon_security_lake-bad_ip branch from ddddba6 to 2a58e1c Compare July 17, 2025 22:08
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@efd6

efd6 commented Jul 17, 2025

Copy link
Copy Markdown
Contributor Author

/test

@efd6
efd6 marked this pull request as ready for review July 17, 2025 23:53
@efd6
efd6 requested a review from a team as a code owner July 17, 2025 23:53
@elasticmachine

Copy link
Copy Markdown

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

@efd6

efd6 commented Jul 17, 2025

Copy link
Copy Markdown
Contributor Author

The sonarqube failure is unrelated.

tag: drop_empty_x_originating_ip
if: ctx.ocsf?.email?.x_originating_ip instanceof List
source: |-
((List) ctx.ocsf.email.x_originating_ip).removeIf(v -> v == '-');

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.

The casting isn't necessary here or in cases like this.

It is necessary in the function drop(Object object) because there object does need to be cast from Object to List.

tag: drop_empty_json_tls_sans_name_ips
if: ctx.json?.tls?.sans instanceof List
source: |-
boolean drop(Object object) {

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.

dropDashes or dropEmpty?

@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @efd6

@elastic-sonarqube

Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
42.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@efd6
efd6 merged commit 7924afd into elastic:main Jul 22, 2025
8 of 9 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package amazon_security_lake - 2.6.1 containing this change is available at https://epr.elastic.co/package/amazon_security_lake/2.6.1/

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 Integration:amazon_security_lake Amazon Security Lake Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

4 participants