Web Security Monitoring and Incident Response

Web Security Monitoring and Incident Response

Dwell time weighs heavily on what a breach costs. A CTO-altitude posture for detection signals, a security-grade audit trail, and a runbook that exists before the incident.

A breach's cost is not fixed at the moment it gets in; a breach that runs for a long time because nobody was watching the right signals can cost more. This article is the CTO-altitude posture for detection and response on web-facing systems — why dwell time, how long a compromise runs before anyone notices, weighs heavily on what a breach costs, what to monitor and why, the difference between debugging logs and a security-grade audit trail, and why an incident-response runbook that does not exist before the incident does not exist at all. One metric worth being able to state to a board is mean-time-to-detect, and a site that cannot estimate it is a site that has already decided to find out the slow way.

Why detection is the gap legacy sites ignore

Prevention is the part of security that gets the budget, because it is the part that feels like progress — a control added, a finding closed, a posture improved. Detection is the part that gets deferred, because it does not produce a visible artifact until the day it does. The result, on many sites that have not been rebuilt in years, is a posture that is comparatively well-defended at the perimeter and effectively blind behind it. The controls were bought to keep an attacker out. Less was bought to notice one who got in anyway.

That asymmetry has a specific consequence. A breach against a site with prevention but no detection does not get caught when it happens. It gets caught when a customer reports something wrong, or a partner notices data where it should not be, or an outside researcher emails a contact address that may not be monitored. By then the attacker has had whatever time elapsed between entry and the external report — and that interval weighs heavily on what the incident costs.

Legacy sites compound this because they log for the wrong reader. The logs exist, often in volume, but they were written to help an engineer debug a failed request, not to help a responder reconstruct an attack. They record what the application did, not who did it, from where, with what privilege, in what sequence. When an incident finally surfaces, the team discovers the logs answer "why did this page error" and cannot answer "what did this session touch and when," which is the only question that matters at that point and the one nobody designed the logs to answer.

The plain way to say all of this: how long a compromise runs before it is detected weighs heavily on what a breach costs. A compromise detected in hours has had little time to spread and is easier to scope. The same compromise detected only much later has had time to reach further. Either one may have to be disclosed, depending on the law that applies; the later one also brings a customer-trust problem and a forensic excavation through logs that were never built to be excavated, and any disclosure has to describe a longer intrusion that is harder to reconstruct. The entry was identical. The difference in cost was bought, or not bought, by detection — before anything happened.

What to monitor and why

Monitoring is not "turn on more logging." It is a deliberate choice about which signals, from which sources, are worth the cost of collecting, retaining, and watching. The useful frame is not volume but answerability: each signal earns its place by being the thing a responder will need to answer a question they cannot answer any other way.

Signal sourceWhat to captureWhy it matters
AuthenticationLogin outcomes, privilege changes, session anomaliesA compromised account can look like a legitimate user to other controls; authentication is one place its misuse can show
EdgeRequest patterns, blocked traffic, abuse signaturesThe edge sees the attempt before the application does, including the ones the application never sees
ApplicationAuthorization decisions, sensitive-action audit eventsThe difference between "a request happened" and "this identity performed this action" — the forensic spine
Dependency / supply chainComponent behavior change, unexpected outbound callsA compromised dependency does not announce itself; it shows as behavior the component never had before

Two of those rows are often the gap. Authorization-decision logging — recording not just that a request was served but that this identity was permitted to perform this sensitive action — is what turns a pile of access logs into a forensic timeline, and it is precisely the thing debugging-oriented logging omits because it is not needed to debug a 500. The unexpected-outbound-call signal is one that can catch the modern supply-chain class, where the application code is fine and the imported component is doing something it never used to. Neither is exotic. Both are often absent on sites instrumented for operations rather than for security.

The requirement underneath the table is that this be a security-grade audit trail rather than logging kept only for debugging, with three properties the OWASP Logging Cheat Sheet makes concrete: it records security-relevant events with the actor and not only the action; it is tamper-evident, so an attacker who reaches the logs cannot quietly edit their own trail out of them; and it is kept for the required retention period — the Cheat Sheet says log data, temporary debug logs, and backups, copies or extractions must not be destroyed before that period ends and must not be kept beyond it, and that legal, regulatory and contractual obligations may affect these periods. Retention settings shorter than an investigation needs are common, so that period is worth setting with investigations in mind. The global median dwell time in Mandiant's M-Trends 2026 was 14 days, but some intrusion types it tracked, such as espionage-related intrusions, had a median of 122 days. A trail an attacker can edit is not evidence. A trail that ages out before the breach is discovered is not there when it is needed. The absence of a security-grade trail is itself a named failure category in the OWASP Top 10:2025, the current edition as of Oct 2026 (A09:2025 Security Logging & Alerting Failures), not an operational nicety.

