Stage 9 of 10 · about 12–20 hours · intermediate · checked 2026-11-23

Specialise and scale

Goal. By the end you can build and test detections in a domain beyond the Windows endpoint, say how detection work scales across teams and customers, and use AI assistance without letting it lower your standards.

Why it matters#

The Windows endpoint is where most people start, but real environments are cloud accounts, identity providers, SaaS products, networks, Linux servers and containers, and attackers move between them. Employers tend to look for one area you know deeply plus enough breadth to talk to the rest. This stage helps you pick and build that depth, and prepares you for the practical question of doing it across a whole team.

What you will learn#

Pick a domain#

You do not need all of these. Choose one, go deep, and sample another.

Domain Typical data Behaviours worth detecting
Cloud control plane AWS CloudTrail, the Azure activity log, Google Cloud audit logs Audit logging switched off or changed, new access keys for a user, an administrator policy attached, a console sign-in without multi-factor authentication, storage made public
Identity and SaaS Microsoft Entra ID sign-in and audit logs, the Microsoft 365 audit log, other identity providers An application granted broad permissions, a new multi-factor method added right after a password reset, a mailbox rule that forwards mail outside the company, a new administrator role assignment
Network DNS, proxy and firewall logs, flow records, Zeek, Suricata Connections at regular intervals to one destination, DNS queries with unusually long names to one domain, rare destinations for a given host
Linux and macOS auditd and system logs, endpoint agents A shell with a network connection to a remote host, a new scheduled job or SSH key, privilege use by an unexpected account, new launch items on macOS
Containers and Kubernetes Cluster audit logs, runtime sensors A privileged workload created, someone running commands inside a running container, a new cluster-wide administrator binding
Email Mail flow and gateway logs Mailbox rules created by an attacker, messages impersonating executives, new forwarding addresses
Web and applications Web server, WAF and application logs A web server process starting a shell, repeated authentication failures, exploitation attempts against known flaws
CI/CD and supply chain Source-host audit logs, build logs A workflow file changed unexpectedly, a build job reaching an unusual destination, a new secret used from a new place

A recipe for learning any domain#

The method you used for the endpoint works everywhere:

  1. Learn what normal looks like in that platform before you look for abnormal.
  2. Find the logs. Which audit sources exist, what is off by default, how long are they kept, how late do they arrive? (stage 3)
  3. Read the ATT&CK matrix for the domain (cloud, containers and others have their own views) and pick a few techniques. (stage 2)
  4. Read public detections for those techniques, in the repositories from stage 5.
  5. Build three to five detections with tests, and put them in your repository. (stages 5 to 7)
  6. Measure noise and health for the new sources, as in stage 8.

Cloud work deserves one warning: only test in an account you own, set a budget alert first, and clean up afterwards.

Beyond simple matches: baselines and anomalies#

Some behaviours have no fixed signature: a user signing in from a country for the first time, a host talking to a rarely seen destination, a service account doing something unusual. Here you compare activity with a baseline, such as the user's own history or their peer group. These approaches are powerful and carry costs:

  • A baseline needs history, so a new user or system starts with no baseline.
  • An attacker who has been present for weeks can teach the baseline that their activity is normal.
  • Analysts need to know why something fired, so explainable logic beats an opaque score.
  • They need maintenance as the environment changes.

Start with simple, explainable statistics (first-seen, rare, peer comparison) before reaching for machine learning, and use risk-based alerting (stage 6) so that a weak anomaly adds a little risk rather than raising a page.

Scaling the work#

Detection engineering stops being one person's repository quite quickly. Things that matter as it grows:

  • Ownership. Every detection has an owner and a review date, and there is a place to send a noisy-rule report. Without that, rules rot.
  • Content that travels. Keep logic separate from environment settings: thresholds, lists and exclusions live in configuration, not in the rule. This is essential if you serve several teams or customers (as a managed provider does): shared logic, per-customer settings, and tests for both.
  • Release rings. Deploy to a small group first, then widen, as in stage 6, but across teams.
  • Cost. Searches cost compute and ingest costs money. Track the most expensive rules, and design detections to filter early.
  • Documentation and onboarding. Detection cards and a contributing guide let new people add rules without a long apprenticeship.

AI assistance, with the guardrails on#

AI assistants can speed up parts of this job, if you keep the standard where it is.

Where they help. Drafting a first rule from a description of a technique. Explaining an unfamiliar rule or query. Translating between query languages. Suggesting test cases and harmless lookalikes. Summarising a report into a list of behaviours to check.

Where they hurt.

  • They invent field names, tables and functions that look right and do not exist.
  • They write logic that reads well and is subtly wrong, such as a condition that never matches.
  • They can leak: pasting real logs, customer data or internal rule details into a service you do not control is a data-handling decision, not a convenience.
  • Text from untrusted sources (a web page, a report, a log line) can contain instructions aimed at the model.
  • It is easy to trust fluent output more than you should.

Guardrails that work.

  1. Tests are the gate. An AI-written rule passes the same checks, positive and negative tests and review as any other (stages 6 and 7).
  2. Verify every field and table against your real schema.
  3. A human reviews every merge, and the pull request says that AI assistance was used.
  4. Keep confidential data out. Use invented or scrubbed examples, or tools your organisation has approved.
  5. Treat output as a draft from a quick colleague who has never seen your data.

A useful prompt gives the log source and the fields that really exist, the behaviour, the output format and the constraints, and asks for the rule, a positive test, a harmless lookalike and the likely false positives. Then you do the checking.

Do this#

  1. Scope a domain (2 hours). Choose one. Read its ATT&CK matrix view, list the data you would need, and mark which sources are off by default or short-lived.
  2. Build three detections (6 to 8 hours). Write them as Sigma where the format fits, with tests and detection cards, and add them to your repository. For cloud, use a throwaway account you own, a budget alert, and a tool built for generating test activity (one is linked below).
  3. Write a first-seen detection (2 hours). Implement "the first time this user does this thing" in your query language, run it on lab data, and measure how noisy it is on day one.
  4. Use an AI assistant under guardrails (3 hours). Ask one to draft a rule for a behaviour you know. Record every error you have to fix, and write the guardrails above into your repository's contributing guide.

Resources#

Free first

Paid or needs an account

  • A cloud account of your own, with a budget alert, for the cloud exercises. Free tiers exist but are limited.

Checkpoint#

You are ready to move on when you can:

Go deeper (optional)#

  • Choose a second domain and repeat the recipe for one technique.
  • Read the audit and health options for one cloud service, and write the three events you would alert on if you could only pick three.
  • For cloud and identity, pair your detections with Threat Hunting stage 6 and test them with Threat Emulation stage 6.

0 / 6 checkpoints ticked

View this page on GitHub