What the installer does
Every step of the InfraFence install.sh, the read-only preflight check it runs before changing anything, and the dry run that shows the plan without touching the server.
Last updated:
InfraFence is built for production servers: the installer checks the server read-only before it changes anything, and leaves alone what it cannot change safely.
The steps
- Token and root. Without
--tokenon a server that is not registered yet, it stops withInstall token is required; a dry run needs no token. It must run as root. - System. Linux only; it detects the init system (systemd, upstart or sysvinit) and the architecture (
amd64orarm64). - Certificates. On RHEL-family systems, or when
curlcannot verify the download, it adds the ISRG Root X1 certificate (Let's Encrypt) to a bundle of its own,/etc/infrafence/ca-bundle.pem, and on RHEL-family systems to the system's trust store too. The certificate is part of the installer and never downloaded; whereopensslis present it is checked against its pinned SHA-256 fingerprint first. - Dependencies. Missing
curl,iptablesorca-certificatesare installed withapt-get,dnforyum; on rpm systemsiptablesis installed asiptables-nftwhere that package exists, so its rules share the backend of firewalld and nftables. If another package operation is running it waits up to 5 minutes (Another package operation is running — waiting for it to finish...). It never runsdpkg --configure -aor repairs broken packages on its own. - Download. The agent binary for the architecture is downloaded from the latest GitHub release (
github.comandrelease-assets.githubusercontent.com, the only download source) and checked against its published SHA-256 checksum. The checksum is required: if it cannot be downloaded or does not match, nothing is installed.--skip-checksuminstalls without it and is unsafe. - Read-only check. It runs
infrafence-agent preflightbefore installing anything (below). - ipset. Installed only if missing, not refused with
--no-ipset, and the check says it is safe: a package manager is available and no package operation is running. - Install. The binary goes to
/usr/local/bin/infrafence-agent, the service is created, enabled and started. - Register. The agent registers with your token and stores its own token in
/etc/infrafence/config.json. The install token is not kept. - Start check. It verifies that the service is running, and prints where to read the logs.
The download, the registration and the service start report their result to the dashboard (with the first characters of the token only), so a failed install can be traced.
The read-only check (preflight)
infrafence-agent preflight scans the server and changes nothing. The installer runs it before installing, the agent runs it at every start and then once a day, and you can run it any time:
sudo infrafence-agent preflight
sudo infrafence-agent preflight --jsonThe output starts with InfraFence preflight (read-only — nothing was changed), then one line per finding with its level: ok, info, warn or block. Without --json, the exit status is 2 when a finding is block and 0 otherwise.
It looks at:
- Firewall: whether
iptablesis installed and usable, and its backend; whetheripsetis present; other firewall managers and security tools (ufw, firewalld, CSF, fail2ban, CrowdSec, netfilter-persistent, Docker, Kubernetes). - Web servers: nginx, Apache (
apache2orhttpd), Caddy and LiteSpeed. - Who manages the configuration: hosting panels and configuration-management tools (Ansible, Puppet, Chef, Salt). When one is present, InfraFence never edits the web server configuration.
- Packages: the package manager and any package operation in progress.
- Resources: free disk space on
/(warns under 200 MB), available memory (warns under 128 MB), the SELinux mode.
The result also reaches the dashboard: the server's Host tab shows it under Host compatibility.
The dry run
curl -fsSL https://github.com/infrafence/infrafence-agent/releases/latest/download/install.sh | sudo bash -s -- --dry-runIt needs no token, and changes nothing on RHEL-family systems either: the certificate step above applies to that run only. It downloads the agent, runs the read-only check and prints Dry run — nothing was installed or changed. followed by what a real run would do: install the binary and the service, install ipset or not, create the INFRAFENCE firewall chains (jumped to from INPUT, and from DOCKER-USER if Docker is present) and register. Web server configuration changes and inbound blocking of threat-intelligence lists stay off until you turn them on in the dashboard.
What it never does
- It never modifies your existing firewall rules: everything lives in the agent's own chains.
- It never finishes other packages' half-done configurations (
dpkg --configure -a), which could restart services. - It never edits a configuration that a hosting panel, LiteSpeed or a configuration-management tool owns.
