Installing the macOS agent

Please read with workstation requirements before installation.

Installation

  1. Download the agent:

  • via the server web interface,

  • via link.

  1. Grant permission to access the hard drive to run the installer script.

For .ibatyrAgent, Terminal, fmon_app, sshd-keygen-wrapper:

Illustration 1 — Installing the macOS agent
  1. Place the installation file on the machine whose activities will be monitored.

To do this, in the terminal from the folder with the agent, run the command:

sudo bash ./agent-macos.sh 10.0.0.1

Instead of 10.0.0.1, enter the IP address of your iBatyr Monitor server.

In the “ibatyrAgent needs accessibility” window that appears, grant rights to the agent:

Illustration 3 — Installing the macOS agent
  1. Grant Terminal permission to install the agent:

Illustration 4 — Installing the macOS agent

In some versions of macOS you need to grant Screen Recording permissions:

Illustration 5 — Installing the macOS agent
  1. To control file operations, allow disk access for the application /Library/Application Support/.AtomSec/fmon_app.

Installing an agent from a pkg distribution

Error**Can’t be opened because apple cannot check it for malicious software**

During agent installation, the error Can’t be opened because apple cannot check it for malicious software may occur.

This error occurs when macOS is unable to verify the manufacturer of the software being launched. There are several ways to solve this problem:

Method 1. In the System Preferences - Security & Privacy section, select the Open Anyway option.

Method 2. Right-click on the application icon. The Open option will be available despite the warning Can’t be opened because apple cannot check it for malicious software.

  1. Download the pkg distribution

Note

If the distribution name does not indicate the address of the iBatyr Monitor server to which the data will be sent, specify it.

Change the file name to agent-macos[server_address].pkg. Here, instead of server_address, enter the IP address of your iBatyr Monitor server.

  1. Run the file.

  2. Follow the installation wizard’s instructions.

  3. When prompted, enter the system administrator login and password.

  4. Grant the system all necessary permissions.

Note

To control file operations, allow disk access for the application /Library/Application Support/.AtomSec/fmon_app.

Illustration 6 — Installing the macOS agent

After installation is complete:

  • Check on all tabs that all necessary permissions are granted:

    Illustration 7 — Installing the macOS agent
  • in the web interface of the iBatyr Monitor server in Alerts and in the section Control Panel - Computers information about the installed agent will appear.

Installation via MDM

When installing the agent via standard Apple MDM, you cannot change the settings of the pkg package directly or through the file name. To pass parameters, add a postinstall script to the installation manifest.

Example commands for setting up an agent:

# Путь к исполняемому файлу агента
EXE="/Library/Application Support/.AtomSec/StaffAgent.app/Contents/MacOS/StaffAgent"

# Переустановка компонентов агента:
# демоны, plist-файлы, PAM-модуль, служебные файлы
"$EXE" reinit

# Указание основного сервера
"$EXE" set_server <host> <port>

# Добавление резервного сервера
"$EXE" add_servers <host> <port>

# Перезапуск служб агента
"$EXE" restart

Additional commands:

# Путь к исполняемому файлу агента
EXE="/Library/Application Support/.AtomSec/StaffAgent.app/Contents/MacOS/StaffAgent"

# Полное удаление агента
"$EXE" uninstall

# Управление PAM-модулем (отвечает за блокировку входа в систему)
"$EXE" install_pam        # Установить PAM-модуль
"$EXE" uninstall_pam      # Удалить PAM-модуль
"$EXE" remove_pam         # Альтернативная команда для удаления PAM-модуля

# Управление службами агента
"$EXE" start              # Запустить службы агента
"$EXE" stop               # Остановить службы агента

Help on all available commands:

"/Library/Application Support/.AtomSec/StaffAgent.app/Contents/MacOS/StaffAgent" help

Removal

To remove the agent, run the command:

bash ./agent-macos.sh uninstall

Agent logs

cat /Library/Caches/com.atomsec.ibatyr/ibatyr.log
cat /Library/Caches/com.atomsec.ibatyr/staff_filemon.log
cat /tmp/ibatyr.err.log
cat /var/log/system.log | grep com.atomsec.ibatyr

Backup Server Job

The macOS agent can be configured with one or more backup servers to transmit events or update the agent itself.

You can specify backup servers in two ways:

  1. Via terminal:

    sudo /Library/Application\ Support/.AtomSec/StaffAgent.app/Contents/MacOS/StaffAgent add_servers 1.1.1.1 555 https://2.2.2.2:888
    

    Here is an example of adding two backup servers: 1.1.1.1 with communication port 555 and 2.2.2.2 with port 888.

    After adding new servers, restart the agent for the updated configuration to take effect:

    sudo /Library/Application\ Support/.AtomSec/StaffAgent.app/Contents/MacOS/StaffAgent restart
    
  2. Manually in the configuration file:

    2.1 Open the configuration file /Library/Caches/com.atomsec.ibatyr/config.

    2.2 Add the address of the new server and the port to connect to it in the format:

    server2 = 1.1.1.1
    port2 = 555
    

If the main server is unavailable, the agent will automatically switch to the backup one. If the first backup server is unavailable, the agent will switch to the next one in the list.

To change the server to transfer data from the agent, use the command:

sudo /Library/Application\ Support/.AtomSec/StaffAgent.app/Contents/MacOS/StaffAgent set_server 1.1.1.1 555