-
Notifications
You must be signed in to change notification settings - Fork 4
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
updated threat filtering by computerName, groupName, groupID and k8scluster #51
base: master
Are you sure you want to change the base?
Conversation
If ComputerName is set via parameter, ignore all threats that don't belong to it.
Hi, thanks for the PR. I will have a look at it. |
I think the change makes sense. The flag Note: Might be nice to add the possibility to set the flag multiple times or have a flag to toggle the precise matching. But we can do that in another PR. We can optimize the implementation a bit. Since we already pass the url.Values map into the func (c *Client) GetThreats(values url.Values) (threats []*Threat, err error) {
...
if computerName, ok := values["computerName__contains"]; ok {
// continue if the name matches
}
... I also checked the API docs, there is only the "computerName__contains" parameter and nothing to match exactely from what I can see. Don't now if the "contains" filter can include patterns. |
From the API docs:
If we do a precise matching by name then we would lose the ability to use multiple values. So a toggle option might be valuable. |
I think this change is something we could add. However, the PR needs some feedback and fixing (see GitHub Actions) before we can move forward. |
feat: adds ability to search threats by group name and/or group ID + by kubernetes cluster name
a colleague added the options to filter threats by groupID, groupName and k8s cluster. |
As the SentinelOne API parameter
computerName__contains
is not an exact match when filtering threats for specific ComputerNames, I updated theGetThreats
function to ignore any threats that don't match the given ComputerName via the--computer-name
parameter.Current behavior for reference:
--computer-name "abc-job01"
Get's threats for hosts like
abc-job01
but also forabc-job01_whatever
(and so on).If parameter
--computer-name
is not supplied, the function will gather all threats for the site