JWT issuance and verification without common footguns

JWTs are easy to misuse because libraries make them look simpler than they are. I pin the algorithm, validate issuer and audience, keep expirations short, and rotate signing keys deliberately. I also avoid putting sensitive business data into tokens j

HMAC signed API requests for webhook and partner integrity

When I need lightweight message integrity without standing up a full asymmetric trust model, HMAC signing is a solid tool. The important details are canonicalization, timestamp freshness, and constant-time comparison. Most failed implementations get t

Python security audit script for exposed risky filesystem state

I like lightweight audit scripts that reveal obvious host hygiene problems quickly: world-writable files, suspicious SUID bits, and weak key permissions. These scripts are not a substitute for configuration management, but they help surface drift befo

Scaling and normalization choices for different model families

Not every model cares about scale, but enough of them do that I keep scaling explicit. Linear models, SVMs, neural nets, and distance-based methods all benefit from well-behaved inputs. I prefer putting scalers inside the pipeline so train and inferen

SQL injection prevention with unsafe and safe query patterns

I teach SQL injection by showing the vulnerable pattern first and then replacing it with parameterized queries. The important point is that escaping is not a strategy and string interpolation is not acceptable anywhere user input reaches SQL. I also p

Least privilege IAM policy for an application on AWS

Cloud IAM mistakes become high-impact quickly, so I keep policies narrow and resource-scoped. Wildcards are convenient until they become an incident report. The baseline question is always the same: what exact actions on what exact resources does this

Input validation with allowlists and explicit schemas

I validate input at trust boundaries, not halfway through business logic. Explicit schemas force decisions about allowed types, lengths, enums, and nested structure. That keeps weird payloads from becoming security bugs and makes error behavior much e

Secrets management with environment isolation and Vault

The rule is simple: secrets should not live in source control, logs, or chat transcripts. I keep local development ergonomic with env files that never leave the machine, and I use a real secret manager in shared environments. Retrieval should be audit

Anomaly detection with isolation forest and robust thresholds

Anomaly detection is mostly about defining normal behavior well enough that deviations matter. I usually combine a model like IsolationForest with feature windows and operational thresholds that the business can interpret. Without that calibration, an

OpenCV image preprocessing for OCR and vision pipelines

A lot of computer vision performance comes from cleaner inputs rather than larger models. I use OpenCV for resizing, denoising, thresholding, and contour extraction when preparing images for OCR or downstream classification. These classical steps ofte

S3 bucket policy that enforces TLS and blocks public reads

Public cloud storage needs explicit safety rails because the defaults are not enough by themselves. I deny insecure transport, block public access at the account level, and scope principals tightly. Storage mistakes are still one of the easiest ways t

Secure webhook endpoint design with replay protection

A webhook endpoint is an internet-facing parser plus an authentication problem. I verify signatures, enforce recent timestamps, and store event IDs to block replay attempts. Reliability matters too, so handlers should be idempotent and fast to acknowl