All documentation
๐ก๏ธ Linux Privilege Control & PBIS Login Authorization
๐ Overview
This document explains how to audit and differentiate between:
- Sudo Access: Who can run privileged commands via
sudo. - PBIS Login Authorization: Who is allowed to log into the system (typically via SSH) when using PowerBroker Identity Services (PBIS).
๐ Section 1: Auditing Sudo Access
To identify which local or AD groups are allowed to run commands with sudo, inspect the sudoers configuration.
โ Command:
sudo grep -E '^%.*ALL=\(ALL\)' /etc/sudoers /etc/sudoers.d/* 2>/dev/null
๐ก What It Does:
- Scans
sudoersfiles for group-based sudo access rules. - Returns lines that match the pattern for full sudo rights (e.g.,
%groupname ALL=(ALL)).
๐ Example Output:
%admin ALL=(ALL) ALL
%wheel ALL=(ALL:ALL) ALL
%domain^admins ALL=(ALL) ALL
๐ Files Scanned:
/etc/sudoers/etc/sudoers.d/*(drop-in config directory)
๐ Section 2: Auditing PBIS Login Authorization
When using PBIS to integrate Active Directory with Linux, login access can be restricted to members of specific AD groups.
โ Command:
/opt/pbis/bin/config --details RequireMembershipOf
๐ก What It Does:
- Shows which AD groups are required for login access.
- If a user is not a member of at least one of these groups, login will be denied โ even if their AD credentials are valid.
๐ Example Output:
RequireMembershipOf: EXAMPLE\\LinuxAdmins
RequireMembershipOf: EXAMPLE\\Domain Admins
๐ Key Differences
| Feature | sudoers (grep -E) | PBIS RequireMembershipOf |
|---|---|---|
| Controls | Who can run sudo commands | Who can log into the system |
| Based on | Local or AD Linux group in sudoers | Active Directory group membership |
| Location / Tool | /etc/sudoers, /etc/sudoers.d/* | /opt/pbis/bin/config |
| Applies To | Privilege escalation | Login authorization |
| Example | %domain^admins ALL=(ALL) ALL | RequireMembershipOf: EXAMPLE\\LinuxAdmins |
๐งช Validation Steps
- To test sudo access:
- Login as a user.
- Run
sudo -lto see allowed commands. - Check group membership:
groups <username>
- To test login access:
- Remove the user from all
RequireMembershipOfgroups. - Attempt SSH login โ should fail with "Access denied".
- Remove the user from all
โ Recommendation
To maintain least privilege and security best practices:
- Restrict login using
RequireMembershipOfto necessary AD groups. - Configure
sudoersto only grant elevated access to trusted groups/users. - Regularly audit both to prevent privilege creep.