Skip to content

Commit fecbcd4

Browse files
author
JERVS Auditor
committed
Improve log-analysis NewCredentials triage
1 parent f4f3374 commit fecbcd4

5 files changed

Lines changed: 114 additions & 9 deletions

File tree

skills/secops/log-analysis/SKILL.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ phase: [operate]
1313
frameworks: [MITRE-ATT&CK-v16, NIST-SP-800-92]
1414
difficulty: intermediate
1515
time_estimate: "20-40min"
16-
version: "1.0.0"
16+
version: "1.1.0"
1717
author: unitoneai
1818
license: MIT
1919
allowed-tools: Read, Grep, Glob
@@ -144,10 +144,24 @@ These Event IDs are the most security-relevant events in the Windows Security Ev
144144
| 5 | Service | Service start under a service account | Expected for known services; new service logons are suspicious |
145145
| 7 | Unlock | Workstation unlock | Normal for workstations |
146146
| 8 | NetworkCleartext | Logon with plaintext credentials over network | Security concern -- credentials exposed; legacy protocol indicator |
147-
| 9 | NewCredentials | Caller cloned token with new credentials (runas /netonly) | Lateral movement technique; always investigate |
147+
| 9 | NewCredentials | Caller cloned token with new credentials (runas /netonly) | Investigate when unexpected for the user, source host, process, network account, or outbound target |
148148
| 10 | RemoteInteractive | RDP logon | Expected for designated jump servers; suspicious on workstations or non-RDP servers |
149149
| 11 | CachedInteractive | Logon with cached domain credentials | Normal when DC is unreachable; suspicious if DC is available |
150150

151+
**LogonType 9 / NewCredentials triage matrix:**
152+
153+
Microsoft describes LogonType 9 as a local token clone that uses different credentials for outbound network connections. Treat it as a context-sensitive lateral-movement signal, not an automatic finding.
154+
155+
| Evidence field | Benign calibration | Suspicious calibration |
156+
|----------------|--------------------|------------------------|
157+
| Process and command line | `runas.exe /netonly`, MMC, SQL Server Management Studio, or approved admin tooling | Unapproved binary, LOLBin chain, encoded PowerShell, or missing process evidence on a host where command-line logging should exist |
158+
| Network account | Named admin, read-only admin, or service account expected for the workflow | Privileged account not normally used from this host or user context |
159+
| Source host role | Admin workstation, jump host, management server, or approved automation runner | Ordinary workstation, kiosk, shared desktop, or newly compromised endpoint |
160+
| Outbound target | Approved admin console, file share, database, or management plane in the change ticket | Multiple servers, domain controllers, admin shares, or hosts outside normal scope |
161+
| Related events | Event 4648 explicit credentials, 4688/Sysmon process creation, EDR process tree, and change ticket align | Missing 4648/process context, followed by SMB/RDP/WMI/WinRM bursts, privilege events, or unusual Kerberos/NTLM activity |
162+
163+
Use `P4/Informational` for expected NewCredentials use with owner and change evidence, `P3` when key context is missing, and `P2` or higher when Type 9 is paired with unusual privileged account use, lateral-movement protocols, or post-logon attacker behavior.
164+
151165
#### Process and Service Events
152166

153167
| Event ID | Description | Security Relevance | ATT&CK Mapping |
@@ -243,7 +257,7 @@ Identify deviations from established baselines that may indicate malicious activ
243257
| Category | Baseline Metric | Anomaly Indicator | Example |
244258
|----------|----------------|-------------------|---------|
245259
| **Temporal** | Normal working hours for user/system | Activity outside established hours | Domain admin logon at 3:00 AM on a holiday |
246-
| **Volumetric** | Average daily event count per source | Significant deviation from mean (> 2 std dev) | 500 failed logons from a host that averages 5 |
260+
| **Volumetric** | Daily/hourly event count per entity and source | Deviation from an entity-aware baseline; use mean/stddev only when the distribution supports it | 500 failed logons from a host that normally has 5, or a rare privileged event outside an approved maintenance window |
247261
| **Geographic** | Normal logon locations | Logon from new country or impossible travel | US-based user authenticates from Eastern Europe |
248262
| **Behavioral** | Normal processes, commands, and network destinations | First-time process execution, new outbound destination | PowerShell on a server that has never run PowerShell |
249263
| **Relational** | Normal user-to-resource access patterns | Access to resources outside normal scope | Finance user accessing engineering source code repository |
@@ -257,11 +271,21 @@ Identify deviations from established baselines that may indicate malicious activ
257271

