Skip to main content

OWASP ASVS 5.0 logging pack

The signed pack packs/owasp-asvs-app-logging selects the security events that OWASP ASVS 5.0 chapter V16 asks an application to log, redacts them with a pack privacy profile, and sends them to BowerSecurity_CL through the existing DCR and stream. It adds event types and policies. It doesn't change the envelope schema, the table, the DCR or policies/default.

Every ASVS and ISM ID on this page is from the verified lists (ASVS 5.0.0 at tag v5.0.0_release, ISM September 2026).

What the pack covers​

ASVS 5.0Requirement (summary)How the pack supports it
V16.1.1Inventory of what is logged, where, how long and who can read itThis page, the event catalogue and the signed pack manifest are the Bower part of the inventory. Destinations are fixed by policy routing
V16.2.1Each entry has when, where, who and whatPolicies quarantine events missing the investigation fields
V16.2.2Synchronised time; UTC or explicit offsetThe envelope requires RFC 3339 timeGenerated; the collector quarantines events more than five minutes in the future
V16.2.3Logs go only to documented destinationsPolicy routing.destination: security-events; outputs are operator-configured, never producer-chosen
V16.2.4Readable and correlatable by the log processorOne versioned envelope, fixed Sentinel columns, request.correlationId and request.traceId
V16.2.5Sensitive data logged per protection level; tokens only hashed or maskedRedaction: secrets removed by field name and value detectors, session ids and usernames HMAC'd, display names removed
V16.3.1All authentication operations, success and failure, with factorsauthentication_success, authentication_failure (default policy), the mfa_* types and labels.authMethod / labels.mfaFactor
V16.3.2Failed authorisation; at L3 all decisions and sensitive data accessauthorisation_failure, sensitive_data_accessed, sensitive_record_changed
V16.3.3Documented security events and bypass attemptsinput_validation_failure, business_logic_violation, anti_automation_triggered, admin and configuration events
V16.3.4Unexpected errors and security control failuresapplication_error, security_control_failure
V16.4.1Encoding to prevent log injectionCR and LF replaced in every value and property name; JSON encoding end to end
V16.4.2Logs protected from access and modificationOwner-only queue files, hash-chained queue ledger, ledger-verified archive (see ISM alignment)
V16.4.3Logs sent to a logically separate systemThe collector runs outside the application and delivers to Sentinel
V16.5.1 to V16.5.4Generic error messages, secure failure, last-resort handlerApplication-owned. The pack logs the outcome (application_error) and removes stackTrace and exceptionMessage

Related requirements in other chapters:

ASVS 5.0Event types
V6.1.1, V6.3.1authentication_failure, anti_automation_triggered; the spraying rule
V6.3.5authentication_success and mfa_failure with source.ipAddress and labels.userAgent, so suspicious attempts can be detected and the user notified
V6.3.7, V6.4.3, V6.4.6password_reset_requested, password_reset_completed, password_changed (labels.initiatedBy)
V6.5.6, V7.5.1mfa_factor_enrolled, mfa_factor_removed, authentication_success with action authentication.reauthenticate
V6.6.3, V6.6.4mfa_failure, mfa_challenge (push), anti_automation_triggered
V7.2.4session_rotated
V7.4.1, V7.4.2, V7.4.3, V7.4.5session_terminated (session.logout, session.timeout, session.revoke_others, session.admin_terminate, session.revoke_all), account_status_changed
V8.2.1, V8.2.2, V8.2.3authorisation_failure with action authz.function, authz.object or authz.field
V8.3.2authorisation_failure with action authz.stale_grant (local detection)
V2.4.1anti_automation_triggered; the mass export rule
V4.1.3, V15.3.4source.ipAddress must come from a trusted proxy header; see each framework guide
V13.4.5The collector's monitoring endpoints need the ingest token; keep /health and /v1/status off the internet
V14.1.2, V14.2.4The privacy profile is the documented logging rule for each data class

The application still owns most of V16.5 and the controls themselves (rate limits, MFA, session revocation). The pack makes their outcomes visible.

Field map​

Every field the brief asks for already has a home in envelope 1.0.0. Two are carried as labels instead of new schema fields:

