New Three new products: fordway trading ERP, UEPS cloud rendering and WPECS delivery and operations View products →

Legacy adoption: read-only discovery, version detection and never changing the host

Engineering By SREYUN 0 views

New projects can be deployed from scratch with the wizard, but a more common situation looks like this: the system was delivered with a set of scripts years ago, the people who delivered it are long gone, the documentation is one config.ini, and now someone has to run it without even knowing what runs on each machine or which versions. Reinstalling is too risky, and manual checks cannot keep up. WPECS's legacy adoption was designed for exactly this.

Adoption in three steps

  1. Add hosts: import the original config.ini and the platform extracts hosts, roles and SSH accounts; or enter host addresses by hand (comma-separated lists, address ranges and CIDR blocks are supported).
  2. Discover services: the platform probes every host read-only over SSH and lists the services it finds with their versions and status.
  3. Confirm: the services become deployments and instances in the platform, with monitoring, alerts, diagnosis, inspections and backups.

How discovery and version detection work

Discovery probes read processes, listening ports, systemd units and container information, and recognize more than 30 kinds of components. Versions are the easiest part of adoption to get wrong, so WPECS checks these sources in order:

  • the program's own version output;
  • a version number in the installation directory name (for example kafka_2.12-2.2.0);
  • the container image tag;
  • failing those, inference from other nodes of the same component or from config.ini.

Dozens of Java microservices on one machine are identified one by one rather than lumped together as "a Java process". Services with neither a systemd unit nor a listening port (started by scripts or nohup, or with ports invisible to non-root users) are monitored by process command line, and containerized ones by container state; the match string can be edited in the monitoring method column.

How "never change the host" is guaranteed

  • Read only: adoption runs only read commands; nothing is installed, reconfigured or restarted.
  • Zero production impact: probes run at low priority with nice and ionice and a hard remote timeout; disk statistics cover only local file systems, so a hung NFS mount cannot stall a probe.
  • Releasing only deletes records: "release" removes the platform's records and never runs an uninstall script.
  • Re-detection previews first: an adopted deployment can be re-detected to correct versions and services; the differences are shown first and the records change only after you confirm.

What you get after adoption

Adopted services get the same operations capabilities as services the platform deployed itself: host and process monitoring (CPU, memory, threads, handles and restart counts per service), security and abnormal events, layered diagnosis, automatic diagnosis of alerts with notifications, scheduled inspections and backups, maintenance manuals, and vulnerability matching against the actual versions. Whether version detection is right directly decides whether vulnerability findings can be trusted, which is why WPECS invests so much in it.

A real lesson: what old scripts can hide

While taking over an existing project, we found a base64 and gzip encoded payload inside the original install script: it sent the complete config.ini (with plain-text passwords for every component) together with the server's public IP to a hard-coded instant-messaging bot URL. Code like this hides in thousands of lines of shell and is very hard to spot in manual review.

That is why WPECS scans custom scripts before running them: encoded payloads, undeclared outbound addresses and credential exfiltration are detected and blocked, and dangerous commands (such as rm -rf / or mkfs) require typing a confirmation phrase. If your project ever used delivery scripts of unknown origin, rotate every password as soon as possible.

Protecting host credentials

Adoption needs SSH accounts. WPECS stores host credentials encrypted with AES-256-GCM, keeps the master key separate from the data (a dedicated key file or environment variable), and never shows passwords again in the interface. It records each host's fingerprint on first connection (trust on first use) and refuses to connect if it changes, which stops man-in-the-middle attacks. Every action goes into a SHA-256 hash-chained audit log that can be verified and exported in one click.

In short

The value of legacy adoption is making a system nobody can explain visible, monitored and operable without taking any change risk. Read-only probes, low priority, preview before apply and releasing without uninstalling are what make it safe to do in production. Learn more on the WPECS product page.

Related articles