Stop Looking for Empty Values

A tiny serialization protocol that removes sentinel values and keeps types precise

> The biggest breakthrough was realizing that I was solving the wrong > problem.

Solution TLDR; In UI, empty value should NOT be represented as “” but rather " ". This is different from what has been the traditional way i.e. empty value is just “”. The difference is minimal and easy to ignore but it is significant. Of course, it is not very safe or convenient due to trims etc. but hear me out. This will be a clean approach to default, empty, and sentinel values in UI: just use single space for a field value!

"" is equivalent to symbol of bottom ⊥
" " means empty string for end-user

Introduction

While designing a generic resource system and form engine, I became convinced that every primitive type needed an “empty value”.

It seemed obvious.

If users can leave a field blank, then surely every type must define what “blank” means.

For weeks I searched for answers:

  • empty integer
  • empty boolean
  • empty date
  • empty timestamp
  • empty UUID
  • empty money

The deeper I looked, the less convincing every answer became.

This article explains why the search itself was misguided and how a surprisingly small serialization protocol solved the problem.


The Wrong Question

Suppose we have the following types:

  • string
  • text
  • integer
  • decimal
  • boolean
  • date
  • timestamp
  • uuid
  • money
  • filesize
  • ranges
  • arrays
  • references
  • files
  • JSON

Now ask:

> What is the empty value of each type?

At first the question feels fundamental.

But it immediately starts falling apart.

0 is not an empty integer.

false is not an empty boolean.

1970-01-01 is not an empty timestamp.

A nil UUID is still a UUID.

The conclusion is unavoidable:

> Sentinel values steal legitimate values from the domain.

Chasing Better Ideas

I explored several directions.

Identity elements

Useful for algebra, but unrelated to missing information.

Empty values

Natural for arrays and some range types, but not for most primitives.

Sentinel values

Practical, but they infect every algorithm with special cases.

Bottom values

Mathematically elegant, but they still leave one unanswered question:

> How does a user enter bottom into a form?

That question turned out to be the key.

The Realization

I wasn’t designing values.

I was designing communication between humans and values.

That is a serialization problem.

Humans never edit integers.

They edit text.

Humans never edit UUIDs.

They edit text.

Even calendars, checkboxes and upload controls eventually produce representations.

Forms are codecs.

Human
   │
Representation
(strings)
   │
Codec
   │
Semantic values

Once viewed this way, the problem changed completely.

Separate the Layers

The architecture became:

Human
   │
   ▼
Form widgets
   │
   ▼
Serialized strings
   │
   ▼
Codec
   │
   ▼
Lifted values (⊥ | T)
   │
   ▼
SQL (NULL or value)

Each layer has exactly one responsibility.

Layer Responsibility


Types Values and validation Codec Serialization SQL Persistence Application Business defaults

Notice what disappeared.

The type system no longer needs empty values.

One Universal Rule

The codec reserves exactly one representation:

""  ⇄  ⊥

That is enough.

Every field shares the same notion of “missing”.

No fake epochs.

No magic UUID.

No special integer.

The Only Exception

Strings are different.

For every other type:

representation ≠ value

For strings:

representation = value

Therefore strings require escaping.

The simple codec is:

Serialized Semantic string


"" ⊥ " " "" " " " " " " " "

The leading spaces belong to the serialization protocol, not the string type.

That distinction is crucial.

Why This Matters

This tiny protocol has surprisingly large consequences.

It removes the need for:

  • sentinel values
  • fake default values
  • empty integers
  • empty dates
  • empty UUIDs
  • type-specific missing semantics

Adding a new primitive type becomes routine.

Implement:

  • parser
  • formatter
  • validator

Nothing else.

What Surprised Me

The real mistake was trying to encode “missing” inside every primitive type instead of treating it as a property of serialization and storage.

Once those concerns were separated, the design became simpler, not more complicated.

Principles

  1. Primitive types should only describe legitimate values.
  2. Missing information belongs outside the value domain.
  3. Forms communicate through serialization.
  4. SQL stores bottom as NULL.
  5. Only strings require escaping because only strings share their representation language with their value domain.

Closing Thoughts

The final solution was almost embarrassingly small.

Not a new primitive.

Not a new database feature.

Not a new type constructor.

So what is it then? Just one serialization rule and one escape rule for strings:

"" is equivalent to bottom ⊥
" " means empty string for end-user

and one escape rule for strings.

Sometimes the hardest part of designing a system is not inventing a clever mechanism.

It is discovering that the original question was asked at the wrong layer of abstraction.

Logical Introduction To Apache Camel

What is Apache Camel? Apache Camel is an open-source integration framework (note! not migration framework) that is a system for connecting applications/systems by routing, transforming, and mediating (i.e. reaching compatibility) messages between them. The following image depicts the core architecture:

