Repository navigation
[o365] Convert stringified numbers back to numbers in the audit pipeline - #21875
Conversation
✅ 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) |
| @@ -1,4 +1,12 @@ | |||
| # newer versions go on top | |||
| - version: "3.11.2" | |||
There was a problem hiding this comment.
I believe this is a breaking change for the same reason the previous change here was.
There was a problem hiding this comment.
Okay.
If we said the earlier _source changes were an unintentional breakage, then I'd call reverting those a bug fix rather than a new breaking change.
But you could say they're two intentional breaking changes.
Also this doesn't fully revert. Some things that should be strings remain strings.
In an case, I've given it a major version bump and marked it as a breaking change in the changelog.
|
🟢 No issues across the latest commits e639fc5. Review summaryIssues found across earlier commits d6e67d4 — 1 lowPackage-level:
🤖 AI-Generated Review | Vera Review Bot - v0.4.2 | 📚 Knowledge base: integration-skills
|
🚀 Benchmarks reportTo see the full report comment with |
| - version: "3.11.2" | ||
| - version: "4.0.0" | ||
| changes: | ||
| - description: >- |
There was a problem hiding this comment.
For a breaking change, there should be the breaking change change, and the bug-fix/enhancement change. See https://github.com/elastic/integrations/wiki/Fleet-Package-Code-Review-Comments#use-of-bugfixenhancementbreaking-change.
The breaking change would say that some _source fields have changed type and there may be a requirement for updates to rules if they are referenced, and the bugfix would say that commonly used semantically numeric fields are now the expected type instead of strings.
There was a problem hiding this comment.
Thanks. Updated.
7117701 to
c7d5175
Compare
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
History
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
Package o365 - 4.0.0 containing this change is available at https://epr.elastic.co/package/o365/4.0.0/ |
…22177) SharePoint and OneDrive list events (RecordType 36, such as ListViewed, ListUpdated, ListColumnCreated and ListColumnUpdated) report ListBaseType as a name such as "DocumentLibrary". Since 4.0.0 (#21875), ListBaseType has been in the script_normalize_numbers field list, and these events failed with: Character D is neither a decimal digit number, decimal point, nor "e" notation exponential mark. The script treats any string that contains an "e" or "E" as a number in scientific notation and passes it to new BigDecimal(value).toBigIntegerExact(). The names contain an "e", so BigDecimal threw, and the whole document was indexed as event.kind: pipeline_error with only the raw o365audit.* fields. Microsoft documents ListBaseType as a string enumeration, so remove it from the list. Also catch NumberFormatException and ArithmeticException in normalize() and return the value unchanged, the same way script_convert_numbers handles values it cannot parse, so that a non-integer string in another listed field no longer fails the whole document. Numbers from the o365audit input, and numeric strings in scientific notation from the CEL input, are normalized as before. Add a SharePoint ListViewed event with a ListBaseType of "DocumentLibrary" to the pipeline tests, and an event with a non-integer UserType ("1.5e0") and a named LogonType ("Delegate") so both catch branches are covered.
Proposed commit message
What does this PR do?
See the commit message. For reviewers:
git show 01f43440d6^:...). The only differences are the three deliberate ones in the commit message and unrelated whitespace trimming inemail.attachments.file.*from o365: fix Painless regex character-limit and Sender mapping errors #19801.Actions,PolicyDetailsorExchangeMetaData, which would also catch IDs and other values the API sends as strings. Numeric keys not in the list stay strings (underExchangeMetaDatathey are still coerced by thelongwildcard mapping). A path applies to every element wherever a list is found along it, and a final*covers every key of a map;*is only used for theCountBy*maps, where every key is a count.file.sizemapping, but whichever merges second needs its version bumped to 3.11.3.Checklist
changelog.ymlfile.How to test this PR locally
Related issues