Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Update Readme Debug & Decsiption Unicode Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DGovEnterprise committed Sep 22, 2023
1 parent a5b82e4 commit 959844e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ If you are using github codespaces, quickstart below:
poetry run siem_query_utils jupyterlab /workspace
# API endpoints
poetry run siem_query_utils serve
# Debug shell
# Debug shell and reloading latest tickets
poetry run ipython
from siem_query_utils import api
api.list_workspaces("ago(10d)")
# update_jira_issues needs the node server running background (in a bash terminal run `node .`)
api.update_jira_issues()
```

After running the above you can open [/api/v1/docs](http://localhost:8000/api/v1/docs) in your browser to get to the swagger debug ui which lets you test all the endpoints.
Expand Down
9 changes: 8 additions & 1 deletion siem_query_utils/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@ def update_jira(df):
df["AlertData"] = list(executor.map(alerts, df["AlertIds"], df["TenantId"]))
for index, row in df.iterrows():
sb_data = sentinel_beautify_local(row.to_dict())
try:
wikimarkup = sb_data["wikimarkup"].decode("utf8")
except:
try:
wikimarkup = sb_data["wikimarkup"][:32700].decode("utf8")
except:
wikimarkup = sb_data["wikimarkup"]
jira_dict = {
"fields": {
"customfield_10002": [int(sb_data["jira_orgid"])],
Expand All @@ -1090,7 +1097,7 @@ def update_jira(df):
"customfield_10065": sb_data["labels"],
"customfield_10071": sb_data["secops_status"],
"customfield_10039": None,
"description": sb_data["wikimarkup"].decode("utf8"),
"description": wikimarkup,
"issuetype": {"id": 10001},
"customfield_10010": "soc/6066f033-446e-4113-a76f-b5e2d77ff296",
"project": {"key": "SOC"},
Expand Down

0 comments on commit 959844e

Please sign in to comment.