Skip to content

o365: validate field type in pipeline before accessing subfields#14056

Merged
chemamartinez merged 2 commits intoelastic:mainfrom
chemamartinez:o365-fix-subfields-access
May 29, 2025
Merged

o365: validate field type in pipeline before accessing subfields#14056
chemamartinez merged 2 commits intoelastic:mainfrom
chemamartinez:o365-fix-subfields-access

Conversation

@chemamartinez
Copy link
Copy Markdown
Contributor

Proposed commit message

As organization field may be a string instead of an object, the following error can appear when accessing its subfields being a string value.

Processor 'conditional' with tag '' failed with message 'dynamic getter [java.lang.String, id] not found'

Added a type check before accessing its subfields to avoid the above error.

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

@chemamartinez chemamartinez self-assigned this May 29, 2025
@chemamartinez chemamartinez added Integration:o365 Microsoft Office 365 bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels May 29, 2025
@chemamartinez chemamartinez marked this pull request as ready for review May 29, 2025 07:43
@chemamartinez chemamartinez requested a review from a team as a code owner May 29, 2025 07:43
@elasticmachine
Copy link
Copy Markdown

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

@efd6
Copy link
Copy Markdown
Contributor

efd6 commented May 29, 2025

Though it would be nice to have a test for this.

@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

cc @chemamartinez

@elastic-sonarqube
Copy link
Copy Markdown

@chemamartinez chemamartinez merged commit 84f11ce into elastic:main May 29, 2025
8 checks passed
@chemamartinez chemamartinez deleted the o365-fix-subfields-access branch May 29, 2025 08:47
@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

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

anupratharamachandran pushed a commit to anupratharamachandran/integrations that referenced this pull request Jun 2, 2025
…stic#14056)

As organization field may be a string instead of an object, the following error can appear when accessing its subfields being a string value.

Processor 'conditional' with tag '' failed with message 'dynamic getter [java.lang.String, id] not found'

Added a type check before accessing its subfields to avoid the error above.
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:o365 Microsoft Office 365 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.

3 participants