Skip to main content
Security guideReviewed

Security logging and monitoring: record the right events, protect the record, and prove each alert fires

Security logging and monitoring is how an application notices that someone is guessing passwords, changing permissions or asking for records that are not theirs.

This guide covers which security events to record, what each record needs to be useful a month later, how to keep secrets and forged lines out of the log, how to protect the log from the person it records, and how to turn a record into an alert that someone acts on. It comes with an event schema you can copy, three detection rules with tests, redaction fixtures, a review checklist and a lab you can run on your own computer.

Security event schema, detection tests, redaction fixtures and review checklist

Part 1 is a security event schema you can copy: eleven fields with the source behind each, and the event names for sign-in, privilege change and object denial. Part 2 is three written detection rules, each with a test that fires it and a near miss that has to stay quiet.

How to use it

Part 3 is the redaction fixtures. Part 4 is a review checklist for your own application, covering timestamps, correlation identifiers, event coverage, content, retention, access, integrity, alerting and testing. Part 5 is an illustration, not a monitoring product: an invented member portal on 127.0.0.1 in a careless and a careful version, a detector, a redaction scan and a hash-chain check, in eight files that import only node: modules and install no packages. Every output was copied from one recorded run on Node.js 26.0.0.

security-logging-and-monitoring.txt

Introduction11 lines

SECURITY EVENT SCHEMA, DETECTION TESTS, REDACTION FIXTURES AND REVIEW CHECKLIST Use it on an application you own, or one you are authorised in writing to test, with test accounts and test records. Part 1 is the security event schema. It works without the lab. Part 2 is the three detection rules, each with a test that fires it and a near miss that has to stay quiet. Part 3 is the redaction fixtures: what to send, what to search the log for, and what a pass does and does not prove. Part 4 is the review checklist for your own application. Part 5 is the lab: an illustration with an invented application that runs all of the above on your own computer. Wherever a line rests on a source, the source is named with its requirement number and level. Wherever it rests on judgement, it says "this page's advice".

What security logging and monitoring is, and how it fails

Security logging is an application writing down the events that matter for security: who signed in, who was refused, who changed what another account may do.

Monitoring is something reading those records while they are fresh, and alerting is that reader telling a person. Each depends on the one before it. An alert cannot fire on an event nobody recorded, and a record nobody reads is only useful after the damage, if it is still there.

The OWASP Top 10:2025 gives the subject its ninth category, A09, which its page titles Security Logging & Alerting Failures. The page says the category keeps its position at number nine with a slight name change, to emphasise the alerting function needed to induce action on relevant logging events.

Its description begins: without logging and monitoring, attacks and breaches cannot be detected, and without alerting it is very difficult to respond quickly and effectively during a security incident.

The page also calls the category incredibly difficult to test for, says it has minimal representation in the CVE and CVSS data, and says it was voted into the list by community survey participants for the third time.

MITRE's catalogue of software weaknesses names the base case CWE-778, Insufficient Logging: when a security-critical event occurs, the product either does not record the event or omits important details about the event when logging it. Both halves count. A failed sign-in that leaves no line is one failure, and a line that says a sign-in failed without saying for which account is the other.

ASVS 5.0 treats the subject in chapter V16, Security Logging and Error Handling. Its control objective says security logs are distinct from error or performance logs and are used to record security-relevant events such as authentication decisions, access control decisions, and attempts to bypass security controls, such as input validation or business logic validation.

One limit of ASVS is worth knowing before you use the chapter as a checklist. Section V16.3 notes that while ASVS includes logging of security events in scope, alerting and correlation are considered out of scope and are handled by operational and monitoring systems.

Its examples of what is out of scope are rules in a security information and event management (SIEM) system and monitoring infrastructure. So ASVS says what to record and how to protect it, and A09 is where to look for whether anyone is told.

The signs OWASP lists

