fix(emitter): never emit a null timezone; reject one in validate - #1138
Closed
scottbrumley wants to merge 1 commit into
Closed
scottbrumley wants to merge 1 commit into
scottbrumley wants to merge 1 commit into
Conversation
Root cause of soc-crowdstrike-{idp,saas} installing with no rule, and of 12
other vendor packs carrying the same latent defect.
THE BUG
The platform rejects a null timezone outright:
POST /public_api/v1/correlations/insert
HTTP 400 'Failed to create correlation rule due to: Invalid timezone'
The pack still installs and the installer reports success, so the rule simply
never exists on the tenant with nothing surfacing why.
WHY IT WAS EVERYWHERE
Only 3 of 16 vendor schemas declare 'timezone' at all. For the other 13 the
emitter wrote the missing value straight through as null, so a schema that
merely omitted the key produced an uninstallable rule. 15 of 17 shipped
correlation rules in this repo carry 'timezone: null'.
This was never a regression. soc-crowdstrike-falcon was born with null (#959)
and fixed to UTC (#961); soc-crowdstrike-idp (#962) and -saas (#963) were
created from the pre-fix pattern immediately after and the fix was never
propagated. IDP and SaaS have not worked since their first commit.
THE FIX
- emitter: a missing timezone now defaults to UTC instead of null. Schemas may
still set it explicitly (pan-cie uses America/New_York).
- validate_mapping: an explicit null/empty timezone is now a hard error, with
the platform's own rejection message in the text.
VERIFIED on deathstar:
- emitted the sentinel-one rule with the fix, inserted it -> HTTP 200, rule
created (id 266, deleted after). Before the fix that pack emitted null.
- negative test: reverting the IDP schema to null now fails validation.
- all 16 vendor schemas validate.
- roundtrip across every vendor pack shows timezone null -> UTC on the 12
affected packs and no drift on the 4 already correct.
Those 12 packs still ship the old null in their committed rule YAML — they need
a re-emit and release, not done here.
Contributor
Author
|
Closing unmerged. The premise in this PR description -- that a null timezone makes a correlation rule uninstallable -- is contradicted by observation: packs shipping timezone: null have installed and their rules have worked on tenants. The HTTP 400 almost certainly comes from correlations/insert, the direct REST path, not from the pack bundle installer that a pack install actually uses. If that holds, this fixes a defect that only bites API-driven rule creation (i.e. our own test tooling), and the "15 of 17 rules are uninstallable" framing here is wrong. Reopen if the insert path turns out to matter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
The platform rejects a null timezone outright:
The pack still installs and the installer reports success, so the rule simply
never exists on the tenant and nothing surfaces why.
Why it is everywhere
Only 3 of 16 vendor schemas declare
timezone. For the other 13 the emitterpassed the missing value straight through as
null— so a schema that merelyomitted the key produced an uninstallable rule. 15 of the 17 correlation
rules in this repo ship
timezone: null.This is not a regression
generate_vendor_content.pyhad not changed since 4 Aug. The null passthroughhas been there the whole time.
IDP and SaaS have never worked since their first commit. The three vendor packs
created on 14 Sep (
microsoft-purview-dlp,nozomi-guardian,spycloud-enterprise-protection) were born the same way.The fix
timezonedefaults toUTCinstead ofnull.Schemas may still set it explicitly (
pan-cieusesAmerica/New_York).timezoneis now a hard errorcarrying the platform's own rejection message.
Verified on deathstar
rule created (id 266, deleted after). Before the fix that pack emitted null.
timezone: null -> UTCon the 12affected packs, no drift on the 4 already correct.
Not done here
The 12 affected packs still ship the old
nullin their committed rule YAML.They need a re-emit and release each — deliberately out of scope for a tooling
change.
Labels: version:patch