Disabling Linux user accounts with Wazuh active response: when teams need it
Security operations teams want a compromised Linux account locked before an attacker moves laterally or escalates privileges. The disable-account active response is the Wazuh mechanism for that containment step. According to the Wazuh documentation, it is an active response script that runs on the agent and disables the affected user account when a rule matches. Wazuh triggers it from the server side: a rule fires on an alert, the server sends an active response command to the agent, and the agent-side script carries out the lock. Because the action lands on a live host, the decision to automate it is a control decision, not only a detection tuning exercise.
Treat this as a containment step with deliberate rule selection. The triggering rules should be ones whose alerts identify a specific account with high confidence, such as a confirmed run of failed authentications against one user or a rule tied to a known-bad account action, rather than broad rules that fire on common administrative activity. Review each candidate rule with your security team and record which alerts may lock which accounts. Confirm in the Wazuh documentation for your installed 4.14 patch release how the script identifies the user, what it does to sessions already open, and whether the lock is reversible from the same configuration, because those details decide how far the response can go.
Before enabling the response, decide the lock duration and the exclusions. Time-limited locks expire on their own and suit uncertain detections, while permanent locks suit confirmed compromise and still need a human to restore access. Service accounts, break-glass administrator accounts and automation identities should be excluded or handled through a separate path, since locking them can stop production jobs. Wrap the configuration in an approval process: named owners sign off on the rule list and exclusions, a change record captures each rule change, and an on-call engineer has a documented unlock procedure. Test the whole chain in a non-production group first, as the sibling Windows and custom script topics also recommend.
Which rules should trigger an account lock
An automatic account lock is only as safe as the rule that fires it. The candidate triggers below differ in how directly they indicate a compromised account and how often they fire on legitimate activity, so each family needs its own false positive review before it is allowed to lock anyone.
Repeated failed authentication
Bursts of failed SSH or PAM logins for one user are the most common trigger, and the default Wazuh rules for authentication failures are the usual starting point. The false positive risk is real-world typos, expired passwords, and automated jobs that retry with a stale credential. Check whether a count threshold and time window separate those cases from a password guessing run, and confirm the rule IDs that fire in your own environment before mapping them to the script.
Wazuh rule documentationBrute force pattern correlations
Correlated rules that combine failures across several hosts or several source addresses can show a spray or credential stuffing attempt better than a single host counter. The risk is that a shared NAT gateway, a bastion, or a load balancer can make many unrelated users look like one attacker. Test the correlation against traffic from your VPN and jump hosts, and decide whether the trigger should lock the named account or only raise an alert.
File integrity and rootcheck alerts
Changes to /etc/passwd, /etc/shadow, or sudoers detected by file integrity monitoring, and rootcheck findings on hidden processes, can point to account tampering. These alerts are often noisy during patching or configuration management runs, so a lock triggered by them can hit administrators during maintenance. Require that the change is attributable to an unexpected user or process before locking, and confirm the monitored paths and rule levels in your own deployment.
Privilege escalation alerts
Rules that flag new sudo grants, unexpected use of su, or a user gaining root through an unusual path are closer to attacker behavior than a failed login. The false positive risk comes from administrators, change tickets, and automation that legitimately escalate, so these rules need an allowlist of expected administrative actors. Confirm which escalation events your audit sources produce before relying on them as lock triggers.
Custom correlated rules
Locally written rules that combine several weak signals, such as a failed login from an unfamiliar network followed by a new session and a sensitive command, can be the most precise triggers available. Their precision depends on the decoders, lists, and tests your team maintains, so a rule that has not been validated against recent logs with wazuh-logtest or a replay should not lock accounts. Document each custom rule's owner and review date.
Only high-confidence rules should lock
Only rules with a documented, low false positive rate should lock accounts automatically, and everything else should alert an analyst or open a ticket. Rule IDs and levels differ between Wazuh versions and between custom rule sets, so the mapping from rule ID to lock action must be verified in your own environment before go-live and retested after each upgrade. Keep the mapping under change control so that a changed rule does not silently widen the set of accounts that get locked.
Time-limited versus permanent locks
A time-limited lock disables the account for a fixed period and then lets the account return to service without anyone acting. This fits cases where the signal is strong but the impact of a false positive is high enough that you do not want a lock to persist unreviewed. The timeout limits the damage from a mistaken lock, but it also means an attacker who waits out the window regains access, so the timeout has to be shorter than the time your responders need to investigate and confirm the account is clean.
- Containment window: The lock only buys time, so it should match how long your on-call team needs to review the alert.
- Automatic reversal: The account comes back without a ticket, so nothing forces a review of why it was locked.
- Re-compromise risk: Credentials stolen before the lock may still be valid when the timer ends, so pair the timeout with a password reset.
- Log trail: Confirm the active response logs the lock and the scheduled unlock so responders can see both events.
- Repeat triggers: Check how the setup handles a second lock on the same account during an active window.
Before you pick a duration, confirm with your security team how long a typical investigation takes on your alert types and test the timeout on a non-production account.
A permanent lock stays in place until a person reverses it. It suits accounts where a compromise is likely and the cost of waiting is higher than the cost of a manual unlock, such as privileged or shared administrative accounts. The trade-off is that every permanent lock creates work for someone, and a lock placed at 2 a.m. on a critical server can stay in place until the owner is available, which may disrupt operations.
- Manual reversal: Someone must run the unlock step on each affected host, so document the exact command and who is allowed to run it.
- Reversal ownership: Name an owner per account class, for example the security operations lead for administrative accounts and the application owner for service-linked users.
- Verification before unlock: Require evidence that credentials were reset and the account's sessions and keys were reviewed before reversal.
- Scope drift: Permanent locks accumulate, so review open locks on a fixed schedule and close the ones no longer needed.
- Responder visibility: Responders need a current list of locked accounts across hosts, which a single host check cannot give them.
Before you enable permanent locks, confirm who holds unlock authority out of hours and test the unlock path on every host class in scope.
Whichever strategy you choose, the reversal path decides whether the lock actually helps. An automated lock that nobody is responsible for reversing becomes an outage waiting to happen, and an unlock that skips verification can hand an attacker back the account. Ownership should be written down before go-live, not worked out during the first incident, and it should cover both routine reversals and emergency ones.
- Runbook: Write the steps for checking the alert, confirming the account, resetting credentials and unlocking, and keep it with the active response configuration.
- Approval rights: Decide which roles can approve an unlock and whether the approver can be the same person who triggered the lock.
- Audit record: Each unlock should record who approved it, the time, the host, and the reason, in a form your auditors can read.
- Escalation path: Define what happens when the owner is unreachable, including who can override the lock.
- Service accounts: Keep exclusions for non-interactive accounts separate from the reversal process so their owners are not surprised.
Ask your security lead to sign off on the reversal runbook and test one full lock and unlock cycle in a lab before any production rule is enabled.
Incident responders need to know, at a glance, which accounts are locked, why, by which rule and for how long. Without that view, a responder may chase a login failure that is really a lock, or reopen a closed case because the account state never got recorded. Visibility matters most for time-limited locks, where the state changes on its own, and for permanent locks spread across many hosts.
- Alert context: The alert that triggered the lock should carry the rule ID, the user, the host and the action taken.
- Account state checks: Give responders a documented way to check whether an account is currently locked on a given host.
- Dashboards and searches: Build a saved search or dashboard for active response events so locks and unlocks are visible together.
- Shift handover: Include open locks and their expiry or review dates in the handover notes.
- Central record: Decide whether the lock list lives in the SIEM, a ticketing system or both, and keep it in sync.
Confirm with your Wazuh administrators which active response events reach the dashboard in your version, and test that a responder can find a locked account within minutes.
Configuration options and when each fits
This table compares the main choices when setting up the disable-account response: which rule levels or groups trigger it, whether the lock is timed or permanent, how it is targeted to groups or agents, and whether it runs on the agent or the server. Read each row against your own account inventory and the documentation for the Wazuh version you deploy, since script names, parameters and defaults can change between releases.
| Choice | Options | When it fits | What to confirm |
|---|---|---|---|
| Triggering rule scope | Specific rule IDs for failed logins or known attack patterns | Narrow triggers suit a first rollout because they only lock accounts after a well-understood signal | Rule IDs and levels in your deployed ruleset, and whether a rule fires on the agent group you target |
| Triggering rule scope | Rule level threshold across many rules | Broad triggers can cover more attack paths but raise the chance of locking a legitimate user on a noisy rule | How many alerts per day cross the threshold in your environment before enabling blocking |
| Lock duration | Timed lock that the server reverses after a set period | Good for brute-force bursts where the user can recover without help desk action | How the timeout is expressed in your version, and that the reversal runs on the same agent |
| Lock duration | Permanent lock until an administrator re-enables the account | Fits confirmed compromise, privileged accounts and cases where a human must investigate first | Who re-enables accounts, how that is logged, and the manual steps on each host |
| Targeting | Per-group application to a set of agents | Lets you start with a pilot group of hosts and expand after testing | Group names, agent membership and how group changes take effect |
| Targeting | Per-agent application to single hosts | Useful for a specific high-value server where you want tight control over the response | How agent IDs are referenced and how many single-agent rules you can maintain |
| Execution location | Run on the agent | Keeps the response close to the host, but depends on the agent staying connected and trusted | Which account commands the script runs under and how it behaves when the agent is offline |
| Execution location | Run on the server | Centralizes logic and logging, but the action still reaches the host through the agent channel | Whether the action is applied to the agent on the server side and how failures are reported |
Excluding service accounts and break-glass users
Service accounts, automation users and break-glass administrators need to be excluded from automatic disabling or handled through a separate path. An active response that locks a user at the wrong moment does not just stop an attacker, it can stop a production job. A nightly backup, a deployment pipeline or a monitoring agent often authenticates as a local or directory user that never has an interactive session. If a rule that fires on repeated failed logins or suspicious sudo activity matches that account, the lock takes effect with no human in the loop, and the job fails until someone notices. Break-glass administrators are the opposite problem: they are the accounts you need when the normal access path is broken, so an automated lock during an incident can remove your last way back into a host.
Build the exclusion list before you enable the disable-account command on any rule. Inventory the non-human accounts on each host group (cron jobs, systemd units, CI runners, configuration management and database service users), and confirm with each owning team which accounts their jobs depend on. For break-glass accounts, decide whether they are excluded entirely or whether their alerts route to a human approval step instead. Keep the list in version-controlled configuration next to the active response settings, so every change has an author, a reason and a review. Confirm with your own environment how the disable-account script identifies the target user and whether your exclusion approach works with your chosen rule set before you rely on it.
Treat the list as configuration that expires unless someone checks it. Set a review schedule, for example quarterly or after each major change in your identity or automation stack, and have the owning teams confirm that each entry is still needed and still correctly named. Remove accounts that no longer exist, and re-test a sample of exclusions after each Wazuh upgrade, since the Wazuh release notes list patch releases every one to two months and a change in rule behavior could shift which accounts are matched. Record each review as evidence of how automated responses are governed, and keep the break-glass account procedure documented alongside it so responders know which accounts are exempt and how to use them during an incident.
Setup sequence with checks
This sequence takes a Linux account lock from idea to production enforcement without locking out a legitimate user. Each stage ends with a check that tells the team whether to move forward or stop.
Inventory accounts and service identities
The security engineering lead and the Linux platform team list every human and service account on the target hosts, with owners, login methods and the jobs each service account runs. They mark which accounts must never be locked automatically, such as break-glass administrators, backup agents, configuration management and monitoring identities. The step is done when each account has an owner and an exclusion decision recorded in change control, and when the team can name the hosts where each one authenticates.
Select triggering rules and set detection-only mode
The detection engineer chooses the Wazuh rules that should lock an account, such as repeated failed authentication followed by a success or alerts tied to a known-bad login pattern, and writes down why each one is trusted. The rules first run as alerts only, with no active response attached. The check is a review of several weeks of alerts, or of a representative window your team agrees on, showing which rules fire, on which hosts and how often they fire on legitimate activity.
Configure the active response in the agent group
The Wazuh administrator adds the disable-account active response to the
ossec.confconfiguration distributed to a dedicated agent group, binds it to the approved rule IDs and sets the timeout behavior: either a time-limited lock that reverses automatically or a permanent lock that waits for a human decision. Group membership is limited to the hosts in the pilot. The check is that the agent group configuration shows the expected rule IDs and the agent confirms it has received the updated configuration.Run controlled tests on a lab host
The test engineer uses a lab host with disposable test accounts and generates the events each triggering rule is meant to catch, while the exclusion list is applied. The team confirms that the lock happens on the intended account only, that the excluded service accounts are untouched and that the alert and the active response log entry both appear in the dashboard. The check is a short written test record that matches each rule to an observed lock and a passing exclusion test.
Confirm the reversal path works
The operations engineer verifies that a time-limited lock lifts as configured and that a permanent lock can be reversed by the documented manual procedure, using the same test accounts. They also confirm the reversal runs on the agent and not only on the server, and they test that the on-call person can restore access without elevated shell access they do not normally hold. The check is a successful unlock of each test account, recorded with timestamps and the operator who performed it.
Wrap the approval process around enforcement
The security lead and the owning platform team agree on who may approve a permanent lock, how the on-call engineer requests one, which evidence must be attached and how a false positive is reported and reversed. The runbook is stored where the on-call team can reach it during an incident. The check is a tabletop walkthrough in which the team handles one simulated lock from alert to approval to reversal, with the runbook updated for any gaps found.
Enable on production with monitoring
The Wazuh administrator moves the approved configuration to the production agent group in a planned change window, starting with a limited set of hosts. The security operations team watches the locks, the exclusion behavior and the failure logs during the first period of operation and reviews every lock against the runbook. The step is complete when the team has reviewed each production lock, confirmed no excluded account was affected, and recorded the expanded host list in change control.
The approval process around automated locks
An automated account lock is only as safe as the process that governs it. The cards below cover who may change the triggering rules, who signs off on exclusions, how an analyst reverses a lock, and how each automated action is recorded for review. Wazuh supplies the mechanics, so these controls are your own process to define and document.
Ownership of trigger rules
Name one owner for every rule that can start the disable-account script, and record who may edit the rule file or the group that carries it. A change to a trigger rule changes which events lock a person out, so treat it like a change to production access controls. Before a rule goes live, confirm which agents and groups it applies to and whether an analyst reviewed the test results.
Wazuh docsExclusion approval
Service accounts and break-glass users belong on an exclusion list only after a documented request names the account, the business owner and the reason it must never be locked automatically. Ask the approver to confirm that the account cannot be the target of an attack path that the exclusion would hide. Review every exclusion on a fixed schedule and remove those whose justification has expired.
Analyst override and reversal
Decide in advance who may unlock an account the script disabled, which steps they follow and how they confirm the user's identity before restoring access. Write the reversal runbook so that it does not depend on the person who approved the original rule. Test it on a non-production account so the first reversal is not performed during an incident.
Logging each automated action
Every lock should produce an alert that identifies the triggering rule, the target account, the host and the time, so reviewers can reconstruct what happened. Confirm that these records are retained in the indexer for longer than your incident review cycle and that analysts cannot silently alter them. Compare the logged actions with the host's own authentication logs during review.
Change records for the script and configuration
Keep the disable-account script, the active response configuration and the rule files under version control with reviewed commits. Each change should link to a ticket that states the reason, the approver and the test evidence. Confirm how the agent group that receives the change is recorded, because a silent drift between groups can lock accounts on hosts that were never reviewed.
Review cadence and ownership of the process
Assign an accountable owner, usually in security operations with input from identity and platform teams, who reviews lock volume, false positives and exclusions on a fixed cycle. Use the results to tighten or retire rules. Document how escalations reach this owner outside business hours, since the most consequential locks often happen then.
Questions buyers ask before outside help
How much effort does a Wazuh account disable build take?
The effort depends on how many triggering rules you want, how many distinct host groups and account types need different treatment, and how many approval steps wrap the response. A narrow build that disables interactive accounts on a few hosts is much smaller than one that covers service accounts, time-limited locks, and approval routing across many environments. The largest drivers are the quality of your existing rules and decoders, the number of systems that authenticate against the same identity source, and how much testing your change process requires. Ask any partner to break the quote into rule design, script configuration, exclusion lists, approval workflow, and testing, so you can see which parts are one-time and which recur.
How long does a fixed-scope engagement for this usually run?
Fixed-scope engagements are agreed in writing before work starts, so the timeline follows from the scope rather than from a generic estimate. Most of the calendar time typically goes to agreeing rule owners, collecting account inventories, and getting change approvers to sign off on the response behavior, rather than to the configuration itself. Ask for a schedule that separates discovery, a non-blocking test period, production enablement, and handover. Confirm that any timeline assumes access to test hosts and a named contact on your side for identity and change questions.
What does the work need from our team?
Three groups of people usually need to contribute. Rule owners, typically security operations, must confirm which alerts are reliable enough to trigger an account lock. Identity and directory staff must provide the list of service accounts, break-glass accounts, and automation users that must never be locked, along with how accounts are provisioned on each host. Change approvers must define who authorizes an automated lock, how long they have to respond, and who can reverse it. Without these inputs, the exclusion list and the approval process will be guesses, and that is where most lockout incidents start.
Can our internal team build and run this without outside help?
Yes, a capable Linux and Wazuh team can build this in-house, provided it has time to test and the authority to approve changes that affect production access. Wazuh is open source with no license fee for the self-hosted software, so the cost is mainly staff time and test infrastructure. Outside help tends to add the most value on exclusion design, approval workflow, and an independent review of the response before it acts on live accounts. Confirm the release you run before you copy any configuration, because active response behavior can differ between Wazuh 4.14 patch releases, and check the current release notes for changes.
What does a retest of the account response involve?
A retest checks that the response fires only for the intended rules, that the lock or unlock happens within the configured window, and that excluded accounts stay untouched. In practice this means replaying representative failed-login and suspicious-activity events against test hosts, confirming the alerts and the active response log entries, and verifying that the approval step blocks or permits the action as designed. A good retest also covers the reversal path, since a lock that cannot be lifted cleanly is an outage waiting to happen. Ask whether a retest is included in the fixed scope, how many scenarios it covers, and whether it is repeated after each Wazuh upgrade.
Do we need to change how we manage service accounts first?
Usually yes, at least for the accounts that the response would otherwise lock. Service accounts that run scheduled jobs, backup agents, or application connections often have no interactive login, but some authenticate with passwords that fail in patterns that look like brute force. Before enabling the response, list each service account, its owner, and whether it authenticates interactively. Exclude those that cannot be locked without an outage, and record the reason so auditors and future staff understand the decision. Changing account design is a separate project and is often outside the Wazuh scope, so confirm who owns it.
Does automated account locking create compliance evidence?
It can supply technical evidence, but it does not satisfy a framework on its own. Alert records, active response logs, approval records, and the configuration history can show that a control operated as designed. DeployOpen prepares systems, controls, and evidence for compliance assessments, but it does not issue audit reports or certifications, and independent auditors decide what is sufficient. Ask your assessor which evidence they expect before you design the logging and approval trail, so the record captures the decisions they will want to see.
Alert to account lock decision path
The decision path starts when an agent on a Linux host sends an authentication event to the Wazuh server, where a decoder and rule raise an alert at a level you have chosen. Before any lock runs, the server checks the alert against your exclusion list of service accounts and break-glass users, then passes the request through an approval gate that your change process owns. Approved requests run the disable-account active response on the agent, which applies either a time-limited or a permanent lock, and the outcome is written to the alert log. Check each hand-off: the rule that matched, whether the account is excluded, who approved, and whether the lock was logged on the host.
Shows how an alert becomes an account lock, with exclusions, approval and logging.
Limits to confirm in your environment
The disable-account response depends on how Wazuh, your distribution and your identity stack behave together. The cards below list the points to confirm with the Wazuh documentation and in a test environment before any rule is allowed to lock a real account.
Supported Linux distributions
Confirm that the disable-account script and its dependencies, such as the account management tools it calls, are supported on each distribution and release in your fleet. Check the Wazuh documentation for the version you run, and test on every distribution family you operate, including older releases that may still be in service. Record the result per distribution so the automation scope matches what has been verified, not what is assumed.
Wazuh release notesDirectory-backed accounts
Accounts that come from LDAP or FreeIPA are not stored in the local password file, so a local lock may not stop login. Confirm how the script locks these accounts, whether the directory side must be changed as well, and how the change propagates to hosts that cache credentials. Test a directory user end to end, including Kerberos ticket reuse and SSH logins that succeed from cached data.
Active sessions and SSH keys
Locking an account does not necessarily end sessions that are already open, and SSH keys in authorized_keys may still be usable depending on the account configuration. Confirm whether the response terminates running processes and sessions, and whether key-based logins are blocked. Decide whether a separate step is needed to kill sessions and remove keys, and test that the step runs on the hosts where it matters.
Timeout accuracy
A timed lock depends on the active response timeout being honored and on the agent clock being correct. Confirm how the agent tracks the timeout, what happens if the agent restarts or loses its connection before the unlock runs, and whether the account is re-enabled reliably. Compare the expected unlock time with the actual time on a test host, and check the time synchronization on endpoints.
Changes across 4.14 patch releases
The 4.14 line has received patch releases through 2026, and any of them may change default scripts, timeout handling or agent behavior. Read the release notes for every patch between your current version and your target, and rerun your test cases after each upgrade. Keep a record of the version on which each response was verified so that a later upgrade does not silently change its behavior.
How scope and testing shape the work
A DeployOpen engagement for automated account disabling is fixed-scope: the scope, deliverables and timeline are agreed in writing before any work starts. For this topic, the written scope should name the rules that may trigger a lock, the accounts that are excluded, whether each lock is time-limited or permanent, which hosts receive the disable-account script, and who approves changes to any of these. Those decisions change the effort more than the installation does, so they belong in the scope document rather than being settled during the build.
Testing is part of that scope, not an afterthought. Before the active response goes live, the test plan should replay representative alerts from ossec.log or the Wazuh dashboard against a staging group of agents and confirm that only the intended accounts are locked, that the lock expires as configured, and that the Wazuh server logs the action. The plan should also cover service accounts, break-glass administrators and the accounts used by Wazuh itself, because a failed test in those cases can lock out the people who need to recover the host. Ask any partner to show the test cases and the expected results before you accept the quote.
The approval process wraps around the automation and is documented as part of the deliverables. Agree in advance who may change a rule ID mapping, who may add an exclusion, and how an emergency unlock is performed and recorded. Confirm with your own change management team whether a locked account needs a ticket, a notification to the affected user or a review after the event. Retesting after each Wazuh upgrade or rule change should be written into the scope too, so the approval record shows that the control still behaves as designed.
How DeployOpen scopes, delivers and supports this feature
DeployOpen treats automatic account disabling as a change to production access, so the work starts with a written list of triggering rules, excluded accounts and approval steps. We then build and test the Wazuh active response configuration in a non-production environment, document it for your operators, and offer ongoing support as a retainer.
How we scope
- Written scope lists the Wazuh rules allowed to trigger the disable-account script and the reasons for each.
- Scope names the Linux host groups in which automatic locks apply and the hosts that are excluded.
- Scope records service accounts, break-glass accounts and emergency access paths that must never be locked automatically.
How we build
- We configure the active response block, the agent group targeting and the time-limited or permanent lock behavior you agreed.
- We test each triggering rule against simulated events on a non-production host to confirm the expected lock and unlock.
- We build the approval step around the automation, so a person confirms high-impact locks before or shortly after they happen.
How we hand over
- You receive the active response configuration, the rule-to-action mapping and the exclusion list as versioned files.
- Documentation covers how to unlock an account, how to check the audit trail and how to change a trigger safely.
- We walk your security operations team through the runbook and the test results before the scope closes.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, Wazuh upgrades and continuous testing of triggers are available as a retainer.
- Retesting after rule changes, Wazuh patch releases or host-group changes can be included in the retainer scope.