A09 lists the conditions under which logging, monitoring, detection and alerting are insufficient. Closely paraphrased, they are:

  • Auditable events, such as logins, failed logins and high-value transactions, are not logged or are logged inconsistently, for instance only logging successful logins but not failed attempts.
  • Warnings and errors generate no, inadequate or unclear log messages.
  • The integrity of logs is not properly protected from tampering.
  • Logs of applications and APIs are not monitored for suspicious activity.
  • Logs are only stored locally, and not properly backed up.
  • Appropriate alerting thresholds and response escalation processes are not in place or effective, and alerts are not received or reviewed within a reasonable amount of time.
  • Penetration testing and scans by dynamic application security testing (DAST) tools, of which the page names two, do not trigger alerts.
  • The application cannot detect, escalate or alert for active attacks in real time or near real time.
  • The application is vulnerable to sensitive information leakage, by making logging and alerting events visible to a user or an attacker, or by logging sensitive information that should not be logged, such as PII or PHI.
  • Log data is not correctly encoded, which leaves the logging or monitoring systems vulnerable to injections or attacks.
  • The application is missing or mishandling errors and other exceptional conditions, such that the system is unaware there was an error and is therefore unable to log that there was a problem.
  • Adequate use cases for issuing alerts are missing or outdated to recognise a special situation.
  • Too many false positive alerts make it impossible to distinguish important alerts from unimportant ones, so that they are recognised too late or not at all.
  • Detected alerts cannot be processed correctly because the playbook for the use case is incomplete, out of date or missing.

Why your application's own events matter when the server already has access logs

If a web server or hosting platform in front of your application already keeps a log of requests, it is fair to ask why the application should keep another.

OWASP's Logging Cheat Sheet answers directly. It says many systems enable network device, operating system, web server, mail server and database server logging, but often custom application event logging is missing, disabled or poorly configured, and that application logging provides much greater insight than infrastructure logging alone. Web application logging, it says, is much more than having web server logs enabled.

The reason is where the knowledge sits. The cheat sheet calls the application code itself the primary event data source. The application, it says, has the most information about the user, with identity, roles and permissions as its examples, and about the context of the event, which it gives as target, action and outcomes, and this data is often not available to either infrastructure devices or even closely related applications.

The lab on this page shows the gap in one request. A signed-in member asks for an invoice that belongs to another member. The portal answers 404, the same reply it gives for an invoice that does not exist, so the caller learns nothing. A record of the request alone would hold a method, an address and a 404.

The careful version's own log holds an event named authz_fail with the outcome denied, the account that asked, the invoice it asked for and the reason not_owner. Four of those inside five minutes is a pattern worth a person's attention, and it can only be counted by something that can tell not_owner from a mistyped link.

Why the reply is a 404 and not a 403 is covered in the broken access control and IDOR guide.

Keep the other logs. The cheat sheet lists further sources of information about application usage that could also be considered, among them network firewalls, network and host intrusion detection systems, application firewalls, and database applications with their automatic audit trails. It adds that data from systems in a different trust zone may be missing, modified, forged or replayed and could be malicious, and must always be treated as untrusted data. The application's security events sit beside those sources and do not replace them.

Security event logging: which events to record

Start from the decisions your application makes about people: who they are, and what they may do.

ASVS 5.0 section V16.3 sets out four requirements, all at Level 2.

  • 16.3.1:all authentication operations are logged, including successful and unsuccessful attempts. Additional metadata, such as the type of authentication or factors used, should also be collected.
  • 16.3.2:failed authorisation attempts are logged. For Level 3, this must include logging all authorisation decisions, including logging when sensitive data is accessed, without logging the sensitive data itself.
  • 16.3.3:the application logs the security events that are defined in the documentation and also logs attempts to bypass the security controls, such as input validation, business logic and anti-automation.
  • 16.3.4:the application logs unexpected errors and security control failures such as backend TLS failures.

What the other sources add

The section says of itself that it outlines the types of events that should be logged but does not attempt to provide exhaustive detail, and that each application has unique risk factors and operational context. 2 min read

Sign-in: success, failure and lockout

Record every sign-in attempt with its outcome, and record the lock when repeated failures cause one. 1 min read

Privilege change: who gave what to whom

Record every change to what an account may do: the account that made the change, the account that was changed, and what was granted or removed. 1 min read

Object denial: a request for a record the caller may not reach

Record each refusal with the account, the type and id of the record asked for, and the reason. 1 min read

What each record needs to be useful a month later

Write each event for a reader who was not there: someone working through an incident weeks afterwards, with the log and nothing else.

