16.8 Detection Engineering
Detection Engineering
Five analytics rules that detect insider threat patterns. These are fundamentally different from the external-attacker rules in M11-M14 — they detect anomalous behaviour by authorised users, not unauthorised access.
Required role: Microsoft Sentinel Contributor.
Rule 1: Bulk File Download Exceeding User Baseline
| |
Entity mapping: Account → AccountDisplayName (FullName). Custom details: TodayCount, DailyAvg, Multiplier.
Rule 2: File Transfer to Personal Cloud Storage
| |
Entity mapping: Account → AccountName (Name). Host → DeviceName (HostName).
Rule 3: USB Device File Copy
| |
Entity mapping: Host → DeviceName (HostName). File → FileName (Name).
Rule 4: Email with Attachments to Personal Address
| |
Tuning note: This rule generates false positives for legitimate personal email to colleagues’ personal addresses (e.g., sending calendar invites to a personal email). Tune by: maintaining an exclusion list for known personal addresses of employees who routinely receive legitimate forwarded email, or by filtering on file extensions (.cad, .dwg, .xlsx, .pdf, .zip) that indicate sensitive documents vs casual attachments (.jpg, .png).
Rule 5: Departing Employee Anomalous Activity (Watchlist-Correlated)
| |
Watchlist requirement: Create a Sentinel watchlist named DepartingEmployees containing the UPNs of employees who have submitted their resignation or been given notice. HR populates this watchlist as part of the offboarding process. This rule applies a lower anomaly threshold (3x baseline vs 5x for general population) to departing employees — because the risk profile is higher during the notice period.
This is the most operationally powerful rule in this module. It turns the HR offboarding process into a detection signal — any departing employee who deviates from their baseline triggers an alert.
Deployment checklist
For each rule: create in Sentinel Analytics, configure entity mapping, set MITRE technique, test against historical data, enable, monitor.
Watchlist setup: Create DepartingEmployees in Sentinel → Watchlists. Columns: SearchKey (UPN), DepartureDate, Department, Manager. HR updates the watchlist during the offboarding process.
Subsection artifact: 5 deployable insider threat detection rules + the DepartingEmployees watchlist specification. Combined with M11-M14: 29 detection rules total covering external attacks, financial fraud, token abuse, consent phishing, and insider threat.
Compliance mapping: NIST CSF DE.AE-2. ISO 27001 A.8.16. SOC 2 CC6.8 (Prevent unauthorized data removal).
Watchlist operations — maintaining the DepartingEmployees list
The DepartingEmployees watchlist is the operational backbone of Rule 5. Without it, the rule has nothing to correlate against. Define the operational process:
Who maintains the watchlist: HR. The security team does not know who has resigned — HR does. The watchlist update should be part of the standard HR offboarding checklist: “When an employee submits their resignation: add their UPN to the DepartingEmployees watchlist in Microsoft Sentinel.”
What to include: SearchKey (UPN), DepartureDate, Department, Manager, RiskLevel (Low/Medium/High — based on access to sensitive data and destination employer). RiskLevel determines the detection threshold: High-risk employees (joining a competitor, with access to IP) trigger on 3x baseline deviation. Low-risk employees (moving to a different industry, no sensitive access) trigger on 5x.
When to add: At resignation acceptance — not at departure. The highest-risk period is between resignation and last day (typically 2-4 weeks). Adding at departure is too late — the exfiltration has already occurred.
When to remove: 30 days after departure date. Keep the entry for 30 days post-departure because: automated processes may continue accessing resources briefly after departure (OneDrive sync, cached credentials), and post-departure login attempts are a separate detection signal (the former employee may attempt to access resources using saved credentials).
| |
Run this monthly. “STALE” entries should be removed. “Active” entries should match HR’s current departing employee list. Discrepancies indicate a process gap — HR is not consistently updating the watchlist.
Try it yourself
Create the DepartingEmployees watchlist in your test Sentinel workspace. Columns: SearchKey (UPN), DepartureDate, Department, RiskLevel. Add 3 test entries. Then run Rule 5 against your workspace — does it correlate the watchlist with CloudAppEvents? If you have test user activity in your lab, adjust the thresholds to trigger an alert. This validates the watchlist-rule integration end-to-end.
What you should observe
The watchlist appears in Sentinel → Watchlists. The _GetWatchlist function returns your test entries. Rule 5 joins the watchlist with CloudAppEvents and applies the lower threshold (3x for departing employees). If your test user has any file download activity, the rule should evaluate it — even if it does not trigger (below threshold).