Skip to content
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

Add IN operator for sumologic connector #845

Merged
merged 3 commits into from
Mar 15, 2022

Conversation

JingqiuDu
Copy link
Contributor

No description provided.

@JingqiuDu JingqiuDu self-assigned this Mar 10, 2022
@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #845 (7640229) into develop (c233a80) will increase coverage by 0.02%.
The diff coverage is 80.95%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #845      +/-   ##
===========================================
+ Coverage    63.81%   63.84%   +0.02%     
===========================================
  Files          452      452              
  Lines        39949    39964      +15     
===========================================
+ Hits         25495    25514      +19     
+ Misses       14454    14450       -4     
Impacted Files Coverage Δ
...es/sumologic/stix_translation/query_constructor.py 49.59% <73.33%> (+4.02%) ⬆️
...s/stix_translation/test_sumologic_stix_to_query.py 77.93% <100.00%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c233a80...7640229. Read the comment docs.

stix_pattern = "[user-account:display_name IN ('abc', 'def')]"
query = translation.translate('sumologic', 'query', '{}', stix_pattern)
_, from_time, to_time = query_constructor.convert_timestamp(query)
queries = "{\"query\": \"displayName = (abc OR def)\", \"fromTime\": \"%s\", \"toTime\": \"%s\"}" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure this is a valid translated query? have you checked the API if it has any IN operator or similar kind of operator support? if there's no IN operator support exists then it should work like OR operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Azam,

I refer to the sumologic query doc here https://help.sumologic.com/05Search/Get-Started-with-Search/How-to-Build-a-Search/Keyword-Search-Expressions#examples

IN operator is NOT supported naturally from sumologic query, we will need to translate it to an combination of "=" and "OR", there are some examples in the docs using "=" and "OR"

@JingqiuDu JingqiuDu force-pushed the SECCON-23845_sumologic-in-operator branch from 9418592 to 9ba0731 Compare March 14, 2022 14:02
@mdazam1942 mdazam1942 merged commit 0ed391b into develop Mar 15, 2022
@mdazam1942 mdazam1942 deleted the SECCON-23845_sumologic-in-operator branch March 15, 2022 16:41
delliott90 added a commit that referenced this pull request Mar 29, 2022
* CrowdStrike: Adding IN operator support (#842)

* Add IN operator for sumologic connector (#845)

* Added IN operator for Vision One UDI connector (#861)

* Adding IN operator support to CB connector (#835)

* fix cb operator lookup

Co-authored-by: Md Azam <mdazam@ca.ibm.com>
Co-authored-by: Jingqiu Du <jingqiu@ca.ibm.com>
Co-authored-by: Arthur Muradyan <arthur.muradyan@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants