All lessons Leer en español

Security in depth · Unit 23

Defenses and detection

Connect prevention, detection, response, and recovery to specific risks and evidence of effectiveness.

11 minready

ATT&CK TA0005 Defense Evasion (defender view)

Helpful before thisThe words that make security clearerComputers and networks

After this lesson you can

  • Distinguish installed controls, reporting coverage, and observed outcomes in supplied records.
  • Locate a detection gap without treating every missing alert as a collection failure.
  • Prioritize owned corrections and specify evidence needed for a defensible readiness decision.

Lessons in this unit

Browse 14 lessons in this topic
  1. How antivirus and EDR protect endpointsFollow an event from a device to a decision, and learn what a quiet dashboard can and cannot tell you.6 min
  2. Segmentation: make every connection earn its placeUnderstand network boundaries, identity checks, and the limits of a firewall.10 min
  3. Detection: why a good alert needs contextExplore signal, noise, base rates, and the evidence behind an alert.11 min
  4. Hardening: reduce what a device has to trustBuild a maintainable baseline for devices, services, and administrative access.10 min
  5. Recovery: how much time and data can you lose?Explore RPO, RTO, backup isolation, and the difference between a backup and a restore.11 min
  6. A control needs an objectiveMeasure whether a monitoring workflow meets its promised outcome.3 min
  7. Layers should not share every failureFind the shared dependency behind three apparently separate protections.3 min
  8. Log fields need defined meaningsUse an event dictionary before deciding that a queued job completed.3 min
  9. Monitor the monitoring pathExplain a quiet dashboard using source, collection, and parsing evidence.4 min
  10. Thresholds trade workload and coverageDoes lower volume alone prove a better rule?4 min
  11. Response actions need authorityUse an approval matrix before a response affects a shared service.4 min
  12. Recovery copies need separate protectionReview whether a protected backup still depends on unavailable production keys.3 min
  13. Exceptions need an end conditionDistinguish an expired approval from a control that was actually restored.4 min
  14. Case: a quieter queue, a missed changeCompare two fictional detection designs using labeled cases, review time, and missing coverage.10 min

A useful defense has a purpose: protect a resource, notice a meaningful event, contain a problem, or restore a service. Product names alone do not tell us whether that purpose is achieved. Coverage, configuration, operational ownership, and evidence all matter.

Prevention, observation, and responsePrevention may block or allow activity. Either result can produce telemetry for detection and response. Recovery informs future protection.PreventionApply the relevant controlBlockedactivityActivityoccursTelemetry + detectionInterpret available evidenceResponse + recoveryContain, restore, improve
Prevention can block activity. Activity that occurs may generate telemetry, detection, and a response. Recovery and lessons learned feed back into protection.

Different controls support different outcomes

Function Question and examples
Prevention Does this reduce the chance or scope of an unwanted action? Examples: access checks, MFA, application control, network policy.
Detection Can relevant activity be recognized in time? Examples: correlated alerts, change monitoring, unusual sign-in review.
Response and recovery Can harm be limited and intended service restored? Examples: session revocation, isolation, tested restoration.

These categories overlap. A DNS sinkhole may block a destination and create evidence. A backup helps recovery only if it is usable, sufficiently current, and protected from the same failure. No fixed set of three products provides complete coverage.

A Control may reduce likelihood or impact without eliminating a weakness. Severity should reflect the actual context and assessment method, not an automatic downgrade because a security product is installed.

Turn telemetry into evidence

Telemetry needs a known source, useful fields, consistent time, secure access, retention, and collection-health checks. A quiet dashboard can mean normal activity, limited coverage, a failed pipeline, or an ineffective rule.

The example below is teaching pseudocode. It describes a hypothesis to investigate, not a deployable rule or proof of malicious activity.

rule: unusual_outbound_4451
when process.image endswith "python.exe"2
and network.dest.port == 4453
and user not in workstation_admins4
then alert severity=medium5
  1. Give the detection hypothesis a descriptive name.
  2. A recorded process name; names alone do not establish intent.
  3. A destination port; confirm the observed protocol and context.
  4. An example exception based on a group; validate whether this exemption is appropriate.
  5. A proposed triage priority that requires local validation.

Authorized automation could match this pattern. A differently named process could evade this particular condition without being invisible to all controls. Evaluate useful positive cases, benign matches, missing fields, and collection failures before claiming the rule works.

Host process events, identity-provider sign-ins, application audits, and network flow records answer different questions. Encrypted traffic and protocols can limit network visibility; application and endpoint records may provide context unavailable on the wire. Collect only data needed for the stated purpose.

Antivirus and EDR overlap

Modern antivirus can combine signatures, heuristics, cloud analysis, and behavioral techniques. EDR adds capabilities for investigation and response, often within overlapping product suites. It is inaccurate to equate all antivirus with simple file hashes or to assume EDR observes every action.

A missed alert can result from collection gaps, policy exclusions, unsupported platforms, limited detection logic, or other causes. A new file is not automatically undetectable. Legitimate signed software can be misused, so context matters alongside publisher trust.

