Join our Newsletter — 33% off our NHI Course
Home› Guides› Secure Logging Vocabulary and Application Security Events Guide:…
Guide Web & API Security

Secure Logging Vocabulary and Application Security Events Guide: Name Events So the SOC Can Detect Attacks

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 15 min read
On this page

Most applications log security events, but each team names them differently, so the SOC cannot write one rule that finds credential stuffing or token replay across the estate. A shared vocabulary of application security events fixes that: when every service emits authn_login_fail, authz_fail or authn_token_reuse with the same fields, detection engineers can alert on the event name rather than reverse-engineering every log format. This guide explains the OWASP Application Logging Vocabulary, how to turn it into an organisational event schema, how to map it to a common SIEM schema, which detections it enables, and how to roll it out without drowning the SOC in noise. It is written for AppSec engineers, platform teams that own logging libraries, and detection engineers. For error handling and what never to log, see the Secure Error Handling and Logging Guide; this page goes deeper on naming, schema and detection.

Key takeaways

  • Name the event, not the symptom. A stable event name such as authn_login_fail lets one detection cover every application; free-text messages such as "bad password for user" do not.
  • Start from the OWASP vocabulary. The OWASP Application Logging Vocabulary Cheat Sheet defines prefixed event types (AUTHN, AUTHZ, SESSION, EXCESS, INPUT, MALICIOUS, PRIVILEGE, USER, SYS, MCP and others) with suggested levels and fields.
  • Agree the envelope as well as the names. A fixed JSON envelope with ISO 8601 timestamps carrying a UTC offset, application ID, request ID and outcome is what makes events correlatable (ASVS V16.2.1 to V16.2.4).
  • Machine identities need events too. Token creation, revocation and reuse (authn_token_created, authn_token_revoked, authn_token_reuse) are the application-side trail for API keys and service tokens.
  • Ship it as a library. Vocabulary adoption succeeds when the platform team publishes a small security logging library per language and a test that fails the build when a required event is missing.

Why application security events need a vocabulary

Infrastructure logs have shared identifiers: Windows has event IDs, cloud audit logs have API action names. Application logs usually have neither. The OWASP Logging Cheat Sheet asks for logging that is consistent within an application and across an organisation's portfolio, using industry standards where they exist, so events can be consumed, correlated and analysed by many systems. The Logging Vocabulary Cheat Sheet then proposes concrete keywords, so that "monitoring and alerting would be improved by simply keying on these terms".

Three things go wrong without one:

  • Detections do not transfer: a credential stuffing rule written for one service's message format misses the next service.
  • Severity is invented per team: one service logs authorisation failures at DEBUG, another at ERROR, and the SOC tunes both away.
  • Coverage cannot be measured: nobody can answer "which applications log token reuse?" because there is nothing consistent to count.

OWASP ASVS 5.0 makes this auditable. V16.1.1 asks for an inventory of what is logged at each layer, V16.3.1 for logging of all authentication operations, V16.3.2 for failed authorisation attempts, and V16.3.3 for the security events defined in the application's documentation plus attempts to bypass controls such as input validation, business logic and anti-automation. A vocabulary is the documentation those requirements refer to.

The OWASP Application Logging Vocabulary

Each event type has a lowercase prefix, a name and optional bracketed context, for example authn_login_fail_max[:userid,maxlimit]. The cheat sheet marks every field after the event type as optional and asks implementers to weigh detection value against their data protection duties: an IP address helps response but can be personal data. The table lists the event types that carry most detection value, with the level the cheat sheet suggests.

