Configuration and Vulnerability Management for Server Fleets: Why It Matters and How I Built Gimbal

Why drift and unpatched packages are still how fleets get breached, and the design of Gimbal: an approval-based agent with its own PKI, least-privilege host access, CVE-aware patching, git-like file integrity baselines, and Ansible without SSH

Last updated November 15, 2026 · Advanced

Overview

Most of the breaches I have helped clean up did not start with a zero-day. They started with a server nobody had patched in eight months, a config file someone edited by hand during an outage and never put back, or an SSH key that should have been removed when a contractor left. The fixes for those problems have been known for twenty years. The hard part is doing them every day, on every host, and being able to prove you did.

This article covers two things:

  1. Why configuration management and vulnerability management are still the highest-return security work a team can do on a Linux fleet.
  2. How I designed and built Gimbal, a multi-tenant platform for Ubuntu and Amazon Linux fleets that does inventory, patching, CVE tracking, file integrity monitoring, and Ansible-based configuration, and the security decisions behind each part.

It is long and detailed on purpose. If you run servers, the first half should be useful whatever tooling you use. The second half is a design walkthrough with the trade-offs I made and a few mistakes I made along the way.

What Gimbal Is Built From

A Go server that is also the certificate authority, a small Go agent on each host, PostgreSQL with one database per tenant, one Cloudflare R2 bucket per tenant for file integrity objects, a React dashboard served from a Cloudflare Worker, and a Kubernetes deployment driven entirely by committed manifests and GitHub Actions. Hosts are Ubuntu 22.04/24.04 and Amazon Linux 2/2023, mostly on EC2.

Part 1: Why This Matters

Configuration Drift Is a Security Problem, Not a Tidiness Problem

Every server starts life matching some known state: an AMI, a cloud-init script, a playbook. From then on, every manual change pulls it further away. Someone raises a limit in sysctl.conf during an incident. A package gets installed to debug something and never removed. An sshd_config line gets commented out “just for now”.

Each change on its own is harmless. Together they produce three real problems:

  • You cannot reason about the fleet. If ten web servers are supposed to be identical but three of them differ in ways nobody wrote down, every incident starts with archaeology.
  • You cannot tell an attack from an admin. Attackers make the same kinds of changes admins do: a new key in authorized_keys, a cron entry, a modified binary, a new systemd unit. If unplanned changes are normal, a malicious one blends right in.
  • You cannot rebuild. When a host is compromised or lost, the only safe move is to replace it. That only works if its correct state is written down somewhere other than on the host itself.

Configuration management (Ansible, Puppet, Chef, Salt) fixes the first and third problems by making the desired state code. File integrity monitoring (Tripwire, AIDE, OSSEC) addresses the second by noticing when the actual state changes. Most teams have one or the other. Very few connect them, which means config management runs generate a stream of “unexpected” integrity alerts that people learn to ignore. That is the gap I most wanted to close.

Unpatched Software Is Still the Front Door

The other half is patching. Public vulnerability data keeps saying the same thing: a large share of real-world exploitation targets vulnerabilities that have had a fix available for months. CISA’s Known Exploited Vulnerabilities catalog exists precisely because so many breaches use old, well-understood bugs.

The reasons teams fall behind are not technical:

  • Visibility. Nobody has a single list of which hosts are missing which security updates.
  • Prioritization. A typical Ubuntu host can have dozens of pending updates. Which ones actually matter this week?
  • Fear of breaking things. “Patch everything” on a production database at 2 PM is how outages happen, so it gets put off.
  • No proof. Auditors, customers and management ask “are we getting better?” and the honest answer is usually “probably”.

A useful vulnerability program needs all four: inventory, prioritization by real-world risk, controlled rollout, and a history you can show someone.

What I Wanted From a Tool

I have used most of the commercial and open-source options in this space at some point in my career. I wanted a platform with these properties, and I could not find one that had all of them together:

  1. Nothing joins without approval. A host should be enrolled like a machine joining a domain, not by anyone who has a token.
  2. No inbound access to hosts. No SSH from a control server, no open ports, no bastion. Hosts in private subnets should just work.
  3. Least privilege on the host. The agent should not be a root daemon that does whatever the server says.
  4. Patching and CVEs in one place, prioritized by what is actually being exploited.
  5. File integrity with history and recovery, not just alerts: see what changed, accept it or put it back.
  6. Configuration as code from Git, applied through the same trusted channel.
  7. Multi-tenant from day one, with real isolation between customers.
  8. Prove it over time: graphs that show the numbers improving.

