-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[ASM] - Expandr 4735 #27624
[ASM] - Expandr 4735 #27624
Conversation
Currently, we score and return all owners in ${alert.asmserviceowner} in sorted owners; instead, we want ${alert.asmserviceowner} to contain a smaller, high-confidence set of owners that we would be comfortable notifying via email. Test plan: pytest + manual testing in tenant
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.
@kball-pa , Approved. Nice work!
@michal-dagan , please merge when possible
scores: Iterable[float], | ||
target_k: int = 5, | ||
k_tol: int = 2, | ||
a_tol: float = 1.0, | ||
min_score_proportion: float = 0.75 |
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.
can you defensively verify that these values are within expected bounds? (for instance, that k_tol isn't -3.)
def test_get_k(): | ||
""" | ||
These cases are designed to specify the intuition we are trying to implement with the algorithm. | ||
They are specific to a target value of 5; if the target_k changes, these tests should update to reflect that. |
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.
The docstring should be generic, so mentioning 5 is not appropriate here unless you're actually setting that parameter in _get_k -- instead you might mention that this test verifies the default case. (The place to note "5" is in the docstring for _get_k -- there it is worth flagging that all the default values are tuned for k=5.)
Hi @kball-pa,
Please feel free to reach out to me with any questions - I'm available here or on slack :) |
@michal-dagan I increased the test coverage and verified that all checks were passing on a previous commit 5d6c938, but now the |
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.
Great!
* Update ranking algorithm for Service Ownership Currently, we score and return all owners in ${alert.asmserviceowner} in sorted owners; instead, we want ${alert.asmserviceowner} to contain a smaller, high-confidence set of owners that we would be comfortable notifying via email. Test plan: pytest + manual testing in tenant * Add release notes * Verify hyperparameters and update docs * Add unit test for value-checking in _get_k * Update release notes * Manually apply diff in output of pre-commit check: use built-ins for type hints, set generators --------- Co-authored-by: kball-pa <131012047+kball-pa@users.noreply.github.com> Co-authored-by: michal-dagan <109464765+michal-dagan@users.noreply.github.com>
* Update ranking algorithm for Service Ownership Currently, we score and return all owners in ${alert.asmserviceowner} in sorted owners; instead, we want ${alert.asmserviceowner} to contain a smaller, high-confidence set of owners that we would be comfortable notifying via email. Test plan: pytest + manual testing in tenant * Add release notes * Verify hyperparameters and update docs * Add unit test for value-checking in _get_k * Update release notes * Manually apply diff in output of pre-commit check: use built-ins for type hints, set generators --------- Co-authored-by: kball-pa <131012047+kball-pa@users.noreply.github.com> Co-authored-by: michal-dagan <109464765+michal-dagan@users.noreply.github.com>
* Update ranking algorithm for Service Ownership Currently, we score and return all owners in ${alert.asmserviceowner} in sorted owners; instead, we want ${alert.asmserviceowner} to contain a smaller, high-confidence set of owners that we would be comfortable notifying via email. Test plan: pytest + manual testing in tenant * Add release notes * Verify hyperparameters and update docs * Add unit test for value-checking in _get_k * Update release notes * Manually apply diff in output of pre-commit check: use built-ins for type hints, set generators --------- Co-authored-by: kball-pa <131012047+kball-pa@users.noreply.github.com> Co-authored-by: michal-dagan <109464765+michal-dagan@users.noreply.github.com>
* Update ranking algorithm for Service Ownership Currently, we score and return all owners in ${alert.asmserviceowner} in sorted owners; instead, we want ${alert.asmserviceowner} to contain a smaller, high-confidence set of owners that we would be comfortable notifying via email. Test plan: pytest + manual testing in tenant * Add release notes * Verify hyperparameters and update docs * Add unit test for value-checking in _get_k * Update release notes * Manually apply diff in output of pre-commit check: use built-ins for type hints, set generators --------- Co-authored-by: kball-pa <131012047+kball-pa@users.noreply.github.com> Co-authored-by: michal-dagan <109464765+michal-dagan@users.noreply.github.com>
Contributing to Cortex XSOAR Content
Make sure to register your contribution by filling the contribution registration form
The Pull Request will be reviewed only after the contribution registration form is filled.
Status
Related Issues
https://jira-hq.paloaltonetworks.local/browse/EXPANDR-4735
Description
Currently, we score and return all owners in ${alert.asmserviceowner} in sorted order. Some of these may be service accounts or other low-confidence users/owners that we don't want to notify.
This PR implements a ranking algorithm for Service Ownership that tries to find a smaller (targeting roughly ~5), high-confidence set of owners that we would be comfortable notifying via email. After the Service Ownership playbook runs, ${alert.asmserviceowner} will contain this smaller, high-confidence set, while ${alert.asmserviceownerunrankedraw} will contain the full set of (deduplicated) owners pulled during enrichment.
See unit tests for detailed specification for how the ranking algorithm works.
Test plan: pytest + manual testing in tenant (see JIRA ticket)
Minimum version of Cortex XSOAR
Does it break backward compatibility?
Must have