Scripting

Rudder: Open Source Configuration Management to Stop Server Drift

A server that is perfectly configured on launch never stays that way for long. A hotfix applied by hand, a "sshd_config" file changed in an emergency... and the gap from the reference configuration quietly grows until no one notices. Rudder, an open source configuration and compliance management solution, promises to detect this drift continuously and fix it if you want it to.

In this article, we will discover Rudder and install it, then deploy an SSH hardening technique with fail2ban, first in Audit and then in Enforce, and deliberately create drift to see the agent fix it on its own.

Overview

Why do server configurations drift?

Configuration drift refers to the growing gap, over time, between the configuration applied to a server on day one and its actual state, which gradually diverges. The causes are often mundane: a manual intervention during an incident, an update that overwrites a file, an option temporarily enabled and then forgotten. On a fleet of several dozen machines, you end up with servers that are almost identical, harder to troubleshoot and sometimes less secure.

The real problem, often, is seeing these gaps.

What is Rudder?

Rudder is a configuration and compliance management platform, with its code published on GitHub - Normation - Rudder. It is built around a central server with a web interface and an agent installed on each machine. According to the Rudder documentation - Configuration concepts, Rudder continuously evaluates drift against defined policies, with or without automatic remediation.

Its vocabulary revolves around four concepts:

  • Technique: a configurable configuration template, a bit like an Ansible role.
  • Directive: an instance of a technique, with its values.
  • Rule: the application of one or more directives to a group of nodes.
  • Group: a set of nodes, static or dynamic (calculated from inventory criteria), as explained in the Rudder documentation - Node management.

The inventory used to feed dynamic groups is sent by each agent once a day, at a random time between midnight and 6 a.m.

The Rudder lab and production examples

The demonstration is performed on a dedicated lab, using Rudder Core, the free and open source version:

  • Server: Rudder 9.1.5 Core, without any plugin, on Debian 13 (trixie), with 4 vCPU, 8 GB of RAM and 30 GB of disk.
  • Nodes, with agent 9.1.5: Debian 13 (later moved to Enforce), Ubuntu 24.04.5 LTS and AlmaLinux 9.8 (kept in Audit).

I also use Rudder in production: a Rudder 9.1.5 server on Debian 13 (trixie) that manages 30 Debian and Ubuntu nodes, with agents on 9.1.5. This instance is not Core: it uses licensed plugins ("Security benchmarks", "Patches & vulnerabilities", "Data sources"). It is only used here to illustrate three read-only views, with hostnames, IP addresses and domains blurred.

Here is its dashboard. The counters at the top summarize the fleet and the configuration objects:

CounterValue in the screenshotWhat does it correspond to?
Nodes30Nodes managed by Rudder.
Pending nodes0Nodes awaiting acceptance.
Groups35Groups used to select target nodes.
Directives20Configurations created from techniques.
Techniques35Templates that define the actions and checks to perform.
Rules12Rules that associate directives with targeted nodes.

In the center, "Global compliance details" shows 100% compliance.

At the bottom, "Score breakdown" also shows vulnerability and benchmark scores for Debian 12 and Ubuntu 24.04. These scores are provided by plugins: they are not available in the Core edition alone.

Rudder vs Ansible

Ansible and configuration drift

To be fair, Ansible can maintain a state. Its modules are idempotent, a playbook can be scheduled (cron, AWX, Ansible Automation Platform), and pull mode (Ansible Documentation - ansible-pull) makes each node run the playbooks itself. Ansible's check mode even simulates a run without changing anything.

Rudder's approach: continuous agent-based verification

Rudder is natively designed for continuous compliance. According to the Rudder documentation, the agent runs by default every 5 minutes, with a random delay ("splay time") to smooth the load. The setting is found under "Settings" > "General", in the "Agent Run Schedule" section, and can be overridden per node. In my lab, this delay is at most 4 minutes, and fixed for a given node: 3 min 18 s for my Debian node.

At each run, the agent checks the desired state, repairs it if needed, then sends a report. Compliance becomes a state measured continuously, by rule and by node.

Audit and Enforce modes

  • Audit: the agent checks the system state and reports it, without applying changes to the managed configuration.
  • Enforce: the agent checks the state, corrects it if it is not compliant, then reports its actions.

The mode can be defined globally, per directive, or per node. If both a node and a directive override it, Audit wins ("Override wins, then Audit wins," says the documentation).

Ansible and Rudder: comparing the approaches

CriterionAnsibleRudder
ModelPush via SSH, without an agent (pull possible)Agent on each node (pull)
FrequencyOn demand or scheduledEvery 5 minutes by default
Observe without changingCheck mode, one-offAudit mode, continuous and reported
ComplianceResult of each runMeasured continuously, with history
DriftCorrected on the next scheduled runDetected at every run, corrected or reported

The two tools are not mutually exclusive and their uses overlap broadly: both can automate system configuration and maintain a desired state. Rudder stands out mainly because compliance tracking, reporting and history are integrated into its day-to-day operation. Their complementarity therefore depends on the team's needs and practices, rather than on a strict separation between orchestration and compliance.

Architecture, prerequisites and installation

The components

  • The root server: web interface, API, policy generation and report collection.
  • Relays, optional, for isolated networks. According to the Rudder documentation, they require the licensed plugin "scale-out-relay".
  • The agent: applies policies, sends its reports and inventory.

Network flows

The Rudder documentation lists the flows to allow:

SourceDestinationPortUse
User, API clientRoot servertcp/443Web interface and API
NodeRelay or servertcp/443Reports, inventories, files
Linux nodeRelay or servertcp/5309Policy retrieval
Server or relayLinux nodetcp/5309Optional: remote execution

Supported systems

Rudder Core supports, free of charge, for both server and nodes, Debian 12 and 13, Ubuntu 24.04 and 26.04 LTS, RHEL 9 and 10 and their derivatives, SLES 15 SP6+ and 16, and Amazon Linux 2023. Ubuntu 20.04 and 22.04, Debian 11 or Windows require a subscription.

Below 50 nodes, the server requires at least 3 GB of RAM, 2 cores and, for "/var/rudder", around 1.5 GB plus 10 MB per node.

A prerequisite specific to our main thread: on AlmaLinux 9, fail2ban requires the EPEL repository. We will manage its activation in the technique with the epel-release package, available in the extras repository.

Installing the server

The Rudder documentation offers a quick script. I preferred the manual method, which is more traceable, on a fresh Debian 13 install. We fetch the repository key into "/etc/apt/keyrings":

