High-value security log examples
I'm trying to decide which application events to send to Bower and see what a good payload looks like.
Security teams do not need every HTTP request or debug line in Microsoft Sentinel. They need a small, reliable set of authoritative security decisions with consistent fields so detections work on day one.
If you have not sent an event to a local collector yet, start with the 5-minute walkthrough in Send high-value security logs from your app.
High-value signal vs application noise
Use this rule of thumb when instrumenting your codebase:
| Instead of sending this (noise or risky) | Send this high-value Bower event | Why the SOC cares |
|---|---|---|
INFO POST /api/login 401 body={"user":"alice","pass":"..."} | authentication_failure | Detects password spraying and credential stuffing without leaking credentials. |
DEBUG UserService.UpdateRole() called (logged in controller, service and repo) | One role_membership_changed after DB commit | Detects privilege escalation cleanly, once, with actor, target and role change. |
INFO GET /api/reports/export 200 (14,200 rows) | sensitive_data_exported | Alerts on mass data exfiltration with classification, export ID and record count. |
WARN 403 Forbidden on /api/invoices/inv-88412 | authorisation_failure (authz.object) | Spots IDOR/BOLA probing by grouping on route template (/api/invoices/{id}) and actor. |
ERROR NullReferenceException at Charge() ... sk_live_... | application_error with error type and correlationId | Tracks unhandled failures and tampering probes without shipping stack traces or secrets. |
INFO GET /healthz 200 or routine GET /static/app.js 200 | Nothing — keep in your app/APM logs | Health checks and static traffic drown real alerts and inflate SIEM ingestion cost. |
Which policy accepts each example?
- Out of the box (
policies/default): Examples 1–4 (authentication_failure,account_lockout,role_membership_changed,sensitive_data_exported) work with every collector's default policy set. - With the signed ASVS pack (
owasp-asvs-app-logging): Examples 5–10 add sign-in success, MFA, authorisation failures, sensitive data access, admin/config changes, anti-automation and application errors. See OWASP ASVS 5.0 logging pack.
Every JSON payload below conforms to
schemas/envelope/security-event.schema.json
and can be posted directly to POST /v1/events with Authorization: Bearer $BOWER_INGEST_TOKEN.
Default policy examples (work out of the box)
1. Failed sign-in
I'm trying to log a failed login attempt so the SOC can catch password spraying.
- When to emit: Once, immediately after your identity provider or credential verifier rejects the attempt.
- Policy:
BWR-POL-AUTH-FAILURE(policies/default). - What Bower redacts: With the ASVS privacy profile,
actor.usernameis replaced with a keyed HMAC pseudonym before persistence, and any query string onrequest.pathis stripped. Never include the submitted password.
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000101",
"timeGenerated": "2026-11-09T01:02:03.456Z",
"eventCategory": "authentication",
"eventType": "authentication_failure",
"eventAction": "authentication.attempt",
"eventResult": "failure",
"eventSeverity": "low",
"eventOutcomeReason": "InvalidCredentials",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"actor": {
"username": "alice@example.com",
"type": "human"
},
"source": {
"ipAddress": "198.51.100.7"
},
"request": {
"correlationId": "req-00101",
"method": "POST",
"path": "/api/login",
"statusCode": 401
},
"labels": {
"route": "/api/login",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64)"
}
}
In C# with Bower.Sdk (IBowerTelemetry):
await bower.AuthenticationFailedAsync(new AuthenticationFailedEvent
{
Username = request.Username,
SourceIpAddress = clientIp,
FailureReason = "InvalidCredentials",
CorrelationId = httpContext.TraceIdentifier
}, cancellationToken);
2. Account lockout
I'm trying to log when an account is locked after too many failed attempts.
- When to emit: Once, at the moment your lockout control locks the account.
- Policy:
BWR-POL-AUTH-FAILURE(policies/default).
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000102",
"timeGenerated": "2026-11-09T01:04:12.100Z",
"eventCategory": "authentication",
"eventType": "account_lockout",
"eventAction": "authentication.lockout",
"eventResult": "denied",
"eventSeverity": "medium",
"eventOutcomeReason": "MaxFailedAttemptsExceeded",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"actor": {
"userId": "user-1001",
"username": "alice@example.com",
"type": "human"
},
"source": {
"ipAddress": "198.51.100.7"
},
"request": {
"correlationId": "req-00102",
"method": "POST",
"path": "/api/login",
"statusCode": 423
},
"labels": {
"route": "/api/login"
}
}
3. Privilege or role change
I'm trying to log when a user is granted or removed from a privileged role.
- When to emit: After the role assignment commits in the database.
- Policy:
BWR-POL-ROLE-MEMBERSHIP(policies/default). RequireseventActionto berole.addorrole.remove,eventResultto besuccess, plusactor.userId,target.id,change.field,request.correlationIdand at least one ofchange.previousValue/change.newValue. - Why
change.newValuesurvives here:role_membership_changedis the one event type where Bower keepschange.previousValueandchange.newValue(because role names are essential for privilege-escalation detection).
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000103",
"timeGenerated": "2026-11-09T01:10:00.000Z",
"eventCategory": "identity-management",
"eventType": "role_membership_changed",
"eventAction": "role.add",
"eventResult": "success",
"eventSeverity": "high",
"eventOutcomeReason": "Ticket-INC-4821",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"actor": {
"userId": "admin-7",
"role": "tenant-admin",
"type": "human"
},
"target": {
"type": "user",
"id": "user-1001"
},
"source": {
"ipAddress": "203.0.113.10"
},
"request": {
"correlationId": "req-00103",
"method": "POST",
"path": "/api/admin/users/user-1001/roles",
"statusCode": 200
},
"change": {
"field": "role",
"newValue": "billing-approver"
},
"labels": {
"route": "/api/admin/users/{id}/roles"
}
}
In C# with Bower.Sdk (IBowerTelemetry):
await bower.RoleMembershipChangedAsync(new RoleMembershipChangedEvent
{
ActorUserId = adminUserId,
TargetUserId = targetUserId,
Role = "billing-approver",
Change = MembershipChange.Added,
Reason = "Ticket-INC-4821",
CorrelationId = httpContext.TraceIdentifier
}, cancellationToken);
4. Bulk or sensitive data export
I'm trying to log when a user exports customer, financial or regulated records.
- When to emit: When the export job completes (or begins streaming) with the final record count and classification. Never include the exported rows or file contents.
- Policy:
BWR-POL-SENSITIVE-EXPORT(policies/default). RequireseventAction=data.export,eventResult=success,actor.userId,target.id,labels.dataClassification,attributes.recordCountandrequest.correlationId.
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000104",
"eventOriginalId": "exp-20261109-0042",
"timeGenerated": "2026-11-09T01:15:30.250Z",
"eventCategory": "data-access",
"eventType": "sensitive_data_exported",
"eventAction": "data.export",
"eventResult": "success",
"eventSeverity": "medium",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"actor": {
"userId": "analyst-12",
"role": "reporting-analyst",
"type": "human"
},
"target": {
"type": "export",
"id": "exp-20261109-0042"
},
"source": {
"ipAddress": "203.0.113.44"
},
"request": {
"correlationId": "req-00104",
"method": "POST",
"path": "/api/reports/export",
"statusCode": 200
},
"labels": {
"dataClassification": "OFFICIAL:Sensitive",
"route": "/api/reports/export"
},
"attributes": {
"recordCount": 1420,
"exportFormat": "csv"
}
}
In C# with Bower.Sdk (IBowerTelemetry):
await bower.SensitiveDataExportedAsync(new SensitiveDataExportedEvent
{
ActorUserId = userId,
RecordCount = rows.Count,
ExportFormat = "csv",
DataClassification = "OFFICIAL:Sensitive",
ExportId = exportId,
CorrelationId = httpContext.TraceIdentifier
}, cancellationToken);
OWASP ASVS 5.0 pack examples
The examples below require the signed owasp-asvs-app-logging
pack on the collector (loaded automatically by examples/asvs-logging/run-local-collector.sh).
5. Successful sign-in and MFA failure
I'm trying to log successful logins (with auth method) and failed MFA challenges.
- When to emit: After sign-in succeeds (include
labels.authMethodsuch aspassword+totporpasskey) and whenever an MFA verification fails (includelabels.mfaFactor, never the OTP code). - Policies:
BWR-PACK-ASVS-AUTH-SUCCESSandBWR-PACK-ASVS-MFA.
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000105",
"timeGenerated": "2026-11-09T01:20:00.120Z",
"eventCategory": "authentication",
"eventType": "mfa_failure",
"eventAction": "mfa.verify",
"eventResult": "failure",
"eventSeverity": "low",
"eventOutcomeReason": "InvalidCode",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"actor": {
"userId": "user-1001",
"type": "human"
},
"source": {
"ipAddress": "203.0.113.24"
},
"request": {
"correlationId": "req-00105",
"method": "POST",
"path": "/api/mfa/verify",
"statusCode": 401
},
"labels": {
"mfaFactor": "totp",
"route": "/api/mfa/verify"
}
}
In Node.js with examples/asvs-logging/node/bower-events.mjs:
bower.send(buildEvent(appMeta, {
eventCategory: 'authentication',
eventType: 'mfa_failure',
eventAction: 'mfa.verify',
eventResult: 'failure',
eventSeverity: 'low',
reason: 'InvalidCode',
actor: { userId: user.id },
sourceIp: req.clientIp,
route: '/api/mfa/verify',
request: { correlationId: req.id, method: 'POST', path: '/api/mfa/verify', statusCode: 401 },
labels: { mfaFactor: 'totp' },
}));
6. Access denied or IDOR attempt
I'm trying to log authorisation denials so the SOC can spot users probing other tenants' or users' records.
- When to emit: Whenever a policy guard, middleware or ownership check denies access.
Pick
eventActionto match the control:authz.function(admin route),authz.object(IDOR/BOLA on a record),authz.field(restricted property) orauthz.stale_grant(token/session using a revoked permission). - Policy:
BWR-PACK-ASVS-AUTHZ-FAILURE. - Tip: Put the route template (
/api/invoices/{id}) inlabels.routeso Sentinel can group attempts across thousands of object IDs cleanly.
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000106",
"timeGenerated": "2026-11-09T01:22:45.000Z",
"eventCategory": "authorisation",
"eventType": "authorisation_failure",
"eventAction": "authz.object",
"eventResult": "denied",
"eventSeverity": "medium",
"eventOutcomeReason": "NotResourceOwner",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"actor": {
"userId": "user-1001",
"role": "customer",
"type": "human"
},
"target": {
"type": "invoice",
"id": "inv-88412"
},
"source": {
"ipAddress": "203.0.113.24"
},
"request": {
"correlationId": "req-00106",
"method": "GET",
"path": "/api/invoices/inv-88412",
"statusCode": 403
},
"labels": {
"requiredPermission": "invoice.read",
"route": "/api/invoices/{id}"
}
}
In C# with Bower.Sdk (IAsvsTelemetry):
await asvs.AuthorisationFailedAsync(new AuthorisationFailedEvent
{
ActorUserId = userId,
ActorRole = "customer",
Kind = AuthorisationFailureKind.ObjectLevel,
TargetType = "invoice",
TargetId = invoiceId,
Route = "/api/invoices/{id}",
HttpMethod = "GET",
RequiredPermission = "invoice.read",
Reason = "NotResourceOwner",
SourceIpAddress = clientIp,
CorrelationId = httpContext.TraceIdentifier
}, cancellationToken);
7. Sensitive record read or change
I'm trying to audit reads or edits of high-sensitivity records (such as health, tax or HR records).
- When to emit: When an authorised user views (
sensitive_data_accessed,data.read) or creates/updates/deletes (sensitive_record_changed,data.create/data.update/data.delete) a classified record. Record the target ID and classification — never the record's field values. - Policy:
BWR-PACK-ASVS-SENSITIVE-DATA.
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000107",
"timeGenerated": "2026-11-09T01:25:10.500Z",
"eventCategory": "data-access",
"eventType": "sensitive_data_accessed",
"eventAction": "data.read",
"eventResult": "success",
"eventSeverity": "informational",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"actor": {
"userId": "caseworker-44",
"role": "claims-officer",
"type": "human"
},
"target": {
"type": "claim-record",
"id": "clm-2026-99104"
},
"source": {
"ipAddress": "203.0.113.55"
},
"request": {
"correlationId": "req-00107",
"method": "GET",
"path": "/api/claims/clm-2026-99104",
"statusCode": 200
},
"labels": {
"dataClassification": "PROTECTED",
"route": "/api/claims/{id}"
},
"attributes": {
"recordCount": 1
}
}
8. Security or admin configuration change
I'm trying to log when an administrator changes a security setting (such as disabling MFA or changing SSO config).
- When to emit: After the administrative change commits.
- Policy:
BWR-PACK-ASVS-ADMIN. - What Bower redacts: For every event type other than
role_membership_changed, Bower automatically stripschange.previousValueandchange.newValueso secrets inside config changes (API keys, webhook secrets, signing certificates) can never leak. Record the setting name inchange.fieldandtarget.id.
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000108",
"timeGenerated": "2026-11-09T01:30:00.000Z",
"eventCategory": "administrative-activity",
"eventType": "configuration_changed",
"eventAction": "config.update",
"eventResult": "success",
"eventSeverity": "medium",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"actor": {
"userId": "admin-7",
"role": "tenant-admin",
"type": "human"
},
"target": {
"type": "setting",
"id": "auth.mfa.required"
},
"source": {
"ipAddress": "203.0.113.10"
},
"request": {
"correlationId": "req-00108",
"method": "PATCH",
"path": "/api/admin/settings/auth.mfa.required",
"statusCode": 200
},
"change": {
"field": "auth.mfa.required"
},
"labels": {
"route": "/api/admin/settings/{key}"
}
}
9. Rate-limit or anti-automation trigger
I'm trying to log when an attacker hits a login rate limit, CAPTCHA or anti-scraping control — without flooding Sentinel.
- When to emit: When your rate limiter or abuse control rejects a request.
- Policy:
BWR-PACK-ASVS-CONTROL-BYPASS(plusBWR-PACK-ASVS-SUPPRESSION-SUMMARY). - Built-in flood protection: Above 20 events per minute per application, event type and
source IP, the collector automatically suppresses individual rows and emits one
telemetry_aggregation_summarywith exact counts, so an attack stays visible without a runaway SIEM bill.
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000109",
"timeGenerated": "2026-11-09T01:35:04.000Z",
"eventCategory": "api-security",
"eventType": "anti_automation_triggered",
"eventAction": "ratelimit.exceeded",
"eventResult": "denied",
"eventSeverity": "low",
"eventOutcomeReason": "LoginRateLimit",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"source": {
"ipAddress": "198.51.100.7"
},
"request": {
"correlationId": "req-00109",
"method": "POST",
"path": "/api/login",
"statusCode": 429
},
"labels": {
"route": "/api/login"
}
}
In Python with examples/asvs-logging/python/bower_events.py:
event = bower_events.build_event(APP, {
"eventCategory": "api-security",
"eventType": "anti_automation_triggered",
"eventAction": "ratelimit.exceeded",
"eventResult": "denied",
"eventSeverity": "low",
"reason": "LoginRateLimit",
"sourceIp": client_ip,
"route": "/api/login",
"request": {"correlationId": request_id, "method": "POST", "path": "/api/login", "statusCode": 429},
})
bower.send_async(event)
10. Unhandled application error
I'm trying to alert the SOC to unhandled server errors or security control failures without shipping stack traces.
- When to emit: Inside your global last-resort exception handler (while returning a generic
error body to the caller per OWASP ASVS 5.0 V16.5.1). Put the exception class name in
labels.errorTypeand a short code ineventOutcomeReason. Keep the stack trace in your internal application logs, joined byrequest.correlationId. - Policy:
BWR-PACK-ASVS-ERRORS.
{
"schemaVersion": "1.0.0",
"eventId": "0195c8a2-7b4d-7000-8000-000000000110",
"timeGenerated": "2026-11-09T01:40:19.880Z",
"eventCategory": "application-security",
"eventType": "application_error",
"eventAction": "error.unhandled",
"eventResult": "failure",
"eventSeverity": "medium",
"eventOutcomeReason": "UnhandledException",
"application": {
"name": "contoso-portal",
"environment": "production",
"version": "2.4.1"
},
"request": {
"correlationId": "req-00110",
"traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
"method": "POST",
"path": "/api/payments",
"statusCode": 500
},
"labels": {
"errorType": "InvalidOperationException",
"route": "/api/payments"
}
}
What NOT to send to Bower
Keep these out of Bower events (even though Bower's privacy engine will catch and redact known secrets and Australian identifiers as a safety net):
- Secrets and credentials: submitted passwords, MFA/OTP codes, recovery codes, bearer
tokens, session cookies, API keys,
Authorizationheaders, connection strings. - Unbounded or raw user input: full HTTP request/response bodies, raw query strings (OAuth codes and reset tokens frequently live there), uploaded file contents, SQL query text.
- Exception internals: raw exception messages (which often echo connection strings, file paths or user input) and stack traces.
- Low-value operational chatter: health-check probes, routine HTTP
200page/asset loads, debug traces, SQL query timings, container startup banners. - Duplicate copies of the same decision: emit once where the decision is authoritative, not once in the controller, once in the service, and once in the repository.
- Unvalidated
X-Forwarded-Forvalues: anyone can forge that header; only read it when the direct peer IP is in yourTRUSTED_PROXIESallow-list.
Bower's Privacy & Secret Protection Engine runs before persistence. If a TFN, Medicare
number, payment card, cloud key, JWT or secret-named field accidentally enters an event,
Bower redacts or removes it before writing to SQLite — and for high-risk findings, enqueues a
separate sensitive_data_detected alert (containing metadata only, never the original value)
so your security team knows a producer is leaking sensitive data.
Where to go next
- Test these payloads locally in 5 minutes: Send high-value security logs from your app
- Use the .NET SDK (typed default + ASVS helpers): ASP.NET Core instrumentation
- Use another stack (Next.js, Node, Python, Go, Rails, Laravel, Spring Boot): Security events from web frameworks
- See every accepted type and required field: Default security event catalogue and ASVS logging pack