Skip to content
This repository was archived by the owner on Dec 14, 2024. It is now read-only.

Commit d7bd687

Browse files
committed
feat(addon): Health Check Dashboard
PR: #295 Add health dashboard to add-on for self checking issues.
1 parent 8048487 commit d7bd687

File tree

5 files changed

+362
-11
lines changed

5 files changed

+362
-11
lines changed

.github/workflows/pr-appinspect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
appinspect-addon:
1010
name: AppInspect (Add-on)
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-20.04
1212
# Remove write permissions
1313
permissions:
1414
contents: read

Splunk_TA_paloalto/bin/input_module_cortex_xdr.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,19 @@ def fetch_xdr_incidents(helper, client, mod_time):
7070
"value": mod_time,
7171
}
7272
)
73+
try:
74+
incidents = client.get_incidents(
75+
limit=50,
76+
sort_field="modification_time",
77+
sort_order="asc",
78+
filters=filters,
79+
)
80+
helper.log_info("Message: XDR API Returned Successfully")
81+
return incidents
82+
except Exception as e:
83+
message = "Message: %s"%e
84+
helper.log_error(message)
7385

74-
incidents = client.get_incidents(
75-
limit=50,
76-
sort_field="modification_time",
77-
sort_order="asc",
78-
filters=filters,
79-
)
80-
return incidents
8186

8287
def fetch_incident_details(helper, client, incident):
8388
try:
@@ -120,7 +125,7 @@ def handle_incidents(helper, ew, incidents, get_details, base_url):
120125
sourcetype='pan:xdr_incident',
121126
data=json.dumps(incident))
122127
ew.write_event(event)
123-
helper.log_debug(f"Got {len(incidents)} results")
128+
helper.log_info(f"Got {len(incidents)} results")
124129
helper.log_debug(
125130
"Got the following incident IDs: "
126131
+ " ".join([str(y) for y in incidents])
@@ -178,5 +183,5 @@ def collect_events(helper, ew):
178183
if incidents:
179184
handle_incidents(helper, ew, incidents, get_details, base_url)
180185
else:
181-
helper.log_debug("No Incidents")
186+
helper.log_info("No Incidents")
182187

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<nav search_view="search" color="#FFFFFF">
22
<view name="inputs" default="true" />
33
<view name="configuration"/>
4+
<view name="health"/>
45
<view name="search" label="Search"/>
56
</nav>

0 commit comments

Comments
 (0)