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 log analytics API support to azure sentinel connector #1214

Merged
merged 20 commits into from
Jan 12, 2023

Conversation

mdazam1942
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Dec 1, 2022

Codecov Report

Base: 85.35% // Head: 85.33% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (38cb77e) compared to base (88a2af6).
Patch coverage: 84.30% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1214      +/-   ##
===========================================
- Coverage    85.35%   85.33%   -0.02%     
===========================================
  Files          558      568      +10     
  Lines        41753    42454     +701     
===========================================
+ Hits         35637    36228     +591     
- Misses        6116     6226     +110     
Impacted Files Coverage Δ
...zure_log_analytics/stix_transmission/api_client.py 31.03% <31.03%> (ø)
...og_analytics/stix_translation/query_constructor.py 63.73% <63.73%> (ø)
...azure_log_analytics/stix_transmission/connector.py 72.13% <72.13%> (ø)
...re_log_analytics/stix_transmission/error_mapper.py 81.81% <81.81%> (ø)
...test_azure_sentinel_log_analytics_stix_to_query.py 98.24% <98.24%> (ø)
..._transmission/test_azure_sentinel_log_analytics.py 99.11% <99.11%> (ø)
...shifter_modules/azure_log_analytics/entry_point.py 100.00% <100.00%> (ø)
...log_analytics/stix_translation/query_translator.py 100.00% <100.00%> (ø)
...g_analytics/stix_translation/results_translator.py 100.00% <100.00%> (ø)
.../test_azure_sentinel_log_analytics_json_to_stix.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mdazam1942 mdazam1942 marked this pull request as ready for review December 7, 2022 14:52
"path": [
"FilePath"
],
"hashes": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think there would every be a search for just hashes, would that even be a valid property or wold it always be hashes.'SHA-1' hashes.'MD5' and so on?

Copy link
Member Author

Choose a reason for hiding this comment

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

ohh didn't notice they put this under hashes. the property is simply called FileHash so all types of hashes will basically be translated into FileHash filed in the query.

Copy link
Member Author

@mdazam1942 mdazam1942 Jan 10, 2023

Choose a reason for hiding this comment

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

And we need to do some processing before results translation to correctly map the hash type in the bundle

"DeviceDescription"
],
"device_name": [
"DeviceId"
Copy link
Collaborator

Choose a reason for hiding this comment

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

the device id and computer seem like it could fit in x-oca-asset? https://github.com/opencybersecurityalliance/stix-extensions/blob/main/2.0/x-oca-asset.md

"incident_name": [
"IncidentName"
],
"severity": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Severity should go under x-ibm-finding provided it's on a scale of 1-100.

"additional_data": [
"AdditionalData"
],
"alertids": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should go under x-ibm-finding:alert_id

"comments": [
"Comments"
],
"description": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should go under x-ibm-finding:description

"resourceId": [
"_ResourceId"
],
"alert_severity": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should go under x-ibm-finding

"alert_severity": [
"AlertSeverity"
],
"description": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should go under x-ibm-finding

]
}
},
"x-azure-security-incident": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Anything that doesn't fit directly into a finding property should be a custom extension of the finding object.

]
}
},
"x-msazure-sentinel-alert": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Anything that doesn't fit with a finding property should go under a custom extension to the finding object.

]
}
},
"x-msazure-sentinel-incident": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Anything that won't fit in a finding property should go in an extension of the finding.

"object": "event"
},
{
"key": "url.name",
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be url.value

],
"ProcessName": [
{
"key": "process.name",
Copy link
Collaborator

Choose a reason for hiding this comment

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

The name property on the process was removed in 2.1, need to change to x_name

],
"FileHash": [
{
"key": "file.hashes",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needs to be mapped to specific hash type ie. file.hashes.'MD5'

Copy link
Member Author

Choose a reason for hiding this comment

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

it needs some post processing on the datasource fields. basically needs to check the hash type and create new datasource fields based on the hash value. The newly created datasource fields can be mapped in to_stix.

@delliott90 delliott90 merged commit 98650c3 into develop Jan 12, 2023
@delliott90 delliott90 deleted the azure_log_analytics branch January 12, 2023 15:23
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