Part 2: Architecture

At a high level there are three planes:

  • The agent plane. Each host runs gimbal-agent, which holds a client certificate and keeps one outbound mutual-TLS WebSocket connection to its tenant’s agent endpoint (<tenant>.agents.gimbal-hq.com). Jobs, live command output and file integrity events all flow over that connection. This plane is DNS-only (not proxied through a CDN) because the TLS session has to terminate at the Gimbal server for mTLS to mean anything.
  • The control plane. The Go server handles enrollment, the certificate authority, the API, job scheduling and the file integrity store. It runs on Kubernetes behind Traefik with TLS passthrough for agents.
  • The dashboard plane. The React dashboard is served from a Cloudflare Worker at <tenant>.gimbal-hq.com. Static assets come from the edge; API calls are forwarded to the origin, which can require a shared secret header so that only requests coming through the Worker are accepted.

Each tenant gets its own PostgreSQL database, its own intermediate CA, its own R2 bucket, and its own set of encryption keys derived from a platform secret. A small control database holds only the tenant list, platform configuration, and data that is genuinely shared (public vulnerability feeds).

Tenant provisioning is a GitHub Actions workflow: it validates the slug, creates DNS records and the Worker route, creates the R2 bucket, asks the platform API to create the tenant (database, CA, routes), and emails the first administrator a one-time setup link. Nothing about a new tenant is created by hand.

Part 3: Trust and Enrollment

FreeIPA-Style Joining

I modeled enrollment on the way FreeIPA and Active Directory handle machines joining a domain:

  1. The agent generates its own private key. The key never leaves the host.
  2. It sends a join request containing a certificate signing request and host facts.
  3. The request sits in a queue until an administrator approves it (or a join token, or the host’s AWS instance identity document, pre-authorizes it).
  4. On approval, the tenant CA issues a client certificate valid for 90 days, renewed automatically while the host stays enrolled.
  5. From then on, the host authenticates every connection with that certificate.

Two rules came straight from operating real fleets:

  • Denied and revoked are permanent. A host that was revoked cannot quietly ask again. Its records are never deleted. The only way back is for someone with root on the host to clear its identity and enroll it as a new machine, which is visible and audited.
  • The agent only stops itself on signed evidence. An attacker who can tamper with the network should not be able to make agents uninstall themselves or stop reporting. Agents only act on revocation or “you are blocked” statements that are signed by the CA they trust.

The Certificate Hierarchy

The PKI went through one significant redesign after a security review. The current design is:

Offline root CA (kept off the platform)
 └── Issuing CA (client auth only, path length 1)
      ├── Tenant A intermediate ── host certificates
      ├── Tenant B intermediate ── host certificates
      └── ...

Server CA (separate, name-constrained to agents.gimbal-hq.com)
 └── agent endpoint server certificates

The important choices:

  • The root is offline. The running platform holds the issuing CA, not the root. Losing the platform is bad; it is not “re-key every host in every tenant” bad.
  • Client and server trust are separate. The CA that signs host certificates cannot sign server certificates, and the CA that signs server certificates is name-constrained to the agent domain. A compromised tenant intermediate cannot be used to impersonate the Gimbal server to agents.
  • Agents pin their trust. The agent package ships the roots it trusts. It does not rely on the system trust store for the agent channel.
  • Keys are encrypted at rest with a platform secret, and the CA code signs through a narrow signer interface so a hardware or cloud KMS can replace the in-process key later.

Certificate revocation is published as a CRL, with a guard: if a single change would revoke a large share of a tenant’s hosts at once, publication pauses until an administrator confirms it. An accidental mass revocation is an outage, and an attacker with partial access could try to use it as one.

Part 4: Least Privilege on the Host

The first version of the agent ran as root, like almost every agent in this category. A security review (which I commissioned from a separate review process and treated as adversarial) pointed out what that means: anyone who controls the server controls every host as root, through whatever the agent happens to accept.

The redesign splits the agent into two parts:

  • gimbal-agent runs as an unprivileged gimbal user. It talks to the server, collects inventory it can read without privileges, and runs the job loop.
  • gimbal-priv is a small socket-activated root helper. It accepts a fixed set of verbs (refresh package lists, apply patches, reboot, self-update, capture or restore a file, run a command as an unprivileged user, run a command as root, and the Ansible verbs). Each verb validates its arguments strictly. There is no “run this shell string as root” unless the host allows it.

