<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Security on Embark Systems</title>
        <link>https://embark.systems/en/tags/security/</link>
        <description>Recent content in Security on Embark Systems</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Wed, 25 Nov 2026 18:00:00 +0800</lastBuildDate><atom:link href="https://embark.systems/en/tags/security/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>emfor 0.8.0: A Jumping Host Clock Is Seen, Credential Files Must Be Regular Files, and the Log Can Be JSON</title>
            <link>https://embark.systems/en/posts/emfor-0.8.0/</link>
            <pubDate>Wed, 25 Nov 2026 18:00:00 +0800</pubDate>
            <guid>https://embark.systems/en/posts/emfor-0.8.0/</guid>
            <description>&lt;img src=&#34;https://embark.systems/images/emfor-0.8.0.png&#34; alt=&#34;Featured image of post emfor 0.8.0: A Jumping Host Clock Is Seen, Credential Files Must Be Regular Files, and the Log Can Be JSON&#34; /&gt;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/embark-systems/emfor&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;emfor&lt;/a&gt; is an open-source health-check daemon that runs on every application host. It checks the backends of the services your applications use and writes which ones are healthy into a local file; applications ask a client library which backend to connect to and get an answer in about a microsecond, without a network round trip.&lt;/p&gt;&#xA;&lt;p&gt;0.8.0 was released on 2026-11-25. The 0.7 releases were about what the daemon trusts; this one is about &lt;strong&gt;whether you can see it when something goes wrong&lt;/strong&gt;. A host clock set back, a peer member whose clock is off, a member that never sends its results: before, each of these only made the answers quietly strange. Now emfor detects them and says so. The release also has several &lt;strong&gt;breaking changes&lt;/strong&gt;; read section 1 before you upgrade.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;0.8.0 is probably the last release that breaks compatibility.&lt;/strong&gt; We expect the releases after it to fix small problems and nothing more: no new breaking changes to the config, the commands, &lt;code&gt;status --json&lt;/code&gt;, the store, the client API, the metrics, the DNS answers or the plugin protocol. This is what we intend, not a promise: if a security fix cannot be done without a breaking change, we will make it and say so at the top of the changelog entry, under &lt;strong&gt;Breaking&lt;/strong&gt;, as we always do.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-read-this-before-upgrading&#34;&gt;1. Read this before upgrading&#xA;&lt;/h2&gt;&lt;p&gt;The store format (2) and the plugin protocol (1) are unchanged. These are the things to watch:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;libemfor&lt;/code&gt; is &lt;code&gt;libemfor.so.0.8&lt;/code&gt;&lt;/strong&gt; (it was &lt;code&gt;libemfor.so.0.7&lt;/code&gt;). A program linked against the C library has to be built again, and the Python, Perl, PHP and Go clients of this release load the new name. The old and the new library can sit side by side: install the new one, move the programs one by one, and remove the old file after the last one.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Credential files must be regular files of bounded size.&lt;/strong&gt; A &lt;code&gt;password_file&lt;/code&gt;, a RADIUS &lt;code&gt;secret_file&lt;/code&gt;, a &lt;code&gt;tls_key_file&lt;/code&gt;, a &lt;code&gt;tls_cert_file&lt;/code&gt; or a &lt;code&gt;ca_file&lt;/code&gt; that is a FIFO, a device or a directory, or larger than the limit (64 KiB; &lt;code&gt;tls_cert_file&lt;/code&gt; and &lt;code&gt;tls_key_file&lt;/code&gt; 1 MiB; &lt;code&gt;ca_file&lt;/code&gt; 8 MiB), is refused now. A link to a regular file still works. Before, a path that pointed at a FIFO stopped the thread that read it. systemd &lt;code&gt;LoadCredential&lt;/code&gt;, Docker secrets and Kubernetes secrets end up as regular files, so none of them is affected as far as we know; we did not try each.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A heartbeat in the future counts as stale.&lt;/strong&gt; When the host clock is set back by more than &lt;code&gt;EMFOR_MAX_STALENESS&lt;/code&gt; (3 s by default) and the daemon then stops writing, clients no longer take the store for fresh until the clock catches up. A lookup then sees every backend as unknown: a &lt;code&gt;closed&lt;/code&gt; service gives &lt;code&gt;ALL_DOWN&lt;/code&gt; (exit status 1 of &lt;code&gt;emfor lookup&lt;/code&gt;), an &lt;code&gt;open&lt;/code&gt; service gives every backend, healthy or not. With a live daemon the clients see a stale store for up to about a second, until its next heartbeat. &lt;code&gt;emfor status&lt;/code&gt; uses a fixed 3 s and exits with 1 in that case, where it exited with 0 before.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;heartbeat_age_ms&lt;/code&gt; can be negative&lt;/strong&gt; in &lt;code&gt;emfor status --json&lt;/code&gt; and &lt;code&gt;emfor lookup --explain --json&lt;/code&gt;, when the heartbeat is later than the reader&amp;rsquo;s clock. A parser has to accept a negative number. In the Rust crate &lt;code&gt;emfor-client&lt;/code&gt;, &lt;code&gt;Explanation.heartbeat_age_ms&lt;/code&gt; is an &lt;code&gt;i64&lt;/code&gt; now (it was a &lt;code&gt;u64&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Upgrade every member of a peer group before setting &lt;code&gt;[peers] cipher = &amp;quot;aes-256-gcm&amp;quot;&lt;/code&gt;:&lt;/strong&gt; an earlier version counts &lt;code&gt;EMP4&lt;/code&gt; as &lt;code&gt;malformed&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;A config that uses a key added here (&lt;code&gt;[log] format&lt;/code&gt;, &lt;code&gt;[peers] cipher&lt;/code&gt;, &lt;code&gt;[metrics] allow&lt;/code&gt;, the &lt;code&gt;ca_file&lt;/code&gt; of an &lt;code&gt;http&lt;/code&gt; check) fails &lt;code&gt;emfor check-config&lt;/code&gt; on an earlier version, so take it out before a downgrade.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;2-clock-trouble-is-visible-now&#34;&gt;2. Clock trouble is visible now&#xA;&lt;/h2&gt;&lt;p&gt;Four things in this release deal with clocks.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The daemon logs a jump of the host clock.&lt;/strong&gt; At each heartbeat (once a second) it compares how far the wall clock moved with how far a monotonic clock moved. When they differ by more than 2 seconds it writes a &lt;code&gt;warn&lt;/code&gt; line with &lt;code&gt;event=clock_jumped&lt;/code&gt;, &lt;code&gt;direction&lt;/code&gt; (&lt;code&gt;forward&lt;/code&gt; or &lt;code&gt;backward&lt;/code&gt;) and &lt;code&gt;jump_ms&lt;/code&gt;, and &lt;code&gt;emfor_clock_jumps_total&lt;/code&gt; counts it. A busy or late tick moves both clocks alike and is not reported. At most one line is written every 10 seconds, but every jump is counted. The heartbeat, the store and the client&amp;rsquo;s staleness decision are the same.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A peer member whose clock is off is shown before its messages are dropped.&lt;/strong&gt; From every message of a member that passes the checks, the daemon measures the member&amp;rsquo;s timestamp minus its own clock. When the last three messages are all at least 2 seconds off in one direction, &lt;code&gt;emfor status&lt;/code&gt; has a line &lt;code&gt;peers: clock of &amp;lt;member&amp;gt; is &amp;lt;n.n&amp;gt; s behind this host&lt;/code&gt; (or &lt;code&gt;ahead of&lt;/code&gt;), &lt;code&gt;emfor status --json&lt;/code&gt; has &lt;code&gt;peers.clock_offsets&lt;/code&gt;, and the log has a &lt;code&gt;warn&lt;/code&gt; and later an &lt;code&gt;info&lt;/code&gt;. The new metric &lt;code&gt;emfor_peer_clock_offset_seconds{peer}&lt;/code&gt; exists for every measured member. The 5-second limit, the votes and the protocol are unchanged.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A member that sends no results is shown.&lt;/strong&gt; When a member is an assigned checker of a backend, is live and does not leave the service out, but sends no fresh result for it (it lacks the service or the backend, its check keeps giving &lt;code&gt;error&lt;/code&gt;, or its packets do not arrive), the other members report it after 10 seconds or 6 intervals of the service, whichever is longer. &lt;code&gt;emfor status&lt;/code&gt; has a line &lt;code&gt;peers: no results from &amp;lt;member&amp;gt; for &amp;lt;service&amp;gt; (&amp;lt;n&amp;gt; backends)&lt;/code&gt;, &lt;code&gt;--json&lt;/code&gt; has &lt;code&gt;peers.silent_checkers&lt;/code&gt;, and there are the metric &lt;code&gt;emfor_peer_silent_checkers&lt;/code&gt; and a log line. Votes and the wire format are unchanged.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Three small fixes.&lt;/strong&gt; One: when a clock offset state ends because no measurement arrived for 10 s, the log no longer says &lt;code&gt;within limits again&lt;/code&gt;; it says the measurement is missing and the state is cleared, and keeps the old line for a member that is really back. Two: &lt;code&gt;emfor status&lt;/code&gt; says that the clock of this host differs from every member only when every member is off in the same direction; with members on both sides it lists them one by one. Three: the JSON log, below.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;We measured the jump detection on FreeBSD 15.1 (an arm64 VM): 6 busy &lt;code&gt;yes&lt;/code&gt; loops and a looping &lt;code&gt;dd&lt;/code&gt; for 11 minutes (about 675 ticks) gave a largest difference of 1 ms and no line; setting the clock +30 s, -45 s and +15 s gave three counts and two lines (the -45 s step was counted but not logged, because it fell inside the 10-second period). The same load for 10 minutes in a Debian container on Linux 7.2 (arm64) also gave 1 ms; a container shares the host&amp;rsquo;s clock, so it was not stepped there. &lt;strong&gt;Not measured: x86-64, and a host that suspends and resumes.&lt;/strong&gt; The 2-second threshold and the 10-second period are choices, not tuned values.&lt;/p&gt;&#xA;&lt;h2 id=&#34;3-the-log-metrics-and-peer-messages&#34;&gt;3. The log, &lt;code&gt;/metrics&lt;/code&gt; and peer messages&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The log can be JSON.&lt;/strong&gt; New &lt;code&gt;[log] format = &amp;quot;json&amp;quot;&lt;/code&gt; (default &lt;code&gt;&amp;quot;text&amp;quot;&lt;/code&gt;) writes one JSON object per line, with the fields of the event at the top level and &lt;code&gt;timestamp&lt;/code&gt;, &lt;code&gt;level&lt;/code&gt;, &lt;code&gt;target&lt;/code&gt; and &lt;code&gt;message&lt;/code&gt;. It is JSON once the daemon has started with it; the lines before that (plugin start, config errors, warnings about the config files) are text. The state change line gains &lt;code&gt;event=backend_state_changed&lt;/code&gt;; &lt;code&gt;event&lt;/code&gt;, &lt;code&gt;service&lt;/code&gt;, &lt;code&gt;backend&lt;/code&gt;, &lt;code&gt;from&lt;/code&gt;, &lt;code&gt;to&lt;/code&gt;, &lt;code&gt;reason&lt;/code&gt;, &lt;code&gt;timestamp&lt;/code&gt; and &lt;code&gt;level&lt;/code&gt; are stable fields now.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A reload logs what it changed.&lt;/strong&gt; After an accepted reload the log has one line per difference (services and backends added, removed or changed, &lt;code&gt;drain&lt;/code&gt;, a changed check definition by digest only, peer group settings), at most 50 per reload and then one line for the rest, before &lt;code&gt;config reloaded&lt;/code&gt;. The daemon also logs the SHA-256 of every config file it reads, at each start and reload. Check options and secrets are never logged. The log cannot say who changed a file; use auditd for that.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A peer secret rotation has a stable line.&lt;/strong&gt; When the content of &lt;code&gt;[peers] secret_file&lt;/code&gt; changes (no reload needed), the daemon logs one &lt;code&gt;info&lt;/code&gt; line with &lt;code&gt;change=peers_secret_rotated&lt;/code&gt; and &lt;code&gt;secret_file=&amp;lt;path&amp;gt;&lt;/code&gt;. It never holds the secret or a hash of it.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;[metrics] allow&lt;/code&gt; limits who can read &lt;code&gt;/metrics&lt;/code&gt;.&lt;/strong&gt; A list of networks (&lt;code&gt;&amp;quot;10.0.0.0/8&amp;quot;&lt;/code&gt;, &lt;code&gt;&amp;quot;fd00::/8&amp;quot;&lt;/code&gt;); a connection from any other source gets &lt;code&gt;403 Forbidden&lt;/code&gt;. Loopback is not exempt once &lt;code&gt;allow&lt;/code&gt; is set. Without &lt;code&gt;allow&lt;/code&gt; nothing changes, except a warning at start and reload when &lt;code&gt;listen&lt;/code&gt; has a non-loopback address. A changed &lt;code&gt;allow&lt;/code&gt; needs a restart.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;http&lt;/code&gt; checks take a &lt;code&gt;ca_file&lt;/code&gt;.&lt;/strong&gt; For a server whose certificate a private CA signed, point &lt;code&gt;ca_file&lt;/code&gt; at the CA&amp;rsquo;s PEM file instead of installing it system-wide or turning off &lt;code&gt;tls_verify&lt;/code&gt;. Only that file is trusted, not the system&amp;rsquo;s CAs. A replaced file takes effect at the next check.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Peer messages can use AES-256-GCM (&lt;code&gt;EMP4&lt;/code&gt;).&lt;/strong&gt; New &lt;code&gt;[peers] cipher&lt;/code&gt;: the default &lt;code&gt;&amp;quot;chacha20-poly1305&amp;quot;&lt;/code&gt; changes nothing; &lt;code&gt;&amp;quot;aes-256-gcm&amp;quot;&lt;/code&gt; makes every member send &lt;code&gt;EMP4&lt;/code&gt;; it needs &lt;code&gt;encrypt = true&lt;/code&gt; and is reloadable. Chapter 13 has a FIPS section that is blunt about it: emfor has no FIPS mode, this is a different cipher, not a validated module. On one arm64 machine a datagram of 150 to 500 bytes took 0.7 to 1.5 microseconds to seal or open in &lt;code&gt;EMP3&lt;/code&gt; and 0.8 to 1.0 in &lt;code&gt;EMP4&lt;/code&gt;. &lt;code&gt;tools/bench-peer-crypto.sh&lt;/code&gt; repeats it; not run on x86-64.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;emfor status&lt;/code&gt; no longer calls an empty store a version problem.&lt;/strong&gt; A store the daemon never wrote to (it exited at start because the DNS port was taken, for example) now says &lt;code&gt;store is empty&lt;/code&gt; and points at the log, instead of &lt;code&gt;store format version (missing)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;4-what-the-manual-says-now&#34;&gt;4. What the manual says now&#xA;&lt;/h2&gt;&lt;p&gt;Many items of this release changed &lt;strong&gt;only the manual, not the program&lt;/strong&gt;, and each says what we actually ran and what we did not.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;A &lt;a class=&#34;link&#34; href=&#34;https://github.com/embark-systems/emfor/blob/v0.8.0/docs/threat-model.md&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;threat model&lt;/a&gt;:&lt;/strong&gt; what emfor protects, which boundaries an attacker can reach (backends, plugins, DNS, &lt;code&gt;/metrics&lt;/code&gt;, the peer UDP port, local users), where each defense is and which gaps are open. It comes from reading the code, not from a penetration test. It records that the peers check the sender against the UDP source address only: one member that holds the secret cannot turn a backend down (2 of its 3 assigned checkers must say down); two colluding members can.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Vector.&lt;/strong&gt; Chapter 14 has a section: the &lt;code&gt;prometheus_scrape&lt;/code&gt; source for &lt;code&gt;/metrics&lt;/code&gt;, and the JSON log through a &lt;code&gt;remap&lt;/code&gt; with &lt;code&gt;parse_json!&lt;/code&gt;, from a file, from the journal or, on FreeBSD, through a &lt;code&gt;sed&lt;/code&gt; that cuts the syslog prefix into the &lt;code&gt;stdin&lt;/code&gt; source. &lt;code&gt;examples/vector/&lt;/code&gt; has the three configs, run with Vector 0.62.0 in docker. The FreeBSD 15.1 arm64 repository has no Vector package, so Vector itself was not run on FreeBSD.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;SELinux and AppArmor.&lt;/strong&gt; The rpm was run on Rocky Linux 9.9 (aarch64 VM, &lt;code&gt;targeted&lt;/code&gt;, enforcing): the daemon ran as &lt;code&gt;unconfined_service_t&lt;/code&gt; and, with &lt;code&gt;tcp&lt;/code&gt;, &lt;code&gt;http&lt;/code&gt; and &lt;code&gt;exec&lt;/code&gt; checks, DNS, &lt;code&gt;/metrics&lt;/code&gt;, an encrypted peer group, the store and a reload, raised no AVC denial. The deb was run on Ubuntu 24.04 (arm64 VM, AppArmor enabled): no profile applies to the daemon and the kernel log has no &lt;code&gt;apparmor=&amp;quot;DENIED&amp;quot;&lt;/code&gt; line. We do not ship a policy module. x86-64 is untested.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Ping and SCTP.&lt;/strong&gt; Chapter 6: the &lt;code&gt;exec&lt;/code&gt; recipes were run under the packaged unit on Rocky Linux 9.9 and Ubuntu 24.04. On Ubuntu the &lt;code&gt;ping&lt;/code&gt; check failed for every backend until &lt;code&gt;net.ipv4.ping_group_range&lt;/code&gt; included the &lt;code&gt;emfor&lt;/code&gt; group. We still do not plan a built-in ICMP or SCTP check.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;HAProxy and 503.&lt;/strong&gt; With two name servers that disagree and several backends on one IP (one host, several ports), HAProxy 3.4.8 answered a few requests with 503: all six runs of 400 requests had some (1 to 21 per run), while six runs with a separate IP per backend had none. FreeBSD 15.1 (HAProxy 3.4.4) shows the same; the 503 that 0.6.0 listed as unexplained there is this case. Nothing in emfor changed; the advice stays: one name server, and a separate IP per backend.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;How big the store gets.&lt;/strong&gt; &lt;code&gt;tools/scale-test.sh&lt;/code&gt; starts up to 8,000 &lt;code&gt;tcp&lt;/code&gt; backends in 80 services and reports the store size, memory, CPU and the time to switch. The rule from it: 6 KB per backend, &lt;code&gt;map_size&lt;/code&gt; at least twice that; the default 64 MiB fits about 5,000 backends.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Several data centres, TLS for &lt;code&gt;/metrics&lt;/code&gt;, CPU cores.&lt;/strong&gt; Chapter 11 says one peer group per data centre, each with its own &lt;code&gt;site&lt;/code&gt;, members and secret, and why members of two sites do not belong in one group. Chapter 12 has &amp;ldquo;Metrics over TLS&amp;rdquo;: &lt;code&gt;listen&lt;/code&gt; stays on loopback, nginx in front terminates TLS, Prometheus uses &lt;code&gt;tls_config&lt;/code&gt; (tried with nginx in a container; Prometheus, HAProxy and stunnel were not tried), and a way to keep emfor on some CPU cores with &lt;code&gt;CPUAffinity=&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A fix to the SNMP trap script.&lt;/strong&gt; &lt;code&gt;examples/snmp/emfor-snmp-trap.sh&lt;/code&gt; &lt;strong&gt;sent nothing&lt;/strong&gt; when a service went all down: &lt;code&gt;emfor status --json&lt;/code&gt; exits 1 then, and the script treated every non-zero exit as a failure and stopped. It now stops only on exit 2 or no output.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A Nix flake, the FreeBSD port, a test for the rpm.&lt;/strong&gt; The repository has a Nix flake and a NixOS module &lt;code&gt;services.emfor&lt;/code&gt; (built and tested in a container on aarch64 Linux, not started on a NixOS machine). &lt;code&gt;net-mgmt/emfor&lt;/code&gt; is in the FreeBSD ports tree. &lt;code&gt;tools/rpm-release-test.sh&lt;/code&gt; tests install, upgrade and downgrade in a Rocky Linux 9 container with systemd; RHEL 8 has glibc 2.28 where the binary needs 2.30, so it is stated as unsupported.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;5-how-to-upgrade&#34;&gt;5. How to upgrade&#xA;&lt;/h2&gt;&lt;p&gt;Install the 0.8.0 package as usual. Run &lt;code&gt;emfor check-config&lt;/code&gt; first on each host, as the daemon&amp;rsquo;s user and with the new binary. Build programs that use the C library again, and upgrade every member of a peer group before you set &lt;code&gt;cipher&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;What this release was tested with: the full test suite, the 72 conformance cases of each of five clients (all pass), the six fuzz targets for 10 minutes each (no crash), and the rpm install, upgrade and downgrade test in an arm64 Rocky Linux 9 container. &lt;strong&gt;The rpm was not tested on x86-64, and the pre-release rpm test was not repeated on a Rocky Linux VM (SELinux was tried on one; see section 4).&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The full list of changes is in the &lt;a class=&#34;link&#34; href=&#34;https://github.com/embark-systems/emfor/blob/v0.8.0/CHANGELOG.md&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;CHANGELOG&lt;/a&gt;, and the source is in the &lt;a class=&#34;link&#34; href=&#34;https://github.com/embark-systems/emfor/releases/tag/v0.8.0&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;v0.8.0 release on GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;-technical-collaboration-and-architecture-consulting&#34;&gt;💡 Technical collaboration and architecture consulting&#xA;&lt;/h3&gt;&lt;p&gt;Are your services struggling with inconsistent health checks, slow failure detection, or check traffic that weighs on your backends?&#xA;We can help you assess your architecture and adopt the health-check and service-discovery approach that fits.&lt;/p&gt;&#xA;&lt;p&gt;📧 &lt;a class=&#34;link&#34; href=&#34;mailto:service@embark.systems&#34; &gt;Book a technical consultation&lt;/a&gt;&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>emfor 0.7.0: Tighter Defaults, a Small Environment for Check Programs, and Fixes from a Security Review</title>
            <link>https://embark.systems/en/posts/emfor-0.7.0/</link>
            <pubDate>Sun, 22 Nov 2026 00:30:00 +0800</pubDate>
            <guid>https://embark.systems/en/posts/emfor-0.7.0/</guid>
            <description>&lt;img src=&#34;https://embark.systems/images/emfor-0.7.0.png&#34; alt=&#34;Featured image of post emfor 0.7.0: Tighter Defaults, a Small Environment for Check Programs, and Fixes from a Security Review&#34; /&gt;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/embark-systems/emfor&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;emfor&lt;/a&gt; is an open-source health-check daemon that runs on every application host. It checks the backends of the services your applications use and writes which ones are healthy into a local file; applications ask a client library which backend to connect to and get an answer in about a microsecond, without a network round trip.&lt;/p&gt;&#xA;&lt;p&gt;0.7.0 was released on 2026-11-22. 0.6.0 was about running emfor next to the tools you already have; this release is about &lt;strong&gt;what the daemon and its files trust&lt;/strong&gt;. It follows a self-assessment against a security checklist and a review of the whole system: the check programs a daemon starts get a small environment, the files it reads and writes are held to stricter rules, and a few places where one slow or wrong input could stall or confuse it are fixed. Several of these are &lt;strong&gt;compatibility changes&lt;/strong&gt;: each tightens a default, and an install that relied on the old behaviour needs one line of config. Read section 1 before you upgrade.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-before-you-upgrade&#34;&gt;1. Before you upgrade&#xA;&lt;/h2&gt;&lt;p&gt;The store format (version 2) and the plugin protocol (1) are unchanged: clients and plugins of 0.6.0 keep working with this daemon. &lt;code&gt;libemfor&lt;/code&gt; is now &lt;code&gt;libemfor.so.0.7&lt;/code&gt;, so rebuild or reinstall what links against it. Six things can stop an install that relied on the old behaviour; run &lt;code&gt;emfor check-config&lt;/code&gt; with the new binary, as the daemon&amp;rsquo;s user, on every host first, because it reports most of them.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;exec&lt;/code&gt; checks and plugins get a small environment.&lt;/strong&gt; A check program that reads &lt;code&gt;HOME&lt;/code&gt;, a proxy variable or the like now needs &lt;code&gt;env_pass&lt;/code&gt; (section 2). &lt;code&gt;check-config&lt;/code&gt; does not warn about this one.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The store files are &lt;code&gt;0640&lt;/code&gt; and &lt;code&gt;0660&lt;/code&gt; by default&lt;/strong&gt; (they were &lt;code&gt;0644&lt;/code&gt; and &lt;code&gt;0666&lt;/code&gt;). An application user that is not in the daemon&amp;rsquo;s group gets &lt;code&gt;UNAVAILABLE&lt;/code&gt; from the client. Add the user to the group (&lt;code&gt;usermod -aG emfor &amp;lt;user&amp;gt;&lt;/code&gt;), or write &lt;code&gt;file_mode = &amp;quot;0644&amp;quot;&lt;/code&gt; and &lt;code&gt;lock_file_mode = &amp;quot;0666&amp;quot;&lt;/code&gt; under &lt;code&gt;[store]&lt;/code&gt; to keep the old behaviour.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A daemon that encrypts peer messages drops plaintext ones by default.&lt;/strong&gt; If a group still has members with &lt;code&gt;encrypt = false&lt;/code&gt; or on 0.3.0, give the hosts that encrypt an explicit &lt;code&gt;accept_plaintext = true&lt;/code&gt; until every member encrypts. A host on 0.3.0 or 0.4.0 does not know that key, so it goes in the same config change as the upgrade there; on 0.5.0 or 0.6.0 it goes in before the upgrade.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A peer secret file must be owned by root or by the user that runs emfor.&lt;/strong&gt; Whoever owns a file can rewrite it, whatever its mode says. &lt;code&gt;chown root:emfor&lt;/code&gt; it on every host before you upgrade.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The main config file is checked like the files of &lt;code&gt;include_dir&lt;/code&gt;&lt;/strong&gt;: not writable by group or others, owned by root or the user that runs emfor. The deb, rpm and FreeBSD port install it that way. A file with mode &lt;code&gt;0664&lt;/code&gt; stops the daemon at start until &lt;code&gt;chmod g-w,o-w /etc/emfor/emfor.toml&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;previous_secret_file&lt;/code&gt; is used only for the secret the daemon replaced.&lt;/strong&gt; It is no longer used just because the current file was touched within 120 seconds (section 4). The first start of 0.7.0 has no record yet, so it ignores the option once.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;2-exec-checks-and-plugins-no-longer-get-the-daemons-whole-environment&#34;&gt;2. &lt;code&gt;exec&lt;/code&gt; checks and plugins no longer get the daemon&amp;rsquo;s whole environment&#xA;&lt;/h2&gt;&lt;p&gt;A program that an &lt;code&gt;exec&lt;/code&gt; check or a plugin starts used to inherit every variable of the daemon&amp;rsquo;s environment, so a secret set there (by a unit file, for example) reached every check program. It now gets only &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;LANG&lt;/code&gt;, &lt;code&gt;TZ&lt;/code&gt; and the &lt;code&gt;LC_*&lt;/code&gt; variables, with the daemon&amp;rsquo;s values, and &lt;code&gt;exec&lt;/code&gt; also gets &lt;code&gt;EMFOR_IP&lt;/code&gt;, &lt;code&gt;EMFOR_PORT&lt;/code&gt; and &lt;code&gt;EMFOR_SERVICE&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The new &lt;code&gt;env_pass&lt;/code&gt; is a list of variable &lt;strong&gt;names&lt;/strong&gt;, never values, in the &lt;code&gt;check_options&lt;/code&gt; of an &lt;code&gt;exec&lt;/code&gt; check and in &lt;code&gt;[plugins.&amp;quot;&amp;lt;name&amp;gt;&amp;quot;]&lt;/code&gt;. It adds variables the daemon has; a name the daemon does not have is skipped. Changing a plugin&amp;rsquo;s &lt;code&gt;env_pass&lt;/code&gt; restarts the plugin on reload, like changing its &lt;code&gt;command&lt;/code&gt;, and the names are part of the check definition that peers compare, so the hosts of a group must list the same names for a service. &lt;code&gt;emfor-check&lt;/code&gt; also reads &lt;code&gt;SSL_CERT_FILE&lt;/code&gt; and &lt;code&gt;SSL_CERT_DIR&lt;/code&gt;, to find the system CAs of a TLS check that has no &lt;code&gt;ca_file&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;3-stricter-files-and-warnings-for-passwords-sent-in-clear-text&#34;&gt;3. Stricter files, and warnings for passwords sent in clear text&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The store files.&lt;/strong&gt; The lock file holds LMDB&amp;rsquo;s reader table and the lock the daemon takes for every commit, and it was writable by every local user. The daemon sets the new modes on the existing files at every start. &lt;code&gt;emfor check-config&lt;/code&gt; and the daemon warn, one line per option, about a &lt;code&gt;file_mode&lt;/code&gt; or &lt;code&gt;lock_file_mode&lt;/code&gt; that other users can write.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The main config file&lt;/strong&gt; can declare a plugin &lt;code&gt;command&lt;/code&gt;, which runs with the daemon&amp;rsquo;s rights, as a fragment can; only the fragments were checked. At start a refusal exits with status 2 before the store is opened; at a reload the old config keeps running.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Peer secrets&lt;/strong&gt; are opened first and the opened file is checked (mode, regular file, owner) and read, so the file cannot be swapped in between and a FIFO named as the secret no longer makes the once-a-second re-read wait. A secret larger than 65536 bytes is a config error (a secret needs 32). The daemon wipes the secret and the keys derived from it from memory when it drops them.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Warnings, never errors.&lt;/strong&gt; A &lt;code&gt;password_file&lt;/code&gt;, &lt;code&gt;secret_file&lt;/code&gt; or &lt;code&gt;tls_key_file&lt;/code&gt; in a check&amp;rsquo;s options that every user can read or that anyone but its owner can write gets one line naming the services that use it. A &lt;code&gt;password_file&lt;/code&gt; without &lt;code&gt;tls&lt;/code&gt; on a &lt;code&gt;redis&lt;/code&gt;, &lt;code&gt;ldap&lt;/code&gt;, &lt;code&gt;mysql&lt;/code&gt;, &lt;code&gt;pgsql&lt;/code&gt; or &lt;code&gt;amqp&lt;/code&gt; check gets a line too. A config that works keeps working.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Invisible characters&lt;/strong&gt; in a check&amp;rsquo;s reason (the bidirectional controls such as U+202E, the zero-width characters, the soft hyphen) are escaped as &lt;code&gt;\u{202e}&lt;/code&gt;, and so are the lines a plugin writes to stderr and the name and version in its handshake, so a backend or a plugin cannot forge a log line or make &lt;code&gt;emfor status&lt;/code&gt; show a service as something else. A redis server that echoes the AUTH password in an error no longer puts it in the reason, and the reason of a failed &lt;code&gt;http&lt;/code&gt; check no longer holds the request URL, token in its query string included.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The systemd unit&lt;/strong&gt; sets &lt;code&gt;UMask=0027&lt;/code&gt;, &lt;code&gt;ProtectProc=invisible&lt;/code&gt; and &lt;code&gt;ProcSubset=pid&lt;/code&gt;, and stops retrying after five failed starts in a minute (an invalid config used to be retried every two seconds without end). &lt;code&gt;systemd-analyze security&lt;/code&gt; rates it 1.5, it was 1.7. A copy of the example unit has to be updated by hand; the packages bring the new one.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;4-fixes&#34;&gt;4. Fixes&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;A late peer message no longer overwrites a newer one.&lt;/strong&gt; The replay check lets a message that the network delivered late through, if its &lt;code&gt;seq&lt;/code&gt; is within 64 of the highest, and the daemon then kept it as the sender&amp;rsquo;s latest result, replacing a later one and making the result look fresh again. Each kept result and each member&amp;rsquo;s tags now remember the &lt;code&gt;boot&lt;/code&gt; and &lt;code&gt;seq&lt;/code&gt; they came from, and an older one leaves them alone. The wire format is unchanged.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A retired secret could come back.&lt;/strong&gt; After a change of secret from K1 to K2 with &lt;code&gt;previous_secret_file&lt;/code&gt; still holding K0, a restart within 120 seconds signed with K0, and the members that had dropped K0 stopped hearing the host. The daemon now keeps a record of the secrets it has used (a fingerprint, never the secret) in &lt;code&gt;&amp;lt;store path&amp;gt;-peers&lt;/code&gt;, mode 0600, and uses &lt;code&gt;previous_secret_file&lt;/code&gt; only for the secret it replaced less than 120 seconds ago.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A hung peer secret file no longer stops the peer loop.&lt;/strong&gt; On a network file system that does not answer, the once-a-second read never returned and the other members saw the host as not live after three seconds while its checks and DNS went on. The read now runs on a blocking thread, and where the system allows it (inotify, kqueue) the file is watched and read when it changes. A hung config file no longer blocks &lt;code&gt;SIGTERM&lt;/code&gt; on a reload either.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;http&lt;/code&gt; checks work on a host without CA certificates.&lt;/strong&gt; Every &lt;code&gt;http&lt;/code&gt; check was an &lt;code&gt;error&lt;/code&gt; with &lt;code&gt;cannot build http client: builder error&lt;/code&gt;, even with &lt;code&gt;scheme = &amp;quot;http&amp;quot;&lt;/code&gt;, because building the client read the system roots for a verifier that a plain request never uses. &lt;code&gt;https&lt;/code&gt; with verification on still needs the certificates, and its reason now says so.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A client that opens the store while the daemon pads it no longer fails.&lt;/strong&gt; The daemon commits a write and only then extends the data file to the recorded length, and a client that opened the store in that gap refused it as truncated for one second. It now measures again up to five times, 20 ms apart.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Smaller ones:&lt;/strong&gt; a restarted plugin leaves no tasks behind; &lt;code&gt;libemfor&lt;/code&gt; on FreeBSD no longer aborts a process that forks while a thread is exiting; the rpm keeps a changed &lt;code&gt;/etc/emfor/emfor.toml&lt;/code&gt; on upgrade (&lt;code&gt;noreplace&lt;/code&gt;) instead of replacing it with the packaged one; durations in the config are parsed by emfor itself, because the &lt;code&gt;humantime&lt;/code&gt; crate is now flagged unmaintained; and &lt;code&gt;examples/pf/emfor-pf-table.sh&lt;/code&gt; and &lt;code&gt;examples/nagios/check_emfor.sh&lt;/code&gt; check what they hand on to &lt;code&gt;pfctl&lt;/code&gt; and to Nagios.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The deploy scripts have a change of their own: &lt;code&gt;emfor-drain.sh&lt;/code&gt; and &lt;code&gt;emfor-peers-sync.sh&lt;/code&gt; ran &lt;code&gt;emfor check-config&lt;/code&gt; as root, and &lt;code&gt;check-config&lt;/code&gt; starts the plugins the config declares, so a plugin ran as root outside the service&amp;rsquo;s sandbox. They now run it as &lt;code&gt;EMFOR_USER&lt;/code&gt; (default &lt;code&gt;emfor&lt;/code&gt;). There is also a new recipe for a peer group whose hosts come and go: &lt;code&gt;emfor-peers-sync.sh&lt;/code&gt; writes &lt;code&gt;[peers] members&lt;/code&gt; into a &lt;code&gt;conf.d&lt;/code&gt; file from a list of addresses (AWS and Google Cloud examples are in the &lt;a class=&#34;link&#34; href=&#34;https://embark.systems/en/emfor/11-peer-groups/#members-from-a-cloud-api&#34; &gt;peer groups chapter of the manual&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;h2 id=&#34;5-known-limits&#34;&gt;5. Known limits&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;The pf recipe and the Nagios examples were run on FreeBSD 15.1-RELEASE (arm64, in a VM) after these changes. Not tested: Nagios itself (only its plugins), FreeBSD 13.x and 14.x, poudriere, and the kqueue watch of the peer secret on FreeBSD by hand. Most checks of this release ran in a Debian container; macOS was run only for part of the tests.&lt;/li&gt;&#xA;&lt;li&gt;The container check that an &lt;code&gt;http&lt;/code&gt; check works without CA certificates was run once, on Debian 13, and is not part of the test gate.&lt;/li&gt;&#xA;&lt;li&gt;Environment: the &lt;code&gt;PATH&lt;/code&gt; that systemd gives the daemon was not checked, and neither were installs whose check programs need variables that nobody here knows about; if one fails after the upgrade, add its variable to &lt;code&gt;env_pass&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Unchanged from earlier releases: the HAProxy 503 after a &lt;code&gt;server-template&lt;/code&gt; slot with port 0 on FreeBSD; the deb and rpm tested in containers, the deb also under systemd but not the rpm, not signed and not in any repository; peer messages have no forward secrecy; the &lt;code&gt;ldap&lt;/code&gt; plugin has been checked against Active Directory only without a certificate; lookup throughput across threads levels off at about two million a second on Linux; with &lt;code&gt;[store] sync = false&lt;/code&gt; (the default) a host crash can damage the store; a host announces at most 80 services left out of the peer group.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;6-how-to-upgrade&#34;&gt;6. How to upgrade&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;Run &lt;code&gt;emfor check-config&lt;/code&gt; as the daemon&amp;rsquo;s user with the 0.7.0 binary on the config of every host before you upgrade it (section 1).&lt;/li&gt;&#xA;&lt;li&gt;Before the upgrade: &lt;code&gt;chown root:emfor&lt;/code&gt; the peer secret files, put application users into the daemon&amp;rsquo;s group (or set the old store modes), and add &lt;code&gt;accept_plaintext = true&lt;/code&gt; where a group still has plaintext members. Look at every &lt;code&gt;exec&lt;/code&gt; check and plugin that needs a variable of the daemon&amp;rsquo;s environment and give it an &lt;code&gt;env_pass&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Install &lt;code&gt;libemfor&lt;/code&gt; and the daemon from 0.7.0, host by host. Once every member has &lt;code&gt;encrypt = true&lt;/code&gt; and the &lt;code&gt;plaintext&lt;/code&gt; count in &lt;code&gt;emfor_peer_messages_rejected_total&lt;/code&gt; stops increasing, remove &lt;code&gt;accept_plaintext = true&lt;/code&gt; again and reload.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The &lt;a class=&#34;link&#34; href=&#34;https://embark.systems/en/emfor/&#34; &gt;user manual&lt;/a&gt; on this site is rewritten for 0.7.0. The full list of changes is in the &lt;a class=&#34;link&#34; href=&#34;https://github.com/embark-systems/emfor/blob/v0.7.0/CHANGELOG.md&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;CHANGELOG&lt;/a&gt;, and the source is in the &lt;a class=&#34;link&#34; href=&#34;https://github.com/embark-systems/emfor/releases/tag/v0.7.0&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;v0.7.0 release on GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;-technical-collaboration-and-architecture-consulting&#34;&gt;💡 Technical collaboration and architecture consulting&#xA;&lt;/h3&gt;&lt;p&gt;Are your services struggling with inconsistent health checks, slow failure detection, or check traffic that weighs on your backends?&#xA;We can help you assess your architecture and adopt the health-check and service-discovery approach that fits.&lt;/p&gt;&#xA;&lt;p&gt;📧 &lt;a class=&#34;link&#34; href=&#34;mailto:service@embark.systems&#34; &gt;Book a technical consultation&lt;/a&gt;&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
