Skip to content
Tech Interview Prep
Technical interview guide

Security Monitoring & Logging

What to log, how SIEMs correlate it, and the difference between detection and prevention controls.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: NIST SP 800-53 Rev. 5; NIST SP 800-92 final plus Rev. 1 initial public draft context; MITRE ATT&CK detection strategies accessed 2026-08-31.

Interview Q&A

Treat each question like a live interview question: answer out loud first (structure, assumptions, tradeoffs), then open the model answer to spot gaps and rehearse a tighter follow-up.

Curated: · Written: · Reviewed:

25 questions

Q&A-2

Decide what a new payment service should log for security.

Answer

What I'd say first

Log at the decision point, not at the edge. For a payment service the security-relevant decisions are: session establishment, authorization on every money-moving call, the payment state transition, refunds and voids, privileged support actions, key and config changes, and bulk data export. One structured event per decision, one schema, and the log pipeline gets its own SLO, because logging is detective, not preventive. It never stops a fraudulent refund; it makes that refund findable in 90 seconds instead of 9 hours.

Assumption I'd state out loud: this service stores PAN, so PCI DSS v4.0 applies. If it's tokenization-only and never sees a PAN, the field list shrinks and retention becomes a business call.

The event

PCI DSS v4.0 Req 10.2.2 names the minimum: user identification, event type, date/time, success or failure, origination, and the affected resource. Everything else is what your investigation needs.

fieldwhyexample
event_iddedupe on retryuuidv4
event_time, receipt_timedetect clock skew and pipeline lagRFC 3339, UTC
actor_id, actor_typewhosup_8812 / customer / service
on_behalf_ofdelegated support accesscust_3391
action, outcomewhat was attempted and decidedrefund / allow
object, tenantwhat it touchedord_5521, merchant_44
amount, currencymoney-moving events only4200, USD
reason_codewhy, without free textgoodwill
trace_idjoins to gateway and DB evidenceW3C traceparent
schema_version, service, envparse and routepay.audit.v1

Never in the event: PAN beyond the first six and last four digits, CVV, full track data, PINs, passwords, tokens, private keys. PCI DSS v4.0 Req 3.3.1 forbids storing SAD after authorization, and Req 3.4.1 requires stored PAN to be rendered unreadable.

Trade-offs

Volume vs investigability. Size it: 200 TPS × ~6 audit events per payment = 1,200 events/s; at 1 KB each that's ~1.2 MB/s, ~100 GB/day, ~3 TB/month. PCI DSS v4.0 Req 10.5.1 wants 12 months retained with the most recent 3 months immediately searchable: ~37 TB raw, ~4 TB after JSON compression in object storage. That number is what kills "log the whole request body".

Exclusion vs field-level encryption. Encrypting a PAN into the log keeps it in PCI scope and in your key-rotation path; excluding it doesn't. Exclude by default; encrypt only where a dispute or regulator genuinely needs the value.

Synchronous vs asynchronous. Writing the audit event in the same DB transaction as the payment guarantees no money moves unrecorded, but couples payment availability to log storage. The outbox pattern gets both: write to a local outbox table inside the payment transaction, ship asynchronously to the central store. Never block the payment on the central sink.

Failure modes

  • Log injection. A merchant name of Acme\n{"outcome":"allow"} forges a second event in a line-delimited sink. JSON-encode every value, strip control characters, alert on parse failures.
  • PAN in free text. A decline reason or support note carrying a full PAN. Regex-scan the stream at ingest and in CI.
  • Clock skew. A host four minutes off reorders the trace. PCI DSS v4.0 Req 10.6 requires time sync; alert above 1s offset.
  • Duplicates on retry. Dedupe on event_id at ingest.
  • Pipeline outage. If the payment path blocks on the sink, a logging outage becomes a payment outage.

Worked trace

Support agent sup_8812 refunds ord_5521 twice in 90 seconds:

{"event_id":"a1","event_time":"2025-03-04T10:00:00Z","actor_id":"sup_8812","actor_type":"support","on_behalf_of":"cust_3391","action":"payment.refund","outcome":"allow","object":"ord_5521","amount":4200,"currency":"USD","reason_code":"goodwill","trace_id":"4bf92f..."}
{"event_id":"b7","event_time":"2025-03-04T10:01:30Z","actor_id":"sup_8812","actor_type":"support","on_behalf_of":"cust_3391","action":"payment.refund","outcome":"allow","object":"ord_5521","amount":4200,"currency":"USD","reason_code":"goodwill","trace_id":"9c1d04..."}

Detection rule: two payment.refund events with outcome=allow, same object, different event_id, within 300s → page. That rule is only writable because object, amount and actor are structured fields rather than prose.

What would change the decision

If the service never stores PAN, drop the masking machinery and the 12-month floor becomes a business choice. If a financial-records rule sets a longer retention, that dominates PCI's 12 months. And if the payment path can't tolerate the outbox write, you're choosing between losing audit events and losing payments: pick the outbox.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-3

Define a durable security event schema and evolution strategy.

Answer

Assumptions. Multi-tenant SaaS, several producers (services, endpoint agents, cloud audit trails) feeding one security data lake, consumers that include detection rules, IR tooling and compliance exports. If you have one consumer and no replay requirement, the versioning machinery below is overkill: keep the envelope and the additive-only rule and stop there.

Core answer. Two artefacts: a stable envelope and a versioned payload.

Envelope, producer-set and immutable:

  • event_id: UUIDv7 or ULID, generated once at the source, never regenerated on retry.
  • event_time (when the action happened, source clock) and observed_time (when the collector saw it).
  • source, service, env, region, tenant_id.
  • schema_version: major.minor.
  • actor (principal id, type, auth method, session id), action, target (type + id), outcome (success/failure/unknown) + reason_code.
  • severity and category from a controlled vocabulary: OCSF categories or your own, but one list, not per-team.
  • correlation_id, trace_id, request_id.
  • integrity: hash or signature over the canonical serialization, plus producer build id.

Payload: typed fields, controlled vocabularies for anything a detection rule keys on, and a raw blob holding the source-native record.

Why these choices behave the way they do. Immutable event_id exists because at-least-once delivery, retries and multi-path ingestion (agent plus cloud trail) all produce duplicates. A stable ID makes dedupe a keyed upsert instead of a heuristic on timestamp+actor, and it is what lets you prove chain of custody: the same event replayed from cold storage keeps its identity. Two timestamps exist because source clocks skew and events arrive late: detection windows key on event_time, retention and lag monitoring key on observed_time. Collapsing them loses the difference between "the attacker acted at 02:00" and "we learned about it at 09:00".

Evolution rules. Take the shape of CloudEvents 1.0 and ECS 8.x: a required core plus extension attributes, and consumers that ignore unknown fields.

ChangeVersion bumpConsumer action
New optional field, new enum valueminornone
Redefining outcome, changing units, tightening a typemajor, new topic/tablemigrate on own schedule
Field deprecationmarked in release N, still written two quarters, removed N+2none until removal

Unknown enum values are preserved verbatim, never coerced to a default. A parser that maps an unrecognised action to "other" silently destroys the signal a new detection rule needs.

Trade-offs. In-place mutation of a shared schema is cheapest and breaks every consumer at once: acceptable only when you own all consumers and can deploy them together. Dual-write (old and new shape) costs roughly 2x storage and write throughput for the migration window and buys zero-downtime consumer migration; use it when consumers deploy independently or you cannot coordinate a flag day. A versioned topic (security.events.v1, security.events.v2) is the cleanest cut: consumers migrate on their own schedule, no dual-write cost, but you run two live pipelines and a routing layer. Prefer it for major changes. Do not dual-write for additive changes; a new optional field needs no migration.

Failure modes and how you detect them.

  • Unknown schema_version above ~0.1% of ingest: a producer shipped ahead of the registry. Alert.
  • Null rate on a required field jumping, e.g. actor.id from 0.2% to 4%: producer regression or a new source not populating it.
  • Consumer parse-failure rate above ~0.5% over 5 minutes: schema drift; page.
  • Coercion bug: assert round-trip, parse then re-serialize must equal the raw payload for unknown values.

Replay. Keep raw events for the retention window (example policy values: 90 days hot, 13 months cold for compliance) so a parser fix is replayed against history, not only forward.

What would change this: a single consumer with no replay requirement drops versioned topics and dual-write; the envelope and additive-only rule stay.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-7

Build reliable collection for cloud, Kubernetes, and ephemeral workloads.

Answer

Clarify and assume. Three sources: cloud control-plane and audit streams (CloudTrail, VPC Flow Logs, Azure Activity Log), Kubernetes container logs from managed and self-managed clusters, and ephemeral compute (Lambda, Fargate, batch, spot). "Reliable" here means three things: no silent loss, every record attributable to a stable identity, and the pipeline itself observable. If you only need best-effort search, most of this is overkill.