ASVS 5.0 requirement 16.2.1, at Level 2, asks that each log entry includes necessary metadata, such as when, where, who and what, that would allow for a detailed investigation of the timeline when an event happens. The Logging Cheat Sheet uses the same four words and says the application logs must record them for each event.

A line such as "login failed for sage" answers one of the four and part of another. The schema in the asset gives each answer its own field, so that the log can be questioned field by field and nobody has to read sentences.

  • When. One instant, written the same way on every line. ASVS 5.0 requirement 16.2.2, at Level 2, asks that time sources for all logging components are synchronised, and that timestamps in security event metadata use UTC or include an explicit time zone offset. It recommends UTC, to ensure consistency across distributed systems and to prevent confusion during daylight saving time transitions.
  • Where. Which application wrote the event and which entry point was called. The cheat sheet's examples include an application identifier and, for a web application, the entry point URL and HTTP method. The lab records the route as a pattern, such as GET /api/invoices/:id, and not the address that was sent.
  • Who. An account identifier, and the address the request came from. The cheat sheet's examples of a user identity include a user database table primary key value. An id keeps a person's name and email address out of every line and still lets an investigator look the person up.
  • What. The name of the event, from a fixed list, and its outcome.
  • On what. The type and id of the record or account the action was aimed at. The cheat sheet lists the object among the attributes to consider recording, with a user account, a data resource and a file as examples.
  • Why it went that way. A reason from a fixed list, such as not_owner. The cheat sheet's entry for it is the reason why the status occurred.

Timestamps: one format, one zone

RFC 3339, published in July 2002 in the Standards Track category, defines a date and time format for use in Internet protocols. 2 min read

Why event names come from a fixed list

A detection rule, a dashboard and a search all key on the event's name. 2 min read

What a correlation identifier is for

In this guide, a correlation identifier is a random value created once for each request and written on every event that request produces. 1 min read

Log redaction: keeping passwords, tokens and card numbers out

A security log is written at the moments when secrets are close at hand.

A sign-in event is created by the code that holds the password, and a refused payment by the code that holds the card number. Personal details need the same care in a log as in a response, and the sensitive data exposure guide works through that field by field. This section is about the mechanism: how a secret gets into a log, and where to stop it.

ASVS 5.0 requirement 16.2.5, at Level 2, sets the rule: when logging sensitive data, the application enforces logging based on the data's protection level. Its first example is that it may not be allowed to log certain data, such as credentials or payment details. Its second is that other data, such as session tokens, may only be logged by being hashed or masked, either in full or partially.

MITRE's entry for the weakness is CWE-532, Insertion of Sensitive Information into Log File, whose mitigations include not writing secrets into the log files.

The Logging Cheat Sheet's section on data to exclude has two lists, and their verbs differ. Items on the first should usually not be recorded directly in the logs, but instead should be removed, masked, sanitised, hashed or encrypted; they include session identification values, access tokens, authentication passwords, encryption keys and bank account or payment card holder data.

Items on the second can sometimes also exist and, while useful for subsequent investigation, may also need to be treated in some special manner before the event is recorded. The section opens with a wider instruction: never log data unless it is legally sanctioned.

The lab's careless version shows one way in: a logger that is handed the request and writes all of it. After one story of nineteen logged entries, the correct password sits in one line of its log, the wrong password in six, one member's session cookie value in eight and the card number in one.

No line was written in order to record a secret. Each secret was copied in with a request body, or used as a convenient label for who was acting.

The wrong password belongs on that list as much as the right one, since a wrong password can be one keystroke away from the real thing.

Three places to stop it

The careful version stops the same secrets at three points, and the third is the one that keeps the first two honest.

  • Build the event from named fields. The careful logger is handed the same request information as the careless one, and never reads the body or the session cookie from it. It takes ids and words from fixed lists. Code that never touches the body cannot copy a secret out of it.
  • Enforce the field list at the last step before writing. One handler in the lab passes its logger the whole parsed request body as extra detail, which a handler should not do. The careful logger's last step rebuilds every event from the schema's lists, so the extra key is dropped, and the event records that one field was dropped without recording its name or value. The card number in that body reached the careless log and did not reach the careful one.
  • Prove it with fixtures. The lab sends requests that carry a marked password, a session cookie, an invented card number and two awkward record ids, then searches the log for those exact values. A test that fails when a fixture value appears in the log catches the next logging change that copies a body, whoever makes it.

Stand-ins, and two limits

Where events have to be tied to a session, the sources point to a stand-in for the token. Requirement 16.2.5 allows hashing or masking, and the cheat sheet suggests considering a hashed value if one is needed to track session specific events. The lab's schema has no session field at all. It ties events together with the account id and the correlation identifier.

Two limits apply. A field list controls which fields exist, not what an allowed field holds: the record id in the lab's events is whatever the caller put in the address, cut to 200 characters. And none of this cleans a log that already holds a secret. Revoking the secret and redacting the copies is the subject of the secrets exposure guide.

Log injection: when a caller writes lines into your log

Log injection is a caller supplying text that the application writes into its log in a way that changes what the log appears to say.

MITRE's entry is CWE-117, Improper Output Neutralization for Logs: the product constructs a log message from external input, but it does not neutralise or incorrectly neutralises special elements when the message is written to a log file. The entry lists log forging as an alternate term, for cases in which the adversary can add additional log entries or modify how a log entry is parsed.

The special element that matters first is the line break. A text log is read one line at a time, so whoever can put a line break into a logged value can end the real entry and begin one of their own.

CWE-117's second example is code that logs a username when registration fails. A username with an encoded newline followed by the words Admin Access Granted produces a second line that reads exactly that, which the entry says could trick administrators into believing that false events occurred or even bypass security monitoring systems.

Its consequences go further than false entries. Forged or corrupted log files can be used to cover an attacker's tracks or to implicate another party, a log that is processed automatically can be made unusable by corrupting its format, and an attacker may inject code or other commands into the log file and take advantage of a vulnerability in the log processing utility.

The lab sends one such value: a record id made of an id that does not exist, a line break, a line shaped like the careless log's own sign-in line for the admin, another line break and a line shaped like a JSON event.

The careless version joins the id into a sentence. Its log gains two lines that no request wrote, so nineteen entries become twenty-one lines, and a reader counting sign-ins by the admin finds two where the story held one.

How structured logging and encoding address it

ASVS 5.0 requirement 16.4.1, at Level 2, asks that all logging components appropriately encode data to prevent log injection, and one of the controls on A09's prevention list is to ensure log data is encoded correctly to prevent injections or attacks on the logging or monitoring systems.

The Logging Cheat Sheet says to apply defences such as these: do not use unstructured text log formats, use structured log formats such as JSON, and limit the size of the user input value used to create the log message.

It notes that some logging frameworks do not consider log injection through line breaks in unstructured logs to be a vulnerability, which means it will not be fixed in them.

A structured format such as JSON helps when the writer follows its encoding rules, because JSON's rules leave no way to write a raw line break inside a string. RFC 8259, the JSON standard, says in section 7 that the characters that must be escaped inside a string are the quotation mark, the reverse solidus and the control characters from U+0000 through U+001F.

Its grammar gives line feed, U+000A, a two-character escape: a reverse solidus followed by the letter n. In the lab's careful log the forged value is one string inside one event.

The line breaks appear as those two characters, the quotation marks in the forged JSON are escaped as well, nineteen entries are nineteen lines, and no line begins with forged text.

Three cautions belong with that result. A plain text search of the careful log still finds the forged words, because they are there, inside the id field of one denied request: read a structured log by its fields, not by searching for phrases.

Encoding for the log file does not make a value safe for every later reader, and the cheat sheet says that in web applications the logs should not be exposed in web-accessible locations and, if they are, should have restricted access and be configured with a plain text MIME type, not HTML.

And length matters as well as content: the lab's careful logger cuts a 500-character record id to 200 characters and marks the cut.

Audit log security: protecting the log from the person it records

A log is evidence about people, and some of those people can reach it.

