How to stop local users from removing the Wazuh agent on Linux
An agent that a local user can remove without anyone noticing leaves a blind spot in your monitoring, and the gap is often largest on the hosts that matter most. Wazuh anti-tampering on Linux is the set of controls that block package removal of the Wazuh agent by local users, so that only an administrator working through your change process can uninstall it. It is one control among several. It does not replace file integrity monitoring, privilege management, host hardening or alerting on agents that stop reporting, and it should be planned alongside those controls rather than treated as the answer to insider risk.
Teams usually need this on shared hosts where several people hold local accounts, on regulated workloads where a missing agent would break evidence collection, and on systems where local users hold elevated privileges such as sudo rights to package managers. A host that is still reporting to the manager is not proof that the agent is intact, so the monitoring design should also flag agents that go silent. Before rollout, confirm the exact mechanism, the configuration keys and the behavior of the validation token against the Wazuh documentation for the 4.14 line in the Wazuh documentation and the agent configuration reference, because the settings and their defaults can differ between releases. Confirm how the protection is applied centrally through agent groups and whether it can be set per agent.
Before you change anything in production, test the flow on a representative set of Linux distributions that your fleet uses, and record which local actions still succeed, such as stopping the service or removing files outside the package. Ask your Wazuh partner or internal team to document the procedure an authorized administrator follows to remove or upgrade an agent, including who approves it and how the removal is logged, so that legitimate maintenance does not become a support emergency.
Choosing central or per-agent uninstall protection
This table compares setting uninstall protection through agent group configuration with setting it on each agent individually. Read each row as a question to answer for your fleet before you choose, and treat the setting names and upgrade behavior as items to confirm against the Wazuh documentation for your release line. The main takeaway is that central control keeps hosts consistent, while per-agent control only pays off when roles genuinely differ.
| Factor | Central through agent groups | Per-agent setting |
|---|---|---|
| Where the setting lives | Agent group configuration held on the Wazuh server and applied to every agent assigned to the group | Local agent configuration on the individual endpoint, managed alongside that host's other settings |
| Who can change it | Users with rights to edit group configuration on the Wazuh server, which should be a small administrator set | Anyone with root or administrator access to the endpoint, unless the local file is managed by a separate tool |
| Fit for mixed-role fleets | Works well when hosts sharing a role can be placed in one group, such as servers of the same application | Suits exceptions, for example a test host or a host that must keep a different protection posture |
| Risk of drift between hosts | Low, because one group change reaches every member and the server shows which group an agent belongs to | High, because a host edited by hand, rebuilt from an older image or missed during rollout can differ silently |
| Cost of changing it later | One group edit, then confirming that agents have picked up the new configuration | Touches each endpoint, so cost grows with fleet size and with how many hosts are configured differently |
| Behavior during upgrades | Confirm in the current documentation how group-managed settings are carried through agent upgrades | Confirm whether local edits survive package upgrades and reinstalls, and whether your configuration tooling overwrites them |
| Evidence an assessor can review | A group configuration export and group membership list that show the setting applied to the population | Per-host configuration checks, which need collection and comparison to prove coverage across the fleet |
What the validation token flow protects and what it does not
The validation token flow limits one thing: removing the Wazuh agent through standard package tooling. When uninstallation protection is enabled, the agent package asks for a validation token before it will be removed, so a local user who runs the normal package remove command is stopped unless they hold the token. Think of the token as the key to the package manager's removal path, not as a lock on the agent itself. The reader should treat it as one control in a layered design, and confirm the exact mechanism, token format and where the token is read from in the Wazuh documentation for the agent version they deploy, since the release notes are the place to check changes between patch releases.
Holders of the token are the people and systems that legitimately remove or upgrade agents: administrators who perform maintenance, the Wazuh manager if it is configured to manage removal, and the deployment tooling that installs and retires hosts. Each holder widens the set of places the secret can leak. Keep the token out of shared configuration repositories, general-purpose chat channels and ticket attachments. Store it in your secrets manager or an equivalent vault, restrict read access to the automation identity that needs it, and record who retrieves it. Ask the vendor or the documentation how the token is generated, rotated and recovered if it is lost, and whether rotating it affects agents already enrolled. Do not rely on a token flow you have not tested in a lab with your own rotation procedure.
The flow does not stop a user with root access. Someone who is root can stop the service, edit or remove agent files, kill the process, change local configuration, or install a rogue agent that reports to a different manager. Those actions are only detected after the fact, through the agent going silent or through configuration and integrity monitoring on the endpoint and the manager. Plan for that gap by pairing this control with agent enrollment restrictions, monitoring for agents that stop reporting, and privilege controls on the endpoint. Protection also differs by platform: the token mechanism described here applies to Linux packages, and your Windows, macOS and other agent hosts need their own assessment before you assume the same protection.
Where anti-tampering sits in the agent trust boundary
The diagram is illustrative and starts at the Wazuh server, which pushes agent configuration to an agent group. The Linux agent package carries the uninstall protection setting, so a local user who tries to remove the agent meets a validation step before the package manager acts. The root account on the host sits outside that boundary: anyone with root can change files, stop services or reinstall the agent, so protection on the endpoint is a deterrent for local users and does not stop a determined administrator. Check that the setting reaches each agent and that removal attempts raise alerts on the server.
Illustrative flow showing how group configuration, the uninstall gate and host root access relate.
Enabling uninstall protection on Linux agents
This sequence turns on uninstall protection for Wazuh agents on Linux in a controlled way, so local users cannot remove the agent, while confirming that monitoring, reporting and upgrades keep working. It ends with a rollout record and a verified, tested configuration on every Linux host.
Inventory Linux endpoints and agent versions
Export the list of enrolled agents with their operating system, distribution, package type and agent version from the Wazuh dashboard or API, and note any hosts that are offline or on unsupported releases. Mark which hosts belong to which agent group. The step is done when every Linux agent appears in a single inventory with a version and a group, and you have a short list of hosts that need an upgrade before the protection setting can be applied.
Confirm setting names and token steps in docs
Open the Wazuh documentation for the agent version in your inventory and record the exact configuration option names, the agent-side settings that control uninstall protection, and the validation token procedure. Check the release notes for the current 4.14 patch level, since behavior can change between patches. The step is done when you have a written note, tied to a specific version, that lists each option name and the token steps you will follow, and a colleague has reviewed it.
Test on a non-production host group
Create a dedicated test group containing a few representative Linux hosts, covering each distribution and package type in your inventory. Apply the protection setting to that group only, then restart or reload the agents as the documentation directs. The step is done when the test hosts show the expected configuration in the dashboard and the agents report their status normally.
Apply the setting centrally to a production group
Assign the protection configuration to the production agent group through the central configuration on the Wazuh server, using the group-level settings rather than editing each host by hand. Record the change, the group name and the configuration version in your change log. The step is done when the server shows the group configuration as synced to the agents in that group and no agent reports a configuration error.
Verify removal is blocked for a standard user
On a sample of hosts from each distribution, log in as a standard non-root user and attempt to remove the agent package using the native package manager, as well as stopping or disabling the agent service. Also confirm that a root or administrative change through the documented token process still works. The step is done when the standard user's removal attempt fails, the failure is logged, and the authorized process succeeds with the validation token.
Confirm agents still report and upgrade
After protection is active, check that the protected agents keep sending events and inventory data to the server, that alerts appear for test activity, and that a controlled agent upgrade on a test host completes using the documented token process. Review the agent status in the dashboard for disconnections. The step is done when the test hosts show continuous check-ins, expected events and a successful upgrade without leaving the agent in a broken state.
Record token custody and access
Document who holds the validation token, where it is stored, how it is retrieved for authorized changes and how it is revoked or rotated if staff change roles. Restrict access to the storage location and log each use. Confirm with the vendor documentation whether the token can be changed without redeploying agents. The step is done when a written custody record names the owners and storage location, and an access review confirms that only approved administrators can reach the token.
Roll out in waves with checks after each wave
Divide the remaining Linux agents into waves, starting with the lowest-risk groups and ending with critical systems. After each wave, check agent connectivity, alert flow, the removal test on a sample host and the record of any failed agents. Pause if a wave shows disconnected agents or configuration errors. The step is done when every wave has a signed-off check record and the final inventory confirms that all Linux agents report the protection setting as active.
Security and operational risks to plan for
Anti-tampering on Linux raises the cost of removing the agent, but it does not make the agent unremovable for someone with root. The cards below cover the places where the control can fail quietly, and the monitoring that tells you when it has.
Root and sudo bypass
Anyone with root or unrestricted sudo can stop the agent, edit its files or remove the package by working around the protection. Confirm which accounts hold root on each endpoint and who can run package managers as root. Treat the protection as a deterrent for local users, and rely on the server seeing the agent go silent as the real signal.
Wazuh docsValidation token storage and access
The uninstall validation token is a secret that lets an authorized process remove the agent, so it needs the same care as other credentials. Decide where it is recorded, such as a secrets store or the configuration management vault, and who can read it. Check that copies in tickets, chat, build logs and automation output are not left behind.
Upgrade and reinstall behavior
Agent upgrades, package reinstalls and rebuilt images can change how the protection is applied on an endpoint. Test the full cycle in a non-production group: upgrade, reinstall, and removal with the token. Confirm that the protection is still active afterward, and that the process you use to re-enable it is documented.
Configuration drift between groups
Protection set per agent or per group can drift as hosts move between groups or as new hosts are added by hand. Compare the effective agent configuration across groups on a schedule, not just at rollout. Record which endpoints are intentionally unprotected, such as lab or retired hosts, so that exceptions stay visible.
Agents that stop reporting
A removed or disabled agent is most useful to detect as a host that has gone silent. Define the expected check-in behavior for each group and alert when an agent stops reporting for longer than your tolerance allows. Confirm who receives the alert and what the response is, so silence does not sit unanswered.
Alerts for tampering attempts
Attempts to stop or uninstall the agent should produce their own alerts, separate from routine health checks. Decide which events to collect from the endpoint, such as package manager activity and service stop events, and test that the matching rules fire in your environment. Tune them to your change process so that planned maintenance does not flood the queue.
What anti-tampering covers on each platform
Linux agents are usually installed from a distribution package, so the core question is whether a local user with administrative rights can remove the agent without authorization. Confirm in the Wazuh documentation for your release line, 4.14 at the time of writing, which uninstall protection options exist, whether they are set through centrally managed agent group configuration or per agent, and how the validation token is generated, stored and supplied during an authorized removal. Test the result on every package family in your fleet, because package managers handle protected removal differently.
- Central or per-agent setting: Confirm whether protection is pushed from the Wazuh server through group configuration or set in the local agent configuration, and which one takes precedence.
- Validation token flow: Confirm who can obtain the token, where it is kept and how an operator uses it to remove the agent.
- Root access: Confirm what protection actually blocks. Assume a root user can still stop the service or edit local files unless the documentation states otherwise.
- Image and container hosts: Check whether agents baked into golden images or container base layers inherit the setting and whether the token process still works after a rebuild.
- Upgrades: Verify that protection survives agent upgrades, following the order in your upgrade plan.
Check each point against the documentation for your exact agent version, using the Wazuh release notes to see when behavior changed, before you write it into a hardening standard.
Windows agents are installed through the Windows installer and run as a service, so removal depends on installer rights, service control permissions and local administrator access. Do not assume that the Linux uninstall protection model applies here. Confirm in the Wazuh documentation for the Windows agent whether an equivalent removal protection exists in your release line, how it is configured and what it blocks. If the documentation does not describe an equivalent for your version, treat removal by a local administrator as possible and plan compensating controls.
- Administrator rights: Limit local administrator membership so that fewer users can uninstall software or stop services.
- Endpoint management controls: Use your endpoint management or application control tools to restrict uninstall actions and service changes, and confirm they cover the Wazuh service name and installer.
- Disconnection monitoring: Use the dashboard agent status view and alerting you build on it to notice when an agent stops reporting.
- Service recovery: Confirm that your management tooling reinstalls or restarts the agent when it is found missing or stopped.
- Testing: Run a removal test under a standard user and under a local administrator to record the actual result for your build.
Record the outcome of those tests with the agent version and Windows build, because the result can change between releases.
macOS agents are installed as packages and run as system services, and removal depends on administrator privileges and the controls your device management platform applies. Confirm in the Wazuh documentation for the macOS agent whether a removal protection equivalent to the Linux option exists for your release line, and whether it is set centrally or locally. Until the documentation confirms it, assume that a user with administrator rights can stop or remove the agent, and use management controls to narrow who has that access.
- Administrator accounts: Restrict administrator accounts and review them regularly, since removal generally requires elevated rights.
- Device management profiles: Use your mobile device management platform to enforce settings and restrict changes to protected files and services, and confirm which settings it can manage for the agent.
- File integrity monitoring: If your agent configuration covers the agent installation paths, alerts on changes there can show tampering attempts. Confirm that coverage in your configuration.
- Disconnection alerts: Track agents that stop reporting in the dashboard and treat unexpected silence from a managed device as an incident to investigate.
- Reinstall process: Define how a missing agent is detected and redeployed, including the approval step for any reinstall.
Confirm each control on a current macOS version in your fleet before you describe it as covering the agent.
Limits to confirm in your environment
Package uninstallation protection is one control among several, and its behavior depends on the agent version, the Linux distribution and the tools that manage your endpoints. The cards below list what to test on your own estate before you treat a removal attempt as blocked, and what the control leaves open.
Agent versions in use
The protection behaves differently across agent releases, so confirm it on every agent version in your estate, not only the one in your test image. Record the exact agent version on each host, including hosts that were enrolled years ago and never upgraded. Run a removal attempt as a local administrator on a sample of each version and keep the result as evidence. The current release line is 4.14, and patch releases arrive roughly every one to two months, so re-test after each planned upgrade.
Wazuh release notesDistributions and init systems
Package managers, service managers and boot paths differ across distributions, so a control that works on one family can behave differently on another. Test on every distribution and init system in the estate, including older releases still in service and minimal images. Check that the agent service restarts after a forced stop, that the package manager refuses removal when protection is on, and that the result is the same after a reboot.
Endpoint and configuration management tools
Configuration management and endpoint management tools can reinstall, reconfigure or remove packages on a schedule, which can undo or conflict with the protection. Identify every tool that touches the agent package or its files, such as Ansible, Puppet, Chef, or your endpoint platform, and confirm how each one handles a protected package. Decide which tool owns the agent lifecycle and document it so a routine run does not silently remove the agent.
Offline and air-gapped repositories
Hosts without internet access install packages from a local mirror, and the mirror must carry the packages and metadata that the protection depends on. Confirm that the offline repository holds the correct agent package for each version and distribution, and that the protection setting survives installation from that source. Plan how updates reach isolated hosts, because a stale mirror can hold back security fixes or leave hosts on unsupported versions.
Survival across agent upgrades
An agent upgrade replaces package files, so confirm whether the protection setting persists through the upgrade or must be reapplied. Test the full sequence on a copy of a production host: note the protection state before the upgrade, run the upgrade, then repeat the removal attempt. Include the central configuration and the per-agent setting, because they can disagree after a change. Schedule this test with every upgrade cycle.
What the control does not stop
Package protection is not a barrier against a root user. A user with root access can stop the service, edit or delete files, or reinstall the host, and that user may also be able to change the protection settings. Treat the control as a deterrent against casual removal by standard local users, and pair it with restricted root access, central alerting when the agent stops reporting, and monitoring for changes to the agent's files.
Questions teams ask before enabling agent anti-tampering
Is Wazuh agent anti-tampering hard to enable on Linux?
For most Linux fleets, enabling package uninstallation protection is a configuration change rather than a large project, but the effort depends on how agents are installed and grouped. The protection is set centrally or per agent, and the validation token flow then governs legitimate removal. Teams with a single standard image and a clear agent group structure usually find it straightforward. Teams with mixed distributions, hand-built hosts or agents installed outside their normal tooling should expect more verification work. Confirm the exact setting names and steps for your Wazuh version in the Wazuh documentation before planning the change.
How long does an anti-tampering rollout take?
The duration depends on fleet size, how many agent groups need different settings, and how much testing each group requires. A useful plan starts with a pilot group of non-critical hosts, then moves through production groups in waves, with a rollback step for each wave. Hosts that are offline, unmanaged or running unusual packaging take the longest because their state must be checked by hand. Ask any partner to base the timeline on a written inventory of host groups, distributions and change windows, not on a generic rollout length.
What does this work need from our internal team?
Your team needs to provide the people who own the endpoints, the Wazuh manager access, and a decision on which hosts are in scope. Someone must approve the change windows and the rollback criteria, and someone must confirm which hosts cannot tolerate a service restart. Security operations should agree on how they will respond when an agent reports as disconnected, because that is the signal that tells you a removal attempt may have succeeded. Plan for these contributions in advance so the technical work does not wait on approvals.
Can our own team enable agent anti-tampering without a partner?
Yes, if your team already administers Wazuh and manages Linux configuration at scale. The work is mostly controlled change: confirm the setting for your version, test it on a pilot group, roll it out by group and verify that agents still report. Teams without recent Wazuh administration experience, or without a way to test on representative hosts, usually benefit from a partner review of the plan. Whichever path you choose, document the validation token handling so that legitimate removals during maintenance do not turn into outages.
What does agent anti-tampering cost, and what should a partner quote?
Costs fall into four groups: the Wazuh software itself, which is open source with no license fee for the self-hosted product, internal staff time, any partner fee, and ongoing operations such as testing after upgrades. The self-hosted software carries no license fee according to the Wazuh Cloud page, but Wazuh Cloud is a separate managed service with its own plans. Costs rise with fleet size, the number of distinct host groups, the number of operating systems and the amount of change control required. Ask a partner to quote the inventory review, pilot, staged rollout, verification, documentation and one retest after the first upgrade, each as a separate line with its deliverables listed.
Does agent anti-tampering stop a user with root access?
No. Anti-tampering is designed to stop local users from removing the agent without the proper flow, but a user with root privileges can generally stop services, alter files or work around package controls. Treat it as one layer. Reduce root access on endpoints, watch for agents that go silent in the Wazuh dashboard, and monitor the agent files and service state so that tampering attempts leave a trace. Confirm exactly which actions the protection blocks on your distribution and version, and do not describe it to auditors as a control against administrators.
How does anti-tampering affect Wazuh agent and server upgrades?
Upgrades are the most common point where protection settings are lost, changed or misunderstood, so the setting must be checked after every agent and manager upgrade. Read the release notes for the target version before scheduling, and test on a pilot group that matches production packaging. Upgrade the central components and agents in the order the documentation calls for, then confirm that protection is still active and that the validation token flow still works. The Wazuh release notes list the patch releases you should review. Include this check in every change record.
Rollout, recovery and proving the control works
Start the rollout with a pilot agent group that holds a few non-critical Linux hosts, and enable package uninstallation protection there before extending it. Keep the protection setting in the agent group configuration rather than on individual hosts, so the state of every endpoint can be read from the manager. Before widening the scope, check three things on each distribution you run: that a non-root user cannot remove the package, that routine agent upgrades and configuration pushes still complete, and that the agent reconnects after a reboot. Confirm with the Wazuh documentation for your release line (currently 4.14) which removal paths the protection covers, since package managers, manual file deletion and disabling the service may behave differently.
Define the recovery path before anyone needs it. A legitimate removal, such as decommissioning, a rebuild or a replacement of the agent, should require a ticket that records the host, the reason, the requester and an approver from the security team, with the platform owner approving if the host is still in service. The validation token should be retrieved from your secrets store by an authorized operator, used for that one removal or re-enrollment, and then rotated or revoked according to the procedure the Wazuh documentation describes. Confirm how the token is issued and whether it can be revoked before it is needed in an incident. Re-enrollment afterwards should follow the same enrollment controls as any new agent.
Treat protection settings as controlled configuration. Keep the agent group files in version control, change them through reviewed pull requests, and record who approved each change. Keep evidence for auditors: exports of the manager configuration and agent group files at each change, the rollout test results for each distribution, records of blocked removal attempts, and alerts from the dashboard showing that the agent reported its status. Retain these under your evidence retention policy. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports or certifications. Independent auditors and certification bodies decide whether the evidence is sufficient for your framework.
How DeployOpen scopes and delivers Wazuh agent hardening
DeployOpen treats Wazuh agent anti-tampering on Linux endpoints as a defined piece of work inside your own infrastructure. We start from your endpoint inventory, your Wazuh deployment and your policy for who may remove agents, then build, test and document the protection before handover. Engagements are fixed-scope, with the scope agreed in writing before work starts.
How we scope
- Inventory which Linux distributions and agent versions need package removal protection and which hosts sit outside the plan
- Confirm whether protection is set centrally or per agent, and who approves changes to agent configuration
- Record the written scope, deliverables and timeline before any change is made to production endpoints
How we build
- Enable uninstallation protection in the agent configuration for the agreed groups, then test removal attempts on pilot hosts
- Document the validation token flow and where its secret is stored, with file permissions checked on each endpoint
- Test what remains exposed on each platform, including Windows, macOS and any agents that run outside the planned groups
How we hand over
- Deliver a written configuration record, test evidence and a list of known gaps that your team must accept or close
- Walk your operations team through the upgrade steps that can affect protection, such as agent reinstalls
- Provide a runbook for rotating validation secrets and for handling a legitimate agent removal
How we support
- Offer ongoing support and upgrades as a retainer, covering protection checks after Wazuh patch releases
- Retest agent removal protection on a schedule agreed in the retainer or after material configuration changes
- Quote follow-on work from the written scope, so cost follows the changes you request and not an assumed effort

