Implement least privilege | Pathfinder

Endpoint Privilege Management A workflow for EPM for Linux

On many Linux systems, any user with sudo or root access can run any command on the host. One stolen password or one careless command can then change system files, expose sensitive data, or give an attacker a path across your network. Least privilege closes that gap. Each user can run only the commands their job needs, and every privileged action is recorded.

Scope of this guide

This workflow shows you how to set up least privilege on your Linux hosts with BeyondTrust Endpoint Privilege Management for Linux (EPM-L). It covers the full setup, from building a role-based policy to committing it and monitoring the results. When you finish, you have the audit records that frameworks such as SOC 2, ISO 27001, CIS Benchmarks, and PCI-DSS ask for.

Prerequisites

  • You have an EPM-L license.
  • You can sign in to app.beyondtrust.io, and you have the policyadmin role in EPM-L.
  • You have installed and activated the EPM-L client on all target Linux hosts.
  • You have a list of your current privileged users and the commands they run.
  • If you plan to use directory users or groups, you have set up a Microsoft Entra ID directory service connection in EPM-L.

Steps

Step 1: Back up your policy and start a transaction

EPM-L groups policy changes into a transaction. Your changes stay private until you commit them, so users are not affected while you work. Back up the current policy first, so you can restore it if you need to roll back later.

  1. Sign in to app.beyondtrust.io.
  2. From the menu, select Endpoint Privilege Management for Linux > Policy. The Role Based Policy page displays.
  3. Select the Backup & Restore tile.
  4. Select Backup Role Based Policy, and save the JSON file in a safe place.
  5. Return to the Role Based Policy page and select any tile.
  6. Select Start Policy Edits.
  7. Enter a reason for the changes, such as Set up least privilege roles. Other administrators see this reason in the transaction history.
  8. Select Continue Editing. The policy pages are now editable.

Step 2: Create command groups

A command group is a set of commands that users are allowed to run on endpoints. Instead of writing a rule for every command, you group related commands and assign the group to a role.

Before you start, list the commands each type of user needs. Use a planning table like this one:

Command groupExample commandsTypical users
Network Diagnosticsping, traceroute, netstat, ss, nmap (read-only)General IT support staff
Package Managementapt, yum, dnf, rpm -qPatching and maintenance teams
Service Controlsystemctl start/stop/restartApplication support teams
User Administrationuseradd, passwd, usermodSenior sysadmins only
Database Operationsmysql, psql, mongod admin commandsDBA team only
  1. On the Role Based Policy page, select the What tile. The Command Groups page displays.
  2. Select Add Command Group.
  3. Turn on Enable Command Group.
  4. Enter a Command Group Name, such as Network Diagnostics.
  5. Enter a Command Group Description that explains the business reason for the group.
  6. For each command, enter the Command the user types. Optionally, enter the full path to run in the Executed field. For example, enter ping as the Command and /bin/ping as Executed.
  7. Select Save.
  8. Repeat these actions for each command group in your planning table.
📘

A command group does not allow or reject commands on its own. You set that with the Action setting on each role in Step 5.

Step 3: Add secure users and groups

A secure user is an account that EPM-L manages. EPM-L policies apply only to the secure users and groups you add here.

You can add users in three ways:

  • Secure users: Add individual Linux user names.
  • Secure groups: Create a group and add users to it, one at a time or by importing a CSV file.
  • Directory service users and groups: Import users and groups from Microsoft Entra ID.
  1. On the Role Based Policy page, select the Who tile. The Users page displays.
  2. Select Add User/Group, and then select Secure User or Secure Group.
  3. Turn on Enable user or Enable Group.
  4. Enter the user or group name and a description.
  5. Select Save Changes.
  6. For a secure group, open the group and select Add to add members, or select Import Users to import them from a CSV file. Select Save Changes.
  7. Review the full list. Confirm that it includes every privileged account, including service accounts and shared accounts.
⚠️

Add service accounts and shared accounts if they can run privileged commands. Unmanaged accounts leave a gap in your policy that attackers can use.

Step 4: Create host groups and schedule groups

Host groups set where a role applies. Schedule groups set when it applies. Create them now so they are ready to assign to roles.

  1. On the Role Based Policy page, select the Where tile. The Host Groups page displays.
  2. Select Add Host Group.
  3. Turn on Enable Host Group.
  4. Enter a Host Group Name and Host Group Description.
  5. Enter the matching hosts. Use host names, not IP addresses.
  6. Select Save.
  7. Create a separate host group for your pilot hosts. You use it to roll out roles in stages in Step 7.
  8. Optionally, select the When tile, select Add Schedule Group, and create a Fixed Schedule or Recurring Schedule, such as business hours only.
⚠️

You can't edit a schedule group after you enable it. Check the times before you enable it.