NeedEnvelope fieldSentinel columnNotes
UTC timetimeGeneratedTimeGeneratedRFC 3339 with Z or an offset
Event typeeventCategory, eventType, eventActionEventCategory, EventType, EventActionLower snake case type, dotted action
Useractor.userId, actor.username, actor.role, actor.typeActorUserId, ActorUsernameUsername is an HMAC pseudonym after redaction
Tenantapplication.tenantIdRawEnvelope.application.tenantId
Source IPsource.ipAddressSourceIpAddressOriginal client address from a trusted proxy only (V15.3.4, V4.1.3)
User agentlabels.userAgentLabels.userAgentTruncated to 256 characters
Request or trace IDrequest.correlationId, request.traceIdCorrelationId, RawEnvelope.request.traceIdW3C trace id where the app uses OpenTelemetry
Routelabels.route (template), request.method, request.pathLabels.route, RawEnvelope.requestQuery strings and fragments are removed from request.path
OutcomeeventResult, eventOutcomeReason, request.statusCodeEventResult, EventOutcomeReasonReason is a short code, never free text from the user
SeverityeventSeverityEventSeverity

Why labels for user agent and route. The envelope is additionalProperties: false, and a new request.userAgent member would be an additive schema change. But a new Sentinel column would also need SentinelSchema.Default, the Bicep table, the DCR and every deployed workspace to change together. Labels already exist (64 string values of 256 characters at most) and already land in the Labels dynamic column, so the pack needs no schema, table or DCR change. If a future envelope version adds request.userAgent and request.route, these labels map one to one. The route label holds the template (/api/invoices/{id}), not the concrete path, so it groups well and carries no identifiers.

Event catalogue​

policies/default keeps authentication_failure, account_lockout, role_membership_changed and sensitive_data_exported. The pack never redefines those types, and AsvsLoggingPackTests fails if it does. Each pack policy accepts, never samples, and quarantines events missing required fields. Unknown types stay denied.

Event typeCategoryActionsResultSeverityRequired (plus time, type, result, app)RecommendedASVS 5.0Policy
authentication_successauthenticationauthentication.login, authentication.reauthenticate, authentication.token_issuedsuccessinformationalcorrelation id; user id or usernamesource IP, labels.authMethod, user agent, trace id, tenantV16.3.1, V7.5.1BWR-PACK-ASVS-AUTH-SUCCESS
mfa_challenge, mfa_success, mfa_failureauthenticationmfa.challenge, mfa.verifysuccess or failureinformational, low on failurecorrelation id, labels.mfaFactor; usersource IP, reason, user agentV16.3.1, V6.6.3, V6.6.4BWR-PACK-ASVS-MFA
mfa_factor_enrolled, mfa_factor_removed, password_reset_requested, password_reset_completed, password_changedidentity-managementmfa.enrol, mfa.remove, mfa.revoke, password.reset_request, password.reset_complete, password.changeanyinformational, medium on removalcorrelation id, target.id; usersource IP, factor, labels.initiatedByV6.3.7, V6.4.3, V6.4.6, V6.5.6BWR-PACK-ASVS-FACTOR-LIFECYCLE
account_status_changedidentity-managementaccount.create, account.disable, account.enable, account.delete, account.unlockanymediumcorrelation id, actor.userId, target.idreason, role, source IPV7.4.2BWR-PACK-ASVS-ACCOUNT-STATUS
session_terminated, session_rotatedauthenticationsession.logout, session.timeout, session.admin_terminate, session.revoke_others, session.revoke_all, session.rotateanyinformationalcorrelation id; user or targetrequest.sessionId (HMAC), attributes.sessionsTerminatedV7.2.4, V7.4.1, V7.4.3, V7.4.5BWR-PACK-ASVS-SESSION
authorisation_failureauthorisationauthz.function, authz.object, authz.field, authz.stale_grantdenied or failuremedium, high for stale grantsaction, correlation id, target.type; user or source IProute, method, role, target id, labels.requiredPermissionV16.3.2, V8.2.1, V8.2.2, V8.2.3, V8.3.2BWR-PACK-ASVS-AUTHZ-FAILURE
sensitive_data_accessed, sensitive_record_changeddata-accessdata.read, data.create, data.update, data.deleteanyinformational, medium on deleteaction, correlation id, actor.userId, target.type, target.id, labels.dataClassificationattributes.recordCount, routeV16.3.2, V14.2.4BWR-PACK-ASVS-SENSITIVE-DATA
admin_action, configuration_changed, permission_changedadministrative-activityany (admin.grant, admin.impersonate, config.update, ...)anymedium or highaction, correlation id, actor.userId, target.typerole, target id, change.fieldV16.3.3, V7.4.5BWR-PACK-ASVS-ADMIN
input_validation_failure, business_logic_violation, anti_automation_triggeredapplication-security, api-securityany (validation.reject, ratelimit.exceeded, captcha.failed, ...)denied or failurelowaction, correlation id; source IP or userroute, method, reason, user agentV16.3.3, V2.4.1, V6.3.1BWR-PACK-ASVS-CONTROL-BYPASS (suppressed above 20 a minute per app, type and address)
application_error, security_control_failureapplication-securityany (error.unhandled, tls.handshake, csrf.validate, ...)failuremediumaction, correlation id, eventOutcomeReasonroute, status code, labels.errorType, trace idV16.3.4, V16.5.3, V16.5.4BWR-PACK-ASVS-ERRORS
database_auditdata-access, administrative-activity, authenticationdb.logon, db.logoff, db.logon_failure, db.ddl, db.dcl, db.privileged, db.sensitive_read, db.sensitive_write, db.query_error, db.audit_configanyby actionaction, target.type, labels.dbEngine; usertarget.name, source IP, labels.dbStatementClassV16.3.2, V16.3.3BWR-PACK-ASVS-DB-AUDIT