Core answer: decouple collection from the workload lifecycle. Never collect from inside the thing that is about to die.

  • Kubernetes: one DaemonSet agent per node tails /var/log/containers/*.log (symlinks into /var/log/pods), enriches with pod metadata from the API server, forwards to a collector tier.
  • Fargate: FireLens sidecar running Fluent Bit or Fluentd. It is the supported way to get container logs off Fargate; you do not own the host.
  • Lambda: a Lambda extension or a CloudWatch Logs subscription filter. Platform delivery is the only option, and it is at-least-once, so dedupe on the request ID rather than trusting log order.
  • Cloud control plane: CloudTrail → CloudWatch Logs → subscription filter → Kinesis Firehose → S3.
INI
[INPUT]
    Name            tail
    Path            /var/log/containers/*.log
    Tag             kube.*
    DB              /var/log/flb/flb_kube.db      # hostPath: read position survives restart
    Mem_Buf_Limit   50MB
    Skip_Long_Lines On

[FILTER]
    Name            kubernetes
    Match           kube.*
    Kube_URL        https://kubernetes.default.svc:443
    Kube_CA_File    /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    Kube_Token_File /var/run/secrets/kubernetes.io/serviceaccount/token
    Merge_Log       On

[OUTPUT]
    Name            forward
    Match           *
    Host            collector.internal
    Port            24224

Identity. Attach pod UID, namespace, deployment, node, cluster name, and cloud account/region. Pod name and pod IP are not identity: they are reused. The Kubernetes filter gets this by querying the API server and caching the result, which is why the agent needs list/watch on pods and namespaces.

Backpressure. When the buffer fills, the agent stops reading rather than dropping: that is the right default, but it means the agent falls behind and you must alert on it.

BufferToolDefaultSurvives agent crash
MemoryFluent BitMem_Buf_Limit 5MBNo
FilesystemFluent Bitoff; opt in via storage.type filesystem + storage.pathYes, needs a hostPath
FileFluentd@type file, buffer_chunk_limit 8MBYes

For audit logs, use disk-backed buffering. Memory buffers are faster and lose everything on a crash.

Node agent vs sidecar. A DaemonSet costs one agent per node regardless of pod count; a sidecar costs per pod. Hypothetical arithmetic: a sidecar at 50m CPU / 100Mi on a 30-pod node reserves 1.5 vCPU and 3GiB before any application runs, against one DaemonSet agent at 100m / 200Mi. The DaemonSet also cannot see logs an app writes to a file instead of stdout: that is the real reason to reach for a sidecar, not density.

Failure modes and detection.

  1. Agent not scheduled on a node (taint, resource pressure). Compare available DaemonSet pods to node count; alert on mismatch past 5 minutes. Symptom: an entire node's logs are absent.
  2. Output backpressure. Watch fluentbit_output_errors_total and fluentbit_output_retries_failed_total from the agent's /api/v1/metrics/prometheus endpoint. Rising counters mean gaps downstream.
  3. RBAC failure. 403s in agent logs; records arrive with no pod metadata and become unattributable.
  4. Clock skew. Compare node time to NTP. Past ~1 second, ordering in an investigation is unreliable: carry an ingestion-side receive timestamp as a second field.
  5. Cardinality explosion. If pod UID becomes a Prometheus label, active series grow with every restart. Watch series count per tenant.

Watch the pipeline itself. A canary pod emits a known line every 60 seconds; alert if it is not seen within 2 minutes. Track lag as ingest time minus event time.

Retain outside the blast radius. Ship to a separate account with write-only credentials from the cluster, and put S3 Object Lock on audit buckets so a compromised node cannot delete its own evidence.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-10

Handle clock skew and ordering across distributed security events.

Answer

Assumptions first. The events come from many hosts and appliances we don't fully control (EDR agents, firewalls, cloud audit logs) and the goal is a timeline an incident responder can defend, not a perfectly ordered stream. If everything came from one host with a monotonic counter, most of this collapses.

The core answer. Bound the skew, carry provenance, and order by causality rather than by timestamp.

Bound it: sync every host to authenticated time. NTP with symmetric keys or NTS, chrony as the client on Linux, and PTP (IEEE 1588) where you have hardware timestamping and need sub-microsecond. NTP gets you single-digit milliseconds on a LAN and tens of milliseconds across a WAN; PTP gets you under a microsecond. That's the budget you design against. A free-running quartz oscillator drifts 10–100 ppm, which is 0.86 to 8.64 seconds per day, so a host that lost its time source for a day is off by seconds, not milliseconds.

Alert on the offset, not just on sync failure. chronyc tracking reports the current offset; node_exporter exposes it as node_timex_offset_seconds. Page when |offset| exceeds your budget: 100 ms is a reasonable starting threshold for a fleet on NTP, tighter if you're correlating at sub-second granularity. Watch step-versus-slew behaviour too: chrony's shipped default is makestep 1.0 3, which steps the clock if the offset exceeds one second during the first three updates. A step backwards means events can arrive with timestamps earlier than ones already ingested.

Carry provenance: record source event time with offset and precision, collector receipt time, and the measured offset at receipt. RFC 5424 syslog has a timeQuality structured-data element with tzKnown, isSynced and syncAccuracy: populate it. Keep the raw record; normalize into a separate field. RFC 3164 is the trap: no year, no timezone, so two events from different hosts are not comparable at all.

Order by causality: W3C traceparent trace-id and span-id, session and transaction IDs, and per-source sequence numbers. Windows event logs give you EventRecordID, monotonic within a log. Linux gives you CLOCK_MONOTONIC plus boot_id from /proc/sys/kernel/random/boot_id: the monotonic clock never jumps, but it resets on reboot, so you need boot_id to know which epoch you're in.

Handle lateness explicitly. In Kafka Streams, windowed aggregations have a 24-hour default grace period; in Flink, a watermark is the assertion that no event older than it will arrive, and anything earlier is dropped unless you set allowed lateness. Pick the watermark from measured p99 ingest delay, not from a guess, and dedupe on event ID with a window at least as long as your retry horizon.

Worked check: a host whose clock stepped back 2 seconds mid-incident:

signalvaluewhat it tells you
source time12:00:03Z then 12:00:01Zimpossible order if you trust it
receipt time12:00:05Z, 12:00:06Zmonotonic, always increasing
node_timex_offset_seconds+2.0 at 12:00:04Zthe step is visible
boot_idunchangednot a reboot
trace-idsame on boththey're causally linked

Order by receipt time and trace-id; annotate the source timestamps as unreliable for that window.

Failure modes: DST and timezone errors (store UTC, ISO 8601 with offset, never local time); offline endpoints that buffer and flush hours of events at once; dedupe windows shorter than the retry horizon, which turn one event into three; and rewriting raw evidence to make the story consistent. Never do that.

What would change the decision: with bounded-uncertainty time like Google's TrueTime, the Spanner paper reports ε typically under 7 ms, you could order by timestamp and wait out the uncertainty. Without that, causality is the only ordering you can defend.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-11

Engineer the telemetry pipeline as a security-critical service.

Answer

Assumptions I'd state up front: telemetry means traces, metrics and logs from production hosts; the pipeline is security-critical because an attacker who can forge, drop or read it defeats detection and leaks secrets (tokens, internal topology, PII in span attributes). I'll assume Kafka as the buffer, object storage as the cold tier, and a shared query tier over per-tenant ingest.

The design turns on three decisions. First, who is trusted to write. Producers are not trusted by default: each agent authenticates with mTLS and a workload identity (SPIFFE/SPIRE-issued SVID), not a shared token baked into config. A shared token can't be revoked per-host and leaks through config management; per-workload identity means a compromised host is one revocation away from being cut off. Second, where durability is bought. Kafka with acks=all and min.insync.replicas=2 on a 3-replica topic survives one broker loss; the cost is that a write blocks when two replicas are down, so the producer needs a delivery timeout and a local disk buffer to absorb that window. Third, how the read path is separated from the write path. Query credentials are read-only and scoped per tenant; the ingest plane never accepts a query. This is what stops a query bug from becoming a write-path compromise.

Java
// Kafka client 3.6, Java 17
props.put(ProducerConfig.ACKS_CONFIG, "all");
props.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, "true");
props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, "5");
props.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, "120000");

Idempotence plus in-flight ≤5 preserves per-partition ordering while still pipelining; drop idempotence and a retry after a timeout duplicates records, which corrupts any count-based alert.

The trade-off that decides most of the cost: head sampling versus completeness. At 50k spans/s and ~1 KB each, raw ingest is ~50 MB/s, or ~4.3 TB/day, ~130 TB over 30 days. Head-sampling 10% cuts that to ~13 TB, but it blinds you to rare events: the exact ones detection rules fire on. Tail sampling keeps errors and slow traces but must buffer every span for the decision window, so memory scales with ingest rate, not with what you keep. The criterion: sample an event class only if its detection rules tolerate the loss; keep auth failures, 5xx and anything feeding an alert at 100%.

Failure modes and how each is detected:

  • Silent collector. Error-rate alerts miss this: a dead collector emits nothing. Use a dead-man's switch: alert on the absence of a heartbeat metric, not on its value.
  • Clock skew. Producers stamp time; if skew exceeds the ordering window, spans land out of order and traces fragment. Detect by comparing producer timestamp against ingest timestamp and alerting on the p99 delta.
  • Cardinality explosion. One unbounded label (user ID, request ID) multiplies series count and blows up the index. Detect with per-metric series count; cap it and route overflow to a bounded fallback label.
  • Poison record. One malformed record stalls a partition. Quarantine the raw bytes to a dead-letter topic with the offset, and alert on dead-letter depth.
SLO (example targets)TargetDetected by
Freshnessp99 ingest→queryable < 60 singest vs query timestamp delta
Completeness≥99.9% of emitted spans storedproducer sequence-gap counter
Durability0 loss on single-broker lossmin.insync.replicas + restore drill
Query availability99.9% read successread-path error budget

Every drop path (sampling, backpressure, quarantine, retention) increments a counter, so a gap in telemetry is always attributable to a named mechanism rather than to silence.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-13

How do you design a tiered log storage architecture (hot, warm, cold) balancing query latency, cost, and historical forensic investigation requirements?

Answer

Tiering balances search latency for active detection against long-term cost and forensic integrity. Under NIST SP 800-92 Rev. 1 guidance, security log storage must support both rapid near-real-time correlation and verifiable historical analysis without letting indexing overhead exhaust the telemetry budget.

Storage Architecture and Lifecycle

[Sources: Endpoints, Cloud, NetFlow]
                   │
                   ▼
   ┌────────────────────────────────┐
   │ Telemetry Ingest & Schema Map  │ (OpenTelemetry / Syslog)
   └───────┬────────────────┬───────┘
           │                │
           ▼                ▼
   ┌───────────────┐ ┌────────────────────────────────────────┐
   │ Hot Storage   │ │ Cold Storage Direct Stream (Raw Immut) │
   │ SSD / Memory  │ │ Object Storage + WORM Lock + Manifests │
   └───────┬───────┘ └────────────────────────────────────────┘
           │ (Day 7-14)
           ▼
   ┌───────────────┐
   │ Warm Storage  │
   │ Sparse / S3   │
   └───────┬───────┘
           │ (Day 30-90)
           ▼
   ┌───────────────┐
   │ Hydrate / Purge
   └───────────────┘
  1. Hot Tier (0–7 or 14 days): Dedicated to automated detections, alerting, and rapid incident triage. Storage uses local NVMe/SSD on distributed search clusters (e.g., Elasticsearch, OpenSearch, ClickHouse). Log schemas are heavily indexed on high-cardinality fields (user.id, source.ip, process.hash). Sub-second to 5-second query latency for rolling correlation windows.
  2. Warm Tier (15–30 or 90 days): Dedicated to active threat hunts, secondary incident analysis, and medium-horizon investigations. Data resides on cheaper object storage backed by stateless query engines, or on nodes with attached block storage using read-only indices with warm caching. Heavy inverted indexes are stripped or shrunk (e.g., Lucene force-merge to single segment, columnar Parquet/ZSTD formats); full-text tokenization is disabled in favor of target field indexes. Query latencies range from 15 seconds to a few minutes.
  3. Cold / Archive Tier (90–365+ days): Fulfills compliance mandates (NIST SP 800-53 AU-11) and multi-month APT scoping. Stored in raw compressed format (Zstandard/Snappy-compressed NDJSON or Parquet) in low-cost object storage (e.g., AWS S3 Glacier Instant Retrieval / Standard-IA) under an independently enforced WORM (Object Lock/Compliance mode) policy. Data is queried in place via federated query engines (Trino, Athena, Data Lake engines) or selectively rehydrated into warm compute.

Worked Cost and Capacity Trace

Assume an enterprise ingest of 1 TB/day uncompressed raw security logs:

TierRetentionFormat / TechRaw DataVolume StoredMonthly Cost (Est.)Search Latency
Hot7 DaysFull Inverted Index (1.3x bloat)7 TB9.1 TB on NVMe~$1,800 (compute + SSD)< 3s
Warm83 DaysColumnar Parquet (4:1 compression)83 TB20.75 TB Object / Cached~$550 (S3 Standard / block)10s – 2m
Cold275 DaysCompressed Parquet + Object Lock275 TB68.75 TB Archive Tier~$280 (Glacier Instant / IA)5m – hours
Total365 Days-365 TB98.6 TB Physical~$2,630 / mo-

Tradeoff check: Storing all 365 days hot would require ~475 TB of provisioned SSDs and massive cluster node counts costing >$30,000/month. Conversely, streaming raw logs straight to cold storage with no hot index drops storage cost to ~$1,500/month but breaks streaming SIEM detection SLOs entirely.

Forensic Investigation Guarantees

  • Immutable Ingest Path: Raw telemetry is teed at the collector pipeline: one branch feeds hot ingestion, while an unmodified stream writes directly to immutable cold object storage with cryptographic batch manifests (SHA-256 hashes generated per block).
  • Query In-Place vs. Hydration: Analysts query targeted cold intervals using partition pruning (dt=2024-03-01/hour=14/source=edr/) to prevent expensive scanning. If full forensic re-indexing is required for legal disclosure, an automated hydration worker pulls compressed partitions and spins up an isolated, ephemeral single-tenant cluster.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-12

Make high-value logs tamper-evident and resilient to deletion.

Answer

Assumption and core answer (first 90 seconds)

I'll assume the adversary is a privileged insider or a compromised service that already has write access to the pipeline, and the requirement is bounded-time detection of deletion or alteration, not impossibility. If you need impossibility, you need WORM media plus a second party, and you should say that out loud.

The answer is three layers, each covering the one below it:

  1. Write path: every record commits to the previous one, so a deletion in the middle breaks verification at the next record.
  2. Storage: the bucket refuses deletion for a fixed window, so the attacker can't simply rewrite the chain.
  3. Anchor: a signed digest of the chain head lands somewhere the attacker doesn't control, so tail truncation is visible.

Mechanism

Each record carries seq, ts, payload, prev = SHA-256(previous record), and hash = SHA-256(seq || ts || payload || prev). A verifier walks the log from the last known-good checkpoint and recomputes. Delete record 5 and record 6's prev no longer matches: caught. Delete records 100 through the end and every remaining record still verifies: the chain is intact, just shorter. That is the failure the anchor exists for.

Every 5 minutes (or every 10k records) compute a Merkle root over the batch, sign it with a key held outside the log account, and write the signed root to a second bucket with its own Object Lock. This is the Certificate Transparency shape (RFC 6962): the log can't equivocate about what it contained, because the signed tree head is already published. A verifier that finds the newest anchor older than 15 minutes raises.

Storage specifics

S3 Object Lock in compliance mode with a 365-day retention: no principal, including the account root, can delete or overwrite that version until it expires. It requires versioning enabled at bucket creation: you cannot retrofit it. Governance mode is weaker: anyone holding s3:BypassGovernanceRetention can delete, so if you use it, that permission belongs only in the break-glass role. GCS Bucket Lock and Azure's locked time-based retention policy are the equivalents; GCS's lock is irreversible once set.

IAM: the writer role gets s3:PutObject and nothing else. The verifier gets GetObject on the log bucket and read on the anchor bucket. No principal holds both PutObject and DeleteObject on the log bucket. Break-glass is MFA-gated and its use pages.

Failure modes and how you catch them

  • Tail truncation. The chain verifies. Caught by anchor freshness, not by chain verification.
  • Governance-mode bypass. Caught by CloudTrail data events on the bucket (off by default and billed per event, so enable them on the log bucket only) filtered to BypassGovernanceRetention and DeleteObject.
  • Retention misconfiguration. A 1-day retention on a bucket that needs a year looks fine until day two. Caught by a daily job that reads GetObjectLockConfiguration and diffs it against the expected value in config-as-code.
  • Producer compromise. A signature proves the batch came from the producer's key, not that the event is true. Sample-audit against an independent source, the service's own database, to bound this; don't claim the log proves truth.
  • Timestamp forgery. Order by monotonic seq, never by ts.

Cost and the erasure conflict

Retention is the expensive part. Tier it: 30 days in S3 Standard, then lifecycle to Glacier Deep Archive at roughly $1 per TB-month, accepting hours to restore. For GDPR erasure against an immutable log, encrypt each subject's records under a per-subject key and destroy the key: the ciphertext stays, the chain still verifies, the PII is gone. Extracts leave the system under chain of custody; the log itself is not the evidence, the extract is.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-6

Protect secrets and personal data in security telemetry.

Answer

Assumptions: you own the producer SDK and the collector, you hold key material in a KMS, and the regulatory frame is PCI DSS plus GDPR. "Telemetry" means logs, traces and metrics.

Core answer. Keep the secret out of the pipeline at the source, and make whatever does reach it non-identifying. Three moves: a field allowlist at the producer, keyed pseudonymisation for identifiers, and collector-side scanning as a backstop only. Redaction is a producer responsibility because the producer is the only component that knows the schema and the semantics; the collector sees bytes.

Why producer-side wins. A collector-side regex runs after the event has crossed the network and landed in the collector's receive buffer and, on a bad day, its disk queue. A compromised or misconfigured collector therefore leaks the secret it was supposed to strip. Producer-side redaction runs in-process before serialisation, so the secret never leaves the host. The cost is update latency: a new secret pattern means a fleet redeploy, not a config push. That is why you do both: producer for the fields you know, collector for the ones you missed.

Pseudonymisation. Replace identifiers with HMAC-SHA-256(tenant_key, id) truncated to 128 bits. Same input, same output, so joins across events survive; different tenant keys mean a cross-tenant join is impossible. Prefix the key version (v3_...) so rotation doesn't silently break correlation: without it every user gets a new pseudonym on rotation and your 30-day trend line splits in two.

Python
import re, hmac, hashlib

SECRET_KEYS = {"authorization", "cookie", "set-cookie", "x-api-key", "password"}
TOKEN_RE = re.compile(r"(?i)\b(bearer|basic)\s+[A-Za-z0-9._~+/=-]{8,}")

def redact(record: dict, tenant_key: bytes) -> dict:
    for k in list(record):
        if k.lower() in SECRET_KEYS:
            record[k] = "[REDACTED]"
    if "user_id" in record:
        uid = str(record["user_id"]).encode()
        digest = hmac.new(tenant_key, uid, hashlib.sha256).hexdigest()[:32]
        record["user_id"] = f"v3_{digest}"
    if "message" in record:
        record["message"] = TOKEN_RE.sub(r"\1 [REDACTED]", record["message"])
    return record

Trace: {"authorization": "Bearer eyJhbGci...", "user_id": "alice@corp.com", "message": "login ok"} → authorization becomes [REDACTED]; user_id becomes v3_ plus 32 hex chars, deterministic for that tenant key; message is unchanged because it matches nothing. Run the same record twice and the pseudonym is identical: that is the correlation property.

What the regex misses. A token base64-wrapped inside a JSON body field, a token split across two log lines, or a format you haven't seen. Detection is best-effort; the allowlist is the control. Route suspected-secret events to a quarantine index with tighter access and 7-day retention rather than dropping them silently, so you can still investigate.

Scale of the leak you're preventing. 50k events/s with 1% carrying a bearer token is 500 tokens/s, 43.2M/day. At ~200 bytes each that is ~8.6 GB/day of live credentials sitting in a searchable index.

producer-sidecollector-side
secret exposure windownever leaves hostcrosses network, sits in collector buffer/disk
update costfleet redeploycentral config push
knows field semanticsyesno
can recover dropped fieldnono

Failure modes. Over-redaction: dropping the whole request body because one field is sensitive makes the telemetry useless. Allowlist fields, don't denylist. Key rotation without a version prefix breaks joins. A collector quarantine that silently drops loses the incident evidence. And a pseudonym is still personal data under GDPR if you hold the key, so treat the key as the crown jewel: KMS-backed, access-logged, stored separately from the telemetry store.

Retention and access. Raw telemetry 30 days, pseudonymised aggregates 13 months, legal hold suspends deletion, and deletion is verified by re-querying the index for the pseudonym and confirming zero hits. Break-glass access is a 4-hour TTL role with every query logged; exports are watermarked with the requester ID. Third parties get aggregates, never the key.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-25

Walk me through onboarding a new log source into our security monitoring platform: how you parse and normalize its fields, what enrichment you apply, how you handle parse failures and unmapped fields, and how you prove detections actually fire on the new data?

Answer

Assumptions I'd state up front: the platform has a common event schema. I'll use ECS 8.x field names, and the same mapping holds if the platform is OCSF-native; ingestion is a stream pipeline (Vector, Fluent Bit, Logstash, or the SIEM's own ingest); and the source is a SaaS audit log pulled as JSON over an API.

The pipeline is four stages, and the last one is the acceptance test, not an afterthought: parse → normalize → enrich → prove detections fire.

Normalize against an explicit mapping table. Not best-effort guessing. For a vendor audit log:

raw fieldECS targetrule
ts (epoch ms)@timestampconvert to UTC RFC3339; keep the original in event.original
actor.emailuser.name, user.emaillowercase; split domain into user.domain
actionevent.actionkeep the vendor verb verbatim, don't rewrite it
result OK/FAILevent.outcomeenum map to success/failure, default unknown
src_ipsource.ipparse IPv4/IPv6; keep raw if unparseable
—event.category: [iam, authentication]derived from an action→category map
—event.dataset: vendor.product, event.module: parser_nameconstants per source

Three failure classes, three different treatments. Transport/format failure (not JSON at all) goes to a dead-letter queue with the raw bytes and a reason, and its rate is alerted on. Field-level failure (unparseable timestamp, malformed IP) still indexes the event with that field null plus tags: [_parse_error] and the error detail: dropping the event loses the detection that only needed event.action. Unmapped-but-valid keys are preserved under an unmapped.* namespace rather than discarded, because that namespace is how you notice the vendor added a field you now need. Budget: parse errors under 0.5% of a dataset's events over 15 minutes, alert above 2%.

Enrichment is best-effort and must never block ingest. Asset/CMDB lookup on host.name or cloud resource id → asset.criticality, owner; IdP lookup on user.name → roles and privileged flag; GeoIP/ASN on source.ip; threat-intel match on file.hash. Cache lookups, cap the timeout around 50 ms, and on a miss pass the event through with null enrichment and tags: [_enrichment_miss]. An unenriched event still matches rules on raw fields; a dropped or delayed one matches nothing.

Validation is what makes the onboarding real. Four checks: (1) field-existence lint in CI. Every field a rule references must exist in that dataset's parsed schema, because a rule querying user.target.name against a source that only emits actor.email is a silent no-fire; (2) golden-corpus replay. 200 events captured from a lab host executing a known technique plus a 100k-event benign day from the same source, replayed through the real pipeline, asserting exactly one alert per technique execution and zero on the benign set (40 alerts on benign means the rule is too broad for this source's noise floor); (3) a synthetic canary with a unique marker injected through the production path every 15 minutes, alerting if it isn't searchable within 5 minutes; (4) saved searches and dashboards run against the new dataset with non-zero expected counts.

Failure modes I'd name: parser drift when the vendor renames a field (detected by unmapped-field growth and parse-error rate, not by a broken detection weeks later); epoch-seconds-vs-milliseconds confusion putting events 50 years off and breaking correlation; API pull overlap producing duplicates (dedup on vendor event id into event.id); and enrichment outage causing backpressure into the pipeline.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-4

Design authentication and session monitoring for account takeover.

Answer

Before I design this, I'd want to clarify the scale, thousands or millions of users, and the identity provider. I'll assume a typical enterprise with an OIDC/SAML IdP like Okta or Azure AD, a SIEM like Splunk, and a mix of web and mobile clients. The goal is to detect account takeover (ATO) by correlating identity lifecycle, authentication, and session events.

The core design has three layers: identity lifecycle events (registration, recovery, MFA changes), authentication events (success, failure, risk challenges), and session events (issuance, refresh, revocation). Correlate them by user ID and session family ID: a chain of tokens from a single login. This lets you catch attacks that span multiple events.

What to log: from the IdP, capture event type, timestamp, user ID, session ID, device fingerprint, IP, ASN, user agent, auth method, MFA outcome, risk score, and target resource. Never log passwords, raw tokens, or secrets. For session events, log issuance, refresh, and revocation with the session family ID. Also log admin impersonation and privilege changes.

Now detection patterns. I'll give three with mechanisms and example thresholds.

  1. Password spraying: many accounts, few attempts each, same IP. Mechanism: avoids per-account lockout. Rule: >10 distinct accounts from one IP in 5 minutes, each with <3 failures. MITRE ATT&CK T1110.003.

  2. MFA fatigue: repeated push notifications. Mechanism: attacker spams until user approves. Rule: >5 MFA challenges in 10 minutes for one user. Detect by counting MFA prompts per user.

  3. Token reuse after revocation: session family correlation. Mechanism: OAuth 2.0 refresh token rotation, when a refresh token is used, it's invalidated and a new one issued. If an old token is reused, it indicates theft. Rule: any reuse of a previously rotated refresh token. This catches stolen tokens even after revocation.

Other patterns: recovery followed by sensitive action (password reset then admin action within 1 hour), new device plus privilege escalation, concurrent sessions from different ASNs.

Here's a table of detection rules I'd implement:

DetectionSignalThreshold (example)Mechanism
Password sprayingMany accounts, same IP, few failures each>10 accounts from one IP in 5 min, each <3 failuresAvoids per-account lockout
MFA fatigueRepeated MFA challenges>5 challenges in 10 min for one userAttacker spams push until approval
Token reuseRefresh token reuse after rotationAny reuse of old refresh tokenOAuth 2.0 rotation with reuse detection
Impossible travelTwo logins from distant geosDistance > 500 km in < 1 hourPhysical impossibility, but VPNs cause FPs

Tradeoffs: inline step-up vs post-hoc revocation. Inline step-up challenges the user at login if risk is high: adds friction but stops ATO early. Post-hoc allows login and monitors, then revokes: less friction but attacker may act before detection. Deciding criteria: sensitivity of the account (admin vs regular), action risk, and user tolerance. For travelers and accessibility, use allowlists and step-up rather than block. NIST SP 800-63B recommends rate limiting rather than hard lockout, so thresholds should be tuned to your population.

Failure modes:

  • Log gaps: missing session revocation events. Detection: compare IdP logs to SIEM, alert on missing expected events. Cost: blind spot. For example, if your SIEM doesn't ingest Okta's session revocation events, you won't see when an admin revokes a user's sessions, and an attacker with a stolen token can keep using it.
  • Overly aggressive lockout: DoS. Detection: spike in lockouts.
  • Token leakage in logs: scan for 'Bearer ' patterns.
  • Session fixation: session ID not rotated after login. Detection: same session ID before and after auth.

Runbook: verify source IP, scope sessions/devices, revoke tokens, force re-auth, preserve evidence. Test with simulated password spraying, MFA fatigue, and token theft.

That's the core.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-5

Monitor privileged and cloud control-plane activity.

Answer

What I'd say in the first minute

Assume multi-account (or multi-subscription/project), at least one compliance regime, and a detection SLA in minutes. The answer: collect control-plane audit from the provider itself into an account the production identities cannot write to, then alert on the small set of actions that change who can do what or whether you can still see it.

Concretely: an AWS organization trail from the management account, Azure Activity Log exported via diagnostic settings, GCP Admin Activity logs (always on, free) routed through an aggregated sink. All three land in a dedicated log-archive account/subscription/project with its own credentials. Detection runs there, not in the workload accounts.

Why provider-native

Control-plane calls are recorded by the provider before your code runs, so an attacker holding root in a workload account still cannot suppress the record, unless they reach the trail itself. That is the entire reason the archive boundary exists. An agent on the host fails exactly when you need it.

ProviderSourceOn by defaultDefault retention
AWSCloudTrail management eventsYes, per-account, single-region90 days in Event history; S3 as long as you keep it
AzureActivity LogYes90 days in the portal
GCPCloud Audit Logs: Admin ActivityYes, always on, no charge400 days

GCP Data Access logs are off by default and billed; AWS data events are billed per 100k events and can dwarf management-event cost. Leave both off until a specific question needs them.

The trace that decides your rule design

A two-hop role chain produces two events. The second looks like this (fields trimmed):

JSON
{
  "eventSource": "sts.amazonaws.com",
  "eventName": "AssumeRole",
  "userIdentity": {
    "type": "AssumedRole",
    "arn": "arn:aws:sts::222222222222:assumed-role/DeployRole/session-1",
    "sessionContext": {
      "sessionIssuer": {
        "arn": "arn:aws:iam::111111111111:role/BuildRole",
        "accountId": "111111111111"
      }
    }
  },
  "requestParameters": { "roleArn": "arn:aws:iam::333333333333:role/ProdAdmin" },
  "responseElements": {
    "assumedRoleUser": { "arn": "arn:aws:sts::333333333333:assumed-role/ProdAdmin/session-2" }
  }
}

Read it the way the rule does: userIdentity.arn says DeployRole, sessionIssuer.arn says BuildRole assumed it. Neither tells you who assumed BuildRole. You reconstruct the chain by joining sessionIssuer.arn to the previous event's assumedRoleUser.arn. A rule that alerts only on userIdentity.arn sees a service role and misses that the origin was a human in a fourth account. That join is the difference between a useful rule and noise.

Alternatives, and when this is wrong

Managed detectors (GuardDuty, Defender for Cloud, Security Command Center) versus custom rules: start managed. They cover known-bad patterns cheaply. Go custom when you have a model of which roles should ever assume which; that trust-graph check is what catches a novel path. Central SIEM versus per-account: central once you pass roughly ten accounts, because cross-account correlation is the point. Streaming (EventBridge/Event Grid/Pub-Sub) for the ~20 high-impact APIs, batch for the rest.

If it is one account, no compliance driver, and no security team, this is overkill: CloudTrail plus GuardDuty plus a weekly review is proportionate.

Failure modes

  • Source silence. Trail stopped, sink deleted, diagnostic setting removed. Alert on the delete APIs themselves (StopLogging, DeleteTrail, Microsoft.Insights/diagnosticSettings/delete, DeleteSink) and on absence of any event per account per hour.
  • Retention change. Someone shortens the S3 lifecycle or log-bucket retention. Alert on lifecycle and bucket-policy writes.
  • Latency assumption. CloudTrail typically delivers within about five minutes; do not build a 30-second SLA on it.

High-impact set worth alerting on: CreateAccessKey, AttachRolePolicy, UpdateAssumeRolePolicy, CreatePolicyVersion with SetAsDefault, Microsoft.Authorization/roleAssignments/write, SetIamPolicy, public bucket policy writes, and break-glass use.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-8

Design an application audit trail for sensitive business actions.

Answer

What I'd say first

Assume a multi-tenant SaaS on Postgres, with sensitive actions: access grant, approval, transfer, export, deletion, override, config change. My design is one immutable audit event per committed business action, written in the same database transaction as the state change, then shipped asynchronously to an append-only store. The rule that decides everything else: if the state change commits, the audit event exists; if it rolls back, the event doesn't.

Why the same transaction

The naive version writes the audit row after the state commit, or publishes to Kafka straight from the handler. That's a dual write, and it loses records. Trace it: the handler updates the accounts row and commits at T. The process is killed before the audit publish. State changed, no audit event: a silent gap, and exactly the case an auditor cares about. Reverse the order and you get phantom events for changes that never happened.

The fix is a transactional outbox: the same transaction inserts into audit_outbox. Debezium tails the Postgres logical replication slot (pgoutput, PG 10+) and publishes to Kafka; a consumer writes to the append-only store. Delivery is at-least-once, so the consumer dedupes on a unique event_id: a unique index on (tenant_id, event_id) makes the retry a no-op.

What the event carries

fieldexample
actor (authenticated)user:u_8812
actor (effective)svc:support-console (impersonation)
tenantt_4471
actionaccess.grant
objectdoc:report-2026-Q1
policyrole:finance-reader
outcomeallow / deny
before/after{role: viewer} → {role: finance-reader}
tracetrace_id=4f2a…
commit timeDB now(), not the client clock
schema version2

Log denied attempts too: outcome=deny is the signal for authorization probing. Record both authenticated and effective actor so impersonation is reconstructable. Never log tokens or raw PII; store the object ID and a hash of the changed fields.

Reconciliation

The outbox covers loss between state and audit. It doesn't cover a consumer that drops events or a code path that skips emission. So a nightly job compares domain signals to audit completeness: sum the domain ledger for a tenant-day (4,182 transfers on 2026-03-14) against the audit count (4,181) → mismatch → page, then replay from the outbox or flag the gap. That's the detection mechanism, not "monitor the pipeline."

Retention and protection

Transport retention is not retention: Kafka's default log.retention.hours=168 (7 days) is a buffer, not the record of truth. The append-only store is. For high-value trails, S3 Object Lock in compliance mode gives WORM: even root can't shorten the retention. CloudTrail's own event history keeps 90 days; a trail to S3 is what you actually keep. Access to the audit store is separate from access to the app.

Tests: denied, successful, rolled-back, retried, concurrent, and admin-impersonation paths; the reconciliation job itself gets a test that injects a dropped event.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-9

Combine endpoint and network telemetry for lateral-movement detection.

Answer

The 90-second answer

Lateral movement detection is a join problem, not a collection problem. Endpoint telemetry tells you which account ran what; network telemetry tells you where it went. Neither closes the loop alone. The join key is (source host, account, destination, time window).

Assumptions I'd state up front: Windows endpoints with Sysmon and the relevant audit subcategories enabled, a flow or Zeek sensor on the east-west path, Kerberos in the domain, and clocks inside the 5-minute Kerberos MaxClockSkew default.

Then model the expected administrative paths, which accounts log on to which tiers, from where, over which protocol. Anything outside that baseline is the signal. The chain worth alerting on is: network logon with an unexpected account → service or scheduled task created → credential access → fan-out.

What I collect

Endpoint (Windows Security log + Sysmon): 4624 logon type 3 (network), 10 (RDP), 9 (NewCredentials); 4625 failures; 4648 explicit credentials; 4672 special privileges assigned; 4688 process creation with command line (requires the "Include command line in process creation events" policy); 4697 service installed (needs the Audit Security System Extension subcategory) and 7045 in the System log; 5140/5145 share access; 4768/4769/4771 Kerberos TGT/TGS/pre-auth failure. Sysmon 1 process create, 3 network connect, 10 process access, 22 DNS query.

Network: Zeek conn.log, dns.log, kerberos.log, smb_mapping.log off a span port, or IPFIX/NetFlow. The distinction matters: sampled NetFlow at 1:100 to 1:1000 will miss a single 1 KB SMB connection entirely; Zeek on a TAP will not. Use flow for fan-out and volume, Zeek for the individual connection.

Worked trace

timesourceeventreading
09:14:02WKS-014Sysmon 1: powershell.exe (PID 6120), parent explorer.exe, cmdline Invoke-Command -ComputerName APP-07interactive user spawning remote exec
09:14:03WKS-014Security 4648: explicit creds for svc_backup → APP-07credential handed to a process
09:14:04APP-07Security 4624: type 3, svc_backup, source 10.20.4.51, NtLmSsp, NTLMnetwork logon, NTLM not Kerberos
09:14:05APP-07Security 4672: SeDebugPrivilege, SeBackupPrivilege to svc_backupadmin-equivalent token
09:14:06APP-07Security 4697: service PSEXESVC installedremote execution artefact
09:14:07sensorZeek conn: 10.20.4.51 → 10.20.9.30:445, 0.4 s, 1.2 KBconfirms the path
09:14:09APP-07Sysmon 10: lsass.exe access, GrantedAccess 0x1010credential access
09:14:11DCSecurity 4769: TGS for MSSQLSvc/db-02, etype 0x17 (RC4)fan-out, downgraded crypto

Every row alone is noise. A workable starting rule: correlate on (source host, account) inside a 60-second window, require at least three of {4648, 4624 type 3, 4697, Sysmon 10, 4769 with etype 0x17}, and weight by destination criticality. Separately, count distinct destination hosts per (account, source host) over 10 minutes: a backup account touching 3 hosts is normal, 30 is not.

Where it breaks

  • NAT. If WKS-014 sits behind NAT, both the 4624 source field and the flow record show the NAT address. You need the firewall's translation log (inside IP:port → outside IP:port) to re-attribute. Seeing 100.64.0.0/10 (RFC 6598 CGNAT) in a 4624 source field means the host identity is already gone.
  • Encryption. SMB 3.x encrypts payload; TLS 1.3 with ECH hides SNI. You keep 5-tuple, byte counts, timing, and the endpoint-side 4624. Don't plan on content.
  • Clock skew. Kerberos MaxClockSkew defaults to 5 minutes. Past that you get 4771 pre-auth failures and a ±1 s join window is meaningless. Track w32time/NTP drift as a data-quality metric.
  • Sampling. As above: a missed sample is indistinguishable from no connection.
  • Unmanaged segments. OT, BYOD, appliances with no agent. The endpoint half of the join is absent. Detect it by comparing daily Sysmon-1 host counts against the asset inventory; a host that goes quiet is a finding, not an absence.
  • Service accounts. svc_backup on 12 systems is a role, not an identity. Always pair the account with source host and logon type.

What I'd do with a hit

Scope by account, source host and destination set. Verify the artefact: pull the 4697 service binary path and hash it. Preserve volatile evidence before isolating (memory, netstat, 4688 command lines). Isolate the source workstation, not the /24. Then check whether the same account authenticated elsewhere in the window.

Retention sets the ceiling on all of this: many EDR platforms default to 30 days of searchable event data, and flow is typically 30 days hot. If your detection window is longer than your retention, the detection doesn't exist.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-14

Establish a detection-as-code lifecycle.

Answer

What I'd say first

Detection-as-code treats a detection as a versioned program with a data dependency, not a query typed into a SIEM console. The lifecycle is author → peer review → CI test → historical backtest → shadow → canary → production → tune → deprecate. Every stage exists because a detection fails in two opposite ways: it can be syntactically valid and never fire (the field it reads was renamed, the source went dark), or it can fire constantly and catch nothing (threshold too loose, exclusion too broad). Review and CI are the cheapest places to catch both; production is the most expensive.

Assumptions I'd state up front: Windows process and Security event logs shipped to one SIEM; Sigma as the vendor-neutral source of truth; git plus a CI runner; a detection engineer and a service owner who can both approve.

The artifact. One rule, one file, a stable UUID as the ID so the ID survives rewrites:

YAML
title: Suspicious PowerShell Encoded Command
id: 3f2a9c1e-7b4d-4a2e-9c8f-1d5e6a7b8c9d
status: test
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith: '\powershell.exe'
    CommandLine|contains: '-EncodedCommand'
  filter_approved:
    ParentImage|endswith:
      - '\sccm.exe'
      - '\intune.exe'
  condition: selection and not filter_approved
falsepositives:
  - Deployment tooling not in the allowlist
level: medium
tags:
  - attack.execution
  - attack.t1059.001

The status field is the lifecycle state (test → stable → deprecated). ATT&CK tags are context for coverage reporting, never the reason a rule exists. The threat hypothesis, owner, runbook link and known limitations live in the same file or its front matter.

CI. sigma-cli converts the rule to the backend query (Splunk SPL, Elastic EQL, Sentinel KQL) so one source compiles everywhere. The pipeline runs the conversion, then the fixtures:

caseinputexpected
positivepowershell.exe -EncodedCommand <b64>, parent explorer.exematch
negativepowershell.exe -File deploy.ps1no match
boundaryparent sccm.exe with -EncodedCommandno match (filtered)
delayedevent indexed 90 s after the process ranstill matched
missingCommandLine absentno match, counted as a data-quality miss

The missing-field case is the one teams skip and the one that matters: it tells you the rule is silently blind when the source changes shape.

Deployment. Backtest against 30–90 days of historical data in a privacy-controlled copy, then shadow (alerts recorded, not paged) for a week, then canary on one host group. Rollback is git revert plus redeploy, which only works if the pipeline, not the console, is the deployment path.

Monitoring and tuning. Track firing volume, precision, source health and disposition. Worked example: a rule firing 500 times a week with 25 confirmed true positives is 5% precision; at 6 minutes of triage per alert that is 50 analyst-hours a week. Excluding the top parent process removes 380 alerts, leaving 120: 20 hours and roughly 21% precision. That number is what justifies the change.

Failure modes. Source goes dark (Sysmon stops on part of the fleet) → coverage drops silently; detect with a heartbeat rule on event volume per host. Threshold tuned to silence noise → true positives suppressed; detect by sampling suppressed alerts monthly. Exception with no expiry → permanent blind spot; every exception carries an expiry date and an owner.

Trade-offs. Shadow is safer and slower; canary is faster and risks a page. Use shadow when the rule is high-severity or the data is noisy; canary when it is low-severity and you need volume data. Don't use detection-as-code for a one-off hunt query: the overhead isn't worth it.

What would change my answer: if the SIEM has no API for pipeline deployment, or the team is one person, the CI stage shrinks to linting and the review stage carries the weight.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-15

Build a meaningful ATT&CK-based detection coverage model.

Answer

Assumptions. ~5,000 Windows endpoints, 400 Linux servers, AWS, Entra ID, EDR on 96% of endpoints, Sysmon, one SIEM. Scope is ATT&CK Enterprise: 14 tactics, ~200 parent techniques, 400+ sub-techniques. The model does not try to cover all of them.

Core answer. Coverage is a per-technique record with an evidence grade, not a percentage. You pick techniques from four inputs (threat model, architecture, current intel, incident history) and for each one record what's exposed, what telemetry exists, what analytic runs, and how far up the evidence ladder you've actually climbed. A technique with no simulation behind it is a mapping, not a detection.

The record. One row per technique. Example for T1003.001:

fieldvalue
techniqueT1003.001 OS Credential Dumping: LSASS Memory
exposed4,800 Windows endpoints, 60 DCs
variantscomsvcs.dll MiniDump, procdump, direct syscall, driver unload
preventionCredential Guard on 3,100/4,800 (65%); LSASS PPL on DCs
telemetrySysmon EID 10 ProcessAccess, TargetImage=lsass.exe, GrantedAccess in {0x1010, 0x1410, 0x1438, 0x143a}
healthSysmon on 4,600/4,800 (96%); EID 10 enabled on 4,400
analyticSigma + EDR behavioral
grade3: simulation detected
owner / runbookdetection eng / IR-07 credential compromise

The ladder. Grade every technique on the same six rungs:

grademeaningevidence required
0intendedtechnique mapped, no data
1source presenttelemetry verified arriving in SIEM
2query deployedanalytic runs, untuned
3simulation detectedAtomic Red Team / CALDERA run fired the alert
4triage succeededanalyst confirmed TP, FP rate acceptable
5containment exercisedrunbook executed in a game day

Why not a percentage. 45 rules, each tagged with every technique it could theoretically catch, maps to 130 of ~200 techniques: "66% coverage." Grade the same 45 rules: 12 reach grade 3+, 20 sit at grade 2, 13 at grade 0-1. Against the 40 techniques in your threat model that's 12/40 = 30%. The 66% is a tagging artifact; the 30% is what you can defend.

Failure modes. Mapping inflation: a rule tagged to techniques it never fires on; detect by requiring one simulation per tag. Telemetry decay: a GPO push disables Sysmon EID 10 on 400 hosts; detect with a daily per-host event-count check against baseline. Sub-technique blindness: the rule catches T1059.001 PowerShell but not T1059.003 cmd; detect by running the atomic for each sub-technique, not the parent.

Decision. Fund the grade 0-1 techniques that are in the threat model, ranked by adversary relevance × blast radius. Report the ladder distribution and the named gaps, not a single number.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-16

Design anomaly detection without turning unusual behavior into guilt.

Answer

Anomaly detection should output a calibrated risk score with evidence, not a verdict. The core is per-entity baselines using robust statistics, then combine with deterministic controls and human triage.

Assume we have metrics, logs, or events; few labels; and heterogeneous populations. A global threshold fails because normal behavior differs by service, role, tenant, region, season, and lifecycle. Consider two services: A normally does 10 errors/min, B normally does 0.1 errors/min. A global threshold of 5 errors/min flags A as normal and B as anomalous, but B's 5 errors/min is a 50x spike and likely an incident. Segment baselines by those dimensions. Use median and MAD instead of mean and standard deviation because a single 10-minute outage can inflate the mean and hide the next anomaly. The robust z-score is:

Python
import numpy as np

def robust_z(x, window):
    med = np.median(window)
    mad = np.median(np.abs(window - med))
    if mad == 0:
        return 0.0  # fallback to fixed threshold
    return 0.6745 * (x - med) / mad

The constant 0.6745 makes MAD a consistent estimator of standard deviation for a normal distribution. For a 1-hour window with Prometheus's default 1-minute scrape interval, you get 60 points. Use at least 2 weeks of baseline to capture weekly seasonality.

Convert the robust z to a p-value using the empirical CDF of the baseline window. Then calibrate to a risk score with Platt scaling on a small labeled set. Output the score with a confidence interval from bootstrapping the baseline window. This gives a probability, not a verdict.

Alternatives: static thresholds are simple but brittle to seasonality. EWMA control charts handle gradual drift but lag by roughly 1/λ windows. Isolation Forest works for multivariate data but is hard to explain. Supervised classifiers need labels and can overfit. Deciding criteria: label availability, explainability requirement, latency budget. When not to use: cold start with no baseline data, or safety-critical systems where false positives are unacceptable. Use deterministic rules instead.

Failure modes: baseline poisoning. An attacker gradually increases traffic to shift the baseline. Detect by monitoring baseline drift rate and comparing to change management. Cost: missed detection. Feedback loop bias: analysts only label alerts they see. Detect by sampling unalerted events and red teaming. Cost: silent false negatives. Alert fatigue: precision below 10% leads to ignored alerts. Detect by measuring time-to-acknowledge and override rate. Cost: real incidents missed.

Hypothetical evaluation on 1M events and 1000 incidents:

MethodPrecisionRecallAlerts/dayAnalyst hours/day
Static threshold (5 errors/min)0.020.3050025
Robust z > 3 per service0.150.651206
Robust z > 3 + deterministic controls0.400.60452.5
Supervised classifier (if labels)0.550.70301.5

The decision point: if precision < 10% or analyst hours > 4/day, raise the threshold or add deterministic controls. Version and canary threshold changes, and keep humans in the loop to correct dispositions.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-19

Walk me through investigating one suspicious endpoint alert: an unexpected process execution or encoded command: which endpoint, identity and network telemetry you pull first, how you pivot, what separates attacker activity from legitimate admin behavior, and what makes you escalate versus close?

Answer

First 90 seconds. I confirm three things before touching anything: what rule fired and on which host, whether the process is still running, and whether the host is still on the network. If it is live I capture volatile state first (process tree, open sockets, loaded modules) because terminating the process destroys the parent-child evidence I need to tell a phishing payload from a scheduled task.

First pull is endpoint, because the alert is endpoint-shaped. On Windows: Sysmon EID 1 (process create. Command line, hashes, parent image), 3 (network connect), 7 (image load), 8 (CreateRemoteThread), 11 (file create), 22 (DNS query), plus EDR's process tree and script-block/AMSI logging. The two fields that decide most cases are the parent image and the full command line; an encoded command on its own means nothing.

Worked trace (worked example, not a real incident):

timesourceeventwhat it tells me
09:14:02Sysmon 1winword.exe → powershell.exe -nop -w hidden -enc SQBFAF…Office spawning PowerShell; no admin workflow does this
09:14:03Sysmon 22DNS query cdn-metrics[.]examplefirst network pivot
09:14:04Sysmon 3TCP 443 → 45.x.x.xegress to a host with no business relationship
09:14:05Sysmon 11%TEMP%\svchost.dll written, unsignedpayload staged
09:13:40IdP sign-injdoe, MFA satisfied, ASN = residential proxyidentity pivot: whose session is this?

Pivot order: endpoint → identity → network. Endpoint says what ran, identity says whose session ran it, network says whether it succeeded. In the trace the identity row is the one that changes the case: the same session token used from a new ASN 22 seconds before execution is credential theft, not a user running a script. Network then tells me whether the payload reached C2: a DNS query with no follow-on connection is a different severity from a sustained beacon.

Attacker vs admin. Legitimate administration has a signed binary, a management parent (SCCM, Intune, Ansible agent), a standard install path, a matching change record, and a source IP that is the admin jump host. Attacker activity shows the inverse: unsigned or renamed binaries in user-writable paths, Office or browser parents, LOLBins with unusual arguments, execution outside the change window, and identity anomalies. Token reuse from a new ASN, interactive logon by a service account, MFA satisfied by a method the user did not use. One indicator is a lead; two independent sources agreeing is a finding.

escalateclose
endpoint + identity, or endpoint + network, corroboratesigned binary, known publisher, management parent
process still running, or persistence written (Run key, service, scheduled task)matches a change record or ticket, in-window
privileged identity, or host holds regulated datano egress, no file write, identity context normal
C2 beacon or lateral movement in the same windowsingle weak signal, no corroboration

Before concluding "no evidence", verify the source is healthy. A missing Sysmon EID 1, 4688 without command-line auditing, or an EDR agent that stopped reporting two hours earlier is itself a finding, and retention has to cover the investigation window or the pivot dies at the first hop.

Closing still costs work: I record the rationale, the evidence checked, and a tuning candidate if the rule fired on a known-good pattern. Escalating means handing over facts, not conclusions: host, user, timestamps, hashes, and the gaps I could not close.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-17

Create a risk-based alert triage and escalation model.

Answer

Clarify first. I'd ask: what's the alert volume, how many analysts, and is there a 24/7 rotation? The model below assumes ~50k raw alerts/day collapsing to ~3k cases, six analysts on rotation, and a CMDB with asset tiers. If you have 500 alerts/day and two analysts, most of this is overhead: a plain severity queue is enough.

The core idea: triage is a routing function, not a judgment call. Score two things separately and never multiply them into one number: consequence (how bad if true) and confidence (how likely it's true). Route on consequence first, because a low-confidence alert on a crown-jewel asset is still a page.

Consequence comes from six inputs, each a lookup rather than a debate:

InputLowHigh
Data classpublicPII / PCI / secret
Asset tierdevtier-0 (IdP, CI, prod DB)
Identitystandard useradmin / service account
Exposureinternalinternet-facing
Blast radiusone hosttenant-wide
Persistenceone-shotestablished foothold

Any two "high" → C1. One high → C2. All low but anomalous → C3. Known-benign pattern → C4.

Confidence is a separate 0–100 taken from the rule's historical precision, not the analyst's gut.

High confidenceLow confidence
C1P1: page, MTTA 5 min, MTTR 4hP1: page, MTTA 15 min
C2P2: Slack + ticket, MTTA 1hP2: ticket, MTTA 4h
C3P3: queue, MTTA 8hP3: queue, MTTA 24h
C4auto-close after enrichment, 5% sampledauto-close, 20% sampled

Worked trace. Alert: "impossible travel" for svc-deploy. Enrichment returns: identity = service account (high), asset = CI runner, tier-0 (high), data class = secret (high), exposure internal (low), blast radius one host (low), persistence one-shot (low). Three highs → C1. The rule's precision over the last 90 days is 0.4 → low confidence. Route: P1, page, MTTA 15 min. The responder does not re-litigate severity; they validate the source is healthy, reconstruct actor/action/target/outcome, and scope related identities and the time window. If the source turns out to be broken, they downgrade with a written rationale: the downgrade is the auditable event, not a silent edit.

Arithmetic on capacity. 3k cases/day, 1% landing P1/P2 = 30 cases. At 45 min each that's 22.5 analyst-hours against 48 available. That headroom is what lets you page on low confidence. If P1/P2 reach 5%, you're at 112 hours and the model collapses into rubber-stamping: that's your signal to fix detection precision, not to raise thresholds.

Trade-offs. The alternative is a CVSS-style pure-severity queue: simpler, but it pages on every high-severity rule regardless of asset, which is how alert fatigue starts. The other alternative is pure-confidence ranking, which buries the one real crown-jewel hit under a thousand noisy-but-confident ones. Risk-based routing costs you a maintained asset inventory and per-rule precision tracking. If you can't keep the CMDB fresh, don't build this: you'll route on stale tiers.

Failure modes. (1) Confidence inflation: rule authors mark everything high to avoid missed pages. Detect by plotting precision per rule monthly; anything above 0.9 with under 10 hits is suspect. (2) Enrichment outage: CMDB down makes every asset look unknown. Fail closed to the last-known tier and flag the case, never default to C4. (3) Downgrade abuse: analysts clearing P1s to hit MTTA. Detect via reopen rate; above 10% means the thresholds are wrong. (4) Dedup collapse: two distinct actors merged into one case. Detect by sampling merged cases weekly.

What would change my answer: if the org has no asset tiering and no per-rule precision data, start with a three-level severity queue and instrument those two things first. The routing model is only as good as the inventory under it.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-18

Reduce alert fatigue without creating hidden detection gaps.

Answer

Core answer (first 90 seconds)

First I'd separate paging alerts from ticket and dashboard alerts. Fatigue is driven by pages that interrupt sleep; the fix for a noisy dashboard is different from the fix for a 3 a.m. page. I'll assume a Prometheus → Alertmanager → PagerDuty path, rules in version control with named owners, and a metric backend that can replay historical series.

The direct answer: cut page volume by removing or fixing rules that don't require human action, and never remove a rule without evidence that something else covers the same failure. Suppression is the last step, not the first.

Why fatigue happens

Fatigue is a ratio, not a count. A responder on a 12-hour shift who gets 40 pages where 6 need action learns to pattern-match the subject line and skip. Those 34 noise pages are the training set for the miss. So the number to move is actionable pages per shift, and the guardrail is detection coverage: for every page you remove, something must still fire for that failure mode.

Where the gaps hide

Three places, all in the suppression layer: inhibition that is broader than intended, aggregation that collapses distinct failure modes under one label, and silences with no expiry.

Worked example: the inhibit rule

YAML
# Alertmanager 0.22+
inhibit_rules:
  - source_matchers:
      - severity="critical"
    target_matchers:
      - severity="warning"
    equal: [alertname, cluster, service]

The equal list is the whole game. With alertname in it, a critical DiskFull inhibits only a warning DiskFull on the same cluster and service: narrow and correct. Drop alertname and a critical DiskFull now inhibits a warning ReplicationLag on the same service. That is the hidden gap: the warning that would have caught a different failure is gone, and nothing in the config says so.

Disposition table

DispositionTarget share of pagesAction
Actionable, needs human≥ 80%keep
Actionable, automatable≤ 10%auto-remediate, keep a ticket
Informative, not actionable0% of pagesdemote to ticket or dashboard
Duplicate of another page0%dedupe or inhibit
Stale (no incident in 90 days)0%delete with owner sign-off

Arithmetic

If a service pages 40 times per 12-hour shift and 6 are actionable, the actionable rate is 15%. Reaching 80% means either removing ~34 pages or making them actionable. Removing 34 pages is the wrong move if any covered a real failure, so classify each one first: replay the last 90 days of series and check whether an incident ever followed the page.

Failure modes and how to detect them

  • Silence with no expiry: CI check that every silence carries an endsAt and an owner label.
  • Inhibit rule wider than intended: unit test that fires the source and asserts the target still fires when it should.
  • Aggregation hiding a mode: count distinct alertnames per group; if a group's alertname cardinality drops after a change, review it.
  • Rule deleted with no replacement: maintain a failure-mode → rule coverage map, reviewed at change time.

Rollout

Shadow the new rule set against replayed history, then track two numbers: pages per shift, and miss proxies. Incidents where the first signal was a customer report or a downstream service rather than our own monitoring. If miss proxies rise, roll back. Every exclusion gets an owner, a reason, an expiry, and a monitor.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-20

Run a hypothesis-driven threat hunt and operationalize its findings.

Answer

Assume you have EDR on most endpoints, network flow logs (Zeek or VPC flow), cloud audit logs (CloudTrail), and an identity provider log, with 90 days hot retention. If you don't, your first finding is a coverage gap, not a hunt.

Core answer (first 90 seconds). Write a hypothesis that predicts an observable you can fail to see. Example: "If LSASS dumping is present, I will see Sysmon Event ID 10 (process access) with GrantedAccess 0x1fffff targeting lsass.exe, followed within 5 seconds by a file write of a .dmp from the same process tree." That is falsifiable: if the query returns zero and a canary shows Sysmon 10 is flowing, the hypothesis is false for that window. Before querying, check data readiness: run whoami on a canary host and confirm process creation lands in the index. Check clock skew with w32tm /stripchart /computer:dc or chrony tracking; if offset exceeds 2 seconds, fix it before correlating. Then query with a versioned notebook (Jupyter + pandas, or a saved Splunk SPL file in Git). Pivot: take the process GUID from EDR, join to Zeek conn.log for outbound IPs, join to CloudTrail for role assumption. Require at least two independent sources, if both come from the same agent, they are one source. Record alternative explanations: a backup tool using comsvcs.dll, a developer running procdump. If credible harm, escalate to IR with the timeline. If no match, state the conclusion bounded by collection limits: "No evidence in 90 days across 95% of endpoints; 5% unmonitored." Convert the validated pattern into a Sigma rule, test with sigma convert -t splunk, run in CI, measure false-positive rate for 7 days, then deploy. Missing fields become a gap ticket with owner and due date. Re-run after a new intel report or when the data source changes.

Trade-offs. Breadth-first hunts sweep 20 TTPs shallowly, cost about 2 analyst-hours each, and surface coverage gaps fast. Targeted hunts go deep on one actor, cost 1–2 days, and produce high-fidelity detections. Automate pivoting when the query is stable and the data model is known; keep it manual when the hypothesis is novel or the telemetry is messy. Do not hunt when the data source is known-broken and cannot be fixed in the window: file the gap instead. Do not hunt an unfalsifiable hypothesis ("attacker used PowerShell"): you will just browse.

Failure modes. Silent log-source gap: Sysmon installed but Event ID 10 disabled. Detect with a canary that triggers the event. Cost: a false "no evidence" read as "no adversary." Clock skew over 2 seconds breaks time-joins. Detect with NTP offset monitoring. Cost: false negatives on correlation. Correlated-only evidence: EDR and Windows Event Log forwarded by the same agent. Detect by mapping data lineage. Cost: false confidence from what looks like two sources but is one.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-21

Validate detections with purple-team and production-safe exercises.

Answer

What I'd say first

Before running anything I'd pin down three things: which detection, which technique variant, and what "validated" means for it. A detection is validated when a specific technique variant produces the expected telemetry, the rule fires on it within a stated latency, and a responder can act on the alert with the evidence attached. Anything less is a demo.

Assume we're validating an Entra ID sign-in rule for MFA-fatigue (ATT&CK T1621) that should alert when one account generates many MFA prompts in a short window.

Run the technique, not a description of it

Use Atomic Red Team's T1621 test rather than hand-waving "suspicious MFA activity": the atomic defines the exact API calls, so the telemetry is reproducible. In the lab, run it against a test tenant. In production, run the same atomic against a canary account named svc-purple-* with a marked UPN, so any alert is attributable and no real user is touched.

Trace the event end to end

The point of walking each hop is that a detection can fail at any of them, and the fix differs by hop.

HopWhat to assertHow it breaks
Source emissionT1621 atomic produces N MFA-prompt eventsAtomic version drift changes the API
Collector/parserFields land as OperationName, UserPrincipalNameParser rename drops the field
Storage/queryRule query returns the canaryQuery window shorter than ingestion lag
RoutingAlert reaches the SOC queueSuppression rule swallows it
ResponseAnalyst has UPN, IP, count in the alertAlert lacks the count, triage stalls

Worked example (illustrative numbers)

Atomic fires 40 MFA prompts over 6 minutes. Entra sign-in logs reach Sentinel in ~3 minutes; the rule runs every 5 minutes over a 10-minute lookback. So the first alert lands ~8 minutes after the first prompt. If the exercise stops watching after 5 minutes, you log a false negative that is actually ingestion latency. Timestamp source emission and alert creation separately: that gap is the number you report, not "it fired."

Trade-offs: lab vs production

Labs are safe and repeatable but synthetic identities have no history, so detections that depend on the identity graph (impossible travel, new-device) can't be validated there; you need a canary with real baseline behavior. Production exercises buy that realism but cost blast radius. Skip production when the technique is destructive (T1486 encryption), when you can't bound the action, or when the detection depends on data you can't synthesize: validate those in lab and accept the gap explicitly.

Failure modes and how you catch them

  • Silent field drift: a parser rename makes the rule match nothing. Catch it with a Sigma rule plus a CI fixture of a known-good event; the rule must fire on the fixture on every commit.
  • Coaching the responders: telling the SOC it's a test measures nothing about triage. Compare MTTA/MTTR against real incidents of the same class.
  • Alert storm: 40 events, 40 alerts. Measure alert-to-event ratio; if it's 1:1 the rule needs aggregation.

What changes the decision

If the atomic can't reproduce the variant the adversary actually used (different MFA provider, different client) a green result proves only the tested variant. State that limit in the writeup rather than claiming the detection is covered.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-22

Measure security monitoring effectiveness without rewarding alert churn.

Answer

Assumptions: a SOC with a SIEM (Splunk ES, Elastic Security, or Sentinel), detections stored as code in git, and purple-team exercises at least quarterly. Without detection-as-code the coverage numbers below are unmeasurable, and that is the first thing to fix.

The core answer. Alert count, MTTA and MTTR are the three metrics that get gamed first, because all three reward volume and speed rather than harm avoided. Measure four layers instead: coverage of the techniques you actually care about, health of the detection pipeline, quality of the disposition decisions, and outcomes. Report medians and p90/p99, never means, and never rank individual analysts.

Why canaries catch what rule tests miss. A unit test proves a rule matches a log line. It does not prove the log line reaches the SIEM. A canary is a synthetic event injected at the source (a known-bad process name on an endpoint, a login from a test IP) that must produce an alert within a bounded time. When it doesn't, the break is somewhere in the chain, and each stage has its own health metric:

source emits → agent/forwarder → indexer → parser → rule → alert → ticket

Agent heartbeat coverage, forwarder queue depth, ingest lag (p99 seconds), parse-failure rate, rule enabled/disabled state. A canary dying at the parser and one dying at a disabled rule are different incidents with different owners.

Why medians beat means. Ten incidents, closure times in hours: 1, 1, 2, 2, 3, 4, 5, 8, 12, 72. Mean = 11.0 h, median = 3.5 h. The mean is dominated by the single hard incident, so a team that closes nine trivial alerts fast and sits on one real breach looks identical to a team that works everything steadily. Report median for typical behaviour, p90/p99 for the tail, and count reopened incidents separately: a reopen is a disposition that was wrong.

MetricGaming vectorCounter-metric
Alerts closed per analystClose as benign without triageSampled closure audit; reopened-incident rate
MTTAAuto-close low severity at ingestMissed-detection rate from purple team
MTTREscalate everything to IREscalation precision (escalated / true positives)
Detection countDuplicate and noisy rulesUnique ATT&CK techniques with a passing test
Coverage %Count rules that never firedEvidence level per technique: tested, fired in prod, or neither

Failure modes. Coverage theatre: 800 rules where 60% have never fired in a test is a claim, not a control. Detect it by requiring a dated test result per rule. Churn masking: alert volume triples after a new rule while true positives stay flat, so the rule is noise. Detect it with true-positive rate per rule and analyst minutes per alert. Metric retirement failure: a dashboard nobody acts on; if a metric hasn't changed a decision in two quarters, delete it. And don't buy detection fidelity with full-payload logging: that is a privacy and storage cost with no matching detection value.

What would change the decision. If purple-team missed-detection rate is above your threshold, stop tuning response metrics and fix coverage. If escalation precision is low, the triage criteria are wrong, not the analysts.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-23

Govern analyst access, searches, and exports of sensitive logs.

Answer

First, clarify scope: which logs are sensitive (PII, auth tokens, payment data), who are analysts (SOC, fraud, compliance), and what regulations apply (GDPR, HIPAA, PCI). Assume a multi-tenant SaaS with logs in a central store like Splunk or Elastic, analysts use SSO with phishing-resistant MFA (e.g., WebAuthn). The core answer: implement just-in-time (JIT) elevation with time-bound roles, mask sensitive fields by default, and audit every access with independent logs.

Why JIT beats standing access: standing access means an analyst's compromised laptop gives persistent access to all logs. JIT with 1-hour elevation (example) means an attacker has 1 hour and only the scope requested. It forces justification and approval, creating an audit trail. In AWS, use IAM roles with sts:AssumeRole and a max session duration of 1 hour; in Azure, use PIM with activation requiring approval and MFA. Detection: CloudTrail logs AssumeRole events, PIM logs activation.

Masking by default: tokenize or format-preserve encrypt PII (e.g., email, SSN) so analysts see user_123 instead of alice@example.com. For investigations, provide a break-glass role that can unmask with approval and full audit. Tradeoff: masking slows investigations because analysts must request unmask; but it prevents bulk exfiltration. When not to mask: if logs are already pseudonymized and correlation requires raw values, but still audit.

Exports: bulk exports need approval, encryption (AES-256), watermarking (unique per-recipient identifier), expiry (e.g., 7 days), and tracking. Use secure workspaces (e.g., AWS S3 presigned URLs with short TTL, or a governed notebook environment) instead of local copies. Failure mode: analyst downloads 10 GB of logs to local laptop, loses it. Detection: DLP alerts on large downloads, CloudTrail S3 GetObject events. Operational cost: false positives from legitimate large exports; tune thresholds.

Failure modes: 1) Standing access + compromised credentials -> attacker exfiltrates logs over months. Detection: anomaly detection on query volume (e.g., >10x baseline), time of day, source IP. 2) Overly restrictive masking -> analysts bypass controls by using personal accounts or shadow IT. Detection: audit of unmanaged data stores. 3) Break-glass without review -> abuse. Detection: independent logs, HR/legal process.

Tradeoffs: JIT vs standing: JIT adds latency (approval wait) but reduces risk. For on-call incident response, use pre-approved break-glass with post-hoc review. Masking vs full access: masking reduces risk but can hinder investigations; use field-level access based on role. Approval vs automated: manual approval for bulk exports (>1 GB) but automated for small queries.

AspectStanding accessJIT elevation
Risk windowPersistent1 hour (example)
AuditLogin onlyJustification + approval
Blast radiusAll logsRequested scope
Operational costLowApproval latency

Review entitlements quarterly, revoke on role change, test access controls. Investigation of analyst misuse uses independent logs and HR/legal/privacy process.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-24

Respond when critical security telemetry is missing or suspected tampered.

Answer

First 90 seconds

Two facts decide everything: how long the gap is, and whether it overlaps an active incident. Assume I'm on call and a health alert says the EDR fleet has sent nothing for six hours. I do not restart the pipeline: a restart flushes the collector queue and erases the reason it stopped. I declare an incident, freeze changes to the affected collectors, and work three questions in order: what is missing, is it absence or tampering, and what independent source can still prove what happened.

Scope it with numbers, not adjectives

Pull the expected rate from the last known-good window. 400 endpoints at one heartbeat per minute is 400 events/min; six hours of silence is 144,000 missing events, and that number goes in the incident. For CloudTrail, log files arrive about every 5 minutes and a signed digest file roughly hourly, so a six-hour gap is ~72 missing log files and ~6 missing digests. Record the exact source, field, tenant, region and interval ("EDR, all tenants, us-east-1, 02:00–08:00 UTC") because a partial gap and a total gap have different causes.

Absence or tampering

Absence is usually boring: a forwarder died, a firewall rule dropped UDP 514, a Kafka topic hit retention.ms (default 604800000 ms, 7 days), or an IAM change removed logs:PutLogEvents. Tampering looks different: it is selective. The attacker keeps the pipeline healthy and removes the events that describe them. Concrete tells: Windows Security log cleared (Event ID 1102), System log cleared (104), auditctl -D wiping auditd rules, Sysmon service stopped, a CloudTrail trail deleted or StopLogging called, rsyslog config edited to drop a facility. CloudTrail's own digest files are the check here: each digest is signed and lists the log files it covers, so I re-run validation and look for a digest that is missing or whose hash does not match.

Trade-offs and the deciding criterion

  • Stop ingestion vs keep the degraded feed. Keep it if the source is the only witness to an active intrusion; stop it if the corruption is poisoning detections. Criterion: does the gap overlap an incident window?
  • Backfill from the source vs accept the gap. Backfill if the source still holds the raw events and the detection needs them; accept it if backfill would re-ingest attacker-controlled data. Criterion: is the source authoritative and unmodified?
  • Rotate credentials now vs preserve the session for attribution. Rotate now if the credential is confirmed compromised; preserve briefly if you need the attacker's session to map lateral movement. Criterion: is the intrusion still live?

Failure modes and how I'd catch them

CauseSymptomDetection
Producer deadZero events, host still upHeartbeat gap alert per host
Permission change403s in forwarder log_internal / splunkd.log errors
CapacityQueue full, events droppedSplunk queue-blocked metrics; Kafka consumer lag
RetentionOld data gone, new data fineIndex age vs ILM policy
TamperingSelective gaps, cleared logsEvent 1102, digest validation

A false alarm worth knowing: a Splunk license violation blocks search, not ingestion. Telemetry is still arriving, you just cannot see it.

Restore and harden

Restore through a reviewed change, then validate with a canary: send a known event end-to-end and confirm it lands in the index with the right timestamp. Backfill needs dedup on a stable key or you double-count. Then hunt for logging-defense impairment, rotate the affected trust, and separate the telemetry control plane from the plane it observes.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-1

Design a security monitoring program for a growing organization.

Answer

Assumptions I'd state up front: 300–800 staff, one primary cloud, SaaS-heavy, no 24/7 SOC yet, one compliance driver (SOC 2 or similar). If you're under 50 people with no compliance obligation, stop after identity logs, EDR and cloud audit logs: the rest of this is overkill until you have a second analyst.

The core answer. Work backwards from the decisions you have to make at 3 a.m., not from the log sources you can switch on. Five decisions cover most of it: is this identity compromised, is this host running something new, is data leaving, did a supplier's breach touch us, and can I reconstruct what happened six months later. Each one names an authoritative source, a latency budget, a retention period and an owner. Everything else is plumbing.

Abuse caseAuthoritative sourceLatencyRetentionOwner
Stolen session / impossible travelOkta System Log (API serves 90 days)< 5 min1 yrIdentity
New IAM key used from an unseen ASNCloudTrail management events → S3< 15 min1 yrCloud
Ransomware canary renamedEDR / Sysmon EID 11 (FileCreate)< 1 min90 dEndpoint
Exfil to a personal bucketS3 data events + VPC flow logs< 15 min90 dCloud

Two things fall out of that table. First, latency budgets differ by an order of magnitude: endpoint telemetry is seconds, cloud API activity is minutes, and pretending everything is real-time is how you buy a streaming stack you don't need. Second, retention is per use case, not per source. Entra ID keeps sign-in logs 7 days on Free and 30 on P1/P2; CloudTrail's console event history is 90 days. If a use case needs a year, you are shipping it somewhere you control.

Cost, worked (hypothetical figures, labelled as such). 200 endpoints × 50 MB/day of Sysmon ≈ 10 GB/day. CloudTrail management events ≈ 2 GB/day. VPC flow logs ≈ 5 GB/day. Call it 17 GB/day, ~510 GB/month. Hot storage at $0.10/GB-month ≈ $51/month; a year of it in object storage at $0.023/GB-month ≈ $140/month. Now compare full packet capture on a 10 Gbps link: 1.25 GB/s ≈ 4.5 TB/hour ≈ 3.2 PB/month. Zeek's conn.log is roughly 0.1% of that and answers most network questions. That's the trade: metadata you can afford to keep for a year beats packets you can keep for four hours.

Detections as code. Sigma rules in a repo, CI runs unit tests on synthetic events, then replays the rule against 30 days of recorded telemetry to count how often it would have fired. A rule that fires 200 times a day at 2% precision costs about 7 analyst-hours daily at two minutes per alert: that is the number that decides whether it ships or gets tuned.

Triage. 300 alerts/day at ~30 per analyst-shift is 10 shifts/day; 24/7 coverage lands near 6 FTE once you account for leave and training. Below that, run business-hours triage with a documented on-call escalation and an evidence-preservation step (snapshot the host, export the identity log slice) before anyone touches the box.

Failure modes and how you'd catch them.

  • Silent pipeline gap. A synthetic canary host emits an event every 5 minutes; page if the collector sees nothing for 15. Without it, a six-hour blind spot during an intrusion looks identical to a quiet night.
  • Clock skew. Correlation windows silently stop matching. Monitor agent-to-collector offset and alert above 2 seconds.
  • Alert fatigue. Track precision per rule, not overall volume. Rules under ~10% precision get tuned or retired on a schedule.
  • Retention creep. Review $/GB and $/decision quarterly; the second number is the one that justifies the first.

Metrics that mean something: tested coverage (percent of catalog use cases with a passing replay), pipeline freshness p95, per-rule precision, and percent of incidents with preserved evidence. Not alert count.

What I'd cut first: the governance forum, if it isn't producing decisions. One monthly review with service, platform, legal and IR is enough; a committee per layer is where these programs go to die.

Curated: · Written: · Reviewed:

Difficulty: Hard