Incident-response readiness

A runbook that is written during the incident is not a runbook. It is improvisation with a document open, performed by people under the worst pressure they will experience that year, making irreversible decisions about disclosure, containment, and customer communication with no rehearsed sequence and no agreed owner. A high-leverage thing a CTO can require here is that the runbook exists before it is needed, and that "exists" means something specific: named owners for each decision, a clock with defined intervals, and a containment-versus-evidence call already reasoned through, because deciding it live trades the investigation for speed or speed for the investigation at exactly the moment both matter most.

Part of readiness is being reachable by the person who finds the problem first, who is frequently not your team. A published, machine-readable security contact — the security.txt format defined in RFC 9116, an Informational RFC — is the difference between a researcher's report arriving at a monitored channel and arriving in a generic inbox, or nowhere, while the issue stays open. Disclosure readiness is not a legal afterthought to the technical response; it is part of the technical response, because the clock on a vulnerability starts when someone outside knows about it, not when you do.

The containment-versus-evidence call deserves its own line because it is the decision that, made badly under pressure, turns a manageable incident into an unrecoverable one. The instinct in the first hour is to pull the compromised system offline immediately — stop the bleeding. That instinct can also destroy the volatile evidence that would have told the team how far the compromise reached and whether it is still active elsewhere, leaving the organization to disclose a breach it cannot characterize, which is the worst disclosure to have to make. The opposite instinct — preserve everything, observe the attacker, lose nothing — can mean the compromise runs longer than it had to while the team gathers forensic completeness it did not strictly need. Neither answer is universally right, which is exactly why it must be reasoned through before the incident and assigned to a named decision owner, not improvised by whoever is on the call at the moment both options are still open and the clock is already running.

The runbook is only real if it has been run. A tabletop rehearsal — walking the named owners through a plausible scenario before any of it is real — is what converts a document into a capability, and it does so by failing cheaply. Rehearsal is where the team discovers that the named owner left, that the contact path routes to a closed queue, that the decision authority for customer disclosure was never actually assigned, that the logs the runbook assumes exist do not. Every one of those is a finding you want surfaced in a meeting, not in the first hour of a live incident. Published guidance on structuring the response exists, most recently NIST SP 800-61 Rev. 3 (April 2025; the current revision as of Oct 2026), which places incident response inside overall cybersecurity risk management as a CSF 2.0 Community Profile; the point at this altitude is that any structure is worth nothing unrehearsed.

What a CTO is accountable for

The metric a CTO should be able to state, including to a board, is mean-time-to-detect — not the count of controls present. Controls-present is a procurement answer; it says money was spent. Mean-time-to-detect is an outcome answer; it says whether the money bought the thing money was supposed to buy, which is the ability to know. A posture that can list its controls but cannot estimate how long a real compromise would run undetected is a posture that has bought prevention and is hoping it never needs detection, which is not a strategy so much as a deferral.

The artifact this resolves to is a breach-readiness statement, and it is the same dual-use document the rest of this topic keeps producing. Internally it is the runbook, the detection coverage, the owners, and the rehearsal record. Externally — handed into a customer security review or summarized for a board — it is evidence that the organization can not only keep an attacker out but notice one who gets in and respond on a clock, which is a question a mature enterprise buyer may ask, since "we have never been breached" can also mean "we have never detected a breach." One narrow boundary belongs here for the same reason it does elsewhere on this topic: cookie settings such as the SameSite attribute and the __Host- name prefix appear in monitoring as security signals of a session. Whether a cookie needs consent is a legal question that depends on jurisdiction, and a separate topic owns it. In the EU, for example, Article 5(3) of the ePrivacy Directive requires Member States to ensure that storing information, or gaining access to information already stored, in the terminal equipment of a subscriber or user is allowed only if the subscriber or user has given consent, having been provided with clear and comprehensive information, including about the purposes of the processing. That does not prevent any technical storage or access for the sole purpose of carrying out the transmission of a communication over an electronic communications network, or as strictly necessary for the provider of an information society service explicitly requested by the subscriber or user to provide the service. The same cookie raises a security question here and a legal question there, and this posture answers the security one.

The tooling is deferred to engineering on purpose. Which log platform, which detection engine, which correlation system — those are engineering decisions on engineering criteria, and they will be replaced before the threat model is. The decisions that do not move, and that therefore sit at this altitude, are three: that detection is funded as deliberately as prevention, that the audit trail is security-grade and tamper-evident rather than debug logging renamed, and that the runbook exists and has been rehearsed before the incident that needs it. Decide and own those three, and the question "how long would a breach run here" has an answer. Leave them implicit, and the answer is "until someone outside tells us," which is an expensive answer to have.

Project Inquiry