sudo install -d -m 0755 /etc/apt/keyrings
sudo wget --quiet -O /etc/apt/keyrings/rudder_apt_key.gpg "https://repository.rudder.io/apt/rudder_apt_key.gpg"

Check its fingerprint (on my Debian 13 template, I had to install the "gpg" package):

gpg --show-keys --with-fingerprint /etc/apt/keyrings/rudder_apt_key.gpg

You should get the "Rudder Project (release key)" key:

pub   rsa4096 2011-12-15 [SC]
      7C16 9817 7904 212D D58C  B4D1 9322 C330 474A 19E8
uid                      Rudder Project (release key) <security@rudder-project.org>

We then declare the 9.1 repository by binding the key to this repository only with "signed-by".

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/rudder_apt_key.gpg] http://repository.rudder.io/apt/9.1/ $(. /etc/os-release; echo $VERSION_CODENAME) main" | sudo tee /etc/apt/sources.list.d/rudder.list

Then install the server:

sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y rudder-server

Expect about 1 GB on disk (OpenJDK 21, PostgreSQL 17, Apache, agent). Then create the first administrator account (the password is requested twice):

sudo rudder server create-user -u USERNAME

On my lab, this account is called "admin". In production, change the password of the "admin" account if it was used for testing, and restrict access to the web interface (admin network, VPN): it controls the configuration of all your servers.

On first login, a license wizard opens: in Core, click "I will configure my license later". Finally, check under "Settings" > "General" > "Allowed Networks" that your nodes' networks are listed, otherwise you will not be able to bring them up: that happened to me.

Login page to the Rudder server web interface
Rudder Core license wizard shown at first login

Installing the agent and enrolling the node

On Debian 13 and Ubuntu 24.04, the agent comes from the same repository:

sudo install -d -m 0755 /etc/apt/keyrings
sudo wget --quiet -O /etc/apt/keyrings/rudder_apt_key.gpg https://repository.rudder.io/apt/rudder_apt_key.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/rudder_apt_key.gpg] http://repository.rudder.io/apt/9.1/ $(. /etc/os-release; echo $VERSION_CODENAME) main" | sudo tee /etc/apt/sources.list.d/rudder.list
sudo apt-get update && sudo apt-get install -y rudder-agent

On AlmaLinux 9, we go through an RPM repository:

sudo rpm --import https://repository.rudder.io/rudder_release_key.pub
printf "%s\n" "[Rudder_9.1]" "name=Rudder 9.1" "baseurl=http://repository.rudder.io/rpm/9.1/RHEL_9/" "gpgcheck=1" "gpgkey=https://repository.rudder.io/rudder_release_key.pub" | sudo tee /etc/yum.repos.d/rudder.repo
sudo dnf -y install rudder-agent

Enrolling the node takes three commands:

sudo rudder agent policy-server <RUDDER_SERVER_IP>
sudo rudder agent inventory
sudo rudder agent run -l

The Debian node enrolled on the first try, not Ubuntu or AlmaLinux: No suitable server found, then Agent is currently in bootstrap policies, cannot run an inventory. According to the journal, cf-serverd had restarted just after the first enrollment and stayed unavailable for about ten seconds, right when my two other nodes were contacting it. In this bootstrap state, the inventory command refuses to continue and asks to retrieve the initial policies. Once the server is reachable again, run:

sudo rudder agent update
sudo rudder agent inventory

The node responds Rudder node waiting to be accepted. In "Node management" > "Pending nodes", select the nodes, click "Accept" and confirm.

Accepting a pending node in Rudder (Pending nodes)

Dynamic groups

Marking test nodes with a property

To target the three test nodes, add a property to each of them. A node property here plays the role of an Ansible host variable.

  1. Open the node details page, then the "Properties" tab.
  2. In "Add a new property", enter demo in "Property name" and rudder in "Value".
  3. Keep the "String" format, then click "+".
  4. Check that the property appears in the list, as shown in the screenshot.

Repeat these steps on the two other nodes.

Adding the demo=rudder property on a node in Rudder

I did the same on the three nodes, not on the server. The API can also be used to add properties, but I did not test it.

Targeting nodes from a property

Now let's create a dynamic group from the property created earlier.

In "Node management" > "Groups", click "Create".

  1. Choose "Group", then the "Dynamic" type.
  2. Name the group Rudder demo - SSH hardening.
  3. Open the "Criteria" tab and fill in the row from left to right:
Criterion fieldValue to select or enter
Category"├─ Properties"
Property to search"Name=Value"
Operator"="
Valuedemo=rudder

Be sure to enter demo=rudder in a single field: demo is the property name, rudder its value.

Click "Search" to verify that the three nodes appear, then "Save" to save the group.

Reading the screenshot: it was taken after Debian was switched to Enforce, described later. Debian is at 100%. Ubuntu and AlmaLinux remain in Audit. Their percentages reflect the still-present drift.

Creating a Rudder dynamic group filtered on the demo=rudder property

Combining criteria

To create a group that brings together Linux machines with OpenSSH installed, choose the "AND" operator: both criteria must be true.

In the "Criteria" tab, enter these two rows:

CategoryFieldOperatorValue
"Node summary""Operating System Type""="Linux
"Software""Name""="openssh-server

Click "Search": the three lab nodes appear, because the package has the same name openssh-server on AlmaLinux too.

Leave "Include Rudder root" unchecked to exclude the Rudder server, then save the group with "Save".

In my personal production setup, the docker_nodes group uses "OR": one of the two conditions is enough to include a node.

CategoryFieldOperatorValue
"Software""Name""="docker-ce
"Software""Name"="docker.io

The group therefore brings together machines on which one of these two packages is installed.

Rudder dynamic group docker_nodes with two Software criteria linked by OR

Techniques: SSH hardening and fail2ban

We now have a group of three test nodes. The next step is to associate a configuration with it. To do that, we will build a technique, then create a directive from it and apply that directive to the group with a rule.

The technique describes the actions. It does not choose the machines on which they run. Creating it alone will therefore not change any of our nodes. Deployment will begin in the next section, first in Audit.

Our configuration must achieve four results: install fail2ban, provide it with SSH protection configuration, forbid SSH connections for the root account, and restart the relevant services only after a change. A fail2ban jail combines a filter, which recognizes authentication failures, with a banning action. Here, we will use the sshd jail.

Creating the technique and getting oriented in the editor

On the Rudder server, in the web interface:

  1. Open "Configurations" > "Techniques".
  2. Click "Create technique".
  3. In "Name", enter SSH hardening - fail2ban. You can use fail2ban and SSH hardening, with conditional restarts as the description.
  4. Keep the "User Techniques" category. The technique identifier is generated from the name. In my lab, it is ssh_hardening___fail2ban.