CategoryEventSuggested levelWhat it signals
AUTHNauthn_login_success, authn_login_failINFO, WARNEvery login attempt, the raw material for brute force and spraying detection
AUTHNauthn_login_successafterfailINFOSuccess after failures: a successful guess or a forgetful user
AUTHNauthn_login_fail_max, authn_login_lockWARNThresholds reached; lockout applied
AUTHNauthn_password_change_failCRITICALFailed password change, possible session takeover in progress
AUTHNauthn_impossible_travelCRITICALSame user from distant regions in an impossible time
AUTHNauthn_token_created, authn_token_revoked, authn_token_deleteINFO, INFO, WARNLifecycle of service tokens and API keys, with entitlements
AUTHNauthn_token_reuseCRITICALA revoked token presented again: a strong indicator of theft
AUTHZauthz_failCRITICALAccess to a resource the caller is not entitled to
AUTHZauthz_change, authz_adminWARNEntitlement changes and all privileged user activity
SESSIONsession_use_after_expireCRITICALExpired session presented, possible replay
EXCESSexcess_rate_limit_exceeded, excess_sessions_exceededWARNAutomation and abuse against limits
INPUTinput_validation_fail, input_validation_discrete_failWARNServer-side validation rejected input; a discrete list value was violated
MALICIOUSmalicious_direct_reference, malicious_sqli, malicious_attack_tool, malicious_extraneousCRITICALAttempts the application recognised and blocked
SEQUENCEsequence_failCRITICALA business flow reached out of order
PRIVILEGE, USERprivilege_permissions_changed, user_created, user_deletedWARNEscalation and account lifecycle changes
SYSsys_monitor_disabledWARNAn integrity, logging or antivirus agent was stopped, and by whom
MCPmcp_prompt_injection, mcp_tool_poisoning, mcp_resource_exhaustionWARNIndicators detected by an MCP client or server

Treat the suggested levels as a starting point. The Logging Cheat Sheet warns that input validation failures are suspicious, not proof of attack, because client defects also produce them, and that severity should be judged by repetition, correlation and context. For the MCP events, the vocabulary advises logging a detection category or rule ID and request identifiers rather than the full prompt or tool input and output, to avoid creating a second sensitive data store and a log injection path.

Designing the event envelope

Names alone are not enough; every event needs the same envelope. The OWASP vocabulary's example format carries datetime (ISO 8601 with UTC offset), appid, event, level, description, useragent, source_ip, host_ip, hostname, protocol, port, request_uri, request_method, region and geo. The Logging Cheat Sheet adds an interaction identifier linking all events for one request, a user type classification (authenticated user, monitoring system, authorised penetration tester) and analytical confidence.

  • Structured, not text: emit JSON. The Logging Cheat Sheet recommends structured formats specifically because unstructured text logs are open to CR/LF log entry injection (CWE-93), and ASVS V16.4.1 requires encoding to prevent log injection.
  • Separate fields for context: keep the vocabulary's bracketed context (userid, resource, tokenid) in named fields as well as in the event string, so the SIEM does not have to parse authn_login_fail:joebob1.
  • Explicit outcome: add an outcome field (success, failure, unknown) even where the name implies it, to support schema mapping.
  • Actor type: record whether the actor is a human user, a service account, an API client or an AI agent. This is what lets the SOC treat a burst of authz_fail from a workload identity differently from a user's.
  • Time: synchronised clocks and UTC or explicit offsets (ASVS V16.2.2).
  • Never in the envelope: passwords, access tokens, session IDs (hash them if you need correlation), connection strings, keys and payment data. The Logging Cheat Sheet's "Data to exclude" list is the baseline. See the JWT and Session Tokens in Code and Logs Guide.

Mapping the vocabulary to a SIEM schema

Most SIEMs normalise to a schema of their own. Keep the OWASP name in a dedicated field (for example event.action) and map the rest, so analysts can use both the portable vocabulary and the platform's built-in content. The Elastic Common Schema (ECS) is used here as an example because its allowed values are published openly: event.category includes authentication, iam, session, intrusion_detection and web, and event.outcome takes success, failure or unknown.

