The DevOps Engineer Left. Can We Trust Our Linux Fleet? An AppSec Incident-Response Playbook
DEV Community

The DevOps Engineer Left. Can We Trust Our Linux Fleet? An AppSec Incident-Response Playbook

An AppSec-led Linux fleet investigation: legitimate-looking persistence, DFIR evidence, scalable hunts, business impact, and rebuild-or-reuse decisions

Expanded field notes · November 2026 · An AppSec-led Linux fleet investigation: from an uncomfortable handover to an evidence-backed business decision.

There is a special kind of silence in an engineering meeting when somebody asks a perfectly reasonable question: “The DevOps engineer is gone. He built most of this environment. We didn't exactly part on good terms. OMG! Are we sure the servers are clean?”🤪

And everybody looks at Security. Ahaha.. but seriously.. 🤡 Not at the antivirus dashboard. Not at the person who owns Kubernetes. At Security. Yep, man. More precisely, at the Application Security guy who happens to be in the room. Wow! Congratulations: your job description just got a free expansion. :)

I encountered this category of problem while working on the Product Security / Application Security side. I was not brought in as a full-time forensic investigator. My responsibility was to protect the product, its development environment, and its delivery chain.

But the engineer who had been operating much of the Linux infrastructure had left under difficult circumstances, the relevant operational knowledge was concentrated in one person, and there was no other specialist ready to take over the security review. So the task landed on my desk.

The uncomfortable part was not the Linux commands. It was the question behind them: Can we keep using an environment whose previous privileged operator is no longer trusted - and what evidence would justify that decision? 💀

This is an anonymized account of the problem and the approach. The company, architecture, number of hosts, timelines, and actual investigation outcome are not disclosed under NDA. Any hostnames, observations, and report excerpts below are synthetic teaching examples, not claims about the real engagement. The commands and decision model are intended to be practical, not a reconstruction of private evidence.

One more distinction before we start: a difficult departure is not proof of malicious behavior. We investigate access and integrity risks, not a former colleague's personality.

📌Disclaimer All code samples are for authorized defensive investigation. Validate against your distro, architecture, risk tolerance, and incident-handling requirements before production use.

A working product is not necessarily a trusted product

Picture a fairly ordinary software company. Its Linux machines host development environments, self-hosted runners, build agents, staging services, internal tooling, containers, and sometimes the parts of CI/CD that eventually touch production.

The applications are running. The pipelines are green. Nobody is reporting an incident. That does not tell us whether the underlying access paths are legitimate.

A former administrator with sufficient access could have left behind a completely ordinary-looking mechanism:

  • a public key in an existing user's authorized_keys
  • a second UID 0 account or an unexpected sudo grant
  • a systemd service, user unit, timer, or cron job
  • a reverse tunnel or persistent outbound session
  • modified sshd settings, firewall or NAT rules
  • an additional CI/CD runner, webhook, deploy key, cloud role, or Kubernetes credential
  • a changed startup script or binary outside package management

Some of these are legitimate administration patterns. That is precisely why finding a file or a port is not the same as finding an attacker. The goal is not to “find malware.” The goal is to reconstruct the trust boundary and establish whether someone still has a path back into the product.

A quick threat model helps:

Former privileged operator | +--> Identity: SSH, sudo, PAM, cloud IAM, VPN, SSO | +--> Persistence: systemd, cron, startup scripts, containers | +--> Remote control: inbound ports, outbound tunnels, control planes | +--> Supply chain: Git, CI/CD, runners, registries, signing keys | +--> Data / operations: backups, databases, secrets, deployment rights | v Product integrity + business impact

MITRE ATT&CK specifically documents SSH authorized-key manipulation (T1098.004), systemd service persistence (T1543.002), and cron abuse (T1053.003). These are not exotic zero-days. They're familiar operating-system features used in an unfamiliar way.

The most convincing backdoor looks like business as usual

