Why FreeIPA HBAC and sudo rules replace allow_all
Many enrolled Linux estates still run FreeIPA with the default allow_all HBAC rule, which lets every enrolled user log in to every enrolled host, while sudo rights live in per-host sudoers files that nobody reviews together. HBAC rules decide who can log in to which hosts, and central sudo rules decide which commands those users can run once they are there. Replacing allow_all is therefore two linked decisions, not one switch: you define access by host group and user group, then you define privilege by sudo rule, and both must agree with the access model you want to audit.
The work is harder than it looks because rules interact. A user may match an HBAC rule for one host and a sudo rule for another, group membership can come from nested groups or external sources, and a rule that is correct on its own can still deny an administrator the path back in. Lockout is the most expensive mistake, so the reader should plan a break-glass account or a known administrative path before allow_all is disabled, and should confirm that the people who administer the hosts keep the access they need during the cutover.
Changes are also not instant. FreeIPA stores the rules centrally, but each client's SSSD service must retrieve and apply them, and caching on the client means a test that passes on one host may behave differently on another that has not refreshed. Before rollout, confirm with your own environment which SSSD version and cache settings your Linux distributions use, and plan verification on a representative host from each class of server, not only on the first one enrolled.
Which FreeIPA components enforce access and elevation
FreeIPA combines 389 Directory Server, MIT Kerberos, the Dogtag certificate system and SSSD on clients, and access and sudo policy touches all four. The cards below follow one rule from where it is stored, to where it is evaluated, to where it is enforced on each Linux host.
389 Directory Server stores the rule objects
HBAC rules, sudo rules, host groups and user groups are all entries in the directory tree that 389 Directory Server maintains as a multi-master LDAPv3 store. Because the rules are replicated like any other directory data, every IPA replica should eventually hold the same policy. When you review a rule, check its scope in the directory object, not only the web UI view, and confirm that replicas converge after a change.
FreeIPA About pageHost and user groups define who and where
HBAC and sudo rules do not name individual hosts or users in most designs. They reference user groups, host groups and hostgroups for services, so membership changes flow through the rule without editing it. Review group membership as part of the access review. A user added to a broad group can gain logins on every host the group's rules cover.
The IPA server evaluates policy centrally
The IPA servers are the place where policy is authored, validated and served to clients. Changes made through the ipa command or the web UI are written to the directory and then served from any replica. Confirm which replicas your clients query, since a client can only receive rules that its replica has already replicated.
Kerberos carries the authenticated identity
MIT Kerberos authenticates the user before any HBAC decision matters. The KDC issues the ticket that proves identity, and the HBAC check then decides whether that identity may open a session on the host. Test with a real Kerberos login, because a rule that looks correct in the UI will not help a user whose ticket fails at the KDC.
SSSD on clients applies the rules
SSSD on each enrolled Linux host retrieves HBAC and sudo rules from the IPA servers and applies them at login and at sudo invocation. Access decisions are therefore only as current as the SSSD cache on that host. After a rule change, verify on a test host that SSSD has refreshed, because a stale cache can allow or block access longer than expected.
Dogtag matters for host certificates only
The Dogtag certificate system issues certificates for hosts and services, not the access decisions themselves. It does not evaluate HBAC or sudo rules. Keep it in your review as a separate dependency: an expired host certificate can break services that depend on it, even when the access rules are correct.
Choosing between allow_all, HBAC service scoping and sudo command scoping
This table compares three ways to control Linux access in FreeIPA: leaving allow_all in place, scoping HBAC rules by host group and service, and layering central sudo rules over HBAC. Read each row against your pilot and production hosts, and use the operational cost column to judge how much review and break-glass planning each option needs.
| Option | When it fits | Operational cost | What to confirm |
|---|---|---|---|
| allow_all HBAC rule | Pilot hosts and lab enrollment where access is not yet agreed | Any enrolled user can log in to any covered host, so it hides gaps in ownership and offers little audit value | Confirm that allow_all is disabled before any production host is added to the domain |
| HBAC rules scoped by host group and service | Production servers where access depends on team, environment or role | Needs named host groups, user groups and service lists such as sshd and sudo, plus periodic review as teams change | Confirm which services each host group actually uses, including sudo and su, before disabling allow_all |
| Central sudo rules with runAs and command lists | Hosts where privilege must be limited to specific commands or target users | Rules are reviewed centrally, but every command list needs an owner and tests before rollout | Confirm how sudo rules are matched on your OS versions and test them with a non-admin account |
| Local sudoers files | Small fixed estates with few administrators and no central identity management | Edits are made host by host, so drift and inconsistent privileges grow with server count | Confirm whether any host still relies on local sudoers entries that central rules do not cover |
| Break-glass access path | Every option above, as a safety net when HBAC or sudo rules block administrators | Needs a documented, tested local or out-of-band account, with its own review and logging | Confirm who can use it, where its credentials are kept, and how each use is reported |
| Rule testing before rollout | Any move from allow_all or local sudoers to scoped central rules | Test accounts, a staging host group and a rollback plan add setup and review time | Confirm the test matrix covers login, sudo and failed-access cases on each OS in use |
How to build and roll out HBAC and sudo rules in order
This sequence moves a FreeIPA domain from broad access to scoped host-based access control and centrally managed sudo, with a pilot, a test for each change, and a break-glass path kept open until the new rules are proven.
Inventory hosts and group them by role
The platform or identity team lists every enrolled Linux host, its owner, its function and its environment (for example production, staging or build). Each host is then placed in an IPA host group that reflects a role, such as web tier or database, so that rules attach to groups rather than to individual machines. Run
ipa hostgroup-findandipa host-findto confirm that every host appears in exactly one intended group. The step is complete when the group list matches the inventory and the owners have signed off on it.Map user groups to access needs
Security and application owners describe who needs to log in to each host group and why, then the team maps those needs to existing IPA user groups. Where a needed group does not exist, it is created now rather than granting access through individual user entries. Privileged roles such as administrators are kept in separate groups so they can be reviewed on their own. The output is a written matrix of user group to host group, reviewed by the owners. Check it with
ipa group-showfor each group named in the matrix.Create a test HBAC rule for a pilot host group
Create a single HBAC rule with
ipa hbacrule-addthat links one user group to one pilot host group and one service, such as sshd. Leave the existing allow_all rule enabled at this stage so no login is blocked by the change. The pilot group should be a low-risk set of hosts that the team can reach through another path. The step closes whenipa hbacrule-showconfirms the rule has the intended user group, host group and service, and the rule is recorded in the change ticket.Verify the rule with the HBAC test facility
Use
ipa hbactestto simulate logins before any real user is affected. Run one test for an allowed user on a pilot host and one for a user outside the group on the same host, then repeat with the service name used by each login path. The expected results are written down before the test runs. The step is complete when every simulated result matches expectations. Any mismatch is fixed in the rule and the test is run again, since the simulation shows the policy, not what a client does.Add sudo rules with explicit command lists
Create sudo rules with
ipa sudorule-add, attach the same user and host groups used in the HBAC rule, and list each permitted command by full path withipa sudocmd-addandipa sudorule-add-allow-command. Avoid a broad ALL entry unless the owner has approved it in writing. Keep privileged commands in a separate rule so they can be reviewed and removed independently. On a pilot host, runsudo -las an allowed user and as an excluded user. The step closes when the output lists only the approved commands for the allowed user and nothing for the other.Confirm SSSD on clients picks up the policy
On each pilot client, the platform team checks that SSSD has refreshed its cache with the new rules. Restarting the service with
sssdtools or clearing the cache withsss_cacheforces a fresh read, and the logs in/var/log/sssdshow whether access and sudo lookups succeed. Confirm the SSSD configuration on the client is the one expected for IPA enrollment. The check is complete when a real test login and asudo -lrun on the client match the results from the server-side tests. Record the SSSD version and any cache issues for the rollout log.Expand the rules and confirm a break-glass account
Extend the HBAC and sudo rules to the remaining host groups in waves, repeating the test and client checks for each wave. Before the allow_all rule is disabled, confirm that a named break-glass account exists, its credentials are stored under the organization's emergency procedure, and a login through it works on a representative host. Then disable allow_all with
ipa hbacrule-disable allow_alland test a login from an excluded user to confirm it is denied. The step is complete when the break-glass login succeeds, the excluded user is refused, and the change is recorded.
What drives the effort of an access policy rollout
This table lists the factors that set how much work an HBAC and sudo rollout takes, why each one matters, and how to keep it contained. Read it before scoping, because most of the effort comes from inventory and naming decisions made early, not from the rule syntax itself.
| Driver | Why it changes effort | How to keep it down |
|---|---|---|
| Host count and role diversity | Each distinct host role (web, database, jump host, build agent) needs its own access pattern, and every host must be enrolled and assigned to a host group before rules can scope to it. | Reuse host groups by function rather than by hostname, and retire unused hosts from the inventory before writing rules. |
| User groups and privilege tiers | Each combination of user group and host group becomes a rule to design, test and document. More tiers multiply the review cycles. | Standardize a small set of role names and map every HBAC rule to one role, so new people join existing groups. |
| Legacy local sudoers files | Local /etc/sudoers and sudoers.d entries on each host must be inventoried, compared and rebuilt as central sudo rules, and FreeIPA does not import them automatically. | Collect sudoers files with configuration management, group identical entries, and move only the commands still in use. Confirm the migration path against the FreeIPA migration how-to, which describes manual LDIF moves for sudo and HBAC rules. |
| Service and application accounts | Non-human accounts often need narrow command rights or non-interactive access, and their owners must be identified before rules can be justified. | Give each service account a named owner and a single purpose, and keep them in their own group so their rules are reviewed separately. |
| Environments (dev, test, production) | Each environment usually needs its own host groups and rules, and rules that work in test may need changes in production. | Use the same role and rule names in every environment and differ only in host group membership. Test rule sets in a non-production realm before production. |
| Audit evidence requirements | Assessors and internal reviewers may ask who could access which host, when rules changed and how access was tested. Producing that evidence takes extra export and documentation work. | Keep rule descriptions and owners in the rule metadata, store exported rule sets under version control, and confirm the exact evidence format with your auditor before the rollout starts. |
How rule rollout differs across single-site, multi-datacenter and air-gapped estates
In a single-datacenter estate, every IdM server, replica and client usually sits on the same network segment and is managed by the same team. Rule changes are made once, replicate to the local replicas and reach clients through SSSD on the normal refresh cycle. The main risk is not replication lag but a rule that is wrong for a host group that is widely used, so testing against a representative host set matters more than the topology.
- Fewer moving parts: One change window and one set of replicas to check after each edit.
- Test host group: Keep a small set of non-production hosts enrolled in the same host groups as production so a rule can be tried before it touches real access.
- Client verification: Confirm with
sssdlogs and a test login that the new rule applies on a sample of clients, not only on the server. - Rollback path: Keep the previous rule definition exported so it can be restored quickly.
- Change record: Track who changed which rule and why, even when the team is small.
Before relying on this model, confirm with your own team how many replicas serve the estate and whether any clients use an allow_all rule that still needs retiring.
Across several datacenters, the same HBAC and sudo rules must be identical on every replica that clients can query, or a user may be allowed in one site and denied in another. The deployment recommendations advise at least two to three replicas in each datacenter, so each site has local copies to answer client lookups during a link failure. Rule changes therefore need to be verified on each site, not assumed to be consistent because replication is running.
- Replica agreement: After each change, compare the rule definitions returned by replicas in each datacenter before declaring the change complete.
- Replication limits: The recommendation of no more than four replication agreements per replica shapes how changes travel, so check the topology before adding sites.
- Staggered rollout: Apply rules to a pilot host group in one site first, then extend to others once client behavior is confirmed.
- Site-specific hosts: Keep host group membership consistent so a host in one datacenter does not inherit different access than its peer.
- Outage behavior: Test a client in a site whose local replicas are unavailable to confirm which rule set applies and how clients fail over.
Confirm with your own architecture how replicas are placed and whether any site is reached only over links that can drop during a change window.
On an air-gapped network, no direct path exists to pull updates or rule sources from outside. Rule changes must be authored, reviewed and carried in through a controlled path, usually with signed or logged transfer media or a one-way gate approved by your security team. The IdM servers stay the only source of truth for rules, so the change record has to be complete before anything is promoted into the estate.
- Controlled promotion: Move changes through a defined path such as development, test and production enclaves, with a named approver at each step.
- Exported definitions: Keep rule definitions in version-controlled files that can be reviewed line by line and replayed on a test realm.
- Offline testing: Use an isolated test realm with representative hosts to check each HBAC and sudo rule before promotion.
- Evidence retention: Store approvals, test results and exported configurations with the change record for later review.
- Update dependencies: Confirm how security fixes for FreeIPA packages reach the enclave, since patch cycles can be slower than online estates.
Confirm with your security team which transfer method and approval steps your enclave allows and how long a promotion can take under that process.
Protecting access rules, administrator accounts and sudo paths
HBAC and sudo rules only protect hosts if the people who can edit them are few, controlled and audited. The cards below cover the administrator model, the break-glass path, who may change access objects, the 4.13.4 security release and how narrow sudo commands should be.
Least-privilege admin roles
Grant administrative rights through FreeIPA roles and privileges instead of sharing the admin account. Map each person to the smallest role that covers their work, such as someone who manages host groups but cannot edit HBAC or sudo objects. Review role membership on a fixed schedule and remove access when staff change duties. Confirm which privileges your FreeIPA version assigns by default, since the defaults are the first thing an auditor will read.
FreeIPA overviewProtecting the IPA admin account
The admin account holds the highest rights in the realm. Keep its password in a sealed, audited store, avoid using it for daily work, and log each use. Confirm how your team authenticates to the web UI and CLI as administrators, and whether that path also requires a second factor. Any automation should use a dedicated account with narrow rights instead of this one.
Break-glass access path
Plan one emergency path that works when the normal SSO or OTP chain fails. This usually means a named, rarely used account with a stored credential, tested on a schedule in a non-production realm. Document who may open it, what triggers it, and how its use is reviewed afterward. Test the path against a restored backup as well, because an outdated backup can break replication.
Restricting edits to access objects
HBAC rules, sudo rules and their member groups decide who reaches which host. Limit edit rights on these objects to a small named group and keep host-group and user-group edits separate where your process allows it. Require a change record for every rule modification, and compare the live rule set against the approved source each review cycle. Ask your implementation partner to show exactly which privileges can modify these objects.
The 4.13.4 security release
FreeIPA 4.13.4, a stabilization release dated July 9, 2026, fixed two CVEs. One fix addressed LDAP access control flaws that could let unauthenticated clients obtain credentials, and another hardened authentication checks across the API. Because access control sits under every HBAC and sudo decision, schedule this upgrade on servers you control, test it on a replica first, and confirm the running version on every server after the change.
4.13.4 release notesNarrow sudo commands
Avoid sudo rules that grant ALL commands. List each permitted binary with its full path, such as /usr/bin/systemctl restart nginx, and separate read-only commands from changing ones. Review rules that use wildcards or shell scripts, since an editable script often grants more than intended. Test every new sudo command in a lab host before it reaches production hosts.
How to test that rules allow what they should and fail safely
Test HBAC and sudo rules in layers, and start with the failure you most want to catch: a rule that silently denies a legitimate administrator, or one that allows more than intended. Begin with the server-side checks. FreeIPA's ipa hbactest command evaluates a user, a target host and a service against the rules you have defined, so you can script expected allow and deny cases and keep them in version control. Run the same cases after every rule change, and treat any mismatch as a blocker. These checks confirm what the directory will decide, but they do not prove what a client host does with that decision, so they are the first layer, not the last.
The second layer is real logins from a dedicated test user on pilot hosts that are enrolled in the same host groups as production. Confirm that the allowed login succeeds through each service you care about, such as sshd and any console or su path, and that a user outside the rule is refused. On the sudo side, run sudo -l as a representative user for each role and compare the output with the expected command list, then confirm that a command outside the list fails. Deliberately break things to see how they fail: remove a user from the host group, change a service name in a test rule, and check that the denial appears where you expect. Also test the cache. SSSD keeps cached policy, so a host can keep applying an old rule until the cache refreshes or is cleared. Confirm the refresh behavior for your SSSD version before relying on a change window.
Last, prove that a bad rule cannot lock out every route into a host. Keep a break-glass account that is outside the HBAC rules you are testing, verify that it still logs in on each pilot host after a deliberately wrong rule is applied, and document how it is protected and who may use it. Ask your team to confirm the exact behavior of allow_all removal on each host class before switching it off in production. Plan a rollback step that can be executed from a session you already hold, and rehearse it on the pilot before any production change.
What to monitor, back up and document after go-live
Once HBAC and sudo rules are live, the policy only stays correct if someone watches denials, reviews changes and keeps a recoverable copy of the directory. The cards below cover those four habits and the record an auditor will ask for, so each rule change can be traced from request to effect.
Watch failed logins and denied sudo
Denied logins and refused sudo attempts are the earliest signal that a rule is too narrow or that a user is probing a host they should not reach. Review SSSD and sudo logs on sample hosts for each host group, then sort denials into expected (contractor on a production host) and unexpected (an engineer locked out after a group change). Unexpected denials after a rollout usually point to a missing group membership or a rule scoped to the wrong host group.
Review every rule change
HBAC and sudo rules are shared objects, so one edit can change access on dozens of hosts at once. Require a second reviewer for any change to a rule's user group, host group or allowed commands, and keep the request, the approver and the test result together. Ask your team which rules changed in the last quarter and who approved each one; if they cannot answer from a record, the review step is not working.
Back up before every policy change
Run ipa-backup before any change to HBAC or sudo rules so you can return to a known state if a rollout goes wrong. Full backups capture the whole server, while data-only online backups are a lighter option for routine checkpoints; confirm which type your team will use and where the archives are stored. Test that an archive can be read on a separate machine, because a backup that has never been restored is an assumption rather than a recovery plan.
Avoid restoring outdated backups
Restoring an old backup into a live replica topology can break replication, because the restored server returns with data that other replicas have already moved past. The first server also handles certificate renewal and CRL publication by default, so a careless restore can disturb those duties too. Plan restores as a topology event: isolate the affected server, confirm which replica holds the authoritative state, and coordinate with the team that owns replication before anything is restored.
Document the access rule matrix
Auditors ask who can reach which host and with which commands, and the answer should come from a single maintained matrix. List each host group, the user groups allowed through each HBAC rule, and the sudo rules that map user groups to commands and run-as accounts. Export the current state from FreeIPA on each review cycle and store it with the change records, so the matrix shows both the present policy and its history.
Common questions about FreeIPA HBAC and sudo rule projects
Can an internal team set up FreeIPA HBAC and sudo rules on its own?
Yes, a team with Linux and directory experience can do it in-house, and many do. The work is mostly configuration and testing, but it touches login for every enrolled host, so a mistake can lock administrators out. The effort depends on whether your team already runs FreeIPA, has tested rules in a non-production realm, and has people who can own each role's policy. If those pieces are missing, a fixed-scope engagement can cover the design, the test plan and the rollout while your team keeps ownership of the policy.
What drives the cost and effort of an HBAC and sudo project?
Cost follows the written scope, and the main drivers are the number of hosts, the number of distinct access roles, how much legacy sudoers content must be reviewed, and what evidence your compliance team needs. Each host group, service and sudo command set adds design and test work. Legacy /etc/sudoers files with many local exceptions usually take the longest to untangle. Ask for a quote that lists host groups, roles, rule count, the number of environments tested, and the evidence package. DeployOpen does not publish a price list, and a quote follows from that written scope.
What does our side need to provide for this project?
Plan to supply a current host inventory with owners and environments, a list of roles and the people who approve access to each, and a catalog of who logs in to which systems today. You will also need change windows for each environment, admin access to the FreeIPA servers and representative test hosts, and a named contact who can approve rule changes. Legacy sudoers files from a sample of hosts help scope the work. Missing role owners are the most common cause of delay, because nobody can say whether a rule is still needed.
How long does an HBAC and sudo rule rollout take?
Duration depends on the scope, mainly the number of hosts, roles and environments, and on how quickly role owners confirm their access needs. Work usually runs in phases: inventory and design, rules built and tested in a lab or staging realm, a pilot on a small host group, then staged rollout with rollback steps. Ask for a timeline in the written scope that shows each phase, the approvals it needs and the change windows it depends on. Any single figure given before the inventory is complete should be treated as a guess.
Can FreeIPA sudo rules completely replace local sudoers files?
For many hosts, centrally managed sudo rules can cover most of what local sudoers files did, delivered through SSSD. Coverage depends on the distribution, the SSSD version and the sudo features your rules use, so confirm the exact behavior in your own build before you remove local files. Keep a documented fallback, such as a small local file for break-glass administrators, until testing proves that central rules apply correctly after reboot, offline operation and client re-enrollment. Check the FreeIPA and SSSD documentation for your release.
What happens to hosts currently set to allow_all during migration?
Hosts under the default allow_all HBAC rule keep letting any enrolled user log in until you change that. A safe migration first lists which users and services actually log in to each host, builds specific rules for those groups, and tests them in a non-production realm. Then it moves hosts from allow_all in small groups, keeping an administrator session open and a rollback plan ready. Removing allow_all too early can lock out service accounts, so the inventory of logins is the step that most often decides the schedule.
Will the project produce evidence for a compliance assessment?
DeployOpen can prepare the access control configuration, test results and change records that your compliance team needs to review. It does not issue audit reports, attestations or certifications. Independent auditors and certification bodies make those determinations. Ask in the scope for the specific artifacts you need, such as rule exports, approval records, test logs and before-and-after access reviews, so they are produced during the project rather than reconstructed later.
How a login and sudo request is evaluated across FreeIPA and SSSD
The flow starts when a user opens a session on an enrolled Linux host, where SSSD asks the IPA server for the user's identity and the HBAC rules that match that host. The HBAC evaluation, which checks user groups, host groups and services, returns the allow or deny decision before the session opens. For sudo, SSSD fetches sudo rules matched to the host and user through the same IPA data. The point to check is that each rule's user, host and command scopes resolve to the groups you expect, because a rule that matches nothing silently denies access.
Login and sudo evaluation flows from SSSD to FreeIPA rules and the directory.
What DeployOpen delivers for an access policy engagement
An access policy engagement is fixed-scope: the hosts in scope, the HBAC and sudo rules to be built, the test cases, the deliverables and the timeline are agreed in writing before work starts. The written scope is also where you confirm who approves rule changes, which host groups and user groups exist in your realm, and whether any hosts sit outside FreeIPA enrollment and must be handled separately. Because a quote follows from that scope, the document is the place to make those boundaries explicit rather than leaving them to be settled during testing.
At handover, the main deliverable is a rule matrix that maps each user group and host group to the HBAC services it may use and the sudo commands it may run, with the owner of each rule and the reason it exists. It comes with test evidence showing how each rule was checked from SSSD clients, including denied logins, so you can see that the intended restrictions hold and not only that allowed access works. A runbook covers break-glass access, the steps for emergency changes and the process for routine rule changes, including who runs ipa hbacrule-test or the equivalent checks before a change goes live. Confirm the exact test tooling and output format in the written scope.
Access policy drifts after go-live as teams, hosts and services change, so a retainer can cover periodic review of the rule matrix, retesting after host or group changes and support for rule requests. Ask in the quote which of these are included, how change requests are logged and how the retainer interacts with the rest of your FreeIPA support arrangements. Your own security team should also confirm that the break-glass procedure is reviewed and approved before the engagement closes, since it is the path that must work when normal rules fail.
How DeployOpen scopes, builds and hands over FreeIPA access policy
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, including FreeIPA host-based access control and sudo rules. We start from a written scope that names the hosts, groups and commands in play, then build and test the policy in your environment before it reaches production systems.
How we scope
- Inventory the hosts, host groups, user groups and services that the HBAC rules must cover.
- Document which sudo commands each role needs and which current allow_all exceptions must be removed.
- Agree the scope, deliverables and timelines in writing before any work starts, since most engagements are fixed-scope.
How we build
- Write HBAC and sudo rules in a test realm or lab first, then promote them to your production FreeIPA domain.
- Test login and sudo behavior on representative hosts through SSSD, including denied attempts, to confirm each rule matches its intent.
- Stage rollout by host group so that a mistaken rule affects a small set of machines before wider deployment.
How we hand over
- Deliver the rule set as a documented catalog with the purpose, owner and scope of each HBAC and sudo rule.
- Provide test cases and the verification steps your team can rerun after future rule changes.
- Walk your administrators through rollout, rollback and how to request changes, so the policy stays under your control.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after go-live.
- Retesting of access policy can follow changes to host groups, roles or FreeIPA releases, as agreed in the scope.
- Confirm with DeployOpen which support level, response terms and review cadence apply before signing the scope.