What Camel is? I mean in addition to applying Enterprise Integration Patterns

  • It can route messages between systems
  • It can transform messages between systems
  • It can mediate between different protocols and data formats

What Camel is not?

  • A message broker
  • An Enterprise Service Bus
  • A workflow engine

The following happens between source software system and target software system

  • Consumer receives event
  • Consumer creates Exchange message
  • Exchange enters PipelineProcessor
  • Each Processor mutates Exchange
  • Branching may occur (Choice/Split)
  • Transformations modify body/headers
  • ProducerProcessor sends to external system
  • Response may update Exchange

Different message types are Event Messagesmessages that have only an inbound message, and Request and Reply messages that have an inbound and an outbound message.

External System (source)
↓
Consumer Endpoint (creates Exchange)
↓
Exchange message
↓
Processor Graph (Pipeline + EIPs + transforms + routers)
↓
Producer Endpoint (sends Exchange out)
↓
External System (target)

Some key concepts are… Camel has 300+ ready to use components now. A component is essentially a factory for endpoints. A Camel route is a compiled processor graph where a consumer creates an Exchange, a chain/tree of processors mutates it, and a producer sends it to an external system; routes are the actual integration logic. In Apache Camel, the only real message container is the Exchange, which wraps a Message (body + headers) plus routing metadata, and everything in the system operates by mutating it through processors.

Exchange PartPurpose
In MessageRequest/input
Out MessageResponse
HeadersMetadata
PropertiesRoute-scoped state
ExceptionError tracking

Processors are basic unit in integration. Different types of processors

Processor TypeIn reality
enterprise integration pattern (EIP)Specialized Processor
transformationProcessor that modifies body
filterProcessor that may stop flow
routerProcessor that branches flow
marshal/unmarshalProcessor that converts formats
endpoint .to()Processor that calls external system
custom logicProcessor you write

CamelContext is the application container / configuration + registry. Runtime is the execution engine that actually runs routes and processes Exchanges. In practice: CamelContext is the main entry point to the runtime, but “runtime” is the broader system behavior while it is running. Legacy runtimes include Karaf and modern runtimes include Spring boot and Quarkus. There is also visual desginer for Apache Camel integration called Kaoto: see https://kaoto.io/ You should prefer using Spring Batch for migrations (over Apache Camel that is more suitable for integrations).

How would a typical integration app then look like?

  1. Source systems (external systems, e.g. 3rd party via API)
  2. Source adapters
  3. Source mappers
  4. Core model (e.g. data models)
  5. Routing layer (Apache Camel or Spring Batch)
  6. Target mappers
  7. Target adapters
  8. Target systems (external systems, e.g. 3rd party via API)

How to Evaluate Software Service Providers: A Balanced Approach

Have you ever wondered why many businesses trust their confidential data to other companies? Not long time ago that information never left company network: most of the documents were modified using local software like Microsoft Office. But nowadays most of the software is connected online. Why it is ok to use services provided by one software service provider but then again choose not to use some services. For example, many companies still choose to host their git repo locally, but others use managed online repos. How can you evaluate software service providers? Often this evaluation is not an explicit process although it should be.

Business & Financial Health

Evaluate the provider’s financial stability and business continuity plans. Are they profitable? Do they rely on volatile funding? What happens if they get acquired or go bankrupt? Look for

  • Revenue model and cash flow stability

  • Client and industry diversification

  • Vendor lock-in risks

Security & Compliance

Security isn’t a feature—it’s a foundation. Look for

  • Certifications (ISO 27001, SOC 2, HIPAA, etc.)

  • Security incident history and response transparency

  • Encryption, authentication, and access controls

  • Third-party security audits

Privacy & Data Control

You should have control over your data at all times. Please check

  • Data processing and storage transparency

  • Data use limitations—are they mining it?

  • Ability to export and delete data easily

  • Residency and compliance with local regulations (GDPR, CCPA, etc.)

Transparency & Governance

A trustworthy provider operates openly. Investigate:

  • Availability of audit logs and activity reports

  • Governance structures and ethics policies

  • Public transparency initiatives (e.g., transparency reports)

Technical Capability & Fit

This is where “will it work with our stack?” comes in. Consider

  • API standards, SDKs, and dev tooling

  • Performance and benchmarking

  • Horizontal and vertical scalability

  • Integration with your architecture or workflow

Support & Reliability

How good is their support—and what happens when things go wrong? Good indicators include

  • Uptime and performance SLAs

  • Support channels (chat, email, phone, community)

  • Documentation quality

  • History of handling outages and post-mortem transparency

Legal & Contractual Clarity

Don’t skip the fine print. Look for

  • Clear SLAs and legal jurisdiction

  • Liability and indemnification terms

  • Compliance with contractual obligations

  • Clarity on termination and data return