OWASP eventExample ECS mappingNotes
authn_login_failevent.category: authentication, event.type: start, event.outcome: failureKeep the vocabulary name in event.action
authn_token_createdevent.category: iam, event.type: creationRecord entitlements and the owning identity
authz_failevent.category: web or api, event.outcome: failureInclude the resource and the policy that denied
session_expiredevent.category: session, event.type: endReason field distinguishes idle and absolute timeout
malicious_sqlievent.category: intrusion_detection, event.type: deniedInclude the rule ID, not the payload
user_created, authz_changeevent.category: iam, event.type: user or changeActor and target user both required

The same approach works for other schemas: map once in the logging library or the ingest pipeline, test the mapping, and publish it so detection engineers know which fields to query.

Detections the vocabulary enables

With consistent names, a small set of rules covers every application. Typical starting rules:

  • Password spraying (T1110.003): authn_login_fail across many distinct user IDs from one source in a short window.
  • Credential stuffing (T1110.004): high authn_login_fail volume with a low but non-zero authn_login_success rate from rotating sources, followed by authn_login_successafterfail.
  • Stolen token use (T1550.001): any authn_token_reuse, or a token used from a new network shortly after authn_token_created.
  • Valid account abuse (T1078): authn_impossible_travel, or a login success followed by a run of authz_fail as the caller probes what it can reach.
  • Object-level enumeration: repeated malicious_direct_reference or authz_fail on sequential resources from one identity, the application view of API1:2023 BOLA probing.
  • Defence tampering (T1685): sys_monitor_disabled outside a change window.
  • Business logic abuse: sequence_fail clustered on one account or flow, which no network control can see.

Feed CRITICAL-level events from the vocabulary to the SOC queue directly; aggregate WARN-level events and alert on thresholds. For broader API abuse patterns, see the Rate Limiting and API Abuse Guide.

Where identity fits: events for service accounts, tokens and agents

Application logs are often the only place where API key and service token activity is visible at all, because the token is validated in the application, not by the identity provider. Apply the AUTHN token events to every non-human credential the application issues or accepts: who created the key, with which entitlements, when it was revoked, and every presentation of a revoked or expired one. Record authz_fail for service callers with the client ID, so a workload that suddenly probes outside its normal endpoints stands out. For applications that expose tools to AI agents, add the MCP events and record the agent's identity separately from the human it acts for. See the Detection Engineering for Non-Human Identities Guide.

Choosing where events are generated

Not every security event has to come from application code. The decision is about who has the context to know an event happened.

SourceGood forBlind toUse when
Application code (vocabulary library)Authorisation decisions, business sequence, token lifecycle, discrete validation failuresNothing it is not coded forAlways for AUTHZ, SEQUENCE and token events, which only the application understands
Identity providerInteractive logins, MFA, federationApplication-issued API keys, object-level accessLogin events where the application delegates authentication entirely
API gateway or WAFRate limits, schema validation, known attack signaturesWhether the caller owned the object; business flow orderEXCESS and MALICIOUS events at the edge, emitted with the same names
Runtime agent or framework middlewareConsistent coverage without code changesDomain meaning of resourcesLarge legacy estates as a first step before library adoption

Where the identity provider owns login, do not duplicate authn_login_* events in the application; correlate on the session or token instead. Where the gateway rejects a request, it should emit the vocabulary event so the SOC sees one naming scheme regardless of which layer acted. The rule of thumb: the layer that makes the decision logs the decision.

Rolling out a security event vocabulary

  1. Publish the organisational vocabulary: adopt the OWASP event names as-is, add only the house events you genuinely need (with the same naming pattern), and define the envelope, levels and required fields in one versioned document.
  2. Build the libraries: a thin wrapper per language (the cheat sheet lists community libraries for Python, .NET, Java, Go and Node.js that can be evaluated or used as a pattern) with one function per event, so developers cannot misspell names or forget fields.
  3. Pilot on authentication: instrument the login, token and session events in one or two high-value applications first; map them in the SIEM and build the spraying, stuffing and token reuse rules.
  4. Run detections in monitor mode: two to four weeks of tuning before paging anyone; record false positive causes (load tests, monitoring probes, pen tests) and tag those actors rather than dropping their events, as the Logging Cheat Sheet advises.
  5. Extend by risk: authorisation and privilege events next, then input and malicious events, then business sequence events for fraud-relevant flows.
  6. Make it testable: unit tests assert that a failed login emits authn_login_fail with required fields; an ingest test fails when an application stops sending an expected event type.