Existing default types the pack relies on: authentication_failure and account_lockout (V16.3.1, V6.3.1), role_membership_changed (V16.3.3) and sensitive_data_exported (V16.3.2).

Rate-limit floods are the one family the pack suppresses. Above 20 events a minute per application, type and source address, Bower stores one telemetry_aggregation_summary per window with the counts, so the volume stays visible without a row per request. Every other family is never sampled.

Redaction​

The pack privacy profile owasp-asvs-app-logging runs on top of the default Australian detectors, before anything is written to the queue:

DataActionWhy
Passwords, tokens, API keys, cookies, Authorization, headers, body, payloadRemoved by field name (built in)Never logged (V16.2.5)
otp, otpCode, totp, mfaCode, verificationCode, recoveryCode, backupCode, securityAnswer, magicLink, nonce, samlResponse, idToken, setCookie, rawBody, rawQuery, queryString, stackTrace, exceptionMessage, statement, queryText, sqlTextRemoved by field name (pack)Authentication material, raw input, internals and SQL literals
JWTs, cloud keys, connection strings, card numbers, TFNs, Medicare numbers and so on in any valueDefault value detectorsCatches secrets in free text
actor.username, request.sessionIdKeyed HMACJoinable for analytics, unreadable without the host key (V16.2.5 hashing)
actor.displayNameRemovedNot needed for investigation
labels.userAgentTruncated to 256 charactersBounded
CR or LF anywhere, including property namesReplaced (custom.log-line-break)Log injection (V16.4.1)
Query strings and fragments in request.path and other URL fieldsRemoved (built in)OAuth codes and tokens live there
change.previousValue, change.newValueRemoved for every type except role_membership_changed (built in)A config or password change records only the field name

The pack samples prove each row: a sample with a password, bearer token, cookie and CRLF payload comes out with none of them, and bower pack build refuses to sign if any survives. Set BOWER_PRIVACY_HMAC_KEY_FILE and BOWER_PRIVACY_HMAC_KEY_ID on the collector. Only one privacy profile is active at a time: if you already use one, copy these rules into it.

Applications should still not send secrets. Redaction is the last line, not the plan.

Install​

bower keys generate --out-dir ./keys
bower pack build packs/owasp-asvs-app-logging --key ./keys/bower-signing.key.pem --out ./artifacts/packs
bower pack test ./artifacts/packs/owasp-asvs-app-logging-1.0.0.bowerpack --trusted-key ./keys/bower-signing.pub.pem
BOWER_PACKS=/etc/bower/packs/owasp-asvs-app-logging-1.0.0.bowerpack
BOWER_PACK_TRUSTED_KEYS=/etc/bower/keys/bower-signing.pub.pem
BOWER_PRIVACY_HMAC_KEY_FILE=/run/secrets/bower-hmac
BOWER_PRIVACY_HMAC_KEY_ID=k2026

Keep policies/default as the policy directory: the pack adds to it. Applications send events to POST /v1/events with their ingest token; see the framework guides.

Sentinel ingestion​

