Blog | G5 Cyber Security

AuthentiCode Launcher Security

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

  1. 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.
  2. Identify Launch Method

    How is AuthentiCode launching applications? Common methods include:

    • Shell Scripts: It might be running a script that uses sudo or 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.

  3. If using Shell Scripts
    • Examine the scripts for sudo commands. 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/application

    Try to run the application directly without sudo. If it fails, investigate why.

  4. 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
  5. 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.
  6. 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_SERVICE for binding to privileged ports) without giving the application complete root access.
    • Use the setcap command to set capabilities on the executable:
      sudo setcap 'cap_net_bind_service=+ep' /path/to/application
  7. 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.
  8. Testing and Verification
    • After making changes, thoroughly test each application to ensure it still functions correctly.
    • Use tools like ps or top to verify that applications are running with the expected user account.
    • Monitor system logs for any errors or unexpected behavior.
Exit mobile version