Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* allowed custom fields * RN * docker
- Loading branch information
Showing
5 changed files
with
79 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
#### Scripts | ||
##### StixCreator | ||
- Fixed an issue where export to STIX failed when more than one indicator was being exported. | ||
- Fixed an issue where export to STIX failed when trying to export file types. | ||
- Updated the Docker image to: *demisto/py3-tools:1.0.0.32758*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
Packs/CommonScripts/Scripts/StixCreator/StixCreator_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import demistomock as demisto # noqa: F401 | ||
from CommonServerPython import * # noqa: F401 | ||
import pytest | ||
from StixCreator import main | ||
|
||
FILE_INDICATOR = \ | ||
{ | ||
'indicators': | ||
{ | ||
'0': {'expirationStatus': 'active', 'firstSeen': '2022-07-31T13:26:05Z', | ||
'indicator_type': 'File', | ||
'lastSeen': '2022-07-31T13:26:05Z', 'score': 'good', | ||
'timestamp': '2022-07-31T13:26:05Z', | ||
'value': 'e14daa9c88a7ec91d770ae262758db73b6593b178527a2d7bba14159fad5f1c2' | ||
} | ||
} | ||
} | ||
|
||
DOMAIN_INDICATORS = \ | ||
{ | ||
'indicators': | ||
{ | ||
'0': {'expirationStatus': 'active', 'firstSeen': '2022-07-31T13:24:44Z', | ||
'indicator_type': 'cve', | ||
'lastSeen': '2022-07-31T13:24:44Z', 'score': 'Unknown', | ||
'timestamp': '2022-07-31T13:24:44Z', | ||
'value': 'test.com' | ||
}, | ||
'1': {'expirationStatus': 'active', 'firstSeen': '2022-07-31T13:24:40Z', | ||
'indicator_type': 'attack pattern', | ||
'lastSeen': '2022-07-31T13:24:40Z', 'score': 'suspicious', | ||
'timestamp': '2022-07-31T13:24:40Z', | ||
'value': 'bad.com' | ||
} | ||
} | ||
} | ||
|
||
|
||
@pytest.mark.parametrize('indicators, stix_type', [(DOMAIN_INDICATORS, 'bundle'), (FILE_INDICATOR, 'indicator')]) | ||
def test_stixCreator_with_indicators(mocker, indicators, stix_type): | ||
mocker.patch.object(demisto, 'args', return_value=indicators) | ||
mocker.patch.object(demisto, 'results') | ||
main() | ||
results = demisto.results.call_args[0] | ||
assert stix_type in results[0]['Contents'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters