Skip to main content
Version: v46

PrivX Server Configuration

PrivX provides settings for managing server behavior, resource usage, and the user experience. This article describes how to configure PrivX Server behavior to meet your deployment requirements.

Dedicated Server Roles​

You can assign roles to individual PrivX Servers in a high-availability (HA) deployment to control which jobs they perform.

Your PrivX deployment must include one of the following server combinations to perform all required jobs:

  • Default roles: At least one default server
  • Dedicated roles: At least one worker-only server and at least one server-only server.

To configure the role of a PrivX Server:

  1. Access the PrivX Server as root.

  2. In the shared-configuration file /opt/privx/etc/shared-config.toml, set server_mode to one of the following values:

    Supported Jobdefaultworker-onlyserver-only
    RoleAll JobsBack-End JobsFront-End Jobs
    Handle user logins••
    Scan cloud hosts••
    Check host availability••
    Process audit logs and session recordings••
  3. Restart PrivX services to apply your changes:

    systemctl restart privx

Configuring Housekeeping Tasks​

Housekeeping tasks periodically check and clean up PrivX data. You can enable, disable, and change the intervals of the following tasks without restarting PrivX:

MicroserviceSetting
Host StoreHousekeeping Interval (Hours)
Monitor ServiceHousekeeping Interval (Hours)
Monitor ServiceDatabase Cache Removal Interval (Seconds)
Role StoreExpired Keys Purge Interval (Hours)
Role StoreSCIM Role Cleanup Interval (Minutes)
Role StoreInactive User Cleanup Interval (Hours)
Role StoreEphemeral Users Cleanup Interval (Minutes)
Trail IndexHousekeeping Interval (Minutes)
Workflow EngineRequests Housekeeping Interval (Hours)

For descriptions of the settings, see PrivX Settings.

To configure one of these housekeeping tasks:

  1. In the PrivX Web UI, go to Administration → Settings.
  2. Select the microservice that runs the task, and click Edit.
  3. Configure the interval:
    • To enable the task or change how often it runs, enter a valid positive value.
    • To disable the task, set its interval to 0 or -1 for the task-specific disabling value.
  4. Click Save. The change applies without restarting PrivX.

Saving the settings reschedules the affected housekeeping tasks, even if their interval values have not changed. The following table describes the effects of enabling, reactivating, and disabling a task.

ActionEffect
Enable a disabled taskThe task runs shortly afterwards and then follows the configured interval.
Reactivate an enabled task by setting its interval to a valid positive value, which can be the same as its current valueSaving immediately resets the schedule. If the task is not running, its next run is scheduled after the configured interval. If it is running, it finishes and its next run is scheduled after that interval.
Disable an enabled taskNo further runs are scheduled. If the task is running, it finishes before stopping.
Disable an already disabled taskThe task remains disabled.

An enabled task can therefore remain stopped. Housekeeping tasks do not run in the following cases, even if they are enabled:

  • On servers with the server-only role.
  • While PrivX is in maintenance mode.

There are exceptions to both restrictions that could be applied to some housekeeping tasks. These tasks either have no configurable settings or require a server restart to apply configuration changes.

Disabled tasks do not run in either normal or maintenance mode.

PrivX Log Settings​

You can configure where PrivX sends log messages, change the log level of individual microservices, and adjust logging settings to improve performance.

By default, PrivX sends regular and audit events to syslog. Audit events use the namespace SSH-PRIVX-AUDIT. Regular messages, including debug, information, warning, and error messages, use the namespace SSH-PRIVX.

Configure logging destinations in /opt/privx/etc/shared-config.toml and microservice log and trace levels in /opt/privx/scripts/local-env.

The following example shows how to enable syslog logging for regular and audit events nds disable stdout for regular events:

# Send PrivX system events to logs under /var/log/privx
send_regular_events_to_stdout = false

# Send PrivX audit events to syslog
send_audit_events_to_syslog = true

# Send regular PrivX system events to syslog
send_regular_events_to_syslog = true

For instructions, see:

Changing Log Levels and Forwarding Logs​

