-
Notifications
You must be signed in to change notification settings - Fork 530
[azure logs] Fix sign-in logs category check #17027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
We can't assume category will not be null.
🚀 Benchmarks reportTo see the full report comment with |
The `?` seems to work when checking field access, but not when checking field access 🤔
💚 Build Succeeded
History
cc @zmoog |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
efd6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit only
| value: azure.signinlogs | ||
| # Use same logic as the `signinlogs` stream that drops any document that doesn't end with `SignInLogs`. | ||
| if: 'ctx.routing?.category.endsWith("SignInLogs")' | ||
| if: 'ctx.routing?.category != null && ctx.routing?.category.endsWith("SignInLogs")' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if: 'ctx.routing?.category != null && ctx.routing?.category.endsWith("SignInLogs")' | |
| if: 'ctx.routing?.category != null && ctx.routing.category.endsWith("SignInLogs")' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this pipeline guarantee the routing field? It looks like it might be optional here.
| value: azure.signinlogs | ||
| # Use same logic as the `signinlogs` stream that drops any document that doesn't end with `SignInLogs`. | ||
| if: 'ctx.routing?.category.endsWith("SignInLogs")' | ||
| if: 'ctx.routing?.category != null && ctx.routing?.category.endsWith("SignInLogs")' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are not processing the logs with no category then should we drop the event which doesn't have category?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, I think we keep the log events.
Two reasons:
- Azure has been inconsistent in naming the field that contains the log category. So far we know they mostly usage
category, but also foundCategoryandCategoryValuein the wild. So I guess an suboptimal indexing is better than losing the log event. - custom routing: we recently added
routing.categoryas candidate field for custom routing, but users may want to customize the routing based on other criteria and fields. If we drop the log event in the main pipeline, it will never reach the custom pipeline.
Proposed commit message
Add an explicit check on
ctx.routing?.categoryto make sure it's not null before calling theendsWith("SignInLogs")method.We can't assume category is always set.
Checklist
changelog.ymlfile.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 practicesHow to test this PR locally
Related issues