An administrator whose role change is recorded may be able to edit the file. Someone who takes over the application server takes over whatever that server can write. ASVS 5.0 section V16.4 says that if logs can be easily modified or deleted, they lose their integrity and become unreliable for incident investigations or legal proceedings, and it sets three requirements at Level 2. Requirement 16.4.1 is the encoding rule from the last section. The other two are about custody.

  • 16.4.2:logs are protected from unauthorised access and cannot be modified.
  • 16.4.3:logs are securely transmitted to a logically separate system for analysis, detection, alerting and escalation. The requirement states its aim: to ensure that if the application is breached, the logs are not compromised.

Who can read it, and who can change it

The Logging Cheat Sheet turns custody into working rules. 1 min read

What a hash chain shows, and what it does not

One form of tamper detection is a hash chain. 1 min read

Why the chain needs a head kept somewhere else

The last two kinds of interference are caught only by a value kept outside the log. 1 min read

How long to keep logs

This page gives no number, because the right one depends on obligations it cannot see. 1 min read

From record to alert: choosing what someone will act on

A record helps with today's incident only if it reaches a person in time.

The 2025 edition changed the category's name to say so, and several of A09's signs are about the last step and not the first: thresholds and escalation processes that are not in place or not effective, alerts that are not received or reviewed within a reasonable amount of time, use cases for alerts that are missing or outdated, and playbooks that are incomplete, out of date or missing.

The opposite failure is on the list as well: too many false positive alerts, so that important ones are recognised too late or not at all. It is a close relative of the alarm fog the Logging Cheat Sheet warns about. The aim is a short list of alerts that are each read.

One of the controls on A09's prevention list is that DevSecOps and security teams should establish effective monitoring and alerting use cases, including playbooks, such that suspicious activities are detected and responded to quickly by the security operations centre team.

For each alert, write down four things before it is switched on. These four are this page's advice.

  • What it means, in one sentence a non-specialist can read: five failed sign-ins for one account inside ten minutes.
  • Who receives it, by name or by roster, and through which channel.
  • What they do first. Each rule in the lab carries its first step inside the alert, so the person who receives it does not start from a blank page.
  • Why the threshold is what it is. A number chosen from your own normal traffic can be explained and adjusted. A number copied from an example cannot.

Three rules, and what keeps each one quiet

The lab has three rules. 1 min read

What the alert carries

Rules 1 and 3 stay quiet for an account, once they have fired for it, until a full window has passed, so one burst produces one alert and not one for every further request. 1 min read

Application security monitoring and intrusion detection for a web application

The phrase intrusion detection covers several different kinds of system, and it helps to know what each can see. 2 min read

How to test that an alert fires

An alert that has never fired is a hope.

A09 puts the test into its list of signs: penetration testing and scans by DAST tools do not trigger alerts. The Logging Cheat Sheet's verification section says logging functionality and systems must be included in code review, application testing and security verification processes. Its items include ensuring the logging is working correctly and as specified, checking that events are being classified consistently, ensuring logging is implemented and enabled during application security, fuzz, penetration and performance testing, and testing that the mechanisms are not susceptible to injection attacks.

The most direct test plays the behaviour and asserts the alert. The lab's detection tests do that for each rule, in pairs, with one extra check that is easy to forget.

  • A test that fires the rule. It sends the requests, five wrong passwords a minute apart for example, runs the detector over the log they left, and asserts that one alert was raised with the expected account, count, priority and times.
  • A test that comes close and has to stay quiet. Four wrong passwords and then the right one. A refused role change. Three refused invoice requests inside the window and a fourth 390 seconds after the first.
  • A check that the detector could read the log. A quiet result means something only if the events were read. The careless log raises no alerts at all, because the detector can read none of its lines, so a near-miss test that asserted only silence would pass on it. The lab's near-miss tests also assert that no line was skipped and that the expected number of events was read.

Time, pipelines and the parts a unit test cannot reach

Time is the awkward part of testing a window, since nobody wants a test that waits ten minutes. The lab's portal takes its clock from the test, which moves it forward between requests. If your application reads the system clock directly in the code that stamps events, changing that is the first step towards alerts you can test. This is this page's advice.

Run the tests where a failure blocks a release. The Node.js test runner documentation says the process exit code is set to 1 if any tests fail. In the lab, all thirteen tests fail against the careless version and all thirteen pass against the careful one.