Here is the misconception I would challenge first: "We ran antivirus, so there can't be a backdoor."

Antivirus is useful for known malware. It is not designed to decide whether a valid SSH key, a legitimate systemd unit, a cloud role, or an approved-looking automation runner should exist. A carefully chosen use of an ordinary administration feature may not require malicious code at all.

That makes authorization and provenance, not merely signatures, central to the investigation.

Legitimate-looking mechanism Why a scanner may miss the risk What I would verify Existing user + extra SSH key A public key is not malware; service accounts often have multiple keys Key fingerprint → owner → change approval → login history → alternate key sources Service/timer named like monitoring systemd is supposed to start services Unit contents, drop-ins, ExecStart, author, package ownership, destination, change history Automation token or deploy key CI/CD credentials are normal business objects Issuer, privileges, last use, expiry, where stored, who can rotate it Self-hosted CI runner Runners legitimately execute arbitrary builds Registration provenance, runner labels, job history, secret scope, egress IAM trust policy / Kubernetes role Nothing suspicious needs to be on the Linux disk Control-plane audit log, role bindings, assumable identities, privilege scope Remote management tunnel Bastions and troubleshooting tools do this all the time Business justification, process ancestry, relay endpoint, persistent configuration

This is not a claim that an unhappy former employee must have planted something. It is a threat model for validating what a once-authorized privileged identity could have done. MITRE ATT&CK covers SSH authorized-key manipulation, systemd timers, and additional Kubernetes roles. The common theme is the abuse of normal features.

From a shell on a build runner to a business incident

The business impact is not limited to someone reading /etc/passwd. Depending on that machine's privileges, an unauthorized operator could potentially:

Access available Plausible consequence Business exposure Production database or snapshot credentials Extract customer records or trade secrets Privacy obligations, notification costs, legal/reputational damage CI/CD runner with deployment secrets Replace a build artifact, inject altered code, abuse release credentials Supply-chain compromise, poisoned releases, loss of product integrity Cloud admin or powerful service account Change IAM, disable logging, manipulate resources Broad loss of control, unexpected cloud costs, recovery delays Backups and disaster-recovery permissions Delete, encrypt, or invalidate restore points Longer outage and potentially catastrophic recovery cost DNS, ingress, registry or signing permissions Redirect traffic or ship untrusted binaries Customer impact, credential theft, brand damage Monitoring / alerting control Suppress alerts and conceal later activity Greater dwell time and an unreliable incident timeline

These are hypothetical blast-radius paths, not allegations or findings from the NDA case. They explain why the risk owner cares about a tiny configuration change on a very ordinary Linux host.

One real-world lesson from GitHub's self-hosted runner guidance: a persistent runner does not provide the isolation guarantees of a clean ephemeral VM. From Product Security's point of view, the runner may be part of the product's trust root, not merely "some box DevOps manages."

The first mistake would be to scan first and think later

I know the temptation: download five scanners, launch a fleet-wide scan, get a CSV, turn everything green, go home. But we need to answer three questions before touching the first host:

  • What are we actually covering? An incomplete asset inventory makes a clean scan meaningless.
  • Do we have trustworthy access? If the person we are investigating controlled our jump host, SSH keys, or automation account, the inspection channel may be compromised as well.
  • What evidence can we afford to alter? Logging in, installing packages, restarting services, or replacing keys changes the system. Sometimes containment must happen immediately; sometimes forensic preservation comes first. Coordinate that trade-off with incident command, legal, and infrastructure owners.

I start with a temporary investigation boundary: a separate operator workstation or clean management host, newly authorized credentials, protected evidence storage, and an agreed change freeze for high-value infrastructure. Use out-of-band cloud or hypervisor snapshots where available and appropriate. Record the time, asset ID, account used, and collection method. Confirm time synchronization; timestamps without a known clock offset are a trap.