You can change microservice log levels to collect more detailed information for troubleshooting. You can also configure rsyslog to forward PrivX logs to external syslog servers.

Changing Microservice Log Levels​

To enable debug output for a microservice, perform the following steps as root on each PrivX Server that requires the change:

  1. In /opt/privx/scripts/local-env, set the log and trace levels for the microservice.
    For example, to set the Authorizer log level to DEBUG and trace level to 5:

    AUTHORIZER_LOG_LEVEL=DEBUG
    AUTHORIZER_TRACE=5
  2. Restart the affected microservice to apply your changes. For Authorizer:

    systemctl restart authorizer

    Alternatively, restart all PrivX services:

    systemctl restart privx
  3. Configure rsyslog to write DEBUG messages to the log file.
    In /etc/rsyslog.conf, locate the following rule. By default, it writes messages with severity INFO or higher to /var/log/messages, excluding the mail, authpriv, and cron facilities. It does not write DEBUG messages.

    *.info;mail.none;authpriv.none;cron.none /var/log/messages

    To include DEBUG messages, change the rule to:

    *.debug;mail.none;authpriv.none;cron.none /var/log/messages
  4. Restart rsyslog to apply the changes:

    systemctl restart rsyslog

Forwarding Logs to Multiple Syslog Servers​

To forward PrivX logs to multiple external syslog servers, perform the following steps as root on each affected PrivX Server:

  1. Create or edit /etc/rsyslog.d/forward-privx-logs.conf and add the following rules. Replace the example IP addresses and ports with those of your syslog servers:

    # Forward PrivX generated log messages to remote servers
    :programname, isequal, "SSH-PRIVX" @@192.168.1.1:514
    :programname, isequal, "SSH-PRIVX-AUDIT" @@192.168.1.1:514
    :programname, isequal, "SSH-PRIVX" @@192.168.1.2:514
    :programname, isequal, "SSH-PRIVX-AUDIT" @@192.168.1.2:514
    & stop
  2. Restart rsyslog to apply the changes:

    systemctl restart rsyslog

Logging Through journald​

For RPM deployments on RHEL 8 and 9, PrivX sends syslog messages to localhost:514 over TCP by default. If the local rsyslog TCP listener is disabled, PrivX cannot send messages to this destination and reports connection errors.

To use journald, configure PrivX to send syslog messages to the local Unix socket /dev/log. Rsyslog can then read the journal through its imjournal module and continue writing log files or forwarding messages to external collectors.

PrivX -> /dev/log -> journald -> rsyslog -> log files / remote collectors
caution

Sensitive audit messages can remain in the journal even if rsyslog is configured to discard them. If persistent journal storage is enabled, these messages can also be stored on disk.

journald receives syslog messages before rsyslog applies the sensitive-event discard rule in /etc/rsyslog.d/privx-syslog.conf. This affects features that generate SSH-PRIVX-SENSITIVE-AUDIT messages. For example, restricted-shell command auditing can include command text in these syslog-only messages. PrivX does not store these messages in its audit-event database.

If sensitive events must bypass the journal, keep audit logging on its existing TCP destination and send only regular events through journald, as described below. If audit logging uses localhost:514, the local rsyslog TCP listener must remain enabled.

