datalake-scripts 3.0.0rc2__tar.gz → 3.0.0rc3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/PKG-INFO +1 -1
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/filtered_threat_entity.py +7 -2
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/cli.py +1 -1
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/get_filtered_threat_entity.py +14 -1
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/PKG-INFO +1 -1
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/README.md +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/atom.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/atom_type.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/bulk_search_task.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/config.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/logger.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/output.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/throttler.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/token_manager.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/utils.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/common/warn.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/datalake.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/advanced_search.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/bulk_search.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/comments.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/endpoint.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/sightings.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/sources.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/tags.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/threats.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/miscellaneous/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/miscellaneous/search_watch.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/common/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/common/base_script.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/helper_scripts/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/helper_scripts/output_builder.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/helper_scripts/utils.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/add_comments.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/add_tags.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/add_threats.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/advanced_search.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/bulk_lookup_threats.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/edit_score.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/get_atom_values.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/get_query_hash.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/get_threats.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/get_threats_from_query_hash.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/lookup_threats.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/search_watch.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/SOURCES.txt +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/dependency_links.txt +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/entry_points.txt +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/requires.txt +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/top_level.txt +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/setup.cfg +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/setup.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/common/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/common/fixture.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/common/test_output.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/common/test_utils.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/conftest.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_advanced_search.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_atom_type.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_auth_via_tokens.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_bulk_search.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_filtered_threat_entity.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_search_watch.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_sightings.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_tags.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_threats.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/scripts/__init__.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/scripts/test_add_new_threats.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/scripts/test_base_scripts.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/scripts/test_cli.py +0 -0
- {datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/scripts/test_csv_builder.py +0 -0
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/filtered_threat_entity.py
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
from datalake.endpoints.endpoint import Endpoint
|
|
2
|
-
from datalake.common.output import parse_response
|
|
2
|
+
from datalake.common.output import parse_response, Output, output_supported
|
|
3
3
|
import re
|
|
4
4
|
import sys
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class FilteredThreatEntity(Endpoint):
|
|
8
|
+
@output_supported({Output.JSON, Output.STIX})
|
|
8
9
|
def get_filtered_and_sorted_list(
|
|
9
10
|
self,
|
|
10
11
|
threat_category_name=None,
|
|
@@ -17,6 +18,7 @@ class FilteredThreatEntity(Endpoint):
|
|
|
17
18
|
ordering="threat_category_name",
|
|
18
19
|
stix_uuid=None,
|
|
19
20
|
tag=None,
|
|
21
|
+
output=Output.JSON,
|
|
20
22
|
):
|
|
21
23
|
"""
|
|
22
24
|
Retrieve threat entities, with available filtering options as input parameters
|
|
@@ -46,7 +48,10 @@ class FilteredThreatEntity(Endpoint):
|
|
|
46
48
|
|
|
47
49
|
try:
|
|
48
50
|
response = self.datalake_requests(
|
|
49
|
-
url=url,
|
|
51
|
+
url=url,
|
|
52
|
+
method="post",
|
|
53
|
+
headers=self._post_headers(output=output),
|
|
54
|
+
post_body=body,
|
|
50
55
|
)
|
|
51
56
|
return parse_response(response)
|
|
52
57
|
except ValueError as ve:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
import json
|
|
3
|
-
from datalake import Datalake
|
|
3
|
+
from datalake import Datalake, Output
|
|
4
4
|
from datalake_scripts.common.base_script import BaseScripts
|
|
5
5
|
|
|
6
6
|
|
|
@@ -24,6 +24,9 @@ def main(args=None):
|
|
|
24
24
|
parser.add_argument(
|
|
25
25
|
"-t", "--tag", help="Filter Tag associated with threat entity", default=None
|
|
26
26
|
)
|
|
27
|
+
parser.add_argument(
|
|
28
|
+
"-ot", "--output-type", help="Desired output type", default=None
|
|
29
|
+
)
|
|
27
30
|
|
|
28
31
|
if args is None:
|
|
29
32
|
args = parser.parse_args()
|
|
@@ -31,6 +34,15 @@ def main(args=None):
|
|
|
31
34
|
args = parser.parse_args(args)
|
|
32
35
|
|
|
33
36
|
dtl = Datalake(env=args.env, log_level=args.loglevel)
|
|
37
|
+
|
|
38
|
+
output_type = Output.JSON
|
|
39
|
+
if args.output_type:
|
|
40
|
+
try:
|
|
41
|
+
output_type = Output[args.output_type.upper()]
|
|
42
|
+
except KeyError:
|
|
43
|
+
dtl.logger.error("Not supported output, please use either json or stix")
|
|
44
|
+
exit(1)
|
|
45
|
+
|
|
34
46
|
threat_entities = dtl.FilteredThreatEntity.get_filtered_and_sorted_list(
|
|
35
47
|
threat_category_name=args.threat_category_name,
|
|
36
48
|
alias=args.alias,
|
|
@@ -41,6 +53,7 @@ def main(args=None):
|
|
|
41
53
|
ordering=args.ordering,
|
|
42
54
|
stix_uuid=args.stix_uuid,
|
|
43
55
|
tag=args.tag,
|
|
56
|
+
output=output_type,
|
|
44
57
|
)
|
|
45
58
|
|
|
46
59
|
if args.output and threat_entities is not None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/endpoints/advanced_search.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake/miscellaneous/search_watch.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/common/base_script.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/helper_scripts/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/helper_scripts/utils.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/__init__.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/add_comments.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/add_tags.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/add_threats.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/advanced_search.py
RENAMED
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/edit_score.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/get_atom_values.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/get_query_hash.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/get_threats.py
RENAMED
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/lookup_threats.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts/scripts/search_watch.py
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/requires.txt
RENAMED
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/datalake_scripts.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/lib/test_filtered_threat_entity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datalake_scripts-3.0.0rc2 → datalake_scripts-3.0.0rc3}/tests/scripts/test_add_new_threats.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|