258272
1. **Select the log source** and the specific metric to baseline (e.g., daily count of Event ID 4625 per source IP).
259273
2. **Collect 30-90 days** of historical data during a known-clean period.
260-
3. **Calculate statistics:** mean, median, standard deviation, 95th percentile, 99th percentile.
274+
3. **Calculate statistics:** mean, median, standard deviation, median absolute deviation, 95th percentile, 99th percentile, non-zero days, and maximum observed burst.
261275
4. **Identify recurring patterns:** daily cycles (business hours vs. off-hours), weekly cycles (weekday vs. weekend), monthly cycles (month-end processing).
262-
5. **Set thresholds:** Define anomaly thresholds at mean + 2 standard deviations for moderate alerts and mean + 3 standard deviations for high-priority alerts.
263-
6. **Document exclusions:** Record known legitimate outliers (patch Tuesday, quarterly audits, penetration tests) that should not trigger anomaly alerts.
264-
7. **Review and update baselines** quarterly or after significant environment changes.
276+
5. **Choose a threshold model:** Use mean + standard deviation only for reasonably dense and stable metrics. For sparse, bursty, or heavy-tailed security events, prefer entity-aware baselines, median/percentile thresholds, peer-group comparison, and explicit minimum-count or maintenance-window evidence.
277+
6. **Document exclusions:** Record known legitimate outliers (patch Tuesday, quarterly audits, penetration tests, approved admin maintenance) with owner, ticket, expiry, and revalidation trigger.
278+
7. **Record confidence:** Mark baselines as `strong`, `partial`, or `not evaluable` based on history length, data completeness, source health, entity coverage, and whether the assumed distribution fits the data.
279+
8. **Review and update baselines** quarterly or after significant environment changes.
280+
281+
**Baseline model selection:**
282+
283+
| Event shape | Recommended model | Avoid |
284+
|-------------|-------------------|-------|
285+
| Dense and stable counts | Mean/stddev plus percentile bands | Static thresholds with no review date |
286+
| Sparse administrative events | Entity-aware allowlist, maintenance-window evidence, peer group, and minimum-count logic | Treating one expected event as anomalous only because the historical mean is near zero |
287+
| Heavy-tailed or bursty activity | Median/MAD, percentiles, max burst, and documented outlier classes | Assuming normal distribution without checking variance and outliers |
288+
| Newly onboarded source | Temporary guardrail threshold plus `partial confidence` and revisit date | Calling absence of history a clean baseline |
265289

266290
**Baseline metrics to establish:**
267291

