Skip to content
Novus Examples
jsonl4 KB

Kubernetes Audit Log — Six Events with an RBAC Denial (jsonl)

Six Kubernetes audit events at two audit levels, including one 403 whose authorization annotations record the forbid decision and its reason. The shape a cluster-audit alert or compliance report reads, with every user and service account invented.

Preview — first 7 linesjsonl
{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"Metadata","auditID":"9f31a700-4c3d-4e9f-8a1b-2c3d4e5f6a7b","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/shop/pods","verb":"get","user":{"username":"system:serviceaccount:shop:checkout","groups":["system:authenticated"]},"sourceIPs":["192.0.2.11"],"userAgent":"kubectl/v1.32.1 (linux/amd64)","objectRef":{"resource":"pods","namespace":"shop","apiVersion":"v1"},"responseStatus":{"metadata":{},"code":200},"requestReceivedTimestamp":"2026-03-17T09:14:32.850000000Z","stageTimestamp":"2026-03-17T09:14:32.891000000Z","annotations":{"authorization.k8s.io/decision":"allow","authorization.k8s.io/reason":""}}
{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"Metadata","auditID":"9f31a701-4c3d-4e9f-8a1b-2c3d4e5f6a7b","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/shop/secrets","verb":"list","user":{"username":"alice@example.com","groups":["system:authenticated"]},"sourceIPs":["192.0.2.11"],"userAgent":"kubectl/v1.32.1 (linux/amd64)","objectRef":{"resource":"secrets","namespace":"shop","apiVersion":"v1"},"responseStatus":{"metadata":{},"code":403},"requestReceivedTimestamp":"2026-03-17T09:14:34.250000000Z","stageTimestamp":"2026-03-17T09:14:34.291000000Z","annotations":{"authorization.k8s.io/decision":"forbid","authorization.k8s.io/reason":"no RBAC policy matched"}}
{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"RequestResponse","auditID":"9f31a702-4c3d-4e9f-8a1b-2c3d4e5f6a7b","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/shop/deployments","verb":"create","user":{"username":"ci-bot@example.com","groups":["system:authenticated"]},"sourceIPs":["192.0.2.11"],"userAgent":"kubectl/v1.32.1 (linux/amd64)","objectRef":{"resource":"deployments","namespace":"shop","apiVersion":"v1"},"responseStatus":{"metadata":{},"code":201},"requestReceivedTimestamp":"2026-03-17T09:14:35.650000000Z","stageTimestamp":"2026-03-17T09:14:35.691000000Z","annotations":{"authorization.k8s.io/decision":"allow","authorization.k8s.io/reason":""}}
{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"RequestResponse","auditID":"9f31a703-4c3d-4e9f-8a1b-2c3d4e5f6a7b","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/shop/configmaps","verb":"patch","user":{"username":"alice@example.com","groups":["system:authenticated"]},"sourceIPs":["192.0.2.11"],"userAgent":"kubectl/v1.32.1 (linux/amd64)","objectRef":{"resource":"configmaps","namespace":"shop","apiVersion":"v1"},"responseStatus":{"metadata":{},"code":200},"requestReceivedTimestamp":"2026-03-17T09:14:37.050000000Z","stageTimestamp":"2026-03-17T09:14:37.091000000Z","annotations":{"authorization.k8s.io/decision":"allow","authorization.k8s.io/reason":""}}
{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"Metadata","auditID":"9f31a704-4c3d-4e9f-8a1b-2c3d4e5f6a7b","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/shop/pods","verb":"delete","user":{"username":"system:serviceaccount:shop:operator","groups":["system:authenticated"]},"sourceIPs":["192.0.2.11"],"userAgent":"kubectl/v1.32.1 (linux/amd64)","objectRef":{"resource":"pods","namespace":"shop","apiVersion":"v1"},"responseStatus":{"metadata":{},"code":200},"requestReceivedTimestamp":"2026-03-17T09:14:38.450000000Z","stageTimestamp":"2026-03-17T09:14:38.491000000Z","annotations":{"authorization.k8s.io/decision":"allow","authorization.k8s.io/reason":""}}
{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"Metadata","auditID":"9f31a705-4c3d-4e9f-8a1b-2c3d4e5f6a7b","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/shop/events","verb":"watch","user":{"username":"system:serviceaccount:kube-system:controller","groups":["system:authenticated"]},"sourceIPs":["192.0.2.11"],"userAgent":"kubectl/v1.32.1 (linux/amd64)","objectRef":{"resource":"events","namespace":"shop","apiVersion":"v1"},"responseStatus":{"metadata":{},"code":200},"requestReceivedTimestamp":"2026-03-17T09:14:39.850000000Z","stageTimestamp":"2026-03-17T09:14:39.891000000Z","annotations":{"authorization.k8s.io/decision":"allow","authorization.k8s.io/reason":""}}

Specifications

Lines
6
Denied Events
1
Audit Levels
Metadata, RequestResponse
Stage
ResponseComplete
Has Authorization Annotations
true
Verbs
get, list, create, patch, delete, watch

Testing contract

Expected to pass
Scenario
Query the audit stream for denied requests.
Expected result
Exactly one event returns code 403 with authorization.k8s.io/decision set to forbid, and both RequestResponse-level events are distinguishable from the four Metadata-level ones.

What is a .jsonl file?

JSONL (JSON Lines) is a text format where each line is a complete, independent JSON value, allowing records to be streamed and appended without parsing the whole file. It is not itself a JSON array and each line must stand alone. It is common in logging, machine learning datasets, and data pipelines.

How to use this file

Use an example JSONL to test line-by-line streaming parsers, append-and-resume ingestion, and batch pipelines that process one record per line.

How to use this file for testing

“Kubernetes Audit Log — Six Events with an RBAC Denial (jsonl)” is a deterministic Novus Examples fixture for Observability, Log parsing, JSON parsing. Structured and plain-text telemetry with known timestamps, levels, request identifiers, and error states for testing log ingestion, correlation, dashboards, and alert pipelines.

Documented properties for this file: JSONL · 4,090 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Telemetry fixtures use fixed trace IDs, span IDs, and timestamps so ingestion is reproducible run to run. Point your collector, parser, or query layer at the file and assert the documented span tree, metric families, or severity mix; service and host names are invented.

Code examples

import json

with open("kubernetes-audit.jsonl") as f:
    rows = [json.loads(line) for line in f]
print(len(rows), rows[0])

Generated by generation/observability.py. Free for any use, no attribution required — license.