What the helper allows is decided on the host, not by the server, through an install profile written to a root-owned /etc/gimbal/policy.conf:

ProfileWhat it allows
observeInventory, update scanning, file integrity detection (hashes only). No changes to the host.
managedEverything in observe, plus patching, reboots, agent self-update, file content capture and restore, commands as an unprivileged user, and Ansible running as a dedicated gimbal-ansible user that escalates with sudo when a task asks for become.
fullEverything in managed, plus commands as root from the console and Ansible running as root.

The installer refuses to run without --profile, so nobody ends up with full by accident. The policy file can only subtract from the profile: a host on managed can add deny = ansible, but nothing the server sends can add a verb the profile does not include.

The managed profile’s use of sudo was a deliberate choice. A task with become: true still gets root, so it is not a security boundary against a malicious playbook. What it buys is that every escalation is explicit in the playbook and recorded in the host’s own sudo log, separate from Gimbal’s audit trail.

Part 5: Patch Management

Inventory

The agent reports installed packages and pending updates on a schedule. On Ubuntu it reads the dpkg database and the apt candidate versions; on Amazon Linux it uses dnf check-update and updateinfo. Each pending update records whether it is a security update and which advisory covers it (USN on Ubuntu, ALAS on Amazon Linux). On EC2 it also reads the instance metadata service for account, region, VPC and tags, so the fleet can be grouped and filtered the way AWS teams already think about it.

Tags are namespaced so they cannot be confused: aws: for tags read from EC2, custom: for tags set in Gimbal, and auto: for facts Gimbal derives (such as the install profile). Targeting a patch job at aws:Environment=prod cannot be satisfied by someone setting a custom tag with the same name.

Applying Updates

From the console you can patch one host or a selection:

  • Security only or all updates, with exclude patterns.
  • Pick individual packages: tick the updates you want on a host, or use the fleet-wide Updates view, where pending updates are grouped by package (for example, openssl on 14 hosts) and you can roll one package out everywhere it is pending.
  • Optional reboot when the package manager says one is required.

Jobs that touch more than a handful of hosts require the user to re-authenticate first. A stolen session should not be able to patch-and-reboot the whole fleet in one click.

Updating the Agent Itself

The agent is distributed as .deb and .rpm packages from signed APT and YUM repositories at packages.gimbal-hq.com (hosted on R2). The install script verifies the repository signing key against a SHA-256 fingerprint you pass on the command line, so a compromised download path cannot swap the key. The APT metadata carries a Valid-Until date and is re-signed twice a week, which stops an attacker from replaying old metadata to hold hosts on a vulnerable version.

Agent updates use a staged rollout: a canary group updates first, the rest wait for a soak period, and the rollout stops automatically if canaries fail to come back on the new version.

Part 6: Vulnerability Management

Knowing that a host has 23 pending updates is not enough. The question that matters is “which of my hosts are exposed to vulnerabilities that are being exploited right now, and what fixes them?”

Gimbal syncs public data daily into the shared control database:

  • Ubuntu Security Notices: each USN with its CVEs, affected packages, and fixed version per release.
  • Amazon Linux advisories (ALAS) for AL1, AL2 and AL2023. Agents on Amazon Linux also report CVE IDs directly from the repository’s updateinfo metadata.
  • NVD for CVSS scores, fetched only for CVEs that actually appear in advisories, and rate-limited to NVD’s public limits.
  • FIRST EPSS: the probability a CVE will be exploited in the next 30 days.
  • CISA KEV: CVEs known to be exploited in the wild.

The server joins each host’s pending updates to advisories and their CVEs. That gives a Vulnerabilities view sorted by real risk (known-exploited first, then severity, then EPSS), and a page per CVE listing the affected hosts, the package version that fixes it, and a button that opens the patch flow with exactly those packages and hosts selected.

The sync runs on one server replica at a time under a PostgreSQL advisory lock, saves progress after every page, and uses upserts throughout, so a restart in the middle of a backfill costs nothing.

Part 7: File Integrity Monitoring

This is the part of Gimbal I spent the most design time on.

Baselines Like Git Commits

