This document provides a step-by-step guide for registering a sudo rule in EPM Linux.
Requirements
Every user who will use sudo rules (general, device, and user) needs to be added to the gonix
group. To add a user to the gonix
group, follow these steps:
- Access the terminal where EPM Linux is installed.
- Type this command to add the user to the
gonix group: sudo usermod -a -G gonix USERNAME
. - Type this command to create a password for the sudo user:
sudo passwd USERNAME
. - Type this command to validate if the user is part of the
gonix
group:sudo getent group gonix
.
Register a General Sudo Rule
- In Segura, hover over the Product Menu in the navigation bar and select EPM.
- In the sidebar menu, select Policies > Linux > Sudo Rules.
- Click Add.
- On the Segregation screen, choose General.
- In the Register Sudo Rules form, fill in the fields:
- Identification name: define a name to identify the rule.
- Active: set the rule status.
- Commands for rule application (full path must be used): fill in with the path of the command that can be executed as sudo and elevate privileges. To discover the path of a command in the Linux terminal, execute which [command].
- Should be NOPASSWD?: if you set this to Yes, the user will not be prompted for a password to execute the command as sudo. If set to No, the user will be prompted for a password.
- Description: add a brief description about this rule.
- Click Continue.
- Click Save.
Register a Sudo Rule for a Device
- In Segura, hover over the Product Menu in the navigation bar and select EPM.
- In the sidebar menu, select Policies > Linux > Sudo Rules.
- Click Add.
- On the Segregation screen, choose Device.
- In the Register Sudo Rules form, on the Sudo rules tab, fill in the fields:
- Identification name: define a name to identify the rule.
- Active: set the rule status.
- Commands for rule application (full path must be used): fill in with the path of the command that can be executed as sudo and elevate privileges. To discover the path of a command in the Linux terminal, execute which [type the desired command].
- Should be NOPASSWD?: if you set this to Yes, the user will not be prompted for a password to execute the command as sudo. If set to No, the user will be prompted for a password.
- Description: add a brief description about this rule.
- On the Devices tab, fill in the fields:
- Click Add to open the Devices modal.
- In the Devices modal, select the devices you want to include in the rule.
- Click Add.
- Click Continue.
- On the Review tab, review the rule registration and click Save.
How to Register a General Sudo Rule for a User
- In Segura, hover over the Product Menu in the navigation bar and select EPM.
- In the sidebar menu, select Policies > Linux > Sudo Rules.
- Click Add.
- On the Segregation screen, choose User.
- In the Register Sudo Rules form, on the Sudo rules tab, fill in the fields:
- Identification name: define a name to identify the rule.
- Active: set the rule status.
- Commands for rule application (full path must be used): fill in with the path of the command that can be executed as sudo and elevate privileges. To discover the path of a command in the Linux terminal, execute which [type the desired command].
- Should be NOPASSWD?: if you set this to Yes, the user will not be prompted for a password to execute the command as sudo. If set to No, the user will be prompted for a password.
- Description: add a brief description about this rule.
- On the User tab:
- Click Add to open the Users modal.
- In the Users modal, select the users you want to include in the rule.
- Click Add.
- Click Continue.
- On the Review tab, review the rule registration and click Save.
Info
To validate if the sudo rules are active, use the command cat /etc/sudoers.d/senhasegura
.