Creating the SSH hardening - fail2ban technique in Rudder's visual editor

We will use the "Visual editor". In the "METHODS" area, the "Add" button opens the "Methods" panel. Its "Filter" field lets you search for a method by name. A method is a reusable action: install a package, copy a file, change an option, or restart a service.

Searching for the Package present method in the Rudder technique editor
In the Methods panel, type Package present in Filter, then select the method found.

For each method, follow these steps: search for its name in "Filter", add it, then open its card to fill in its parameters. To give it the name proposed in this article, click the small pencil next to the component name in the card header. This name will appear in reports. It is separate from the method's "Name" parameter, which may refer to a package or a service.

The 01., 02., etc. prefixes used below are names we choose so we can keep track of things. They are not automatic numbers. We will see these names again in screenshots and reports.

A card notably offers three tabs:

  • "Parameters": the values to apply, for example the package name.
  • "Conditions": the circumstances under which this method runs.
  • "Result conditions": the names of the conditions produced by its result, to be reused later.

For now, leave "Policy mode override" on "None". We will control Audit or Enforce at directive and node level during deployment.

Preparing the fail2ban template file

A template is a model file whose certain values will be replaced when used. Here, the same model will serve all nodes, but its comment will contain each machine's name and its demo property.

On your workstation, create a text file named exactly jail.local.j2, containing:

# File generated by Rudder (technique "SSH hardening - fail2ban").
# Any local change is overwritten at the agent's next run.
# Node: {{ vars.sys.fqhost }} - demo property = {{ vars.node.properties.demo }}

[sshd]
enabled  = true
port     = ssh
backend  = systemd
maxretry = 3

Save it as a text file, without an extra .txt extension after .j2.

The [sshd] section enables SSH protection. maxretry = 3 sets the number of failures taken into account before a ban, within the window configured by fail2ban. backend = systemd tells it to read the systemd journal. This latter option is already expected by the Debian 13 and Ubuntu 24.04 packages examined in the lab. We write it here to make the choice visible.

The expressions between {{ and }} are interpreted by Jinja2. In Rudder, variables available to the template are accessed through vars: vars.sys.fqhost provides the node name and vars.node.properties.demo its property defined when creating the dynamic group. The final content will be written to /etc/fail2ban/jail.local on the node, not on the Rudder server.

Understanding Jinja2: a template, data, a generated file

Jinja2 is a template engine: it reads a text model and inserts the data provided to it. The rendering is this transformation. The .j2 extension is used here to identify the template. Fail2ban will read the generated file, jail.local. Jinja template syntax.

In our example, the lines enabled = true and maxretry = 3 are fixed text: they are copied as-is. The expressions between double braces are replaced by their value:

Template expressionWhat Rudder provides at render time
{{ vars.sys.fqhost }}The node's full name, known by the agent
{{ vars.node.properties.demo }}The value of the demo node property, defined earlier

Illustrative example: on a node named debian-demo.example.test, with demo=rudder, the template line becomes:

# Node: debian-demo.example.test - demo property = rudder

The braces disappear: the final file contains directly usable text. Here, only information in comments varies. The protection settings remain identical on all three machines.

Jinja2 also supports conditions and loops, useful for adapting richer configurations. We are only using variable substitution in this technique. Rudder method documentation.

The native alternative: Mustache

For a template like this, I recommend Mustache: this engine is built into Rudder and does not require installing python3-jinja2 on the nodes. Here is the equivalent of our template file:

# File generated by Rudder (technique "SSH hardening - fail2ban").
# Any local change is overwritten at the agent's next run.
# Node: {{{vars.sys.fqhost}}} - demo property = {{{vars.node.properties.demo}}}

[sshd]
enabled  = true
port     = ssh
backend  = systemd
maxretry = 3

Triple braces insert values without HTML escaping, which is suitable for a configuration file.

We keep Jinja2 in the rest of the tutorial to maintain a reference point relative to Ansible. With Mustache, we would need to use the corresponding rendering method. Installing the Jinja2 Python module would then become unnecessary.

Installing the required packages

On AlmaLinux 9, fail2ban requires the EPEL repository. We will handle this prerequisite in the technique.

Add a "Package present" method, named 00. EPEL repository (AlmaLinux 9). In "Parameters", fill in:

  • "Name": epel-release.
  • "Provider": default.
  • Leave "Version" and "Architecture" empty.
Rudder Package present method to install the epel-release package

In the "Conditions" tab, select "AlmaLinux" in "Operating system", set major version to 9, and leave minor version empty. This card must come before the fail2ban installation. It will not run on Debian or Ubuntu.

AlmaLinux 9 condition applied to a Rudder technique method

Then add a "Package present" method and name its card 01. fail2ban package. In "Parameters", fill in:

  • "Name": fail2ban.
  • "Provider": default.
  • Leave "Version" and "Architecture" empty.
Rudder Package present method to install the fail2ban package
Card 01. fail2ban package: Name is fail2ban and Provider is default. The pencil next to the title lets you rename the component. Version and Architecture remain empty.

This method requests that the package be installed, without enforcing a specific version. With the default provider, the agent uses the package manager appropriate for the system.

Add another "Package present" method, named 02. Python Jinja2 module, with the same parameters except for "Name": python3-jinja2. This package allows the agent to transform our template into a configuration file. It has this name on all three systems in the lab.

Rudder Package present method to install the python3-jinja2 package
Card 02 installs python3-jinja2. Provider remains default.

Why install Jinja2 on every node? The "File from a jinja2 template" method performs rendering on the target machine. It uses the Python jinja2 module, which is not bundled with the agent: card 02 ensures it is present before card 04 is rendered. Method prerequisites.

In our demonstration, AlmaLinux remains in Audit: the EPEL card checks the package's presence without installing it. That card was absent from the first Audit snapshot kept in the deployment section.

Distributing the template, then generating jail.local

There are two different operations: make the template file available on the node, then replace its variables to write the final configuration. We dedicate two methods to them, in that order.

In the same technique, after the package installation cards:

  1. Open the technique's "Resources" tab at the top of the editor.
  2. Click "Manage resources". A file management window opens.
  3. At the top right of this window, open the "⋮" menu, then choose "Upload files".
  4. Select the jail.local.j2 file created on your workstation. Wait until it appears in the list, then click "Close".
  5. Back in the technique, the file shows the NEW badge. A message indicates that one file remains unsaved: click "Save" to finish the upload.
