Skip to content

Commit

Permalink
feat(addon): Health Check Dashboard
Browse files Browse the repository at this point in the history
PR: #295 

Add health dashboard to add-on for self checking issues.
  • Loading branch information
paulmnguyen committed May 17, 2023
1 parent de56c63 commit de4dfdc
Show file tree
Hide file tree
Showing 5 changed files with 362 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-appinspect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
appinspect-addon:
name: AppInspect (Add-on)
runs-on: ubuntu-20.04
runs-on: ubuntu-20.04
# Remove write permissions
permissions:
contents: read
Expand Down
23 changes: 14 additions & 9 deletions Splunk_TA_paloalto/bin/input_module_cortex_xdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@ def fetch_xdr_incidents(helper, client, mod_time):
"value": mod_time,
}
)
try:
incidents = client.get_incidents(
limit=50,
sort_field="modification_time",
sort_order="asc",
filters=filters,
)
helper.log_info("Message: XDR API Returned Successfully")
return incidents
except Exception as e:
message = "Message: %s"%e
helper.log_error(message)

incidents = client.get_incidents(
limit=50,
sort_field="modification_time",
sort_order="asc",
filters=filters,
)
return incidents

def fetch_incident_details(helper, client, incident):
try:
Expand Down Expand Up @@ -120,7 +125,7 @@ def handle_incidents(helper, ew, incidents, get_details, base_url):
sourcetype='pan:xdr_incident',
data=json.dumps(incident))
ew.write_event(event)
helper.log_debug(f"Got {len(incidents)} results")
helper.log_info(f"Got {len(incidents)} results")
helper.log_debug(
"Got the following incident IDs: "
+ " ".join([str(y) for y in incidents])
Expand Down Expand Up @@ -178,5 +183,5 @@ def collect_events(helper, ew):
if incidents:
handle_incidents(helper, ew, incidents, get_details, base_url)
else:
helper.log_debug("No Incidents")
helper.log_info("No Incidents")

1 change: 1 addition & 0 deletions Splunk_TA_paloalto/default/data/ui/nav/default.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<nav search_view="search" color="#FFFFFF">
<view name="inputs" default="true" />
<view name="configuration"/>
<view name="health"/>
<view name="search" label="Search"/>
</nav>
Loading

0 comments on commit de4dfdc

Please sign in to comment.