MEIER-354: Add Serilog with OpenTelemetry sink and harden WAF rules#22
Merged
andymeierdev merged 2 commits intomainfrom Mar 25, 2026
Merged
Conversation
🍹
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds structured logging with Serilog (using OpenTelemetry sink to Seq) to the Docs app, and hardens the Cloudflare WAF rules to prevent case and URL-encoding bypass attacks.
Changes
Serilog with OpenTelemetry Sink
sln/paket.dependencies/sln/src/Docs/paket.references: AddedSerilog,Serilog.AspNetCore,Serilog.Sinks.Console, andSerilog.Sinks.OpenTelemetrypackages.sln/src/Docs/Config.fs:Envmodule withvariableandvariableOrDefaulthelpers for cleaner env var access.SeqConfigtype withendpoint(defaults tohttp://localhost:5341).Configwithdebug,appName, andseqfields.sln/src/Docs/Program.fs:configureLoggerthat sends logs to Seq via the OpenTelemetry OTLP ingest endpoint (/ingest/otlp/v1/logs) usingHttpProtobufprotocol.UseSerilogRequestLoggingwith/healthendpoint filtered toVerboseto reduce noise.mainintry/finallywithLog.CloseAndFlush()andLog.Fatalon startup failure.Pulumi — Seq Endpoint Config
pulumi/src/config.ts: AddedseqConfigreadingseq:endpointfrom Pulumi config.pulumi/src/k8s/deployment.ts: PassesSEQ_ENDPOINTto the app ConfigMap from the Pulumi seq config.WAF Hardening
pulumi/src/cloudflare/waf.ts:lower(url_decode(...))to normalize both case and percent-encoding, preventing bypass via mixed case (e.g./ReAcT/.EnV) or URL encoding (e.g.%2F).const pvariable to DRY up the rules./phpMyAdminrule (now redundant withlower())./login,/api/config,/careers_not_hosted, and.env.(catches.env.sample,.env.prod, etc.).Validation
dotnet build src/Docs/Docs.fsproj— builds with 0 warnings, 0 errors.pulumi preview— shows expected resource changes (ConfigMap replace, WAF ruleset create, deployment replace).