Uploading the jail.local.j2 file into the resources of a Rudder technique
In Manage resources, the ⋮ menu gives access to Upload files. Here, jail.local.j2 is already uploaded.

The tab should then show Resources 1. Next to the file, Rudder shows Use in methods with: and provides this path:

${resources_dir}/jail.local.j2

Copy it with the button placed to its right. ${resources_dir} represents the technique's resources directory on the node: the agent retrieves these resources with its policy. You do not need to create this directory yourself or copy the template to the server over SSH.

resources_dir path of the jail.local.j2 template in the Rudder technique resources

In Resources, the button to the right of ${resources_dir}/jail.local.j2 copies the path to use in card 03.

Add the "File from local source" method, named 03. Copy of jail.local.j2 template. In "Parameters", fill in:

  • "Source": ${resources_dir}/jail.local.j2.
  • "Path": /etc/fail2ban/jail.local.j2.

The copy happens on the node: the agent retrieves the model provided with the technique, then the "File from local source" method copies it to /etc/fail2ban/jail.local.j2. The next method will use this template to generate the fail2ban configuration.

Rudder File from local source method copying jail.local.j2 onto the node

Then add "File from a jinja2 template", named 04. Rendering of jail.local. In "Parameters":

  • "Source template": /etc/fail2ban/jail.local.j2.
  • "Path": /etc/fail2ban/jail.local.
Rudder File from a jinja2 template method generating /etc/fail2ban/jail.local
Jinja2 rendering: Source template refers to the .j2 model. Path refers to the configuration file to generate.

The first path is the template present on the node. The second is the file that fail2ban will read. At each run, Rudder compares the expected result with this file: a manual change, for example to maxretry, will be reported in Audit or corrected in Enforce.

Changing an INI option without managing the whole file

Understanding INI: a section contains keys and their values

INI is a text file format that groups settings under section names in brackets. Inside a section, a key = value line defines an option. For our setting, the file must contain:

[Definition]
loglevel = INFO

[Definition] is the section. loglevel is the key. INFO is its value. The section is part of the setting's address: looking only for a line containing loglevel is not enough to express where it must go.

The Rudder method translates this structure into four fields:

FieldRole
"Path"The file to edit
"Section"The target section, entered without brackets: Definition
"Name"The key to create or modify: loglevel
"Value"The expected value: INFO

This setting concerns fail2ban logs, not the number of failures before a ban. INFO requests normal operational messages, without the debugging verbosity of DEBUG. We place this customization in fail2ban.local: fail2ban reads its .local files after the corresponding .conf files, which makes it possible to extend the configuration provided by the package. fail2ban format and options.

We will now set fail2ban's logging level to INFO. Add "File key-value in INI section", named 05. loglevel in fail2ban.local, then fill in:

  • "Path": /etc/fail2ban/fail2ban.local.
  • "Section": Definition.
  • "Name": loglevel.
  • "Value": INFO.

This method ensures that loglevel = INFO is present in the [Definition] section. It creates the file if needed. Unlike the template, it does not replace its entire content.

Rudder File key-value in INI section method for fail2ban loglevel

The four fields target loglevel = INFO in the [Definition] section of /etc/fail2ban/fail2ban.local.

We deliberately use two separate files: jail.local is entirely generated by Jinja2. fail2ban.local receives a targeted INI modification. Making the same file managed by both a full template and a second editing method could lead to repeated corrections.

Forbidding SSH root login

Understanding Augeas: changing a configuration by its structure

Augeas is a configuration file editing tool. It reads a file and represents it as a tree: options become entries reachable by a path. You can then ask for "set the value no for the PermitRootLogin option" rather than build a text search and replace.

To understand the file format, Augeas uses a lens. It is a module that knows how to read and rewrite a syntax. The Sshd lens knows the syntax of the OpenSSH server configuration. The name must be copied as-is into "Lens".

Take this simplified content:

Port 22
PermitRootLogin yes
PasswordAuthentication no

Our method targets the PermitRootLogin entry and sets it to no. The expected result in the file is:

Port 22
PermitRootLogin no
PasswordAuthentication no

We give Rudder one specific option while leaving the other settings under their current management. Augeas preserves unrelated elements, including comments, as far as its lens allows. This is useful when you want to manage part of an existing file without supplying a full template. How Augeas works.

Add "File Augeas set", named 06. PermitRootLogin no. Augeas can read the structure of some configuration files: it lets us change an SSH option without rewriting the entire sshd_config file.

In "Parameters", enter the following four values:

  • "Path": /etc/ssh/sshd_config/PermitRootLogin.
  • "Value": no.
  • "Lens": Sshd.
  • "File": /etc/ssh/sshd_config.

Be careful with the difference between "Path" and "File": the first one names the file and the option to change in the method's notation. The second contains only the file path. Sshd tells Augeas how to interpret it. The tool and this lens are provided by the Rudder agent.

The path /etc/ssh/sshd_config/PermitRootLogin is not a file path to create on disk. In this method, it means: "in the file /etc/ssh/sshd_config, reach the PermitRootLogin entry".

ParameterHow to read it
"File": /etc/ssh/sshd_configThe actual file to load
"Lens": SshdThe module that understands its syntax
"Path": /etc/ssh/sshd_config/PermitRootLoginThe option to reach in its structured representation
"Value": noThe value to assign to it

PermitRootLogin no forbids direct SSH logins for the root account, including by key. It does not prevent an authorized non-root account from logging in and then using sudo. Meaning of PermitRootLogin in OpenSSH.

In Enforce, a different value will be corrected. In Audit, Rudder will report the drift without writing it. This edit does not check included files, nor the validity of the entire SSH configuration: we will handle those points with the checks below (File Augeas set parameters).

Rudder File Augeas set method to enforce PermitRootLogin no in sshd_config

Before deploying in Enforce, check the files in /etc/ssh/sshd_config.d/. An included file before the changed line may already define PermitRootLogin. SSH keeps the first applicable value: modifying the main file might then not change the effective configuration. In the lab, no included file defined this option. The verification command to run on the node is:

sudo sshd -T | grep -i permitrootlogin

Checking SSH syntax

Add "Command execution result", named 07. Validation sshd -t, after the Augeas method. In "Parameters":

  • "Command": /usr/sbin/sshd -t.
  • "Kept codes": 0.
  • "Repaired codes": 256.

sshd -t checks the configuration syntax without starting an SSH server. A code 0 means the check succeeded. The "Kept codes" field tells Rudder which exit codes to interpret as success.

Rudder Command execution result method to validate SSH configuration with sshd -t

The /usr/sbin/sshd -t command uses 0 in Kept codes and 256 in Repaired codes, according to the workaround explained below.