Pack events use the same stream (Custom-BowerSecurity), DCR transform and table (BowerSecurity_CL) as every other Bower event. The fixed columns carry the common fields; Labels, Attributes, Target, Change and RawEnvelope carry the rest as dynamic values. No table, DCR or stream change is needed.

Use BowerSecurityEvents (deployed by deploy/sentinel/analytics/main.bicep) for counts, because Bower delivers at least once. Example queries per family:

// Authentication and MFA: methods, factors and failure reasons per app
BowerSecurityEvents
| where EventType in ("authentication_success", "authentication_failure", "mfa_success", "mfa_failure")
| summarize count() by ApplicationName, EventType, AuthMethod = tostring(Labels.authMethod),
Factor = tostring(Labels.mfaFactor), EventOutcomeReason
// Factor, password and account lifecycle for one (pseudonymised) user
BowerSecurityEvents
| where EventCategory == "identity-management"
| where EventType startswith "mfa_factor" or EventType startswith "password_" or EventType == "account_status_changed"
| project BowerEventTime, ApplicationName, EventType, EventAction, ActorUserId, TargetId = tostring(Target.id),
InitiatedBy = tostring(Labels.initiatedBy), SourceIpAddress
// Sessions revoked by administrators
BowerSecurityEvents
| where EventType == "session_terminated" and EventAction in ("session.admin_terminate", "session.revoke_all")
| project BowerEventTime, ApplicationName, ActorUserId, TargetId = tostring(Target.id),
Sessions = toint(Attributes.sessionsTerminated)
// Authorisation failures by route and kind (IDOR, function, field, stale grant)
BowerSecurityEvents
| where EventType == "authorisation_failure"
| summarize Failures = count(), Users = count_distinct(ActorUserId)
by ApplicationName, EventAction, Route = tostring(Labels.route), TargetType = tostring(Target.type)
| sort by Failures desc
// Sensitive reads, changes and exports per classification
BowerSecurityEvents
| where EventType in ("sensitive_data_accessed", "sensitive_record_changed", "sensitive_data_exported")
| summarize Events = count(), Records = sum(tolong(Attributes.recordCount))
by ApplicationName, EventType, Classification = tostring(Labels.dataClassification)
// Privileged and configuration changes
BowerSecurityEvents
| where EventCategory == "administrative-activity" or EventType == "role_membership_changed"
| project BowerEventTime, ApplicationName, EventType, EventAction, ActorUserId, ActorRole = tostring(RawEnvelope.actor.role),
Setting = tostring(Change.field), TargetId = tostring(Target.id)
// Validation, business logic and rate-limit hits, including suppressed counts.
// Summaries carry the suppressed type in Labels and the key (with the address) in Attributes.
BowerSecurityEvents
| where EventType in ("input_validation_failure", "business_logic_violation", "anti_automation_triggered")
or (EventType == "telemetry_aggregation_summary" and tostring(Labels.suppressedEventType) == "anti_automation_triggered")
| extend Address = coalesce(SourceIpAddress, tostring(Attributes.suppressionKey["source.ipAddress"]))
| summarize Stored = countif(EventType != "telemetry_aggregation_summary"), Suppressed = sum(tolong(Attributes.suppressedCount))
by ApplicationName, Address
// Errors and security control failures
BowerSecurityEvents
| where EventType in ("application_error", "security_control_failure")
| summarize count() by ApplicationName, EventType, EventOutcomeReason, ErrorType = tostring(Labels.errorType)
// Database audit by engine and action
BowerSecurityEvents
| where EventType == "database_audit"
| summarize count() by Engine = tostring(Labels.dbEngine), EventAction, EventResult, Database = tostring(Target.name)

Summary fields are described in the suppression guide.

Sentinel analytics​

deploy/sentinel/analytics/asvs.bicep deploys five scheduled rules from rules/asvs, disabled by default. Deploy main.bicep first, because the rules read its functions.

RuleFires whenParameters
password-spray.kqlOne address fails sign-in against at least 10 distinct accounts in 10 minutes (stuffing or spraying); reports any successes from that addresssprayAccountThreshold
privilege-change.kqlAny successful role, permission or admin.grant changenone
admin-after-hours.kqlPrivileged or configuration change outside 07:00 to 19:00 on a weekday, or on a weekend, local timetimeZone (default Australia/Sydney), businessStartHour, businessEndHour
mass-export.kqlOne user exports or reads at least 10,000 sensitive records, or runs 5 exports, in an hourexportRecordThreshold, exportCountThreshold
log-silence.kqlAn application with at least 20 events in the last 7 days has sent none for 60 minutessilenceMinutes
az deployment group what-if -g <rg> --template-file deploy/sentinel/analytics/asvs.bicep \
--parameters workspaceName=<workspace> timeZone=Australia/Perth