When an administrator initializes file integrity on a host, the agent walks the configured paths (by default the operating system itself: /etc, /usr, /bin, /sbin, /lib*, /boot, /root, cron spools; other directories are opt-in) and builds a Merkle tree: each file is hashed, each directory is a tree object listing its children’s hashes and attributes, and the root hash identifies the entire state of the host. Those objects are content-addressed and stored off the host, in the tenant’s bucket. A baseline is a commit pointing at a root tree.

Because the trees are content-addressed, the second and later scans only upload what changed, and comparing two states is a tree diff, not a full file-by-file comparison.

A baseline can only be created once per agent installation. If an attacker gets into the console, they should not be able to quietly re-baseline a compromised host so that their changes become “normal”. A new baseline requires removing and reinstalling the agent, which creates a new identity.

Detection

After the baseline, the agent watches for changes in real time with fanotify, the Linux kernel’s filesystem notification API, which can watch whole mounts without a kernel module. Scheduled full rescans catch anything the real-time monitor could miss (for example, changes made while the agent was stopped).

Every detected change becomes an open item with the before and after attributes, size, mode, owner, hash, and a diff for text files whose content was captured.

Accept or Revert

Each change ends in one of two decisions, and both are recorded:

  • Accept folds the new state into a new baseline commit.
  • Revert puts the file back. For small configuration files (/etc, cron, SSH directories, up to 1 MiB) the content is stored, so Gimbal can restore the exact bytes, owner and mode. For files owned by an OS package (binaries, libraries), Restore from package reinstalls that exact installed package version from the distribution repository, re-hashes the file, and only marks the change reverted if the result matches the baseline. Package configuration files are excluded from that path, since they are restored from captured content instead.

Revert is deliberately conservative. It refuses to restore content the host never had at that path, refuses to follow symlinks in parent directories, and will not delete anything that existed before the baseline.

Capturing Secrets, Safely

Here the product goal and the security review disagreed, and it was the most useful disagreement of the project.

The review flagged that Gimbal stored copies of files like /etc/shadow, SSH host keys and authorized_keys. Its default recommendation was to stop capturing them.

But those are exactly the files you need back after ransomware or a rootkit. If an attacker adds a key to authorized_keys or replaces host keys, “here is the previous version, restore it” is the whole point. So we kept capture and changed how it works:

  • Files are classified on the host. Anything that is not world-readable, or matches a list of known secret paths, is sealed: encrypted on the host, before upload, to a per-tenant sealing public key using HPKE (X25519). The server stores ciphertext it cannot read in normal operation.
  • Sealed content is stored per host. A host can only ever retrieve objects it uploaded itself, and sealed content is only released back to that same host inside an audited restore job that needs a separate permission.
  • Sealed content is never shown to a person in the console. You can see that shadow changed and restore it; you cannot read it.
  • Tenants can opt into strict mode, where the decryption key is held by the tenant and supplied only when a restore is requested.
  • Everything else is encrypted at rest with per-object AES-GCM, and object names are HMACs of the content hash, so the bucket does not leak which files a host has.

The general lesson: when a security finding conflicts with a product requirement, the answer is rarely “remove the feature”. It is usually “keep the capability and change who can see what, and when”.

Part 8: Configuration Management Without SSH

The newest part of Gimbal is Projects, modeled on AWX/Ansible Tower: a project is a Git repository and branch, a template is a playbook plus an inventory selector and variables, and a run applies it.

The difference is how Ansible reaches the hosts. AWX connects over SSH from a control node, which means SSH keys to manage, inbound port 22, and usually a bastion. Gimbal already has an authenticated, encrypted, outbound connection to every host, so I used that instead:

  • The server runs Ansible, in a fresh Kubernetes Job per run. The runner container is unprivileged, has a read-only filesystem, no Kubernetes credentials, a network policy that only allows it to talk to the Gimbal server, and a single run-scoped token.
  • A custom Ansible connection plugin (gimbal) implements exec_command, put_file and fetch_file by sending them to the server, which relays them to the host’s agent over the existing mTLS channel. Ansible modules, file copies, templates, roles and handlers all work normally.
  • Agentless EC2 hosts are next: the runner image already includes the aws_ssm connection plugin, so hosts without the agent can be reached through AWS Systems Manager once the AWS account connector lands.
  • Repositories are fetched with a GitHub App installation token (one hour, read-only, per repository), a fine-grained personal access token, or a deploy key Gimbal generates. Runs always use a pinned commit SHA.