Why 256 in "Repaired codes"? The field is mandatory in the 9.1.5 interface: if left empty, it blocks saving. But this command checks a file and does not repair anything. I therefore use a value that is impossible for a Unix process exit code, which is limited to 255. Any non-zero result will still be an error. This is a workaround tested in this lab, not an official Rudder recommendation.

This check protects the restart, not the file write. The previous method already wrote sshd_config. If sshd -t fails, we will prevent the automatic restart, but the file must be corrected before any later SSH restart.

Restarting SSH after a validated change

A systematic restart every five minutes would be pointless. We want to trigger it only if the SSH option was modified and if the new configuration is valid. Rudder allows this with the conditions produced by the previous methods.

Open the 06. PermitRootLogin no card, then "Result conditions". The "Repaired" result provides:

file_augeas_set__etc_ssh_sshd_config_PermitRootLogin_repaired

In 07. Validation sshd -t, the "Success" result provides:

command_execution_result__usr_sbin_sshd__t_kept
Repaired condition of the Augeas method in Rudder's Result conditions tab
In Result conditions, copy the value of the Repaired line with the button on the right. It will be used to condition SSH restart.

In card 07, retrieve the "Success" line, whose identifier ends with _kept. This is the value that completes the "Repaired" result of card 06.

Success condition of sshd -t validation in Rudder's Result conditions tab

These names are technical, but you do not have to invent them: copy them from Result conditions. The paths and the command are used to build their name. If you change these parameters, copy the new names displayed.

How should the retrieved value be read? In file_augeas_set__etc_ssh_sshd_config_PermitRootLogin_repaired, we can recognize the file_augeas_set method, the option path in a form usable in an identifier, and then the repaired result. Rudder builds this name from the parameters: the copy button lets you keep the exact characters, especially underscores.

The dot between the two identifiers means AND: "the configuration was corrected and its syntax was validated." So a single true condition is not enough to trigger this restart.

Add "Service restart", named 08. SSH restart (Debian and Ubuntu), then enter these values:

TabFieldValue
"Parameters""Name"ssh
"Conditions""Operating system""Debian", without entering a version
"Conditions"Other conditionsPaste the two conditions joined by a dot

For "Other conditions", use the conditions from your own cards rather than blindly copying the example:

  1. In the technique editor, click the header of 06. PermitRootLogin no to expand the card, then open the "Result conditions" tab. This tab lists the conditions that the method can produce at runtime.
  2. Find the "Repaired" line and click the copy button to the right of its identifier. This is the value you need to retrieve, not the card title or the word "Repaired". Paste it immediately into "Conditions" > "Other conditions" of card 08. We choose this result because the restart must follow an actual file change.
  3. Expand 07. Validation sshd -t, also open "Result conditions", and then use the copy button on the "Success" line. Here, it corresponds to the success of the syntax check. The identifier ends with _kept.
  4. Go back to "Conditions" > "Other conditions" of card 08. After the first value already pasted, add a dot ., then paste the "Success" identifier from card 07, with no space.

These identifiers depend on the method parameters: if you used a different path in card 06 or a different command in card 07, they may differ from ours. The simple name given to the card does not change them. Always take the values provided by "Result conditions".

If you later modify a method or its parameters, check its Result conditions again. If the produced identifier has changed, replace its reference in the "Other conditions" fields of the cards that use it as well. The link depends on the exact condition name: an old reference may still remain in the field even though the method no longer produces that condition. The restart may then stop triggering. Copy the new value from "Result conditions" to restore the link.

Here is the expression obtained with our parameters:

file_augeas_set__etc_ssh_sshd_config_PermitRootLogin_repaired.command_execution_result__usr_sbin_sshd__t_kept

This condition means: restart SSH only if card 06 corrected the configuration and card 07 validated it. The "Debian" choice, without a version, covers Debian and Ubuntu: a single card is enough for their ssh service. After saving, Rudder may display this same targeting as "Debian family".

The "Applied condition expression" field is calculated automatically by Rudder: you do not need to enter anything there.

Conditional restart of the ssh service on Debian and Ubuntu in a Rudder technique

For AlmaLinux, add another "Service restart" card:

Card name"Name" in Parameters"Operating system" in Conditions
09. SSHd restart (RHEL-like)sshd"Red Hat family"

In "Other conditions", copy exactly the same expression as in card 08. The two criteria remain the same: configuration corrected, then validation successful. The "Operating system" selector handles system targeting.

Conditional restart of sshd on the Red Hat family in a Rudder technique
Card 09 targets "Red Hat family". It reuses the same results from 06 and 07 as card 08.

We now have two SSH restart cards: ssh for Debian and Ubuntu, sshd for AlmaLinux. Only the Debian node is in Enforce in this lab. The SSH restart on Ubuntu, where SSH uses ssh.socket, and on AlmaLinux is not validated here.

Restarting fail2ban after a configuration change

Finally add "Service restart", named 10. Restart fail2ban. In "Parameters", the "Name" parameter is fail2ban.

This time, the restart should happen if the jail.local file or the fail2ban.local file has been corrected. In "Conditions", without system restriction, fill in "Other conditions":

(file_from_template__etc_fail2ban_jail_local_repaired|file_key_value_present_in_ini_section__etc_fail2ban_fail2ban_local_repaired)

The vertical bar | means OR. Parentheses group the two possibilities. Copy the conditions from "Result conditions" in cards 04 and 05: despite the Jinja2 method name, its condition starts with file_from_template_, without jinja2.

Conditional restart of fail2ban after a configuration change in Rudder
Operating system remains on "All". The | bar links the Repaired results from cards 04 and 05.

When the files are already correct, neither condition is true: fail2ban does not restart. If only SSH has been changed, the fail2ban restart is also ignored.

Saving and checking the order

Your technique should now contain eleven cards, in this order:

No.Component name
00EPEL repository (AlmaLinux 9)
01fail2ban package
02Python Jinja2 module
03Copy of jail.local.j2 template
04Rendering of jail.local
05loglevel in fail2ban.local
06PermitRootLogin no
07Validation sshd -t
08SSH restart (Debian and Ubuntu)
09SSHd restart (RHEL-like)
10Restart fail2ban

Click "Save". If the button is greyed out, check the required fields on the cards, especially "Repaired codes". In the lab, an error there was reported as Parameter 'repaired_codes' is empty.

The technique's "Parameters" tab and the "Parameters" tabs of its cards do not serve the same purpose. We set the values directly in the cards. We did not create any configurable parameter for the future directive. The future directive will therefore indicate that no parameter is configurable.

