TL;DR
The AuthentiCode Launcher is running all applications with its permissions, which is a major security risk. This guide shows you how to restrict it so that each application runs with its own permissions.
Solution Guide
- Understand the Problem
- Currently, AuthentiCode launches everything as itself (likely root or a highly privileged user). This means if an app has a vulnerability, it can compromise the entire system.
- We need to change this so each application runs in its own isolated environment with only the permissions it needs.
- Identify Launch Method
How is AuthentiCode launching applications? Common methods include:
- Shell Scripts: It might be running a script that uses
sudoor similar to execute programs. - Systemd Services: It could be using systemd unit files to launch apps.
- Custom Launcher Application: There may be a dedicated application responsible for launching others.
Check the AuthentiCode configuration files and any associated scripts or services.
- Shell Scripts: It might be running a script that uses
- If using Shell Scripts
- Examine the scripts for
sudocommands. If found, review which programs are being executed with elevated privileges. - Remove unnecessary uses of
sudo. Ideally, applications should not require root access to run normally. - If an application *requires* root access, consider using a more targeted approach like capabilities (see Step 6).
Example: If you find this in a script:
sudo /path/to/applicationTry to run the application directly without
sudo. If it fails, investigate why. - Examine the scripts for
- If using Systemd Services
- Locate the systemd unit files for the applications launched by AuthentiCode. These are usually in
/etc/systemd/system/or~/.config/systemd/user/. - Edit each unit file and ensure the
User=directive is set to a non-privileged user account that owns the application files. If it’s currently set to root, change it! - Reload systemd after making changes:
sudo systemctl daemon-reload - Restart each service:
sudo systemctl restart application.service
- Locate the systemd unit files for the applications launched by AuthentiCode. These are usually in
- If using a Custom Launcher Application
- Examine the source code or configuration of the launcher application.
- Identify how it’s executing other programs. Look for functions like
exec(),subprocess.Popen()(Python), or similar in other languages. - Modify the launcher to run applications using a non-privileged user account. This often involves changing the user ID before execution.
- Capabilities (Advanced)
If an application needs only specific root privileges, use Linux capabilities instead of running it as full root.
- Capabilities allow you to grant individual permissions (e.g.,
CAP_NET_BIND_SERVICEfor binding to privileged ports) without giving the application complete root access. - Use the
setcapcommand to set capabilities on the executable:sudo setcap 'cap_net_bind_service=+ep' /path/to/application
- Capabilities allow you to grant individual permissions (e.g.,
- Sandboxing (Highly Recommended)
For maximum security, consider sandboxing applications using technologies like:
- Firejail: A simple and effective application sandboxing tool.
- Snap/Flatpak: Containerized package managers that provide strong isolation.
- Docker/Podman: More complex containerization solutions suitable for larger applications.
- Testing and Verification
- After making changes, thoroughly test each application to ensure it still functions correctly.
- Use tools like
psortopto verify that applications are running with the expected user account. - Monitor system logs for any errors or unexpected behavior.