Quiz Entry - updated: 2026.10.13
How is a sudo rule stored in Active Directory, for example to let web developers restart the web server?
Extend the AD schema with the sudo project's sudoRole class, then create one sudoRole object per rule with the attributes sudoUser, sudoHost and sudoCommand.
- Extend the schema. AD does not know sudo rules by default. The sudo project ships a schema file, which is imported with
ldifde. Changing the schema needs membership in Schema Admins, a highly privileged group that should otherwise stay empty. - Create a container
sudoers(an object of classsudoRole) in ADSI Edit. The normal "Users and Computers" tool cannot edit these attributes. - Create one
sudoRoleper rule. Each object is one line of asudoersfile:
| Attribute | Example value | Meaning |
|---|---|---|
sudoUser |
%gg_ch_webdevs@g001.ckteck.com |
Who (the % marks a group) |
sudoHost |
lc-001 |
On which host (name, IP, network or netgroup) |
sudoCommand |
/bin/systemctl restart apache2 |
Exactly which command |
The ticket asked for "sudo rights", but the rule follows the principle of least privilege: the web developers can restart Apache on one host and nothing else. A rule like sudoCommand: ALL would have made them full root.
Go deeper:
sudo.ws: sudoers.ldap manual — every sudoRole attribute and how rules are matched.