The "YAML editor" provides another representation of the same cards. It is useful for reading or reproducing a technique, but you do not need to fill it in in addition to the visual editor.

The "Resources" path described here was validated on the Debian node after the first tests. Template copy and rendering there are compliant, without restarting the services again. The first Audit excerpt and its percentages come from the initial tests, which used the shared folder to copy the same model. The screenshots have been updated with the technique resources and the EPEL card.

Deploy in Audit, then in Enforce

The technique is ready, but it is not applied yet. We now need to connect three objects: the directive chooses the configuration, the group chooses the machines, and the rule links the two.

Everything that follows concerns the lab machines. Before touching SSH, keep a VM console available and make sure your usual account, different from root, can open a new SSH connection with sudo. This is the account that must keep working once root login is forbidden.

Creating the directive in Audit mode

In the Rudder server interface:

  1. Open "Configurations" > "Directives".
  2. Under "User Techniques", select SSH hardening - fail2ban.
  3. Click "Create with latest version".
  4. Name the directive Rudder demo - SSH hardening.
  5. In "Policy mode", choose "Audit".
  6. Open "Parameters" to verify the content, then click "Save" and confirm creation.

The Parameters tab here says This Technique has no configurable parameters. That is normal: we entered the values directly in the technique cards. There is nothing to copy into this directive.

The Audit choice is essential for the first pass: Rudder will evaluate the desired configuration without installing fail2ban, writing its configuration or restarting SSH.

Creating a Rudder directive in Audit mode for SSH hardening
Selecting Audit mode in the form before saving.

Creating the rule and checking the targeted machines

  1. Open "Configurations" > "Rules", then click "Create".
  2. In "Name", enter Rudder demo - SSH hardening.
  3. In the "Directives" tab, select the directive you just created. It should appear in "Apply these directives".
  4. In the "Groups" tab, include the Rudder demo - SSH hardening group created from the demo=rudder property. It should appear in "Apply to Nodes in any of these Groups".
  5. Check that you are targeting the three lab nodes only, without the Rudder server, then save and confirm rule creation.

The same name is used for the directive, the rule and the group so they are easy to find. They are indeed three distinct objects. The rule page should show Nodes 3 and Audit mode.

Let the server finish generating policies. The next agent run will fetch this configuration. To trigger the check without waiting, open a console on each of the three nodes and run:

sudo rudder agent run

rudder agent run tries to fetch the latest available policy, then starts its evaluation. The directive's Audit choice remains in effect even if Rudder's global mode is Enforce.

Reading the first Audit result

In the agent output, the letter A means a method in Audit and E a method in Enforce. Some system directives may remain in Enforce: look for the lines from our ssh_hardening___fail2ban technique.

During the first test, fail2ban was not installed on any of the three nodes and the SSH option had not yet been hardened. The technique then had eleven components, with two distinct SSH cards for Debian and Ubuntu. We have since grouped those two SSH cards and added the EPEL preparation: the procedure above also has eleven components, but their composition differs from the first test. The excerpt and percentages from that first snapshot correspond to the version with eleven components:

=> 11 components in Audit mode
   -> 1 compliant
   -> 5 not-applicable
   -> 5 non-compliant

Here is how to read it:

StatusMeaning in our test
compliantThe python3-jinja2 package is already present: nothing is missing for this check.
non-compliantThe fail2ban package, template copy, rendering, INI option and SSH setting do not yet match the requested configuration.
not-applicableThe command check is not run in Audit by this method. The four restart cards also do not run.

If you had already installed or configured fail2ban, your numbers would be different. The goal is not to reproduce a percentage: it is to understand the drift before allowing it to be corrected.

To read the details for a node, open "Node management" > "Nodes", select the machine, then "Compliance". Expand the rule and its directive to find the components.

The screenshot below shows Ubuntu, still in Audit. It was taken again after the tests. Debian had already moved to Enforce at that point.

The rule shows about 54% / 45%. The tooltip from the first test detailed Compliant: 9.09%, Not applicable (audit): 45.45% and Non compliance: 45.46%. Not-applicable items are included in the green share: (1 + 5) / 11 = 54.5%. This therefore does not mean that half of the hardening has been applied.

Two messages also deserve an explanation: the missing package was accompanied by If you tried to install a virtual package…, and Augeas by your request has failed. In this test, these were drift detections in Audit, not an attempted installation or modification that failed.

In Audit, the lab checks confirmed that sshd_config remained unchanged, SSH did not restart, and fail2ban was not installed.

A temporary file may appear in Audit. In this lab, Augeas creates a .augnew file in /etc/ssh/ to prepare the change, without applying it to the sshd_config file used by SSH.

Switching only Debian to Enforce

We are now going to allow corrections on Debian only. Ubuntu and AlmaLinux must remain in observation.

There is a trap: forcing Debian to Enforce is not enough if the directive itself stays in Audit. Under Rudder's priority rules, Audit wins when a node and a directive impose conflicting modes.

Proceed in this order:

  1. Open "Node management" > "Nodes", then the Ubuntu node page and its "Settings" tab. Set its mode to "Audit" and confirm. The confirmation says: Directives will never be enforced on this node, regardless of their policy mode.
  2. Do the same for the AlmaLinux node.
  3. Check the Debian node mode: in the lab, it inherits the global Enforce mode. It should therefore be allowed to apply the configuration.
  4. Go back to "Configurations" > "Directives", open our directive and replace "Audit" with "Global mode (enforce)". Save.

The expected result is as follows:

NodeMode at node levelResult for our directive
DebianEnforce, inherited from the global mode in the labDrift can be corrected.
UbuntuAudit forcedDrift is only reported.
AlmaLinuxAudit forcedDrift is only reported.

After policy generation, run the following command on Debian only:

sudo rudder agent run

The agent can then install fail2ban, generate its files, modify the SSH option and restart services if their conditions are met.

Verifying the configuration and SSH access

On the Debian node, start with these checks:

sudo sshd -t
sudo sshd -T | grep -i permitrootlogin
sudo fail2ban-client status sshd
sudo fail2ban-client get sshd maxretry
sudo fail2ban-client get loglevel
sudo cat /etc/fail2ban/jail.local

Here is the output observed on the Debian node in the lab. sshd -t produces no message when the check succeeds. fail2ban counters may vary on your machines.

$ sudo sshd -t

$ sudo sshd -T | grep -i permitrootlogin
permitrootlogin no

