-
Notifications
You must be signed in to change notification settings - Fork 1
Capture Time Redaction
aryehcitron@gmail.com edited this page Aug 21, 2026
·
1 revision
Kronikol has two kinds of "hide this":
| Mechanism | Where it acts | What it protects |
|---|---|---|
ReportConfigurationOptions.ExcludedHeaders, RequestResponsePostProcessor / MidProcessor, the Request/Response…FormattingProcessor delegates |
Render time — only the PlantUML diagram note | Diagram hygiene. The raw Headers / Content are still stored and still serialised verbatim into TestRunReport.json, the mergeable JSON, and any NDJSON sink. See Filtering and Redacting Diagram Content. |
RequestResponseLogger.Redaction (CaptureRedaction) |
Capture time — before an entry is enqueued | The security boundary. A redacted value never reaches the in-memory store or any file derived from it. |
If a credential must not land on disk, redact at capture. Treat ExcludedHeaders as cosmetic.
using Kronikol.Tracking;
// Once per process (e.g. in your test pipeline startup / report hook).
RequestResponseLogger.Redaction = CaptureRedaction.Secrets();CaptureRedaction.Secrets() replaces the values of the well-known credential headers with [REDACTED] (case-insensitive): authorization, proxy-authorization, cookie, set-cookie, x-api-key, x-auth-token, api-key, x-amz-security-token, x-goog-api-key (CaptureRedaction.DefaultSecretHeaders).
RequestResponseLogger.Redaction = new CaptureRedaction(["authorization", "x-internal-token"])
{
Replacement = "***", // what replaces a redacted value (default "[REDACTED]")
DropHeaders = true, // remove the header instead of replacing its value (default false)
}
.RedactContent(@"Bearer\s+[A-Za-z0-9\-_\.]+", "Bearer ***") // regex over request/response bodies
.RedactContent(@"Password=[^;]+", "Password=***");-
Headers— the denylist (mutableHashSet<string>, case-insensitive). -
ContentPatterns/RedactContent(...)— regular expressions applied toContent; every match is replaced. -
Custom— a finalFunc<RequestResponseLog, RequestResponseLog?>hook: rewrite anything, or returnnullto drop the entry entirely (e.g. health-check noise). - Phase variants (
SetupVariant/ActionVariant) are redacted with the same rules.
Redaction runs before MaxContentLength truncation, so a secret near the end of a long body is still scrubbed.
-
kronikol ingestreplays NDJSON throughRequestResponseLogger.Log, so a raw capture file produced elsewhere is still redacted on the way into the report (the CLI enables the secure preset by default;--no-redact/--redact-headeradjust it). -
Kronikol.Extensions.ProxyTaphas its own capture-time denylist (ProxyTapOptions.SecretDenylist, defaultDefaultSecretHeaders) applied before any sink — including an NDJSON file sink, which the global hook would not see. See Integration ProxyTap Extension. - The mergeable JSON (
GenerateMergeableData = true) is payload-free (component relationships only) and is safe to share widely regardless.
The simplest assertion is against the data file:
var json = File.ReadAllText(Path.Combine(ReportGenerator.ResolveReportsDirectory(options), "TestRunReport.json"));
Assert.DoesNotContain("my-secret-token", json);Getting Started
Common Tasks
Integration Guides
- Integration xUnit3
- Integration xUnit2
- Integration NUnit
- Integration MSTest
- Integration TUnit
- Integration BDDfy xUnit3
- Integration LightBDD xUnit2
- Integration LightBDD xUnit3
- Integration LightBDD TUnit
- Integration ReqNRoll xUnit2
- Integration ReqNRoll xUnit3
- Integration ReqNRoll TUnit
- Integration Playwright
Uninstrumentable / polyglot backends
- Integration ProxyTap Extension
- Integration TcpTap Extension
- Integration Otlp Extension
- Ingesting External Captures
- Integration Cucumber Messages
- Capture-Time Redaction
Extensions
- Integration AtlasDataApi Extension
- Integration BigQuery Extension
- Integration Bigtable Extension
- Integration BlobStorage Extension
- Integration ClickHouse Extension
- Integration CloudStorage Extension
- Integration CosmosDB Extension
- Integration Dapper Extension
- Integration DynamoDB Extension
- Integration EF Core Relational Extension
- Integration Elasticsearch Extension
- Integration EventBridge Extension
- Integration EventHubs Extension
- Integration Grpc Extension
- Integration Kafka Extension
- Integration MassTransit Extension
- Integration MongoDB Extension
- Integration MySqlConnector Extension
- Integration Npgsql Extension
- Integration Oracle Extension
- Integration PubSub Extension
- Integration Redis Extension
- Integration S3 Extension
- Integration ServiceBus Extension
- Integration SNS Extension
- Integration Spanner Extension
- Integration SqlClient Extension
- Integration Sqlite Extension
- Integration SQS Extension
- Integration StorageQueues Extension
- Integration OpenTelemetry Extension
- Integration DispatchProxy Extension
- Integration MediatR Extension
- Integration PlantUML IKVM
Configuration
- Tracking Dependencies
- Tracking Custom Dependencies
- HTTP Tracking Setup
- Report Configuration
- Diagram Customisation
- Phase-Aware Tracking
- Content Formatting
- PlantUML Server Configuration
Features
- Generated Reports
- Search Syntax
- Component Diagrams
- PlantUML Browser Rendering
- Inline SVG Rendering
- Internal Flow Tracking
- Tags and Attributes
- Excluding Requests
- Excluded Headers
- Multi-Host Test Architectures
- Event-Driven Architecture Testing
- Service Bus Tracking Patterns
- Background Thread Correlation
- Parallel-Safe Background Correlation
- Event & Message Tracking
- Assertion Tracking
- Step Tracking
- Tabular Attributes
- Large Response and Diagram Handling
- Querying Reports
- Diagnostics and Debugging
- CI Summary Integration
- CI Artifact Upload
- Merging Parallel Reports
Reference