Insider Threat Detection
An insider threat differs from every other category in one structural way: the person involved is using access they were legitimately granted. Controls built to keep attackers out do nothing here, and detective work becomes a question of normality rather than of legitimacy â which makes baselines, context and organizational process the core of the discipline rather than the sensors. A program that ignores that ends up surveilling employees instead of finding risk, which is both ineffective and, in most jurisdictions, unlawful.
Three insider profiles, three different defenses
Treating insider risk as one problem produces solutions that fit none of it. A malicious insider plans, probes and covers tracks; a negligent insider causes the same damage through carelessness; and a compromised insider â a legitimate user whose credentials or device were taken over â is an external attack wearing an internal identity. Each profile leaves different artifacts and warrants a different response, and misclassifying the third as the first can waste weeks of investigation on an employee who is themselves a victim.
| Profile | Motivation | Typical signals | First response |
|---|---|---|---|
| Malicious | Revenge, theft, sabotage | Off-hours probing, bulk download, policy probing | Contain access, involve counsel |
| Negligent | Convenience, haste | Shadow IT, unencrypted sharing, misconfiguration | Coach, train, remediate |
| Compromised | External attacker using valid credentials | Impossible travel, odd API use, privilege escalation | Treat as external incident |
The classification drives everything downstream, including who is informed. HR and legal involvement early is not bureaucracy; it is what prevents a legitimate security investigation from becoming an employment matter without the right evidence, and it protects the organization when the conclusion turns out to be compromise rather than misconduct.
What a baseline is actually for
A behavioral baseline is a compact description of how a specific user, service or group normally behaves â login windows, device and network patterns, data volumes, application mix â computed over a period long enough to include the business cycle. Its purpose is not to judge the person but to make deviation visible cheaply. Without a baseline, every alert is a standalone event and analysts must rediscover context by hand; with one, the alert arrives with a comparison attached.
The failure mode is a baseline that drifts or is built from a contaminated window. If the training period includes a compromise, anomalies become the norm; if it spans only two weeks, month-end finance activity looks malicious every month. Practical baselines are therefore built per cohort where individual history is thin, refreshed on a schedule, and reset deliberately when a person changes role â a promotion that legitimately grants new access should not produce a week of risk alerts, and a role change is exactly the moment an unadjusted baseline over-fires.
Signals worth collecting, and their limits
Signal quality decides whether a program produces insight or noise. Technical signals are cheap and continuous: authentication outcomes and times, volume and destination of data movement, use of removable media, cloud uploads, privilege changes and access denials. Contextual signals are rarer and far more sensitive: role changes, resignation notice, performance issues, financial pressure. The technical signals alone usually indicate activity; the contextual ones are what turn activity into risk â and they require explicit governance to use at all.
| Signal family | Examples | Coverage | Governance constraint |
|---|---|---|---|
| Access | Logins outside pattern, failed access to new resources | Universal | Notice to employees required |
| Data movement | Bulk downloads, large uploads, print volume | Endpoint and cloud | Minimization of content inspection |
| Network | New destinations, tunneling tools, unusual protocols | Perimeter and proxy | Metadata preferred over content |
| Endpoint | Removable media, archive creation, screenshot tools | Managed devices | Policy must prohibit explicitly |
| Context | Role change, offboarding, project deadline | HR systems | Access strictly limited, purpose-bound |
Collect metadata wherever content would work, keep contextual signals in a separate store with restricted access, and document which signals are used for which purpose. That last point is what makes the program defensible to employees, regulators and courts alike.
The second rule is about the data itself: keep raw telemetry out of the risk store. Score from derived features â volumes, counts, deviations, timestamps â so an investigator sees that a user downloaded four gigabytes at 2 a.m. rather than the contents of what they downloaded. Content inspection belongs to a separate, purpose-limited process with its own audit trail.
-- Derived-feature view: enough to score risk, never enough to read the data.
CREATE VIEW insider_signals AS
WITH hourly AS (
SELECT
user_id,
date_trunc('hour', event_time) AS hr,
COUNT(*) AS events,
COUNT(DISTINCT resource_id) AS resources,
SUM(bytes) AS total_bytes,
MIN(is_off_hours::int) AS any_off_hours,
SUM(CASE WHEN removable_media THEN 1 ELSE 0 END) AS media_events,
SUM(CASE WHEN access_denied THEN 1 ELSE 0 END) AS denials
FROM access_telemetry
WHERE event_time > now() - interval '7 days'
GROUP BY 1, 2
),
stats AS (
SELECT
user_id,
AVG(total_bytes) AS mean_bytes,
STDDEV(total_bytes) AS stddev_bytes,
AVG(events) AS mean_events
FROM hourly GROUP BY user_id
)
SELECT
h.user_id,
h.hr,
h.total_bytes,
ROUND((h.total_bytes - s.mean_bytes) / NULLIF(s.stddev_bytes, 0), 2) AS z_bytes,
h.any_off_hours,
h.media_events,
h.denials
FROM hourly h
JOIN stats s USING (user_id)
WHERE (h.total_bytes - s.mean_bytes) / NULLIF(s.stddev_bytes, 0) > 3
OR h.media_events > 0
OR h.denials >= 3;
Querying derived features also makes the program auditable: an employee or regulator can be shown the rule and the aggregates without exposing anyone's documents. Keep the view versioned, review the thresholds quarterly against actual outcomes, and record every change so that a score produced six months ago can still be explained.
From anomalies to a risk score
Raw anomalies do not prioritize anything; a score that combines magnitude, frequency, asset criticality and context does. The scoring model below is intentionally simple and fully inspectable â a black-box risk number is one that nobody can challenge, which is precisely why it should be avoided.
"""Transparent insider risk scoring: every weight is auditable."""
WEIGHTS = {
"data_volume_z": 3.0, # standard deviations above the user's own baseline
"off_hours": 1.5, # activity outside their usual window
"new_destination": 1.0, # first contact with this resource or domain
"denied_access": 1.0, # repeated attempts to reach things they cannot use
"removable_media": 2.0, # use of media prohibited by policy
"critical_asset": 2.5, # touches a system rated critical
}
CONTEXT_MULTIPLIER = {
"none": 1.0,
"role_change": 0.7, # expect legitimate novelty after a move
"resignation": 1.6, # elevated, but never sufficient alone
}
def risk_score(events, context="none"):
"""events: list of signal names observed inside the review window."""
total = sum(WEIGHTS.get(name, 0.5) for name in set(events))
return round(total * CONTEXT_MULTIPLIER.get(context, 1.0), 2)
window = [
"data_volume_z", "data_volume_z", "off_hours", "new_destination",
"removable_media", "critical_asset",
]
for label, ctx in [("ordinary week", "none"), ("after role change", "role_change"),
("during notice period", "resignation")]:
print(f"{label:20} risk={risk_score(window, ctx)}")
# Escalate only when score and corroboration agree â never on score alone.
Two rules keep a scoring model honest. First, no score initiates an investigation by itself: it queues human review, where a second independent signal must confirm that something real is happening. Second, scores are sampled and audited for demographic and cohort bias, because a model trained on one population will happily flag an entire team whose working pattern simply differs.
â ī¸Detection is not the program
A perfectly tuned UEBA deployment without a charter, an escalation path and a legal review will either sit unused or produce a discrimination complaint. Build the governance first: purpose, permitted signals, retention, access, appeal route, and who is authorized to open a case.
Program structure that survives scrutiny
Effective insider threat programs are small and cross-functional by design: security operations as the technical owner, human resources for employment context, legal for authority and privacy, IT for access data, and a business representative who understands what a critical process actually is. The charter should state the program's purpose in one sentence, list the signals it may use, define who can open and close a case, and require periodic review of both cases and model behavior.
Escalation must be written down before the first case: at what threshold is HR notified, when does legal join, when is an account contained rather than watched, and who decides. Watch-then-contain is a legitimate posture for suspected negligence, but the thresholds need to be pre-agreed; improvising containment while a case is live is how organizations both over-react and under-react within the same incident.
Investigation, response and fairness
Investigation steps mirror any other inquiry: preserve the evidence before acting, establish the timeline from independent sources, interview only after technical facts are solid, and document each decision with its justification. Containment options exist on a spectrum â targeted access reduction, enhanced logging, device inspection, suspension of credentials â and the least disruptive option that addresses the risk is almost always the right one for a negligent case.
Fairness is operational, not just ethical. Tell employees what monitoring exists and why, apply the same signals to equivalent roles, give individuals a route to correct mistaken context (a flagged resignation that never happened, a second job that was disclosed), and purge contextual data on a schedule. Organizations that get this right find the program improves security and survives employee scrutiny; those that do not find the program ends after its first internal complaint.
Common Mistakes
Running one undifferentiated insider program for all three profiles
Fix: Classify first: malicious, negligent and compromised require different responses.
Building baselines from a contaminated or too-short window
Fix: Use a full business cycle, refresh on schedule, and reset after role changes.
Escalating on an algorithmic score alone
Fix: Require human review plus a corroborating independent signal before opening a case.
Collecting content when metadata would answer the question
Fix: Prefer metadata, document purposes, and restrict contextual data to named roles.
Omitting HR and legal until a case is already live
Fix: Establish the charter, thresholds and escalation path before the first investigation.
Best Practices
- Publish a charter naming purpose, permitted signals, retention and access.
- Baseline per cohort when individual history is thin, and reset on role change.
- Audit scores and outcomes periodically for bias and false-positive concentration.
- Keep containment proportional, with the least disruptive effective option.
- Tell employees plainly what is monitored and why.
Key Takeaways
- Insider risk splits into malicious, negligent and compromised profiles with different responses.
- Baselines exist to make deviation visible cheaply, not to judge behavior.
- Contextual signals raise risk but require explicit governance to collect and use.
- Transparent scoring with human confirmation beats black-box risk numbers.
- A charter, escalation thresholds and an appeal route are what make the program defensible.
- Fairness practices are a security control: they keep the program alive after its first complaint.