$ sudo fail2ban-client status sshd
Status for the jail: sshd
|- Filter
|  |- Currently failed: 0
|  |- Total failed: 0
|  `- Journal matches: _SYSTEMD_UNIT=ssh.service + _COMM=sshd
`- Actions
   |- Currently banned: 0
   |- Total banned: 0
   `- Banned IP list:

$ sudo fail2ban-client get sshd maxretry
3

$ sudo fail2ban-client get loglevel
Current logging level is 'INFO'

$ sudo cat /etc/fail2ban/jail.local
# File generated by Rudder (technique "SSH hardening - fail2ban").
# Any local change is overwritten at the agent's next run.
# Node: node-rudder.local - demo property = rudder

[sshd]
enabled  = true
port     = ssh
backend  = systemd
maxretry = 3

In the lab, the Debian jail read the journal with Journal matches: _SYSTEMD_UNIT=ssh.service + _COMM=sshd. Then open a new SSH connection with your non-root account, while keeping your session and VM console available. My non-root account was still able to connect after the rule was applied.

If sshd -T does not show no, do not stop at reading the line written in sshd_config: check the files included in sshd_config.d. Our Augeas method does not manage them. The syntax check and the effective value check answer two different questions.

In the rule's "Nodes" tab, under "Compliance by nodes", finally verify that Debian is compliant and Ubuntu and AlmaLinux remain in Audit. The first measurements showed Debian at 100%, and the other two nodes around 54% / 45%.

Rudder compliance by node after the Debian node was switched to Enforce mode

100% does not mean "nothing changed". A configuration successfully repaired is counted as compliant. In this first deployment, repairs represented 66.68% of the compliance shown for Debian.

Changing SSH and waiting for automatic correction

The first deployment was launched manually. To demonstrate the value of the agent, we will now change a value and run no Rudder command at all: the scheduled execution must take over.

On the Debian node in the lab, I replaced PermitRootLogin no with PermitRootLogin yes at 16:44:23:

sudo sed -i 's/^PermitRootLogin no$/PermitRootLogin yes/' /etc/ssh/sshd_config

I did not restart SSH for this manipulation: it creates a drift in the file monitored by Rudder. I then forced neither run nor an agent update.

On the next scheduled run, the agent corrected the file, validated its syntax and restarted SSH. The report contains:

The component labels in this excerpt have been harmonized with numbering 01–10. The results and messages are from the initial test.

result_repaired | 06. PermitRootLogin no       | Setting the node value for /etc/ssh/sshd_config/PermitRootLogin was repaired
result_success  | 07. Validation sshd -t       | Execute command /usr/sbin/sshd -t was correct
result_repaired | 08. SSH restart (Debian and Ubuntu) | Restart service ssh  was repaired
result_na       | 10. Restart fail2ban         | Skipping method 'Service restart' with key parameter 'fail2ban' since condition '(…)' is not reached  was not applicable

The result matches our conditions: SSH restarts because its file changed and the check succeeded. Fail2ban does not restart, because its configuration did not change.

Right after the correction, the 06. PermitRootLogin no and 08. SSH restart (Debian and Ubuntu) components appear as Repaired in the Debian node compliance view. On subsequent runs, they return to a compliant state without further repair.

To find the proof afterward, open "Configurations" > "Rules" > "Rudder demo - SSH hardening" > "Recent changes". Select the time slice from October 21, 2026, 12:00 to 18:00 UTC, then look for the two lines at 14:48:19 and 14:48:20 UTC: modification of PermitRootLogin, then SSH restart. They correspond to 16:48 in the local time used for the test narrative.

Rudder Recent changes tab: configuration drift automatically corrected

Verifying the correction of a fail2ban configuration drift

I performed a second test at 16:51:34, replacing maxretry = 3 with maxretry = 10 in /etc/fail2ban/jail.local. Again, I did not run any Rudder command.

On the next scheduled run, the agent reapplied the template and restarted fail2ban. The next check confirmed the value was back to 3:

sudo fail2ban-client get sshd maxretry

SSH did not need to restart this time.

Where can you see it in the previous screenshot? The last three lines show two repair reports for the rendering of jail.local at 14:53:19 UTC, then the fail2ban restart at 14:53:20 UTC. That corresponds to 16:53:19 and 16:53:20 in the local time used here.

The screenshot therefore shows the repair of the file and the restart of the service. The manual change to maxretry and its return to 3 come from the test logs and terminal checks. They are not shown in this image.

What does 100% compliance mean in Rudder?

Between the manual change and the agent's next pass, the interface still showed the previous report, at 100%. During the corrective pass, the agent detected and repaired the drift in the same run. The report received by the server therefore contained Repaired, which is also counted in the 100%.

In these successful tests, we therefore did not see compliance go red before turning green again. To spot corrections, look at the repair reports, not just the percentage. A repair indicates that a state has been restored. It does not, by itself, identify the person or process that caused the drift.

The Enforce demonstration here is validated on Debian. Ubuntu and AlmaLinux were used to verify targeting, packages and Audit behavior. Their full fail2ban deployment and SSH service restart are not covered by these tests.

Rudder Core and paid offerings: what are the differences?

The previous lab works with Rudder Core, without any paid plugin. It proves configuration management and automatic correction of two drifts on Debian. The production screenshots show additional features: you need to distinguish these two scopes to know what you can reproduce for free.

Features available in Rudder Core

Rudder Core is open source and free. The server, the agent, the technique library and the generic methods are published under the GPLv3 license: see the Rudder, rudder-agent and rudder-techniques repositories.

With Core, we created dynamic groups, built a technique, observed drift in Audit, then authorized its correction in Enforce. Reports let you track this configuration by node and by rule.

Core is therefore already suitable for a recent Linux fleet when the need is: "these machines must keep this configuration." This should not be confused with a tool that automatically associates a published vulnerability with each of your servers.

Features and services offered with the subscription

Pricing is per node per year, by quote. According to the Rudder Plans and pricing page, the offers are as follows:

OfferAnnounced scope
Rudder EnterpriseSecurity configuration management, unlimited standard support and one additional solution of your choice: patches and vulnerabilities, or policy and benchmark compliance. Security fixes for 18 months. Update window of 6 months.
Rudder Corporate Security SuiteThe full set of solutions, premium support and guaranteed fix times. Security fixes for 24 months. Update window of 9 months.

Mandatory onboarding fees are added in the first year. Detailed terms and support scope should be read in the commercial offer.

The plugin documentation distinguishes free integration plugins from licensed functional plugins. Among the functions concerned:

  • Patches and vulnerabilities: update campaigns and CVE tracking, the identifiers assigned to published vulnerabilities.
  • Security benchmarks: checking against a hardening benchmark, for example CIS.
  • Change validation: approval workflow before application, with change-validation.
  • Relays: policy distribution in an architecture using relays, with scale-out-relay.
  • Centralized authentication: login to the interface with LDAP, Active Directory, OAuth 2.0 or OpenID Connect, depending on the authentication backends.

The choice therefore depends on the required features: the lab in this article does not need a subscription, but an organization that needs relays, an approval workflow or vulnerability tracking falls outside the Core scope.

My interest in patch and vulnerability tracking

Personally, the "Patches & vulnerabilities" part is what convinces me most. Seeing the CVEs that affect each of my machines, applying a targeted fix, driving updates from Rudder as part of operational maintenance, and having a dashboard of what has or has not been done: that is what makes the difference on a daily basis. Rudder then measures not only compliance with configuration policies, but also the actual security state of the fleet.

Concrete example: reacting to a PHP alert

The PHP2Shell fixes published on October 21, 2026 illustrate this need. The CVE-2026-109618 and CVE-2026-109619 vulnerabilities, rated 9.2 in CVSS 4.0, allow unauthenticated remote code execution on PHP applications exposed to the network. See the PHP advisory, the CERT-FR advisory and Ubuntu's explanations.

The fixed versions published by PHP are 8.2.35, 8.3.36, 8.4.27 and 8.5.12. These are upstream versions, from the PHP project. Distributions can also include the fix in their own packages without reusing that version number.

For example, Ubuntu 24.04 provides the fix in 8.3.6-0ubuntu0.24.04.13. The beginning of the number remains 8.3.6, but the package is patched. A test that compares only "PHP 8.3.6" to "PHP 8.3.36" would therefore reach the wrong conclusion. Ubuntu also provides fixes for older branches in its supported releases: upstream end of support and distribution support are not the same thing.

What could Rudder bring in this case? Three steps must be separated:

  1. Identify the machines to inspect, with Core. A dynamic group on the "Software" criterion can search for installed PHP packages, for example php8.4-fpm or libapache2-mod-php8.4. Their presence provides a list of candidates. It does not prove network exposure or the presence of the vulnerability by itself. To judge the fix, you need to examine the full package version and the distribution advisory.
  2. Apply an update configuration, with Core. A technique can request a specific package version, or latest in the "Version" parameter of "Package present", then restart the relevant service if the package was repaired. The model is similar to our conditional SSH restart. The repository must provide the fix and the application must then use the updated libraries. Ubuntu reminds us that affected applications must be restarted.
  3. Associate vulnerabilities with nodes and drive remediation, with the paid offer. This is the role of the Patches & vulnerabilities module. CVE identification becomes a product feature instead of relying only on a software group and your reading of advisories.

Inventory deserves special attention. In the lab, its daily submission is scheduled between midnight and 6 a.m.: the group may therefore still reflect an older state. To send a new inventory from a node:

sudo rudder agent inventory

Then wait for it to be processed on the server before interpreting the group. This PHP remediation scenario was not executed in the lab: it explains the possible use of the functions and must be validated before a real deployment. The tests in this article focus on SSH and fail2ban.

How should repairs be interpreted in the Changes column?

The next screenshot comes from my production setup, which uses plugins. It shows eleven rules at 100% and In application. The system rule Global configuration for all nodes is Not applied, in gray.

Rudder rules from a production fleet with the Changes column showing repairs

On the new screenshot, the MOTD - YouKyi Banner rule shows 1117 in "Changes" (1118 in the initial reading presented in the table below). This column counts Repaired reports for the current six-hour slice. Slices start at 00:00, 06:00, 12:00 and 18:00 UTC: this is not a sliding window.

I verified this reading in the rule's "Recent changes" tab, since no tooltip explained it:

ReadingInterpretation
1118 at 17:40 UTCCumulative repairs since 12:00 UTC. The slice ended at 1182.
192 at 18:50 UTCRepairs in the new slice, which started at 18:00 UTC.

Why so many repairs while the rule remains at 100%? In this case, two directives were conflicting:

  1. MOTD - Default scripts disabled applied mode 644 recursively to /etc/update-motd.d/. It therefore removed execute permission from my 00-youkyi script.
  2. MOTD - Script put that same script back to 755, therefore executable.
  3. On each subsequent pass, the two operations started over.

Reading the parameters in the interface confirmed the cause. The 1,174 to 1,188 repairs per slice observed matched this oscillation, not that many different manual changes.

The proposed fix is to keep appropriate permissions on the directory and on 00-youkyi, and to limit removal of execute permission to the default scripts you actually want to disable. Their list must be inventoried before changing the directive.

Update of October 26, 2026: this fix was applied to the existing rule, replacing the conflicting directives with one directive that targets the scripts to disable without recursion. The October 26 validation reported 30 nodes out of 30 compliant, with no error, and no repair on the second pass on the pilot node.

The Changes column therefore signals activity to investigate. A high number can reveal conflicting directives, an application rewriting its files, or another cause: the counter alone does not let you decide.

Lab summary: Rudder's strengths and limits

The strengths observed:

  • The agent corrects drift without waiting for manual intervention: the two changes in the lab were restored on the next scheduled run.
  • Audit lets you read drift before allowing remediation, then gradually move nodes into Enforce.
  • Conditions limit restarts to the relevant services. When the configuration remains correct, those cards are skipped.
  • Dynamic groups make it possible to target a configuration from properties and inventory.

The limitations encountered:

  • The compliance percentage includes not-applicable items and successful repairs: you need to open the report details.
  • Audit mode may leave the .augnew temporary file from our Augeas method, and some messages are not very explicit.
  • The sshd -t check comes after writing the file. An error prevents the conditional restart, but does not restore the old file.
  • The Augeas setting in this example does not check files included in sshd_config.d.
  • The mandatory "Repaired codes" field and the debian family, which includes Ubuntu, require knowing the details explained in the section devoted to techniques.
  • The Enforce deployment of fail2ban and SSH restarts on Ubuntu and AlmaLinux still need to be tested.

Conclusion

With Rudder Core, we created a hardening configuration, read drift in Audit, then allowed it to be corrected on a single node. The Debian agent then restored two manual changes on the next scheduled run, with a restart of only the affected service.

To reproduce the approach, remember the sequence: a technique describes the actions, a directive uses that technique, and a rule applies it to a group of nodes. Start in Audit, check the reports, then gradually move to Enforce.

Finally, do not reduce compliance to a green percentage. Look at Repaired states, skipped components and the actual system configuration. That detail is what lets you distinguish a stable configuration from one that is being corrected in a loop.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.