Ethics, Sustainability & Values

Does the provider’s mission align with your own? Explore:

  • Corporate social responsibility (CSR)

  • Sustainability and environmental commitments

  • Ethics of product use and misuse prevention

User & Industry Validation

What do other users say? Is this a well-regarded product in your field? Check that

  • Testimonials and case studies

  • Explore independent reviews (G2, Capterra, Developer forums)

  • Adoption among reputable companies

Risk & Exit Strategy

Even with a great provider, you need a “Plan B”. Make sure that

  • Your data can be easily exported

  • The provider doesn’t stand in the way of migration

  • There are tools and processes for offboarding

  • The level of vendor lock-in is acceptable

#Evaluation CategoryDescriptionWeightScore (1–10)Weighted Score
1Business & Financial HealthStability, independence, revenue model, business continuity, lock-in factors10%
2Security & ComplianceCybersecurity practices, certifications, vulnerability handling, compliance with standards10%
3Privacy & Data ControlData use limits, storage/processing transparency, exportability, data minimization10%
4Transparency & GovernancePublic audit logs, transparency reports, governance models, clear internal controls10%
5Technical Capability & FitPerformance, scalability, extensibility, SDKs/APIs, compatibility with your architecture10%
6Support & ReliabilitySLA uptime, incident history, support speed, channels, documentation quality10%
7Legal & Contractual ClarityContract enforceability, jurisdiction, liability, indemnity clauses, legal predictability10%
8Ethics, Sustainability & ValuesAlignment with corporate values, sustainability practices, social responsibility10%
9User & Industry ValidationTestimonials, case studies, industry adoption, independent reviews10%
10Risk & Exit StrategyBackup/export tools, data egress ease, offboarding options, vendor lock-in reduction10%
Total100%Sum
Weighted scorecard for software service providers

A Model To Manage SaaS Software System Development And Deployment When You Need To Deal With Multiple Versions

A Three-Lifecycle Architecture for Private SaaS Deployments

> Problem: How do you manage a private SaaS product where every customer has dedicated infrastructure, multiple environments (dev/QA/prod), and customers intentionally run different supported product versions?

The mistake many teams make is treating development, deployment and customer operations as one lifecycle. They are not.

This article proposes splitting the system into three repositories and three independent lifecycles, each producing an immutable artifact consumed by the next stage.


The Big Picture

                 SOFTWARE SUPPLY CHAIN

 ┌──────────────┐    ┌────────────────┐    ┌───────────────┐
 │ product.git  │ -> │ deployment.git │ -> │ customers.git │
 └──────────────┘    └────────────────┘    └───────────────┘
        │                     │                      │
        ▼                     ▼                      ▼
 Application          Deployment Bundle      Customer Release
   Artifacts
                                                   │
                                                   ▼
                                             Deployment
                                                   │
                                                   ▼
                                            Running System

Each repository has exactly one responsibility.

Repository Produces
product.git Application Release
deployment.git Deployment Release
customers.git Customer Release

Why not one repository?

BAD

product/
playbooks/
inventories/
customerA/
customerB/
customerC/

Everything evolves together.
GOOD

product.git
deployment.git
customers.git

Each evolves independently.

Lifecycle 1 — Product

Purpose:

> Transform source code into released application artifacts.

Requirements
    │
    ▼
Feature Branch
    │
    ▼
main
    │
    ▼
release/x.y
    │
    ▼
Git Tag
    │
    ▼
CI Build
    │
    ▼
Application Artifacts

Branching:

