skills/secops/post-incident-analysis/SKILL.md
Conduct post-incident review for closed security incidents including timeline reconstruction, detection/response gap analysis, and lessons-learned documentation
npx skillsauth add happy-technologies-llc/happy-servicenow-skills post-incident-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides a structured methodology for conducting post-incident reviews (PIRs) of closed security incidents in ServiceNow Security Operations. It reconstructs the incident timeline, identifies gaps in detection and response processes, and generates comprehensive lessons-learned documentation.
Key capabilities:
When to use: After a security incident has been resolved and closed, typically within 5-10 business days of closure for major incidents or as part of periodic review cycles for lower-severity events.
sn_si.analyst, sn_si.manager, sn_si.adminsn_si_incident, sn_si_task, sn_ti_observable, sn_vul_vulnerable_item, sys_journal_field, sys_audit tablesFetch the full incident record including resolution details and timing fields.
Using MCP:
Tool: SN-Read-Record
Parameters:
table_name: sn_si_incident
sys_id: [INCIDENT_SYS_ID]
fields: sys_id,number,short_description,description,category,subcategory,priority,state,assigned_to,assignment_group,cmdb_ci,opened_at,resolved_at,closed_at,close_notes,close_code,business_criticality,risk_score,attack_vector,kill_chain_phase,affected_user,caller_id,contact_type
Using REST:
GET /api/now/table/sn_si_incident?sysparm_query=number=[INCIDENT_NUMBER]&sysparm_fields=sys_id,number,short_description,description,category,subcategory,priority,state,assigned_to,assignment_group,cmdb_ci,opened_at,resolved_at,closed_at,close_notes,close_code,business_criticality,risk_score,attack_vector,kill_chain_phase,affected_user,contact_type&sysparm_limit=1&sysparm_display_value=true
Retrieve all work notes and comments in chronological order to reconstruct the event timeline.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sys_journal_field
query: name=sn_si_incident^element_id=[INCIDENT_SYS_ID]^elementINwork_notes,comments^ORDERBYsys_created_on
fields: element,value,sys_created_on,sys_created_by
limit: 500
Using REST:
GET /api/now/table/sys_journal_field?sysparm_query=name=sn_si_incident^element_id=[INCIDENT_SYS_ID]^elementINwork_notes,comments^ORDERBYsys_created_on&sysparm_fields=element,value,sys_created_on,sys_created_by&sysparm_limit=500
Pull security incident tasks to understand the response workflow and task completion times.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sn_si_task
query: security_incident=[INCIDENT_SYS_ID]^ORDERBYopened_at
fields: sys_id,number,short_description,state,priority,assigned_to,assignment_group,opened_at,closed_at,close_notes,work_duration
limit: 50
Using REST:
GET /api/now/table/sn_si_task?sysparm_query=security_incident=[INCIDENT_SYS_ID]^ORDERBYopened_at&sysparm_fields=sys_id,number,short_description,state,priority,assigned_to,assignment_group,opened_at,closed_at,close_notes,work_duration&sysparm_limit=50&sysparm_display_value=true
Track how the incident evolved by reviewing field changes (priority, state, assignment).
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sys_audit
query: tablename=sn_si_incident^documentkey=[INCIDENT_SYS_ID]^fieldnameINpriority,state,assigned_to,assignment_group,category^ORDERBYsys_created_on
fields: fieldname,oldvalue,newvalue,sys_created_on,user
limit: 200
Using REST:
GET /api/now/table/sys_audit?sysparm_query=tablename=sn_si_incident^documentkey=[INCIDENT_SYS_ID]^fieldnameINpriority,state,assigned_to,assignment_group,category^ORDERBYsys_created_on&sysparm_fields=fieldname,oldvalue,newvalue,sys_created_on,user&sysparm_limit=200
Examine which IOCs were identified and when, to assess detection timeliness.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sn_ti_observable
query: security_incident=[INCIDENT_SYS_ID]^ORDERBYfirst_seen
fields: sys_id,type,value,source,confidence,first_seen,last_seen,threat_score,sys_created_on
limit: 100
Using REST:
GET /api/now/table/sn_ti_observable?sysparm_query=security_incident=[INCIDENT_SYS_ID]^ORDERBYfirst_seen&sysparm_fields=sys_id,type,value,source,confidence,first_seen,last_seen,threat_score,sys_created_on&sysparm_limit=100
Check whether the attack exploited known vulnerabilities and whether patches were available.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sn_vul_vulnerable_item
query: cmdb_ci=[AFFECTED_CI_SYS_ID]
fields: sys_id,vulnerability,cmdb_ci,state,risk_score,cvss_score,first_found,last_found
limit: 50
Tool: SN-Query-Table
Parameters:
table_name: sn_vul_entry
query: sys_idIN[VULNERABILITY_SYS_IDS]
fields: sys_id,cve_id,description,cvss_score,severity,exploit_available,vendor_advisory,published_date
limit: 20
Using REST:
GET /api/now/table/sn_vul_vulnerable_item?sysparm_query=cmdb_ci=[AFFECTED_CI_SYS_ID]&sysparm_fields=sys_id,vulnerability,cmdb_ci,state,risk_score,cvss_score,first_found,last_found&sysparm_limit=50&sysparm_display_value=true
GET /api/now/table/sn_vul_entry?sysparm_query=sys_idIN[VULNERABILITY_SYS_IDS]&sysparm_fields=sys_id,cve_id,description,cvss_score,severity,exploit_available,vendor_advisory,published_date&sysparm_limit=20
Compute key performance indicators from the incident timeline.
Metrics to calculate:
first_seen and incident opened_atopened_at and first state change from "New"opened_at and containment task completionopened_at and resolved_atUsing MCP:
Tool: SN-Add-Work-Notes
Parameters:
table_name: sn_si_incident
sys_id: [INCIDENT_SYS_ID]
work_notes: |
=== POST-INCIDENT ANALYSIS REPORT ===
Incident: SIR0008901 | Analyst: J. Smith | Review Date: 2026-03-19
EXECUTIVE SUMMARY:
Ransomware incident affecting file server FILESVR-03. Initial access
via phishing email delivered to user in Finance department. Malware
propagated to shared drives before containment. No data exfiltration
confirmed. Full recovery from backups completed.
TIMELINE RECONSTRUCTION:
2026-03-10 08:15 - Phishing email received by user (first observable)
2026-03-10 08:22 - User clicked malicious link and downloaded payload
2026-03-10 08:45 - Malware executed, began encrypting local files
2026-03-10 09:30 - Encryption spread to mapped network drives
2026-03-10 10:15 - Help desk ticket opened by affected user
2026-03-10 10:30 - Security incident created (SIR0008901)
2026-03-10 10:45 - Triage complete, escalated to P1
2026-03-10 11:00 - Server isolated from network (containment)
2026-03-10 14:00 - Malware sample identified, IOCs extracted
2026-03-11 09:00 - Full forensic analysis complete
2026-03-12 16:00 - Server rebuilt and restored from backup
2026-03-13 10:00 - Incident resolved and closed
RESPONSE METRICS:
Time to Detect: 2h 15m (email received → incident created)
Time to Triage: 15m
Time to Contain: 30m (from triage)
Time to Eradicate: 1d 3h
Time to Resolve: 3d 1h 30m
Reassignments: 1
Escalations: 1 (P3 → P1)
DETECTION GAP ANALYSIS:
- Email gateway did not flag the phishing email (new domain, no reputation data)
- EDR agent on workstation was running outdated signatures (3 days old)
- Network-based detection triggered 45 minutes after execution
- No UEBA alert for anomalous file access patterns
ROOT CAUSE:
Primary: Spear-phishing email bypassed email security controls
Contributing: EDR signature update delay, user security awareness gap
WHAT WENT WELL:
- Rapid containment once incident was identified (30 minutes)
- Clean backups available for full restoration
- Clear communication to management throughout
IMPROVEMENT RECOMMENDATIONS:
1. Implement URL sandboxing on email gateway (Priority: High)
2. Reduce EDR signature update interval to 4 hours (Priority: High)
3. Deploy UEBA for anomalous file access detection (Priority: Medium)
4. Conduct targeted phishing awareness training for Finance (Priority: Medium)
5. Add network segmentation between user workstations and file servers (Priority: Low)
LESSONS LEARNED:
- Phishing remains the primary initial access vector; defense-in-depth required
- Backup strategy proved critical for recovery; validate backup integrity quarterly
- Containment playbook was effective; formalize for similar future incidents
| Tool | Purpose | |------|---------| | SN-Query-Table | Retrieve incident history, tasks, observables, audit entries, and vulnerabilities | | SN-Read-Record | Get complete details on the incident under review | | SN-Add-Work-Notes | Document the PIR findings on the incident record | | SN-Update-Record | Update incident fields such as close_code or add PIR reference | | SN-Execute-Background-Script | Run scripts to calculate complex metrics across related records |
Cause: Analysts may not have documented all actions in work notes during a high-pressure incident.
Solution: Supplement with audit log data (sys_audit), syslog entries, and task completion timestamps to fill timeline gaps. Interview responding analysts if needed.
Cause: The first_seen timestamp on observables may reflect when they were ingested, not when the attack actually began.
Solution: Cross-reference with external SIEM or EDR timestamps. Use syslog entries to identify the earliest evidence of compromise.
Cause: The cmdb_ci field on the incident may not match the CI in vulnerability records due to naming discrepancies.
Solution: Search sn_vul_vulnerable_item by CI name using LIKE operator, or query by IP address or hostname.
Cause: Audit retention policies may have purged entries for older incidents.
Solution: Check the sys_audit_delete table for archived records. For future PIRs, ensure audit retention covers at least 90 days.
Example 1: Phishing Incident PIR
Example 2: Data Breach PIR with Regulatory Implications
secops/correlation-insights - Correlate related incidents discovered during PIRsecops/incident-summarization - Generate executive summaries from PIR findingssecops/metrics-analysis - Track PIR metrics trends over timesecops/shift-handover - Reference PIR findings in shift briefingssecurity/incident-response - Incident response procedures reviewed during PIRtesting
Manage supplier onboarding, qualification, performance monitoring, and offboarding with auditable lifecycle controls
tools
Identify emerging risks, prioritize intake signals, and route candidates into formal GRC risk assessment workflows
documentation
Screen inbound documents for completeness, policy risk, and routing readiness before extraction or case workflows
testing
Generate concise task summaries with status, timeline, blockers, SLA risk, and recommended next actions