To configure logging through journald:

  1. Perform the following steps as root on each PrivX Server. Back up each configuration file before you modify it.

  2. Check that journald is running and its syslog socket is available:

    systemctl status systemd-journald.service
    ls -l /dev/log /run/systemd/journal/dev-log
  3. In the [shared] section of /opt/privx/etc/shared-config.toml, configure the following to use journald:

    send_regular_events_to_syslog = true
    send_regular_events_to_stdout = false
    syslog_protocol = "unixgram"
    syslog_address = "/dev/log"

    send_audit_events_to_syslog = true
    send_audit_events_to_stdout = false
    audit_event_format = "syslog"
    audit_event_syslog_protocol = "unixgram"
    audit_event_syslog_address = "/dev/log"

    To keep audit events on the default TCP destination, use these audit overrides instead:

    audit_event_syslog_protocol = "tcp"
    audit_event_syslog_address = "localhost:514"

    If audits already use a dedicated collector, retain that collector's protocol, address, and required audit format.

  4. Check /etc/rsyslog.conf to ensure that rsyslog reads messages from the journal. Retain the existing module options. The relevant settings typically look like this:

    module(load="imuxsock" SysSock.Use="off")
    module(load="imjournal" StateFile="imjournal.state")

    Load each module only once. Keep the include for /etc/rsyslog.d/*.conf and your existing file, forwarding and sensitive-event rules. ForwardToSyslog=yes is not needed when using imjournal.

  5. Resolve any reported configuration errors, then restart rsyslog and PrivX:

    rsyslogd -N1

    systemctl restart rsyslog.service
    systemctl restart privx.service

    No startup-script or systemd-unit changes are needed. Standard output (stdout) and standard error (stderr) diagnostics goes to /var/log/privx/. Syslog messages configured to use /dev/log go to journald.

  6. Generate a PrivX event, such as a test login, and check the journal for regular and audit messages:

    journalctl --since '5 minutes ago' -t SSH-PRIVX
    journalctl --since '5 minutes ago' -t SSH-PRIVX-AUDIT

    Also confirm that the event reaches your configured log file or external collector. If audit logging remains on TCP, audit events continue to appear at that destination rather than in the journal. If messages are missing, check /var/log/privx/*.log for syslog connection errors.

After verification, you can disable rsyslog's TCP port 514 input if no audit logging or other applications use it. After changing the configuration, validate it and restart rsyslog.

Configuring Journal Storage and Retention​

You can configure journal storage and retention separately in /etc/systemd/journald.conf and its drop-in configuration files. Review storage, retention, and rate limits for your deployment. journald and the rsyslog imjournal module can discard messages under load. If you require complete audit logs, test with representative traffic.

To check the configuration options supported by the systemd version installed on your server, run man journald.conf. For additional information, see the journal configuration and rsyslog imjournal documentation.

Restoring the Previous Logging Configuration​

To restore the previous logging configuration, restore the previous settings in /opt/privx/etc/shared-config.toml and any rsyslog configuration files you changed. If you changed the rsyslog configuration, validate it and restart rsyslog. Ensure that the previous logging destination is available before restarting PrivX. If the previous destination was localhost:514, enable the local rsyslog TCP listener first.

Optimizing Log Performance​

Large amounts of syslog traffic can reduce PrivX performance, particularly when verbose logging is enabled for multiple microservices. By default, PrivX sends messages to local syslog over TCP. You can reduce the performance impact of logging by:

  • Using less verbose log levels.
  • Logging to stdout or file instead of rsyslog.
  • Switching to UDP logging.

Outside of troubleshooting scenarios, we recommend keeping microservice log levels at INFO. For more information on setting log levels, see Changing Log Levels and Forwarding Logs.

Writing Regular Events to Stdout or Files​

To write regular events to stdout instead of rsyslog:

  1. In /opt/privx/etc/shared-config.toml, set the following values on each PrivX Server:

    send_regular_events_to_stdout = true
    send_regular_events_to_syslog = false
  2. Restart PrivX services to apply your changes:

    sudo systemctl restart privx
  3. To specify which files receive stdout and stderr output, set stdout_log and stderr_log in the microservice's startup script in /opt/privx/scripts/<microservice_name>.sh. For example, the Role Store startup script is /opt/privx/scripts/role-store.sh.

  4. Restart the affected microservice after changing its startup script.

Using UDP for Syslog Messages​

You can enable UDP separately for regular and audit events. If you use UDP (instead of TCP) for logging, mind that UDP messages can be lost without notifying the sender.

caution

UDP does not guarantee message delivery and prevents some events from being logged. If your deployment requires complete syslog, such as for SIEM integration, use TCP rather than switching to UDP. Audit events are logged to the database, regardless of syslog settings.

To enable UDP for both regular and audit events:

  1. In /opt/privx/etc/shared-config.toml, set the following values on each PrivX Server:

    syslog_protocol = "udp"
    audit_event_syslog_protocol = "udp"
  2. Restart PrivX services to apply your changes.

Custom Disclaimers​

You can configure custom disclaimers to display messages to users in the PrivX Web UI, such as terms and conditions on the login page. Saved disclaimer settings appear in JSON format.

Example custom disclaimer

To configure custom disclaimers:

  1. In the PrivX Web UI, go to Administration → Settings → Global Settings and click Edit.

  2. Under Disclaimers, click Add Disclaimer. Configure the disclaimer content and behavior using the following fields:

    For checkboxes, the JSON value is true when enabled and false when disabled.

    FieldValuesJSON PropertyDescription
    PathRegular expressionpathSpecifies where the disclaimer appears. For example, ^/auth/login$ limits it to the login page.
    StyleJSON values: float, local, popupmodeSpecifies how the disclaimer appears. For example, Popup (modal dialog) displays it in a modal dialog. The local style is supported only on the login page.
    TitleTexttitleSpecifies the disclaimer title.
    TextTexttextSpecifies the disclaimer message.
    Acceptance TextTextacceptSpecifies the label displayed next to the acceptance checkbox. For example, “I have read and agree to the terms and conditions.”
    Users can accept the disclaimer to close ittrue, falseacceptableAllows users to accept and close the disclaimer. When enabled, users must accept the disclaimer to proceed unless closing without acceptance is also allowed (closeable is also true). Acceptance is stored in browser local storage. Clearing that storage causes the disclaimer to appear again.
    Users can close the disclaimer without accepting ittrue, falsecloseableAllows users to close the disclaimer without accepting it.
    Expiration TimeNumber of hoursexpirationTimeSpecifies how long a dismissal remains valid, in hours. The disclaimer appears again after this period.
    User dismissal of the disclaimer expires at the next logintrue, falseexpireAtLoginWhen enabled, a dismissed disclaimer appears again at the next login. When cleared, logging in does not itself expire the dismissal.
    Content UpdatedDate and timetimeStampRead-only. Stored in ISO 8601 format, such as 2020-01-01T12:00:00Z. Displays when the disclaimer content was created or updated. When this timestamp changes, it causes PrivX to treat the disclaimer as new and display it again, even to users who previously accepted it.
    No corresponding editable fieldUnique identifieridIdentifies the disclaimer and allows PrivX to track its acceptance separately from other disclaimers.

    PrivX converts the field values to JSON and displays the saved configuration under Disclaimers in view mode. For example:

    [
    {
    "id": "terms-and-conditions",
    "timeStamp": "2020-01-01T12:00:00Z",
    "path": "^/auth/login$",
    "title": "Terms and Conditions",
    "text": "Lorem ipsum dolor sit amet.",
    "accept": "I have read and agree to the terms and conditions",
    "mode": "popup",
    "acceptable": true,
    "closeable": false,
    "expirationTime": 24,
    "expireAtLogin": false
    }
    ]
  3. Click Preview to check how the disclaimer appears to users. Save your changes.

  4. Restart PrivX services to apply your changes. Click Restart on Administration → Settings, or run the following command as root on the PrivX Server:

    systemctl restart privx

Resetting Superuser Password​

If you forget the password for a local PrivX superuser account, you can reset it:

  1. Access a PrivX Server as root. In a high-availability (HA) deployment, perform these steps on one of your PrivX Servers.

  2. Run admin-tool with password-reset. Replace <username> with the username of the local superuser account:

    /opt/privx/bin/admin-tool password-reset <username>
    note

    This command does not check whether the new password meets your organization’s password requirements. It may accept a password that the PrivX Web UI would reject.

  3. When prompted, enter a new password that meets the configured password requirements.

You can now log in to PrivX with the new password. You can also change the password in the PrivX Web UI, which checks that it meets the configured password requirements.

Resetting PrivX Server Settings​

To reset some or all PrivX settings to their default values:

  1. Back up the current PrivX settings to a JSON file. Run the following command on one PrivX Server with <filename.json> replaced with the backup file path:

    /opt/privx/bin/settings-tool -command=export -out <filename.json>
  2. On one PrivX server, run settings-tool to reset the required settings. Use -scope to select a service or the global settings. Use -section with -scope to select a specific group of settings within that scope.

    Replace <scope> and <section> with the corresponding identifiers from the Scope and Section columns in PrivX Settings. Use the values exactly as listed, including capitalization and hyphens.

    • To reset all settings:

      /opt/privx/bin/settings-tool -command=reset
    • To reset all settings in a specific scope:

      /opt/privx/bin/settings-tool -command=reset -scope=<scope>
    • To reset only a specific section within a scope:

      /opt/privx/bin/settings-tool -command=reset -scope=<scope> -section=<section>

    For example, to reset only the disclaimer settings in the GLOBAL scope:

    /opt/privx/bin/settings-tool -command=reset -scope=GLOBAL -section=disclaimer
  3. Restart PrivX on all PrivX Servers to apply your changes:

    systemctl restart privx

Restoring Previous Settings​

caution

Restore settings only to the same PrivX version from which the backup was created. Restoring settings to a different PrivX version can cause PrivX to malfunction.

To restore settings from a backup, run the following command on one PrivX Server, where <filename.json> is replaced with the backup file path:

/opt/privx/bin/settings-tool -command=import -in <filename.json>

Restart PrivX on all PrivX Servers to apply the restored settings.

SSH Product Integrations​

You can configure links to other SSH products in PrivX. Administrators can access these links from the upper-right corner of the header bar:

SSH product menu icon in the PrivX header bar

To configure a link to SSH Universal Key Manager (PrivX Key Manager):

  1. In the PrivX Web UI, go to Administration → Settings and click Edit.
  2. Under SSH Product Integrations, enter a valid URL for SSH Universal Key Manager.
  3. Save your changes.

To open a configured product, click the product menu icon in the upper-right corner of the header bar and select the product.

Changing SSH and RDP Bastion Ports​

You can change the ports used by SSH Bastion and RDP Bastion to match your deployment requirements. By default:

  • SSH Bastion listens on port 2222
  • RDP Bastion listens on port 3389

To change either Bastion port, perform the following steps on all PrivX Servers:

  1. Update the configuration for the Bastion service:

    ServiceConfiguration FileSettingDefault Port
    SSH Bastion/opt/privx/etc/ssh-mitm.tomlssh_listen_addresses2222
    RDP Bastion/opt/privx/etc/rdpmitm/rdpproxy.iniport in the [globals] section3389
    • SSH Bastion: Update ssh_listen_addresses to specify the new port. For example, to use port 8022:

      ssh_listen_addresses = [
      ":8022"
      ]
    • RDP Bastion: Add or update port in the [globals] section. For example, to use port 3999:

      port=3999

    Save your changes.

  2. Allow TCP connections to the new port in the firewall. The following commands use firewalld and the public zone. Replace public with the appropriate zone for your deployment and <new_port> with the port configured in step 1:

    sudo firewall-cmd --permanent --zone=public --add-port=<new_port>/tcp

    If the old port is no longer needed, remove its firewall rule. Replace <old_port> with the previous port number:

    sudo firewall-cmd --permanent --zone=public --remove-port=<old_port>/tcp

    Apply the firewall changes:

    sudo firewall-cmd --reload
  3. Restart PrivX to apply the configuration changes:

    sudo systemctl restart privx
  4. Verify that you can establish an SSH or RDP connection using the new Bastion port.

Performance Optimizations​

The following settings can help reduce memory or socket usage. Review the limitations before applying these changes.

Optimizing for Low-Memory VMs​

If you are running PrivX Server on a virtual machine (VM) with limited memory, adjusting garbage collection for the Role Store service may improve performance.

To adjust Role Store garbage collection, perform the following steps on each affected PrivX Server:

  1. In /opt/privx/scripts/role-store.sh, find the following line:

    SSH_AUDIT_PRIORITY=${auditpriority} SSH_LOG_LEVEL=$loglevel SSH_TRACE=$tracelevel /opt/privx/bin/role-store >> "$stdout_log" 2>> "$stderr_log"

    Add GOGC=80 at the beginning of the line:

    GOGC=80 SSH_AUDIT_PRIORITY=${auditpriority} SSH_LOG_LEVEL=$loglevel SSH_TRACE=$tracelevel /opt/privx/bin/role-store >> "$stdout_log" 2>> "$stderr_log"
    warning

    Lowering GOGC can reduce heap memory usage but increase the CPU time spent on garbage collection. For production deployments, we recommend increasing the memory available to PrivX Servers beyond the minimum requirements instead. Setting GOGC too low can increase latency and reduce overall PrivX performance. The default value is 100.
    For more information on GOGC and the Go Garbage Collector, see A Guide to the Go Garbage Collector.

  2. Save your changes and restart the Role Store service.

Optimizing for Socket Usage and Latency​

You can configure PrivX microservices to connect directly to each other instead of routing traffic through Nginx. This configuration can reduce the number of required sockets by almost half and reduce Nginx bottlenecks.

warning

If your deployment has sufficient resources, we recommend increasing socket limits instead of using direct connections.
When microservices connect directly to each other, logging and timeout behavior changes:

  • Nginx logs do not include HTTPS requests sent directly between microservices. You can use PrivX logs to obtain more comprehensive request records.
  • Direct connections ignore Nginx timeouts or other Nginx settings. They use the PrivX default TLS timeout of 60 seconds.

To enable direct communication between microservices, on each PrivX Server update the settings in /opt/privx/etc/shared-config.toml to use the direct addresses in the following table:

Setting NameNginx Address (Default)Direct Address
rolestore_addresshttps://localhost/role-store/api/v1https://localhost:8081/role-store/api/v1
local_user_store_addresshttps://localhost/local-user-store/api/v1https://localhost:8084/local-user-store/api/v1
local_user_store_defaulthttps://localhosthttps://localhost:8084
workflow_engine_addresshttps://localhost/workflow-engine/api/v1https://localhost:8085/workflow-engine/api/v1
host_store_addresshttps://localhost/host-store/api/v1https://localhost:8882/host-store/api/v1
keyvault_addresshttps://localhost/keyvault/api/v1https://localhost:8090/keyvault/api/v1
networkaccessmanager_addresshttps://localhost/network-access-manager/api/v1https://localhost:8899/network-access-manager/api/v1
extenderservice_addresshttps://localhost/extender-service/api/v1https://localhost:8981/extender-service/api/v1
connectionmanager_addresshttps://localhost/connection-manager/api/v1https://localhost:8091/connection-manager/api/v1
connectionmanager_ws_addresswss://localhost/connection-manager/api/v1/websocketwss://localhost:8091/connection-manager/api/v1/websocket
authorizer_addresshttps://localhost/authorizer/api/v1https://localhost:8082/authorizer/api/v1
rdp_proxy_addresshttps://localhost/rdp-proxy/api/v1https://localhost:8087/rdp-proxy/api/v1
ssh_proxy_addresshttps://localhost/ssh-proxy/api/v1https://localhost:8880/ssh-proxy/api/v1
monitor_addresshttps://localhost/monitor-service/api/v1https://localhost:8092/monitor-service/api/v1
rdpmitm_addresshttps://localhost/rdp-mitm/api/v1https://localhost:8093/rdp-mitm/api/v1
trail-index_addresshttps://localhost/trail-index/api/v1https://localhost:8094/trail-index/api/v1
sshmitm_addresshttps://localhost/ssh-mitm/api/v1https://localhost:8095/ssh-mitm/api/v1
vault_addresshttps://localhost/vault/api/v1https://localhost:8098/vault/api/v1
secrets_manager_addresshttps://localhost/secrets-manager/api/v1https://localhost:8100/secrets-manager/api/v1
license_manager_addresshttps://localhost/license-manager/api/v1https://localhost:8101/license-manager/api/v1
settings_addresshttps://localhost/settings/api/v1https://localhost:8099/settings/api/v1
dbproxy_addresshttps://localhost/db-proxy/api/v1https://localhost:8983/db-proxy/api/v1
apiproxy_addresshttps://localhost/api-proxy/api/v1https://localhost:8984/api-proxy/api/v1

Settings not listed in the table use the same values in both microservice communication modes.

Save your changes, then restart PrivX services on each PrivX Server to apply them.