main
 ├── feature/*
 ├── release/2.8
 ├── release/2.9
 └── release/3.0

Outputs:

  • backend-2.9.0.jar
  • frontend-2.9.0.zip
  • database migrations
  • API specification

Boundary:

product.git ends when immutable artifacts are published.


Lifecycle 2 — Deployment

Purpose:

> Transform released application artifacts into a reproducible installer.

Inputs:

  • application artifacts
  • Ansible playbooks
  • roles
  • templates
  • pinned collections
Application Artifacts
          │
          ▼
 Resolve Coordinates
          │
          ▼
 Assemble Installer
          │
          ▼
 Deployment Bundle
          │
          ▼
 Publish Artifact

Example bundle:

deployment-2.9.0-1.tar.gz

site.yml
roles/
collections/
artifacts/
manifest.yml

Example manifest:

deployment:
  version: 2.9.0-1

application:
  backend: 2.9.0
  frontend: 2.9.0

Notice that the deployment bundle is itself a release artifact.


Lifecycle 3 — Customer

Purpose:

> Bind a deployment bundle to a customer configuration.

Repository:

customers/

 customerA/
   common/
   qa/
   prod/

 customerB/
   common/
   qa/
   prod/

Each environment declares:

deployment_bundle: deployment-2.9.0-1
replicas: 3
domain: app.customerA.com

Conceptually:

Deployment Bundle
        +
Customer Configuration
        =
Customer Release

The customer release declares the desired state. Nothing has been deployed yet.


Deployment Execution

Deployment is intentionally not a release.

Customer Release
      │
      ▼
ansible-playbook
      │
      ▼
Running Environment

If execution fails, the customer release still exists and can be retried.


Repository Boundaries

┌──────────────────────────┐
│ product.git              │
│ source -> artifacts      │
└───────────┬──────────────┘
            │
            ▼
┌──────────────────────────┐
│ deployment.git           │
│ artifacts -> bundle      │
└───────────┬──────────────┘
            │
            ▼
┌──────────────────────────┐
│ customers.git            │
│ bundle + config          │
│ -> customer release      │
└───────────┬──────────────┘
            │
            ▼
      Deployment Execution

Ownership

Developers
    │
    ▼
product.git

Platform / DevOps
    │
    ▼
deployment.git

Operations
    │
    ▼
customers.git

Automation
    │
    ▼
Deployment

End-to-end Flow

Developer
    │
    ▼
product.git
    │
    ▼
Application Artifacts
    │
    ▼
deployment.git
    │
    ▼
Deployment Bundle
    │
    ▼
customers.git
    │
    ▼
Customer Release
    │
    ▼
Ansible
    │
    ▼
Running Customer Environment

Benefits

  • Clear separation of concerns.
  • Stable Mainline only where it adds value (product.git).
  • Immutable artifacts at every stage.
  • Customer upgrades become configuration changes rather than code changes.
  • Rollbacks are performed by selecting an earlier deployment bundle.
  • Easy auditing because every lifecycle has explicit inputs and outputs.

The key insight is that a private SaaS platform is not a single lifecycle. It is a software supply chain with three independent factories:

  1. Build the software.
  2. Build the installer.
  3. Build the customer release.

Only after those three steps does deployment begin.

System Security Hardening – OS / Ubuntu Long-Time Support Version (LTS)

An OS hardening baseline is a set of pre-configured, secure settings and best practices designed to minimize an operating system’s attack surface and reduce vulnerabilities. Compliance is measurement of how well your system aligns with a given standard (baseline). Audit (verification) gives you compliance score and report.

Security Technical Implementation Guides (STIGs) are configuration standards that provide prescriptive guidance on how to secure Operating Systems, network devices, etc. against cyber security threats. STIGs are developed by DISA. STIG hash categories CATI, CATII, and CATIII, which can be implemented separately.

The CIS Critical Security Controls (CIS Controls) are a prescriptive, prioritized, and simplified set of best practices that you can use to strengthen your cybersecurity posture. Currently, there are 18 security controls published. CIS controls are developed by CIS. CIS has levels Level1, Level2, and Level3, which can be implemented independently.

So how would you go about hardening OS (for your sec ops machine)? You choose the OS distribution that is in my case Ubuntu 24.04 LTS. Second, you choose security baselines, which are in my case CIS (Level1) and STIG (CATI). Then you can decide how to implement the baselines: for example Ubuntu Security Guide and Ansible Lockdown. After implementation you will proceed into verification: audit and compliance report from tooling. Finally, you will know your hardening status and the level of the compliance. Congrats, you have successfully made your OS more secure!

What is Ubuntu Security, Security Guide and Pro?

See my other post about how to enable and disable Ubuntu Pro. It is a good idea to run audit/verification first, and then check what the report says and then plan fixes.

Framework Implementation Verification Report Output
CIS Level 1 (Server) usg (Ubuntu Pro)

sudo usg fix cis_level1_server

usg (Ubuntu Pro)

sudo usg audit cis_level1_server

CIS compliance report(HTML/TEXT)
STIG CAT I Controls sudo usg fix disa_stig sudo usg audit disa_stig STIG compliance report(HTML/XCCDF)

There are also open source options for CIS/STIG

Ansible Lockdownansible-playbook with tags "audit" "remediate"ORsudo ua enable fips-updatessudo usg fix disa_stig

oscap (OpenSCAP)oscap xccdf eval --profile stigORsudo usg audit disa_stig

NOTE! “Always run the DISA-STIG hardening scripts on fresh installations of Ubuntu. As the hardening scripts adjust the system configuration, if additional non-core services have been installed to the system, the compliance scripts may break them by modifying essential configuration.” Might be also a good thing to do the same with CIS too…

Hardening of laptops must include disk encryption, namely Full-Disk Encryption (FDE). For maximum security, you can combine both methods—using TPM with a PIN/Password requirement. In TPM‑only mode, physical-access attackers can bypass root since laptop boots up normally. With TPM+PIN LUKS unlocks only after PIN entry. Also, TPM hardware enforces rate‑limiting, so an attacker cannot brute‑force the PIN. In summary, ALWAYS use TPM+PIN!

If you use full-disk encryption + a boot PIN, you already protect against:

  • Someone stealing your laptop and reading the disk
  • Someone removing the SSD and plugging it into another machine
  • Many “evil maid” attacks, since TPM+PIN protects keys even if tampered

Power-on/BIOS passwords protect:

  • Booting from USB or external device
  • Changing Secure Boot settings
  • Tampering with firmware (eg. disabling TPM + rebooting)
  • Installing a bootkit before your OS loads

This complements FDE, because FDE only protects data, not firmware. Use it if

  • You travel with your laptop
  • You leave it in shared spaces
  • You work with sensitive materials
  • You want defense-in-depth

Use safe enough password, which is nowadays means 16 random of printable ASCII characters or 10 BIP39 mnemonic words (around 100 bits of entropy). Please consider using password manager – highly recommended or even mandatory.

Links and material

Ubuntu Pro: Complete Enablement And Disablement Guide

Did you know that Ubuntu Pro is free for personal use on up to 5 machines (physical or virtual)?

Prerequisites

Install/Update the Ubuntu Pro Client:

sudo apt update
sudo apt install ubuntu-advantage-tools

Verify installation:

pro version

Enabling Ubuntu Pro

Step 1: Attach to Ubuntu Pro

Option A – Interactive Method (Recommended):

sudo pro attach
  • Copy the code displayed
  • Visit https://ubuntu.com/pro/attach in your browser
  • Log in with your Ubuntu One account
  • Enter the code and follow the prompts

Option B – Direct Token Method:

sudo pro attach YOUR_TOKEN_HERE

Step 2: Check Available Services

sudo pro status

Step 3: Enable Specific Services

sudo pro enable SERVICE_NAME

Common services:

  • esm-apps – Extended Security Maintenance for applications
  • esm-infra – Extended Security Maintenance for infrastructure
  • livepatch – Kernel live patching (no reboot needed)
  • realtime-kernel – Real-time kernel support

Enable multiple services at once:

sudo pro enable esm-apps esm-infra livepatch

Disabling Ubuntu Pro

Disable Individual Services

sudo pro disable SERVICE_NAME

Example:

sudo pro disable livepatch

Note: This removes access to the service but leaves installed packages on your system.

Completely Detach from Ubuntu Pro

sudo pro detach

This disables all services and detaches your machine from your Ubuntu Pro subscription.

Stop the Ubuntu Pro Daemon (Optional)

If you want to completely disable Ubuntu Pro functionality:

sudo systemctl stop ubuntu-advantage.service
sudo systemctl disable ubuntu-advantage.service

Useful Commands

Check current status:

sudo pro status

View detailed service information:

sudo pro status --all

See security updates available:

sudo pro security-status

Re-enable the daemon (if previously disabled):

sudo systemctl enable ubuntu-advantage.service
sudo systemctl start ubuntu-advantage.service

Linux Kernel Upgrade vs Distribution Upgrade

 

1. Kernel upgrade (Linux kernel)

What is it?

The kernel is the core of the OS:

  • Hardware drivers

  • Process scheduling

  • Memory management

  • Filesystems

  • Networking stack

Ubuntu ships kernel updates within the same distro release.

Example:

  • Ubuntu 22.04

    • Kernel goes from 5.15.0-60 → 5.15.0-91

    • Still Ubuntu 22.04


When a kernel upgrade is required

You typically need (or strongly want) a kernel upgrade when:

1. Security vulnerabilities (most important reason)

  • Kernel CVEs (very common)

  • Installed via sudo apt upgrade

  • Usually backward-compatible

2. New hardware support

  • New CPU, GPU, Wi-Fi, NVMe, USB devices

  • Especially laptops released after your Ubuntu version

  • Ubuntu LTS provides HWE (Hardware Enablement) kernels

3. Bug fixes or performance improvements

  • Filesystem bugs

  • Networking issues

  • Scheduler improvements

4. Compliance / stability requirements

Certain kernel versions required by:

  • Kubernetes

  • eBPF features

  • Containers / virtualization

When a kernel upgrade is not needed?

  • Your system is stable

  • No new hardware

  • No security policy forcing it

You can run an old kernel safely as long as it’s still supported and patched.

Impact of kernel upgrade

  • Requires reboot

  • User-space apps unchanged

  • Low risk

  • Rollback easy (GRUB lets you boot older kernel)

2. Distro upgrade (Ubuntu release upgrade)

What is it?

A distro upgrade moves from one Ubuntu release to another:

For example: 20.04 → 22.04 or 22.04 → 24.04

This upgrades:

  • Kernel

  • GNU libc

  • Systemd

  • Desktop environment

  • Core libraries

  • Package versions

  • Default configs

When a distro upgrade is needed?

1. End of Life (EOL)

Ubuntu releases have support windows:

Release Support
LTS 5 years (10 with ESM)
Non-LTS 9 months

Once EOL:

  • No security updates

  • No kernel patches: Upgrade required, prefer LTS-LTS upgrade!

2. You need newer user-space software

Examples:

  • Newer Python / Java / Node

  • Newer systemd

  • Newer OpenSSL

  • Newer desktop features

Kernel upgrades alone won’t help here.

3. Major architectural changes

Examples:

  • New init systems

  • New Wayland features

  • New packaging defaults

  • New cgroups versions

These are distro-level changes.

4. Vendor / software requirements

Some software explicitly requires specific versions like  Ubuntu ≥ 22.04 and glibc ≥ X.Y

Kernel version doesn’t satisfy this.

Impact of distro upgrade

  • Requires reboot (often multiple)

  • Higher risk than kernel upgrade

  • Config file changes

  • Possible app breakage

  • Rollback is hard (usually reinstall or full snapshot restore)

When to upgrade?

Situation Kernel Upgrade Distro Upgrade
Kernel CVE

Yes

No
New hardware Yes No
App wants newer libc No Yes
Ubuntu nearing EOL No Yes
Stability issues Try first Maybe
Want new features No Maybe

 

How To Manage Server Access In Small To Medium Sized Organisation?

For Linux access, you want four properties, in this order:

  1. Centralized authorization (who may access what)
  2. Short-lived credentials (so revocation is easy)
  3. No per-server user management
  4. Auditability without heroics

The Simple Plan

Based on long-lived SSH public keys (authorized_keys) which are centrally managed. Each user  has own keypair, there is only single os account on linux server, keys are deployed via Ansible to server’s authorized keys.

  • Ensure log level logs user details
  • Ensure key comments are correct
  • Generate a fingerprint→name map from your git keys and store it centrally (and/or ship to hosts)

Turn on verbose auth logging (mandatory)

In /etc/ssh/sshd_config

LogLevel VERBOSE PubkeyAuthentication yes PasswordAuthentication no

This commonly causes sshd to include the public key fingerprint in auth logs, which you can map back to a person (because you already have the pubkeys in git/ansible). Fingerprints are logged to /var/log/auth.log when rsyslogd is enabled and otherwise visible by “journalctl -u ssh”. The retention of these files varies and must be checked (e.g. 30 days) but best would be to send these logs to centralized log or SIEM like Wazuh.

Pros: zero workflow change
Cons: attribution is by fingerprint (fine in SIEM, slightly annoying by hand)

Add per-key comments and keep a fingerprint map (simple + effective)

Ensure using SHA256 fingerprints consistently (ssh-keygen -E sha256),

Ensure each public key has a unique comment like: ssh-ed25519 AAAAC3... alice@company

Then you maintain a generated map (Generate the map centrally using CI job or admin machine and store to git):

  • fingerprint → engineer
  • for example, server log shows: “Accepted publickey for ubuntu … SHA256:abcd…” which you can search from the map in git
  • fingerprint calculation is based on “ssh-keygen -lf $KEY -E sha256”

You can even generate it automatically during Ansible deploy and ship it to /etc/ssh/key_owners.json so on-call can quickly answer “who is this key?”

Pros: simple, low risk
Cons: still relies on fingerprint in logs

Leave Console Login for Emergencies

The idea is to keep TTY / cloud console password login working and use SSH keys only for remote access. SSHD configs are not relevant here! But there is one important caveat:

You must have at least one user account that allows interactive login!

What “cloud console login” actually does. Cloud console access gives you:

  • a TTY
  • a getty prompt
  • which runs /bin/login

That login path requires all of these to be true:

  1. User exists in /etc/passwd
  2. User has a valid login shell
  3. User is not locked
  4. PAM allows login
  5. User has a password set (unless you have fancy auth)

A Maturity Ladder Towards Advanced Plan

  • Long-lived keys, but centrally managed (git + Ansible)
  • Add SSO groups → role mapping (authorization centralized)
  • Switch auth to short-lived SSH certs (Smallstep or custom signer)
  • Optional: add approvals/session recording (Teleport / bastion)

The Advanced Plan

Utilizes external services like Teleport and Keycloak. Based on short-lived SSH certificates signed by an SSH CA (OpenSSH certs), issued via SSO.

Idea

  • Deploy Teleport OSS : free for small companies, but commercial license for bigger
  • Integrate with your IdP, for example Keycloak
  • Enforce SSO because SSO has the best UX/DX for getting a new cert
  • SSH cert TTL ≤ 15 minutes. Note that short-lived certs do not mean short-lived sessions. SSH validates the certificate only at session establishment. After that, the TCP session lives independently of cert expiry.

Process hardening

  • Add access requests for production
  • Add session recording if/when needed

What is Teleport?

Capability Smallstep Teleport
SSH cert issuance ✅ ✅
OIDC integration ✅ ✅
Short-lived certs ✅ ✅
Role-based access ⚠️ ✅
Per-role MFA ❌ ✅
Access requests ❌ ✅
Session recording ❌ ✅
Just-in-time access ❌ ✅
Audit UX ❌ ✅

Behind the scenes Teleport:

  1. ssh invokes a local helper
  2. Helper checks for a valid SSH cert
  3. If missing/expired:
  4. starts OIDC device flow
  5. opens browser
  6. CA issues short-lived cert
  7. Cert loaded into ssh-agent
  8. SSH resumes

A Teleport-managed server “integrates” by running a Teleport agent on the server (the Teleport node / sshd service). Then it registers itself to the Teleport Auth Server, gets a host certificate, and from then on Teleport can route and authorize SSH connections to it.

What Facebook did vs what you should do

Meta Your org
x509 PKI SSH certs
Custom infra Teleport or light CA (smallstep)
Huge revocation infra TTL-based expiry
Dedicated IAM team One infra owner

Giving Claude Code Direct Access To Mobile UI (React-Native)

Problem: Developing Mobile Apps is slow – even with AI Agents.

Solution: The solutions is giving Claude direct access to the simulator. That’s where MCP servers come in. MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems. Using MCP, AI applications like Claude can connect to data sources (e.g. local files, databases), tools (e.g. search engines, calculators) and workflows (e.g. specialized prompts) – enabling them to access key information and perform tasks. In a way, MCP is a smart API. We are going to use “mobile-mcp” project.

MCP in 30 Seconds

  1. You tell Claude what to do
  2. Claude asks the MCP server how to do it
  3. The MCP server translates that into commands
  4. Claude executes them

MCP server that wraps mobile device simulator control. Using it, Claude can tap, swipe, read the screen, and run tests, etc. automatically without human intervention.

Teaching Claude

Having the MCP server is step one. The next step is teaching Claude how to use them effectively is where the magic happens. This goes in your project’s CLAUDE.md file. Here’s a simplified example of what can be inside it:

# Expo + mobile-mcp Testing Guide (`claude.md`)

This document defines **how to test this Expo React Native app using mobile-mcp**.
It assumes the app is run via **Expo (dev client or Expo Go)** and controlled through **mobile-mcp simulator tools**.

Follow these rules strictly to ensure deterministic, repeatable tests.

## Environment Assumptions

- App is built and run using **Expo**
- Simulator/emulator is controlled via **mobile-mcp**
- Navigation uses **React Navigation**
- App supports **accessibility labels / testIDs**

## Permissions (Camera, Notifications, Location)

- Handle permission dialogs explicitly
- Assert whether permission was:
  - Requested
  - Granted
  - Denied
- Capture screenshots of system dialogs when relevant

## Core Principles

1. **Accessibility-first (required)**
   - Prefer `accessibilityLabel`, `accessibilityRole`, or visible text
   - Coordinates are a last resort only
2. **State-aware testing**
   - Expo preserves state across reloads — always confirm state explicitly
3. **Deterministic navigation**
   - Use only documented flows from `sitemap.md`
4. **Fail fast**
   - If an expected element is missing, stop immediately
5. **Evidence-based**
   - Screenshots are mandatory for UI verification

## Standard Test Workflow (Required)

When asked to test a feature or UI change, follow this sequence **exactly**.

### 1. Start the Expo App
### 2. Launch the App in Simulator
### 3. Normalize App State
### 4. Navigate Using Semantics Only
### 5. Verify UI State (Mandatory)
### 6. Capture Screenshots
### 7. Report Results

If I ask Claude to “test the commenting flow,” Claude builds the app, launches the simulator, takes a screenshot, taps on a post, takes a screenshot, taps on the comment button, takes screenshot, adds a comment and presses submit, reads the screen state, and tells me whether it worked. If something’s broken, it shows me the screenshot and proposes a fix. In some cases it’ll see the visual inconsistency and will fix it immediately just like it would fix a compiler error.

What My Agentic Workflow Looks Like Now

Before:

  1. Open and start simulator
  2. Make a change
  3. Build and deploy (automatically) the change
  4. Navigate to the feature
  5. Test the feature
  6. Take a screenshot
  7. Find file in file system
  8. Drag into the agent e.g. Claude
  9. Explain what I am expecting vs observed
  10. Ask for a new change and repeat

After:

  1. Describe what I want
  2. Claude builds, tests, and confirms

New improved workflow means that Claude makes a change and then accomplishes the given goal without user intervention, which means that several manual steps are omitted and skipped for fast execution: agent like Claude can see its own change, which speeds up the iterative and incremental changes.

Mobile MCP Setup Guide

The guide can be used for both Android and iOS development. The goal is to enable agent (Claude) to make changes to React-Native app and then visually get feedback about the done change. Also, the user can provide feedback about the change via agent CLI.

Complete Setup Guide for Mobile MCP with Expo Android

This guide shows you how to give Claude Code visual control over your Android emulator, enabling it to see screenshots, read UI elements, and interact with your React Native Expo app automatically.

1. Prerequisites

Make sure you have these installed:

  • Node.js v22+ – Check with: node –version

  • Android Debug Bridge (ADB) – Check with: adb version

  • Android SDK – Verify (often it is ~/Android/Sdk): echo $ANDROID_HOME

  • Claude Code installed – Check with: claude –version

2. Install Mobile MCP in Claude Code

Navigate to your Expo project and add Mobile MCP (@mobilenext/mobile-mcp@latest):

cd /path/to/your/expo-project

claude mcp add mobile-mcp — npx -y @mobilenext/mobile-mcp@latest

3. Start Your Android Emulator

Some basics first. dev-client flag tells Expo to use a development build, A dev client is your actual app, but with special debugging tools built in. A development build is a debug build of your app that contains expo-dev-client library. It helps you iterate as quickly as possible and provides a more flexible, reliable, and complete development environment than Expo Go. You can install any native library and configure or apply changes to a native project using app config or by creating a config plugin. You can create a development build locally or use EAS Build to create a build in the cloud.

expo run:android / expo run:ios (Build + Run)

What it does:

  • Builds the native app
  • Installs it on simulator/emulator
  • Starts Metro bundler automatically
  • Launches the app

List available emulators:

emulator -list-avds

Start your emulator:

emulator -avd YOUR_AVD_NAME &

Or use Expo to build and run (starts emulator automatically):

npx expo run:android # or ‘npm run android’ if in package.json

4. Verify Connection

Check connected devices:

adb devices

5. Start Claude Code and Test

Start Claude Code in your project:

claude

Test the connection with these prompts:

  • “List all available devices”

  • “Take a screenshot of the current screen”

6. Create CLAUDE.md Configuration

Create a CLAUDE.md file in your project root to teach Claude about your app:

Project Information

  • Framework: React Native with Expo

  • Package name from app.json

  • Build command: npx expo run:android

Testing Workflow

  1. Build the app – Run build command and wait for success

  2. Launch in emulator – Use launch_app with bundle ID

  3. Take screenshot – Capture initial state

  4. Navigate – Use accessibility labels or coordinates

  5. Verify state – List elements and compare

  6. Report back – Share screenshots and findings

7. Add Accessibility Labels to Your Components

Update your React Native components with accessibility labels for reliable testing:

<Button

onPress={handleLogin}

accessibilityLabel=”login-button”

testID=”login-button”

>

8. Available Mobile MCP Commands

Claude can automatically use these tools:

Category

Commands

Device Management

list_available_devices, get_screen_size, get_orientation, set_orientation

App Control

list_apps, launch_app, terminate_app, install_app

UI Interaction

take_screenshot, list_elements_on_screen, click_on_screen_at_coordinates, double_tap, long_press, swipe

Input

type_keys, press_button (BACK, HOME, etc.), open_url

9. Example Usage

Here are some example prompts you can give Claude:

  • “Build and launch the app, then take a screenshot of the home screen”

  • “Test the login flow with email test@example.com and password test123”

  • “Navigate through all bottom tabs and verify they load correctly”

  • “Find the settings screen and toggle dark mode”

10. Pro Tips

  1. Always use accessibility labels – Makes testing 10x more reliable than coordinates

  2. Document flows in sitemap.md – The more context, the smarter Claude gets

  3. Start simple – Begin with basic screenshots to verify everything works

  4. Use dev builds – Faster iteration than release builds

  5. Keep emulator running – Don’t close it between test runs

11. Debugging

If Mobile MCP isn’t working:

  • Start Claude Code with debug logging: claude –mcp-debug

  • Check devices: adb devices

  • Verify tools: Type /mcp in Claude Code

What You’ve Accomplished

You’ve now given Claude Code complete visual control over your Android emulator. Claude can:

  • See what’s on screen via screenshots and accessibility tree

  • Interact with your app by tapping, swiping, and typing

  • Test complete user flows automatically

  • Verify that features work as expected

  • Report issues with screenshots and detailed findings

This transforms Claude Code into a powerful automated testing assistant that works just like a human tester! 🎉

Additional Resources