Step 5: Create roles

A role is the main building block of least privilege in EPM-L. It sets four things: who can act, what commands they can run, where they can run them, and when. When you change a role, the change applies to everyone assigned to it.

Follow these principles when you design roles:

  • Base roles on job functions, not individuals. For example, Junior Developer, Senior DBA, or IT Support.
  • Start with fewer permissions and add more as needed. Granting access is easier than taking it away.
  • Separate duties where your policy requires it, such as deploying code and managing the database.
  • Limit each role to the hosts it needs. For example, a DBA role allows database commands only on database servers.
  1. On the Role Based Policy page, select the Roles tile.
  2. Select Add Role.
  3. Enter a Role name based on a job function, such as Linux Support - Level 1, and a Description.
  4. Select Create And Edit the Role. The Edit Role page opens on the General tab.
  5. Set Action to Accept for a role that allows commands, or Reject for a role that blocks them.
  6. Confirm that Policy is set to Enabled, and then select Save.
  7. Select Assignments.
  8. Under Who, add the secure users and groups as Submit Users. Add the account the commands run as, such as root, as Run Users.
  9. Under What, add the command groups for this role.
  10. Under Where, add the host groups for this role as Submit Hosts and Run Hosts. Start with your pilot host group.
  11. Optionally, under When, add a schedule group.
  12. Select Save.
  13. For roles with elevated privileges, select Session Replay, turn on Session Replay, and select Save.
  14. Repeat these actions for each job function on your list of privileged users.
✅

Consider a break-glass role for emergencies. Turn on session replay for it, and limit it to a few trusted administrators.

Step 6: Review your changes

Review the policy before you commit it. A careful review prevents accounts with too much access, which is a security risk. It also prevents accounts with too little access, which stops people from doing their jobs.

  1. On the Role Based Policy page, select the Entitlement Reports tile.
  2. Use the filters, such as Submit User, Run Host, and Command, to check who can run what, where, and when.
  3. Review the results with team managers. They know which people need which access.
  4. For users who now rely on unrestricted sudo, confirm that their new role covers every command they need.
  5. Fix any gaps in the roles, users, or command groups.
  6. Select Review Policy Edits. The Transaction Summary page lists every change in your transaction.
  7. Check that the summary matches what you planned.
✅

Record your role assignments in a spreadsheet or CMDB, so you have a reference outside the console.

Step 7: Commit your policy

Committing applies every change in your transaction to the live policy at once. Your least privilege policy is active as soon as you commit.

  1. On the Transaction Summary page, select Commit Policy Edits.
  2. On a pilot host, test the policy as described in Verify the results.
  3. Run the pilot for one to two weeks. Collect feedback and review the audit logs.
  4. When the pilot is stable, start a new transaction and add your other host groups to each role's Where assignments.
  5. Repeat until every managed host is covered.
⚠️

Changes are live for all users as soon as you commit. To discard a transaction before you commit, select Cancel Policy Edits. To roll back after you commit, restore the backup you saved in Step 1 from the Backup & Restore tile.

Step 8: Monitor privileged activity

EPM-L logs every privileged request on managed hosts. Audit records help you spot misuse and prove that your controls work.

  1. From the menu, select Endpoint Privilege Management for Linux > Events. Review accept and reject events for your hosts.
  2. From the menu, select Endpoint Privilege Management for Linux > Search and Replay. Replay sessions for roles with session replay turned on.
  3. If you have a SIEM, select Endpoint Privilege Management for Linux > SIEM Connections, and then select Add Connection. Choose your SIEM Connection Type, enter the connection details, select Test Settings, and then select Save SIEM Connection.
  4. Set up alerts in your SIEM for high-risk events, such as rejected commands or access outside business hours.
  5. Schedule regular reviews of events and entitlement reports. Review weekly for active operations and monthly for policy changes.
✅

You can download events and session records as JSON or CSV files. Export and archive them regularly as audit evidence for your compliance program.

Verify the results

  • Confirm that each pilot host appears on the Endpoints page under Endpoint Privilege Management for Linux > Endpoint Management. A host appears after a user runs pbrun on it at least once.
  • On a pilot host, use pbrun to run one command that a role allows and one that no role allows. Confirm that EPM-L accepts the first and rejects the second.
  • In Events, confirm that both requests appear with the correct Accept and Reject event types.
  • For the first 24 to 48 hours after each commit, check Events for unexpected rejections. An unexpected rejection can point to a gap in a role or command group.

Next steps


©2003-2026 BeyondTrust Corporation. All Rights Reserved. Other trademarks identified on this page are owned by their respective owners. BeyondTrust is not a chartered bank or trust company, or depository institution. It is not authorized to accept deposits or trust accounts and is not licensed or regulated by any state or federal banking authority.