Every rule uses a detection key, so a replayed or late row never raises a second alert. The event rules re-check late rows for an hour, like the existing replay-safe rules. AsvsAnalyticsContentTests checks the columns, anchors, defaults and replay safety statically. The rules haven't been run against a live workspace yet: validate them in your workspace before you set enableRules=true.

log-silence.kql needs no setup. The collector's own source expectations are more exact (per source, with a set allowance) and should be used where you can configure them.

The pack also ships three local Sigma detections that tag events before they leave the host: an MFA factor removed, an action under a withdrawn grant, and a backend TLS failure.

Database audit​

Database audit notes cover pgaudit, MySQL, SQL Server, MongoDB and Azure Cosmos DB, and when to use a native connector instead of database_audit events.

ISM mapping​

For Australian government readers. This adds to, and doesn't repeat, the ISM alignment for the collector and delivery path. ISM September 2026.

ControlRequirement (summary)Pack supportOrganisation responsibility
ISM-2051Software generates enough event logs to detect cyber security eventsEvent catalogue and per-framework guides; policies quarantine events missing investigation fieldsInstrument every application; review coverage when features change
ISM-2052Event logs produced by software protect sensitive dataPack privacy profile: secrets removed, usernames and session ids HMAC'd, CRLF neutralised, query strings droppedDon't send secrets; protect the HMAC key; classify data correctly
ISM-1911Security-relevant usage, errors and crashes of software centrally loggedapplication_error, security_control_failure and every usage family aboveWire the last-resort error handler to emit the event
ISM-1978, ISM-1979Security-relevant events for server applications centrally loggedSame events, delivered to SentinelDeploy a collector for internet-facing and internal servers
ISM-1895Successful and unsuccessful single-factor authentication centrally loggedauthentication_success, authentication_failureEmit both outcomes
ISM-1683Successful and unsuccessful MFA events centrally loggedmfa_challenge, mfa_success, mfa_failure, factor lifecycleEmit from the MFA provider or the app
ISM-1509Privileged access events centrally loggedadmin_action, after-hours ruleMark privileged roles in actor.role
ISM-1650Privileged account and security group management centrally loggedrole_membership_changed, permission_changed, account_status_changed, privilege change ruleEmit from every place roles change
ISM-1566Use of unprivileged access centrally loggedauthentication_success, sessions, sensitive data accessDecide which unprivileged actions matter
ISM-1910, ISM-2015Network API calls that change or read non-public data centrally loggedsensitive_data_accessed, sensitive_record_changed, sensitive_data_exported with route and methodEmit for every such API, internet-facing or not
ISM-1537Security-relevant database events centrally loggeddatabase_audit policy; database audit notesEnable native auditing and choose the connector
ISM-1536All queries from software to databases, and resulting errors, centrally loggeddb.query_error events; the pack removes statement textNative database or driver audit logs carry the statements, with their own access controls
ISM-0585Date, time, user or process, description, equipment capturedRequired fields per policy; application.instance and source for equipmentSupply the fields
ISM-0988Accurate, consistent time sourceUTC timeGenerated; future-dated events quarantinedNTP on application hosts
ISM-1959Consistent, structured formatOne envelope for every familyNone
ISM-1405, ISM-1906, ISM-1907, ISM-1228Central logging; timely analysis; incident identificationDelivery to Sentinel; five starter rules; log silence ruleTune, enable and triage the rules
ISM-1985, ISM-1815Logs protected from access, modification and deletionCollector queue and archive controls (see ISM alignment)Sentinel RBAC and immutability

Limits and gaps​

  • No ASVS ID from the pre-check failed verification. The application, not Bower, meets the controls the events report on (rate limits, MFA, session revocation, V16.5 error handling).
  • The analytics rules are statically tested only. No live Sentinel run is claimed.
  • The SDK (Bower.Sdk) has typed helpers only for the three default events. Other families are sent as envelopes over HTTP (see the framework guides); typed helpers are a follow-up.
  • User agent and route are labels, not first-class columns. Query them as Labels.userAgent and Labels.route.