Skip to content

feat(packs,sdk): add signed database audit parsers and typed OWASP ASVS SDK helpers (#208) - #312

Merged
jusso-dev merged 1 commit into
mainfrom
feat/asvs-db-parsers-and-sdk-helpers
Nov 21, 2026
Merged

jusso-dev merged 1 commit into
mainfrom
feat/asvs-db-parsers-and-sdk-helpers

Conversation

@jusso-dev

Copy link
Copy Markdown
Owner

Summary

Advances #208 by closing the remaining repository code gaps tracked on the issue:

  • Additive runtime semantic target mapping (src/Bower.Pipeline/CustomLogParser.cs, src/Bower.Packs/PackRuntime.cs):
    • Allows signed JSON pack parsers to map bounded eventCategory, eventAction, eventResult, target.type/target.id/target.name, and up to 8 validated labels.<key> fields (raising the bounded field mapping cap from 7 to 16).
    • Keeps existing strict validation intact while allowing optional enrichment fields (source.ipAddress, target.id, target.name, eventOutcomeReason, labels.*) to omit JSON null values produced by transforms.
  • Four signed database audit parsers in packs/owasp-asvs-app-logging (version: 1.1.0):
    • parsers/pgaudit-jsonlog.json — PostgreSQL 15+ jsonlog AUDIT: and password-failure records.
    • parsers/mysql-audit-json.json — MySQL Enterprise Audit and Percona audit_log_filter JSON records.
    • parsers/mongodb-audit-json.json — MongoDB Enterprise / Atlas JSON audit records.
    • parsers/sqlserver-audit-33205.json — SQL Server Audit Event ID 33205 via the Windows Event Log source.
    • Every parser maps only allow-listed security metadata (database_audit, labels.dbEngine, labels.dbStatementClass, actor/target/source IP), drops raw SQL statements before redaction, and passes BWR-PACK-ASVS-DB-AUDIT after privacy.yaml pseudonymisation.
  • Typed Bower.Sdk OWASP ASVS 5.0 helpers (src/Bower.Sdk/IAsvsTelemetry.cs, AsvsSemanticEvents.cs, BufferedBowerClient.Asvs.cs, ServiceCollectionExtensions.cs):
    • Adds additive IAsvsTelemetry (registered by AddBower(...) alongside IBowerTelemetry, preserving full backwards compatibility for both net10.0 and net11.0) with strongly typed async methods covering all 11 ASVS pack event families.
  • Docs & tests: Updates docs/deployment/database-audit.md and adds tests/Bower.UnitTests/AsvsSdkAndDbParsersTests.cs.

Remaining non-code items on #208 (reported honestly)

  • Live Sentinel validation of the five ASVS analytics rules still requires an Azure Sentinel workspace (not run here).
  • Decision on promoting labels.userAgent / labels.route to first-class schema columns in a future envelope version remains open for maintainer sign-off.

Verification

  • dotnet build --configuration Release — 0 warnings, 0 errors (both net10.0 and net11.0 SDK builds)
  • dotnet test (AsvsSdkAndDbParsersTests, AsvsLoggingPackTests, AsvsExampleContractTests, TransformPackTests, TransformConformanceTests, PackTests) — 30 passed, 0 failed
  • dotnet format --verify-no-changes — passed
  • python3 -m unittest tools/docs/tests/test_build_tools.py — 7/7 passed

Security and compatibility impact

  • Strictly additive pack, parser, and SDK API changes; IBowerTelemetry, SentinelSchema.Default, Bicep, and DCR templates are unchanged.
  • All four DB audit parsers drop raw SQL/query text before redaction and default-deny non-audit records.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 89f6ca96-763d-49a3-9a85-d1fa3d054c74
Commits

Reviewing files that changed from the base of the PR and between 7dd9f69 and 7d752dc.

Files selected for processing: 14

  • docs/deployment/database-audit.md
  • packs/owasp-asvs-app-logging/pack.yaml
  • packs/owasp-asvs-app-logging/parsers/mongodb-audit-json.json
  • packs/owasp-asvs-app-logging/parsers/mysql-audit-json.json
  • packs/owasp-asvs-app-logging/parsers/pgaudit-jsonlog.json
  • packs/owasp-asvs-app-logging/parsers/sqlserver-audit-33205.json
  • src/Bower.Packs/PackRuntime.cs
  • src/Bower.Pipeline/CustomLogParser.cs
  • src/Bower.Sdk/AsvsSemanticEvents.cs
  • src/Bower.Sdk/BufferedBowerClient.Asvs.cs
  • src/Bower.Sdk/BufferedBowerClient.cs
  • src/Bower.Sdk/IAsvsTelemetry.cs
  • src/Bower.Sdk/ServiceCollectionExtensions.cs
  • tests/Bower.UnitTests/AsvsSdkAndDbParsersTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jusso-dev
jusso-dev merged commit 5fa3302 into main Nov 21, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant