-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
92 additions
and
4 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,27 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import sys | ||
import json | ||
from thehive4py.api import TheHiveApi | ||
|
||
ALERT_ID = '** PUT AN ALERT ID HERE **' | ||
API_KEY = '** YOUR API KEY **' | ||
|
||
api = TheHiveApi('http://127.0.0.1:9000', API_KEY) | ||
|
||
print('Promoting alert %s to a case' % ALERT_ID) | ||
print('-----------------------------') | ||
|
||
response = api.promote_alert_to_case(ALERT_ID) | ||
|
||
if response.status_code == 201: | ||
print(json.dumps(response.json(), indent=4, sort_keys=True)) | ||
print('') | ||
|
||
else: | ||
print('ko: {}/{}'.format(response.status_code, response.text)) | ||
sys.exit(0) |
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,25 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import sys | ||
import json | ||
from thehive4py.api import TheHiveApi | ||
from thehive4py.query import Eq | ||
|
||
api = TheHiveApi('http://127.0.0.1:9000', '**YOUR_API_KEY**') | ||
|
||
print('Search for case templates') | ||
print('-----------------------------') | ||
|
||
response = api.find_case_templates(query=Eq("status", "Ok")) | ||
|
||
if response.status_code == 200: | ||
print(json.dumps(response.json(), indent=4, sort_keys=True)) | ||
print('') | ||
|
||
else: | ||
print('ko: {}/{}'.format(response.status_code, response.text)) | ||
sys.exit(0) |
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
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