A test like this stops at the detector. Two more checks belong to the running system. The first is this page's advice: send a marked test event through the real pipeline on a schedule and confirm that the named person received the alert, because rules, forwarding and paging each fail separately.

The second is the cheat sheet's: test the effect on the application of logging failures, for which its examples include simulated database connectivity loss, lack of file system space and missing write permissions, and ensure logging cannot be used to deplete system resources.

It adds that if log data is used in any action against users, such as blocking access or account lock-out, you should ensure this cannot be used to cause denial of service of other users.

The lab: one member portal, a careless log and a careful log

The lab is an illustration written for this page: an invented application, an in-memory log and a detector written for the purpose.

It is not a monitoring product, its thresholds are not recommendations, and nothing in it is a client's code or a client's result.

The application is the member portal of an invented community garden, with four accounts and five plot-fee invoices. It has four routes: sign in, read an invoice, pay an invoice and change an account's roles. It comes in two versions that run the same routes and the same sign-in, lockout, role and ownership checks, and make the same five calls to their logger with the same information.

The careless logger writes free-text lines with the computer's local time, the session cookie value and the whole request body.

The careful logger writes one JSON object per line in the schema from the asset, with a UTC time, a correlation identifier and three hash-chain fields, and never reads the body or the cookie.

It is eight files that import only node:assert/strict, node:crypto, node:http and node:test and call the global fetch() function, and it installs no packages. The portal listens on 127.0.0.1 and asks for port 0, and the Node.js documentation says that when the port is omitted or is 0, the operating system will assign an arbitrary unused port.

The log lives in memory and nothing is written to disk. Passwords are labels, stored as salted scrypt hashes, the card number is zeros with a counter, and usernames end in .example.

One story of requests is sent to both versions: an allowed read, five failed sign-ins that end in a lock, three role changes by the admin, a refused role change, four refused invoice requests, two awkward record ids and one request with no session.

Each version wrote nineteen entries. From the careful log the detector read all nineteen and raised five alerts: one for the failed sign-ins, three for the role changes, of which the admin's grant to their own account was urgent, and one for the refused invoice requests. From the careless log it read none of twenty-one lines and raised nothing.

The scan found every fixture value in the careless log and none in the careful one. The integrity check had nothing to verify in the careless log. In the careful log it caught all four kinds of interference once the kept head was used, two of them by the chain alone.

The lab was written and run on Node.js 26.0.0 on macOS, the only version and system it was run on, and every output in the asset comes from that run. The story's clock is set by the script, so its times are the same on every run.

Correlation identifiers, session values, hashes, ports and test timings will differ on your computer. The careless log's local times shown in the asset are from the recorded run of run-lab.mjs, which was made with the TZ environment variable set to Australia/Melbourne.

What logging cannot tell you

A log is the application's own account of what it believed at the time, and it has edges.

  • It holds only what was instrumented. CWE-778's definition has two halves, an event not recorded and an event recorded without important details. The lab writes no event for an allowed read or a completed payment, so its log cannot say who looked at an invoice they were entitled to see. ASVS 16.3.2 asks for that at Level 3, as the logging of all authorisation decisions.
  • It records the identity the application saw. A request made with a stolen session cookie is logged under the victim's account id, and the cheat sheet lists an attacker causing the wrong identity to be logged, in order to conceal the responsible party, among the attacks on accountability.
  • Silence is not a clean result. No alert can mean no attack, an attack below every threshold, a rule that reads a field nobody writes any more, or a log that stopped. The count of skipped lines and a scheduled test event are how you tell these apart.
  • It does not prevent anything. The refused requests in the lab were refused by the access check, not by the log. A09's own description is about detection and response.
  • An integrity check says that something changed, not who changed it.
  • It starts when you turn it on. Nothing reconstructs the events from before the schema existed.

Where an outside security test fits

Clever Ops does not monitor applications and does not provide incident response.

If an alert tells you someone is inside your application now, an incident response specialist comes first. What a test offers sits before that day.

A Clever Ops web application and API penetration test sends its requests from the source addresses listed in the signed authorisation letter, during an agreed testing window, and each request is logged, so a question about what was sent, and when, can be answered from the record. That gives you something to hold your own logging against.