Rollback: event emission should never break the request path. Log asynchronously, fail open on the logger (but alert on logger failure through sys_ events or pipeline health), and keep a feature flag to reduce verbose event classes if volume spikes.

Small versus large organisations: a small team can adopt the vocabulary directly in its logging configuration and start with five detections. A large estate needs the libraries, a schema registry, ownership of the SIEM mapping, and a coverage dashboard per application.

Detection and measurement

  • Coverage: percentage of internet-facing applications emitting the core AUTHN and AUTHZ events with all required fields.
  • Schema conformance: share of security events that pass schema validation at ingest (target above 99%).
  • Token visibility: percentage of applications that issue or accept API keys and emit authn_token_created and authn_token_revoked.
  • Detection value: alerts per month from vocabulary-based rules, with true positive rate after tuning.
  • Silence detection: number of applications whose expected event volume dropped to zero, and time to notice.
  • Hygiene: secret or token findings in application logs from periodic scanning (target zero).

Framework mapping

FrameworkReferenceRelevance
OWASP ASVS 5.0V16.1.1, V16.2.1 to V16.2.5, V16.3.1 to V16.3.4, V16.4.1 to V16.4.3Log inventory, metadata, common format, required security events, injection and protection
NIST CSF 2.0PR.PS-04, DE.CM-09, DE.AE-02, DE.AE-03Logs generated for monitoring; application monitoring; analysis and correlation
NIST SP 800-53 Rev. 5AU-2, AU-3, AU-8, AU-9, AU-12, SI-4Event logging, record content, time stamps, protection, generation, monitoring
ISO/IEC 27001:2022 Annex AA.8.15, A.8.16Logging; monitoring activities
MITRE ATT&CKT1110.003, T1110.004, T1078, T1550.001, T1685Techniques the vocabulary-based detections target

Common failure patterns

  • Vocabulary in name only: teams adopt the names but put the context in free text, so the SIEM still parses strings. Require named fields.
  • Logging the secret to explain the failure: authn_token_reuse events that include the full token value. Log the token ID or a hash.
  • Everything CRITICAL: every input validation failure pages the SOC, which then mutes the feed. Aggregate WARN events.
  • Dropping "known" traffic: filtering out monitoring and pen test sources at the application hides real attacks from those addresses. Tag them instead.
  • Logs stay with the application: events written to local files that an attacker who compromises the host can edit. ASVS V16.4.3 requires shipping to a logically separate system.
  • No negative test: a refactor removes the login failure event and nobody notices for months, because nothing alerts on silence.

Practitioner checklist

  • Publish an organisational security event vocabulary based on the OWASP Application Logging Vocabulary, versioned and owned.
  • Define one JSON envelope with ISO 8601 UTC timestamps, application ID, request ID, actor type and outcome.
  • Ship a security logging library per language; forbid hand-written security event strings.
  • Instrument AUTHN, AUTHZ and SESSION events first, including token create, revoke and reuse for API keys and service tokens.
  • Map events to the SIEM schema in one place and keep the vocabulary name in its own field.
  • Deploy spraying, stuffing, token reuse, BOLA probing and monitor-disabled detections in monitor mode, then enforce.
  • Exclude passwords, tokens, session IDs, keys and payment data; scan logs for secrets.
  • Ship logs off-host to a protected store and alert on missing event streams.
  • Add unit tests that assert required events and fields on security-relevant code paths.

Standards and references

Related NHI Mgmt Group resources: Secure Error Handling and Logging Guide · Privacy in Security Logging and Monitoring Guide · Logging and Monitoring Policy Template · OMB M-21-31 Logging Maturity Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.