If there is active unauthorized access, prioritize containment; do not wait for an elegant forensic workflow while the attacker is moving. Otherwise, capture volatile process and network evidence before rebooting or reinstalling anything. This is a risk-based response, consistent with NIST SP 800-61 Rev. 3.

My first 60 minutes: stop the easy re-entry paths

With the relevant owners and an emergency-change procedure, I would:

  • disable the departed person's IdP, VPN, bastion, Git, CI/CD, cloud, and remote-support identities
  • invalidate active sessions, refresh tokens, PATs, deploy keys, and credentials that person could have copied
  • check shared accounts and service identities rather than assuming disabling a named user is enough
  • remove or restrict external exposure of administrative interfaces
  • review inbound and outbound access
  • protect audit logs and backups with permissions outside the former operator's control
  • verify a clean break-glass path before touching the existing admin account

Important: blindly rotating a production secret can break the application. Inventory dependencies, plan rotations, and distinguish an emergency revocation from a controlled migration. Credential rotation is part of containment and recovery - not an excuse to skip evidence collection.

Preserve the story before the story changes

For a real investigation, I maintain a short evidence and decision log from minute one. Not glamorous; absolutely necessary. At minimum:

  • Incident or assessment ID, authorized scope, assigned owner, and whether this is preventive offboarding review or confirmed incident response.
  • UTC acquisition time and source clock/time offset, collector version/hash, operator identity, access path, host/cloud resource ID.
  • Whether evidence was collected live, from a snapshot, from existing EDR, or from independently retained cloud/audit logs; record collection failures as first-class results.
  • Original data location, acquisition digest, restricted storage destination, subsequent handling and access history.
  • A SHA-256 hash detects later changes only if the starting point and collection path are trustworthy.
  • Decisions taken before collecting evidence (revoke a token, quarantine network, stop a workload), with rationale and approval.

A host with potential root compromise can lie through ps, ss, find, package tools, or even an installed sensor. Live SSH output is a triage signal, not independent proof of absence. Independent cloud control-plane logs, historical EDR telemetry, trusted snapshots, golden images, and artifact signing are complementary sources.

For particularly sensitive cases, bring in experienced DFIR/legal personnel to preserve evidence with suitable procedures; I am describing an AppSec-led first response, not a substitute for a forensic laboratory.

Also avoid relying on a magical “last 30 days” cutoff: the suspected change may predate offboarding, and timestamps can be manipulated. Build a timeline around last independently trusted state, last known authorized admin activity, actual departure, credential revocation, and present. This aligns with the risk-management framing of NIST SP 800-61 Rev. 3 (April 2025): prepare, detect, respond, recover, and explicitly manage remaining uncertainty.

Define coverage. Otherwise “all clear” means “all reachable”

The fleet is rarely just /etc/hosts on a laptop. I would join several inventories: cloud instances, virtualization inventory, Terraform state and IaC, CMDB, SSH/Ansible inventories, Kubernetes nodes, CI runners, and DNS. Then I would reconcile them.

For every asset, I want at least: asset_id, hostname, environment, role, owner, criticality, public_exposure, collection_status, and last_seen.

The resulting buckets matter:

Bucket Meaning Action In scope, collected We have recent evidence Analyze and assign confidence In scope, unreachable Host exists but did not respond Unknown, escalate and collect by alternate path Discovered, not in inventory Shadow asset Identify owner; prioritize Ephemeral / terminated Host may have disappeared Preserve cloud, orchestration, and historical logs Out of scope by design Explicitly excluded Document why and who approved it

I measure coverage, not just detections: collected / in-scope, with an explicit unknown count. If 18 of 100 machines never responded, “82 clean” does not turn into “100 secure” because PowerPoint looks nicer that way.

The tools: no silver bullet, just complementary evidence

My practical stack is intentionally layered. If the environment already has a capable EDR or osquery deployment, use it. A crisis is a poor moment to install random security agents on every production machine.

Tool Model / cost What I use it for Important limitation OpenSSH + supplied read-only collector Built-in / free Fa

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.