@@ -337,7 +361,7 @@ Produce log analysis findings in this structure:
337361
```markdown
338362
## Security Log Analysis Report
339363
**Date:** [YYYY-MM-DD]
340-
**Skill:** log-analysis v1.0.0
364+
**Skill:** log-analysis v1.1.0
341365
**Frameworks:** MITRE ATT&CK v16, NIST SP 800-92
342366
**Analyst:** [Name or AI-assisted]
343367

@@ -375,7 +399,7 @@ Produce log analysis findings in this structure:
375399
| [HH:MM:SS] | [Source] | [Description] | [T-ID] | [Suspicious / Benign / Confirmed malicious] |
376400

377401
### Baseline Observations
378-
[Any baseline deviations noted, with comparison to established norms]
402+
[Any baseline deviations noted, baseline method used, history window, confidence, and known-good context such as maintenance/change evidence]
379403

380404
### Visibility Gaps
381405
[Log sources that were not available but would have provided relevant data]
@@ -451,6 +475,14 @@ A single Event ID can have very different meanings depending on the context. Eve
451475

452476
Attempting to identify anomalous behavior without knowing what normal behavior looks like leads to both false positives (flagging normal activity as suspicious) and false negatives (missing truly anomalous activity that blends into an unfamiliar baseline). Invest in baseline establishment for high-value log sources before relying on anomaly-based analysis.
453477

478+
### Pitfall 6: Treating NewCredentials as Automatically Malicious
479+
480+
Windows LogonType 9 can indicate credential replay or lateral movement, but it is also generated by legitimate alternate-credential workflows such as `runas /netonly` from admin workstations. Do not escalate every Type 9 event by itself. Correlate process lineage, command line, network account, outbound target, source host role, related Event 4648, and change evidence before assigning severity.
481+
482+
### Pitfall 7: Applying Mean and Standard Deviation to Sparse Security Events
483+
484+
Many security-relevant events are sparse or heavy-tailed: privileged alternate-credential use, admin maintenance, rare service restarts, and one-off cloud control-plane actions. Mean plus standard deviation can over-alert on expected one-off work or under-alert after a single large burst inflates the baseline. Use entity-aware baselines, percentiles, median/MAD, peer comparison, maintenance windows, and explicit confidence labels for sparse sources.
485+
454486
---
455487

456488
## 8. Prompt Injection Safety Notice
@@ -478,3 +510,4 @@ This skill processes user-supplied content that may include raw log data, event
478510
9. **AWS CloudTrail Event Reference** -- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html
479511
10. **Azure Activity Log Schema** -- https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log-schema
480512
11. **NIST SP 800-61 Rev 2 -- Incident Handling Guide** -- https://csrc.nist.gov/publications/detail/sp/800-61/rev-2/final
513+
12. **Microsoft Event 4624 -- Logon types and NewCredentials fields** -- https://learn.microsoft.com/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4624
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Benign calibration: sparse baseline with approved maintenance
2+
3+
```text
4+
Metric: daily NewCredentials events for admin workstation aw-17
5+
History: 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0
6+
CurrentCount: 1
7+
Context: quarterly maintenance window
8+
Owner: infrastructure operations
9+
Ticket: CHG-2026-0605
10+
```
11+
12+
Expected assessment: do not alert only because the mean is near zero. Use owner/ticket evidence, event context, and peer/admin-workstation baseline before scoring severity.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Benign calibration: approved NewCredentials admin workflow
2+
3+
```text
4+
EventID: 4624
5+
LogonType: 9
6+
LogonProcessName: seclogo
7+
AuthenticationPackageName: Negotiate
8+
SubjectUserName: analyst01
9+
TargetUserName: analyst01
10+
NetworkAccountName: domain-admin-readonly
11+
ProcessName: C:\Windows\System32\runas.exe
12+
CommandLine: runas /netonly /user:DOMAIN\domain-admin-readonly mmc.exe
13+
SourceHostRole: admin workstation
14+
OutboundTarget: management console subnet
15+
RelatedEvent: 4648 explicit credentials present
16+
ChangeTicket: CHG-2026-0605
17+
```
18+
19+
Expected assessment: informational or benign true positive when the account, process, source host, target, and change ticket match approved administration. Do not mark as lateral movement solely because `LogonType` is `9`.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Vulnerable calibration: sparse low-and-slow aggregate pattern
2+
3+
```text
4+
Metric: failed logons against privileged accounts
5+
PerEntityCounts:
6+
admin-a: 1
7+
admin-b: 1
8+
admin-c: 1
9+
admin-d: 1
10+
admin-e: 1
11+
SourceIPs:
12+
- 198.51.100.10
13+
- 198.51.100.11
14+
- 198.51.100.12
15+
- 198.51.100.13
16+
TimeWindow: 25 minutes
17+
MaintenanceWindow: none
18+
```
19+
20+
Expected assessment: escalate the aggregate pattern even if each single entity count is small. Peer-group and population-level analysis should catch low-and-slow password spraying that per-user mean/stddev thresholds may miss.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Vulnerable calibration: unexpected NewCredentials lateral movement
2+
3+
```text
4+
EventID: 4624
5+
LogonType: 9
6+
LogonProcessName: seclogo
7+
AuthenticationPackageName: Negotiate
8+
SubjectUserName: helpdesk-temp
9+
TargetUserName: helpdesk-temp
10+
NetworkAccountName: domain-admin
11+
ProcessName: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
12+
CommandLine: powershell.exe -NoProfile -EncodedCommand <redacted>
13+
SourceHostRole: ordinary workstation
14+
RelatedEvent: 4648 missing
15+
FollowOnEvents:
16+
- SMB connection to dc-01
17+
- WinRM connection to app-07
18+
- EventID 4672 special privileges assigned
19+
```
20+
21+
Expected assessment: high priority investigation because Type 9 is paired with unexpected privileged network credentials, suspicious process evidence, non-admin source host role, and follow-on lateral-movement protocols.

0 commit comments

Comments
 (0)