Sensor integrity also matters: protect policy changes, monitor service health, and review vulnerable drivers and unsupported components. Continue with AV and EDR for the file-to-behavior pipeline.

MFA and application control have boundaries

MFA adds an authentication factor to the flow it protects. It can prevent a password alone from completing that flow, but does not necessarily stop lockouts, copied-verifier guessing, or misuse of an existing session. Recovery and alternative methods need separate review.

Application control restricts which software may run under defined rules. Safety depends on rule type, signer scope, writable locations, interpreted content, and enforcement mode. A broad path allowance can be dangerous when an untrusted actor can modify the permitted files; the mere existence of a writable folder outside the policy is not the definition of a gap.

Segmentation and identity protection

Segmentation can prevent communication or constrain the resources reachable from an affected host. Egress policy can block some outbound activity and produce useful records. Permitting HTTPS does not prove every permitted connection is safe, while decrypting all traffic is not a universal requirement or complete solution.

Directory defense also protects where powerful credentials are used. Keep high-trust administrative identities away from less trusted endpoints, restrict sensitive group and policy changes, and review service identities and certificate issuance. Credential Guard, LSA protection, signing, and channel binding have specific scopes and prerequisites; none replaces all other controls.

Choose a correction and verify recovery

A recommendation should connect a demonstrated weakness to an implementable change, an owner, and a verification method. Proposed detection is not confirmed detection until evidence shows it handles the relevant behavior with tolerable false positives.

Response must also preserve necessary evidence and business continuity. A restoration exercise should check data integrity, dependencies, keys, and intended service operation. The existence of a backup file alone is insufficient. Cloud identity and AI defense apply the same reasoning to other environments.

Worked review: four reassuring claims

A fictional staff-records team must decide whether its service is ready for ordinary operation and an identity-provider outage. The owner requires current endpoint reporting, alerts for the seven labeled exercise events, and a restoration route usable during that outage. These are the exercise requirements, not universal industry thresholds.

  • D1: Six fresh sign-ins required the configured MFA step. Account recovery and already-established sessions were not assessed.
  • D2: All ten in-scope devices have a sensor installed. Only eight have supplied current reporting evidence; the state of the other two is unknown.
  • D3: All seven independently labeled relevant events arrived centrally with complete fields and parsed successfully. Five generated the required alert; two did not.
  • D4: A backup restored intact files while the normal identity provider was available. The recovery instructions require that provider; no alternative access evidence is supplied.
PredictWhich statement is strongest: “all products are installed,” “80% reporting coverage,” or “the outage scenario is ready”?

Installation is established, but it answers a narrower question. Reporting coverage is 8/10 = 80% for this inventory and time window. The outage scenario remains unverified because D4 did not exercise the missing identity dependency. None of these statements proves overall protection against every threat.

Trace the gap before choosing a product

D3 supports detection of 5/7 relevant cases, about 71.4%, for this exercise. It does not provide benign-case counts, so precision and analyst workload cannot be calculated. Start by reviewing rule conditions and exclusions: the two missing alerts cannot be explained here by absent or unparsed source records. Do not change the event labels merely to improve the percentage.

The endpoint owner investigates D2’s reporting gap. The detection owner explains and corrects D3’s missed cases. The recovery owner demonstrates a usable route under D4’s actual outage assumption. D1 supplies useful sign-in evidence while leaving alternative account pathways on their own review list.

A readiness card should identify each required outcome, the evidence supporting it, the unresolved dependency and a responsible decision-maker. A temporary operational acceptance, if authorized, must state its limits; it must not silently relabel missing evidence as verified protection.

Terms you met

ControlTelemetryDetectionEDRSegmentation

Check yourself

No timer. No penalties. Read the explanation and try again whenever you like.

  1. What reporting-coverage claim does D2 support?

    Show the answer

    Correct answer: Eight of ten in-scope devices have current reporting evidence; the other two remain unknown. The denominator is the ten devices in the inventory. Installation records do not substitute for fresh reporting evidence.

  2. Which investigation best addresses D3?

    Show the answer

    Correct answer: Review rule logic and exclusions for the two missed labeled events, preserving the supplied parsing evidence. D3 says all seven complete records arrived and parsed. The next review should explain why two did not produce the required alert.

  3. Which assurance statement is justified by D1?

    Show the answer

    Correct answer: The six tested fresh sign-ins required MFA; recovery and existing-session behavior remain unassessed. The result supports the tested flow. It supplies no evidence about the other pathways explicitly excluded from the exercise.

  4. What should the readiness owner do with D2-D4?

    Show the answer

    Correct answer: Assign the reporting and detection gaps, and require a recovery exercise covering the unavailable identity dependency before claiming that scenario ready. Each gap has a different cause and verification need. The successful file restoration is useful but narrower than the required outage scenario.

Try it

  • WriteWrite a release-review card for D1-D4 with four rows: supported claim, remaining limitation, owner, and next verification. Model D2 as 8/10 reporting coverage and D3 as 5/7 detection of labeled cases. Keep recovery approval conditional on the missing dependency evidence.
References