YARA rules for spotting suspicious binaries during triage

YARA is useful when you need lightweight pattern matching across files during incident response or malware triage. I keep rules specific and review false positives often. Overbroad rules create noise fast, which is the enemy during an active investiga

Ruby refinements for scoped monkey patching

Refinements provide scoped modifications to existing classes without global monkey patching. I use refinements to add methods to core classes safely. Refinements activate with using statement—scope-limited to file or module. Unlike monkey patches, ref

Kubernetes StatefulSets for stateful workloads

StatefulSets manage stateful applications requiring stable identities and persistent storage. Unlike Deployments, StatefulSets provide ordered Pod creation (pod-0, pod-1, pod-2) and stable network identifiers. Each Pod gets a predictable hostname via

Regular expressions for pattern matching

Ruby's regex engine provides powerful text processing. I use =~ for matching, match for captures. Character classes \d, \w, \s match digits, words, whitespace. Quantifiers *, +, ?, {n,m} control repetition. Anchors ^ and $ match start/end. Groups () c

OAuth 2.0 Authorization Code with PKCE for public clients

For browser and mobile clients, PKCE closes an important hole in the classic authorization code flow. I use it by default with public clients, require exact redirect URI matching, and keep token exchange on TLS only. This is one of those cases where t

Session cookie hardening for browser based authentication

Sessions are fine when they are treated like security-sensitive state. I set HttpOnly, Secure, and SameSite deliberately, rotate session identifiers after login, and keep idle timeout separate from absolute timeout. Weak cookie settings are still a co

Multi-tenancy database patterns and strategies

Multi-tenancy serves multiple customers from one application. I implement tenant isolation via schemas, databases, or row-level security. Shared schema with tenant_id column is simplest—good indexing essential. Separate schemas per tenant improves iso

Database migrations and schema management

Rails migrations evolve database schema over time. I use change method for reversible migrations. Migrations create tables, add/remove columns, add indices. up and down methods provide explicit control. Irreversible migrations like data transformation

WKWebView for web content display

WKWebView displays web content with modern WebKit rendering engine. It replaces deprecated UIWebView with better performance and security. I configure WKWebViewConfiguration to customize behavior like JavaScript, cookies, and media playback. Navigatio

Terraform AWS RDS and ElastiCache provisioning

Terraform provisions managed database services declaratively. AWS RDS supports PostgreSQL, MySQL, and other engines with aws_db_instance. The engine_version pins database versions. instance_class sets compute size. allocated_storage and max_allocated_

CSP report endpoint for monitoring attempted browser policy violations

I like CSP reporting because it reveals both rollout mistakes and active attack attempts. The endpoint should accept reports quietly, avoid noisy validation failure loops, and forward the data into normal observability systems. Reporting without triag

Database migration with Flyway

Flyway manages database schema evolution through versioned SQL scripts. Migration files follow naming convention—V1__initial_schema.sql, V2__add_users_table.sql. Flyway tracks applied migrations in a schema history table. Migrations run automatically