OWASP counts penetration testing that does not trigger alerts among A09's signs, and the Logging Cheat Sheet says events from pen testers should never be excluded from the log, though you may want to include a classification flag for them.

Tell whoever watches your alerts the window and the addresses beforehand. Afterwards, compare what your log recorded and which alerts fired with what the test sent. The comparison is yours to make, because a test run from outside can describe only what the tester could observe.

Destructive actions are off by default for real people's accounts and records that existed before the test, and reset, lockout and deletion checks run only on test accounts and test records where the rules of engagement allow them. Lockout and rate-limit checks use a small, agreed number of requests, and Clever Ops does not run load or denial-of-service testing.

A report records what was tested and what was found. It is evidence for your decisions, not a certificate, and it is not monitoring: an alert rule broken by a release the week after the test is outside what it can speak to.

If Clever Ops built or hosts your application, the work is a security review rather than an independent test, and the report says who built it and who hosts it.

Frequently asked questions

Security logging is an application recording security-relevant events, such as sign-ins, refusals and permission changes. Monitoring is reading those records while they are fresh, and alerting is telling a person. OWASP's Top 10:2025 covers failures of all three under A09, whose description says that without logging and monitoring, attacks and breaches cannot be detected, and without alerting it is very difficult to respond quickly and effectively during a security incident.

ASVS 5.0 section V16.3 asks, at Level 2, for all authentication operations, failed authorisation attempts, the security events defined in your documentation together with attempts to bypass security controls, and unexpected errors and security control failures. OWASP's Logging Cheat Sheet adds a longer list, including input validation failures, session management failures and use of higher-risk functionality such as changes to privileges. This guide builds its schema around three families: sign-in, privilege change and object denial.

ASVS 5.0 requirement 16.2.1 asks for necessary metadata, such as when, where, who and what, that would allow a detailed investigation of the timeline. In this guide's schema that is a UTC timestamp, the application and route, an event name from a fixed list, the outcome, an account identifier for the actor, the type and id of the object, the source address, a correlation identifier shared by every event of the request, a reason from a fixed list and the schema version.

ASVS 5.0 requirement 16.2.5 gives credentials and payment details as examples of data it may not be allowed to log, and session tokens as data that may only be logged hashed or masked. OWASP's Logging Cheat Sheet lists data that should usually not be recorded directly in the logs, including authentication passwords, access tokens, session identification values, encryption keys and payment card holder data. In the lab on this page, the careless logger puts passwords, a session cookie value and a card number into its log.

It is a caller supplying text, such as a line break followed by a made-up entry, that changes what the log appears to say. MITRE catalogues it as CWE-117. ASVS 5.0 requirement 16.4.1 asks that all logging components appropriately encode data to prevent it, and OWASP's Logging Cheat Sheet gives defences such as not using unstructured text log formats, using structured formats such as JSON, and limiting the size of user input used in a log message.

This guide gives no number. A09's prevention list, which opens by saying developers should implement some or all of its controls depending on the risk of the application, includes holding login, access control and server-side input validation failures for enough time to allow delayed forensic analysis. ASVS 5.0 requirement 16.1.1 asks that the logging inventory documents for how long logs are kept, and OWASP's Logging Cheat Sheet says legal, regulatory and contractual obligations may impact on retention periods. Decide the period for each kind of log, write down the reason, and check that the oldest record you can read matches it.

They work at different layers. The abstract of NIST SP 800-94 describes four classes of intrusion detection and prevention system: network-based, wireless, network behaviour analysis software and host-based. Detection inside an application is built on events the application emits, and OWASP's Logging Cheat Sheet says the application has the most information about the user and the context of an event. OWASP's AppSensor project uses the term application layer intrusion detection for that approach.

Play the behaviour and assert the alert. For each rule, write one test that sends the requests that should fire it and checks the alert's fields, and one near miss that has to stay quiet. Assert as well that the detector read every line, because a detector that reads nothing also raises nothing. Then send a marked test event through the real pipeline on a schedule, to confirm the alert reaches the person named to receive it.

Scope the right test for your application

Tell us what you have built, who uses it and when it needs to launch. You will get a plain-English recommendation: a website audit, a web application test or a referral to a specialist.