Downloads · 30 days
0
stetteh/identity-anomaly
identity-anomaly is a machine learning model from stetteh. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
An Isolation Forest model that flags anomalous authentication events — the patterns behind credential compromise, lateral movement, and insider threats — across a hybrid (cloud + on-prem) identity environment. Trained…
Downloads · 30 days
0
Access
Public
Updated Jul 17, 2026
Repo size
1.1 MB
Likes
1
Public
Click a slice to open those files.
.pkl1.1 MB · 97%
From the Hugging Face model README
An Isolation Forest model that flags anomalous authentication events — the patterns behind credential compromise, lateral movement, and insider threats — across a hybrid (cloud + on-prem) identity environment. Trained and evaluated on the LANL authentication dataset (~2M events).
Scores each login event and returns an anomaly score (negative = anomalous). It uses 9 features: time (hour / day-of-week / weekend), a per-user 1-hour rolling login count and distinct-machine count, and encoded logon type / auth type / orientation / success. The two rolling features make the scorer stateful — feed events in time order and it behaves like a live stream.
pip install -r requirements.txt
python example.py
from identity_score import score_event
score_event({"src_user":"u1@DOM","src_pc":"PC1","auth_type":"Kerberos",
"logon_type":"Network","orientation":"LogOn","success":"Success"})
# -> {"is_anomaly": false, "anomaly_score": ..., "hourly_count": 1, "unique_pcs": 1}
docker run -p 8081:8080 ghcr.io/samuelgtetteh/identity-anomaly:0.1
curl -s localhost:8081/score -H 'Content-Type: application/json' \
-d '{"src_user":"u1@DOM","src_pc":"PC1","auth_type":"Kerberos","logon_type":"Network","orientation":"LogOn","success":"Success"}'
isolation_forest_model.pkl — the trained model · scaler.pkl — the fitted StandardScaleridentity_score.py — feature engineering + scoring · serve.py — FastAPI wrapperAssistive detection for a SOC: it surfaces events worth investigating, not a verdict. Anomaly ≠ malicious — a human should triage flagged events. Feature encodings and rolling-window semantics match the training/serving pipeline; scores are only comparable within the same deployment.
Trained on the LANL "Comprehensive, Multi-Source Cyber-Security Events" dataset (subject to LANL's
terms). Code and released weights: Apache-2.0 (LICENSE).
Tetteh, S. G. Hybrid Identity Anomaly Detection. Jarvis College of Computing and Digital Media, DePaul University.