The runner container is sized from the run’s parallelism: memory and CPU grow with the number of hosts Ansible works on at once, up to a cap. Parallelism is also where plan limits apply. Every plan can run a playbook against the entire fleet; larger plans run against more hosts at the same time. I chose that over limiting the number of targets per run, because limiting targets just makes people split one change into twenty runs, and concurrency is what actually drives cost.

The piece that will tie this back to Part 1 is on the roadmap: making file changes attributable to the playbook run that caused them, so file integrity can tell “this changed because commit a1b2c3d of the web-baseline playbook ran” from “this changed and nobody knows why”. The second kind is the one worth waking up for.

Part 9: Identity, Access and Audit

People sign in through Gimbal ID, an OpenID Connect provider I run for my products. Roles are granted per application using OpenRBAC, a small open specification I wrote for this: each application publishes a manifest of the actions it supports (for example patch.apply, fim.revert, projects.run), marks the dangerous ones, and suggests roles for common personas (operator, security, auditor). The identity provider fetches the manifest and puts the granted actions in the token. Gimbal checks for the exact action on every request.

Local accounts exist only for break-glass access and are created from the command line on the server. They require an authenticator app (TOTP) with recovery codes. Sessions end after 30 minutes idle and 12 hours absolute. High-risk actions (running commands on many hosts, reverting sealed files, running playbooks) require a fresh sign-in within the last few minutes.

Everything that changes state is written to an audit log with the actor, session, source address and details. The root helper on each host also keeps its own audit log, so the host has an independent record of what it was asked to do and by which job.

Part 10: Proving It Over Time

The last requirement was being able to answer “are we getting better?” with data.

Gimbal takes a daily snapshot per tenant of the numbers that matter: hosts and their status, pending updates and pending security updates, percentage of hosts fully patched, open advisories and CVEs, reboots required, agents out of date, hosts with file integrity monitoring, open integrity changes, and integrity changes accepted and reverted. A Trends page charts them over 30 days, 90 days or a year, shows the change against the start of the range, and exports CSV for auditors and management.

The snapshot runs hourly and keeps the last value of each day, under an advisory lock so multiple replicas do not double-count.

Lessons From Building It

Commission an Adversarial Review Early

The review produced nearly 40 issues. A handful were simple bugs. Most were design assumptions I had not questioned: a root agent, a single online root CA, a browser-only Origin check applied to agents, plaintext content in object storage. Fixing them early was cheap compared to fixing them with customers on the platform.

The most valuable part was not the findings themselves but writing down, on each issue, why the product needed something and finding a version that satisfied both sides. The sealed-capture design above came directly out of one of those threads.

Some Things I Got Wrong

  • I tried to migrate instead of starting over. Moving existing integrity data to the encrypted format turned out to be very slow, because it walked every tree object. For a pre-launch tenant with a few hosts, wiping the data and re-baselining was faster and also removed every plaintext copy at once.
  • A “Copy” button inside a form submitted the form. On the authenticator setup step, tapping Copy sent an empty code, which counted as a failed attempt and locked the account. Every button now has an explicit type, and the server no longer charges an attempt for an empty submission.
  • Newer sudo rejected a line in the sudoers file. sudo-rs, now the default on newer Ubuntu releases, does not know requiretty, so visudo -c refused the whole file. Validating the file with visudo -c before installing it is what caught it.
  • Config-only deploys did not restart the server. Secrets are read at start, so a deploy that changed a secret but not the image left the old pod running. The pod template now carries a hash of the configuration objects, so a config change rolls the pod.

Keep Production Declarative

Everything in production comes from committed manifests applied by CI: the namespace and permissions, the deployment, network policies, secrets rendered from GitHub secrets. The server itself manages the per-tenant ingress routes it needs, through narrowly scoped permissions. When something is wrong, the fix is a pull request, and the history of how production got to its current state is in Git.

What’s Next

  • An AWS account connector, to run playbooks through Systems Manager on hosts without the agent and to import GuardDuty, Inspector and Security Hub findings next to Gimbal’s own data.
  • Scheduled check-mode runs as drift and compliance reports.
  • Automatic acceptance into the integrity baseline for changes made by approved playbook runs.
  • Batched runs for very large fleets.

If you are working on something similar, or want to try Gimbal on your own hosts, the fleet module is in early access at gimbal-hq.com/fleet. I am also happy to talk through any of these design decisions; my contact details are below.

Let's talk about your infrastructure

Tell me about your architecture, automation, or modernization goals.

Book a Consultation