Custom fields in audit events: never drop data, never invent it
An audit trail is only worth something if people can trust what is in it. Two quiet failures destroy that trust: values that never arrive, and values that were never sent but appear anyway. Both happen easily when events carry free-form fields and a pipeline reshapes them for different storage systems.
Integrating Stripe Checkout safely: idempotency keys, signed webhooks and row locks
A hosted checkout looks simple: create a session, send the customer to the provider’s payment page, wait for confirmation. In a demo it works on the first try. In production, the network drops a request, a webhook arrives twice, and the customer’s browser comes back at the same moment as the provider’s confirmation. Each of those can turn into a double charge or a payment shown as failed although the money arrived.
resourceType vs resource: make your OpenAPI authorization unambiguous
When security code is generated from a contract, every field in that contract is an instruction. If one field means two different things, the generator has to guess which one you meant, and the guess is invisible in code review. In access control, an invisible guess is how a check quietly disappears.
Declare authorization in your OpenAPI spec: x-labs64.auth
In most codebases, the rule “only callers with the payment:read scope may list payments” lives in a controller annotation or a security configuration class. The API documentation does not show it, the gateway does not know it, and the tests have to discover it. When a reviewer looks at a new endpoint, they read the spec, but the access rule is somewhere else entirely.
One policy decision point, three enforcement points: authorization with Cerbos
In a multi-tenant platform, authorization tends to fall apart into pieces. The gateway checks who may call which endpoint. Each service checks its own business rules. And every query that lists data has a hand-written WHERE tenant_id = ? that somebody must remember. When each piece has its own rules and its own engine, one change to a permission means edits in several places, and one forgotten filter means one tenant can see another’s data.
readOnlyRootFilesystem in Kubernetes: keep /tmp writable
A read-only root filesystem is one of the cheapest ways to harden a container. If an attacker manages to run code inside it, they cannot replace binaries, install tools or drop files into system paths. One line in the Pod spec turns it on. And then, often, the application stops working.