RustDesk Policies

Policies → RustDesk controls how the RustDesk client behaves on each managed machine. You write a policy with all 31 RustDesk client options (permissions, network, idle disconnect, recording and the client window) and assign it to all agents, a collection, a tag or one agent. Each policy also holds the machine's Approval mode, which is the consent setting: whether the person at the computer is asked before a RustDesk session starts. One policy wins on each machine, and Athena sends every agent its own settings.

Scope
  • Windows, Linux and macOS agents. One policy covers all three. Only Approval mode and the recording save folder are handled differently per OS (see Approval mode).
  • A licensed module. Your licence must include RustDesk policies (module.rustdesk). Without it, the page and the agent tab are hidden, the REST endpoints return 403 and no options are sent to agents. See Licence states.
  • The connection stays in Settings. Enable RustDesk integration, the server address and key, and the RustDesk passwords (default, length, rotation) are still under Settings → Agent → Remotes. A policy can't set them. See RustDesk Remote Access.
  • Not the WebRTC screen-share. Whether Athena's built-in screen-share asks first is set by Unattended Access. The agent Record policy is the screen-share recording. Neither one changes RustDesk.
Moved from Settings → Agent → Remotes

The RustDesk Security and General panels, the fleet-wide Ask the person at the computer first checkbox and the per-machine Ask before connecting selector are gone. Remotes now shows a RustDesk client options and consent box that links here. When you upgrade, Athena turns your old settings into a Default policy, so the machines keep the same options. The old consent REST call POST api/agents/{id}/rustdesk-consent has been removed. Use the approval-mode exception instead.

Where it appears#

PlaceAddressWhat it shows
Policies → RustDesk/policies/rustdeskThe Policies list (priority, assignments, key options, device counts) and the Assignments list in priority order. Part of the Policies group.
Policy editor/policies/rustdesk/new, /policies/rustdesk/editor/<id>New RustDesk policy / Edit RustDesk policy: every option, the Assigned to card and the What a device receives preview.
Policies landing card/policiesPolicies and Assignments counts, with the line "Each device gets the policy that wins on it, sent by Athena."
Agent details → RustDesk PolicyAgent details tabOne machine's effective policy, its approval mode and who asks for consent there, the last config sent, and its approval-mode exception. Updates live.
Settings → Agent → Remotes/settings/agent/remotesThe RustDesk connection and passwords. While RustDesk is enabled, a box links to Policies > RustDesk.

Permissions

PermissionKeyDefault rolesAllows
View RustDesk policiesrustdesk.policies.viewHelpdesk, Operator, AdminSee RustDesk policies, their assignments and an agent's effective policy (the page, the read-only editor and the agent tab).
Manage RustDesk policiesrustdesk.policies.manageOperator, AdminCreate, edit and delete policies and assignments, including each policy's approval mode, and set or clear an agent's approval-mode exception.

With view only, the policy name opens the editor read-only ("Read-only: you can see this policy but not change it.") and the New policy, edit, delete and assignment controls are not shown. The connection and password settings still use the RustDesk permissions described in RustDesk Remote Access. See Permission Model.

The Default policy created on upgrade#

The first time the server starts with this module, it creates one policy from your old Settings → Agent → Remotes options:

Consent never gets weaker on upgrade. Before, two settings decided consent: Athena's "ask first" checkbox (with the per-machine override), and RustDesk's own approval mode. If either of them asked, the Default policy (or, for a machine whose old override differed, a per-agent exception) is set to Click to accept. If neither asked, the old approval mode is kept. When this changes anything, the Policies page shows a one-time line: "Created on upgrade. Consent never weakens: N device(s) Athena asked consent for will also be asked by RustDesk itself, and N device(s) RustDesk asked for will also get Athena's prompt." The audit log records a rustdesk.legacy-seeded event with the same counts.

Quick start#

  1. Open Policies → RustDesk and click New policy.
  2. Enter a Name (up to 100 characters) and, if you want, a Description (up to 500). Set Approval mode and any other options, then click Save. A new policy starts with every option at its default. After the first save the editor reopens on the saved policy.
  3. In the Assigned to card, choose a Type (All agents, Agent, Collection or Tag). Then pick the collection or tag, or type the agent's Hostname, and click Add assignment. Start with a small test collection.
  4. Open a test machine's RustDesk Policy tab. Check the Effective policy, check Consent on this device, and wait until Last config sent shows Applied.

A policy reaches no machine until it is assigned. The editor then says "Not assigned: this policy reaches no device yet."

Approval mode, in the editor's Consent section, is the only consent setting for RustDesk sessions. There are three choices. Click to accept asks in a different way depending on the machine's OS:

Choice (value)Agent OSWho asksThe device is sent
Click to accept (ask the person)
click
WindowsAthena asks the signed-in user before every session it starts, and records the answer. RustDesk does not ask a second time.password-click
Linux, macOSRustDesk's own Accept dialog asks. Athena does not ask first and does not record the answer.click
Password or click (unattended)
password-click
AnyNobody. Sessions start with nobody asked.password-click
Password only (unattended)
password
AnyNobody.password

The default for a new policy is Password or click (unattended). When a policy is unattended, the editor shows "Unattended: sessions start with nobody asked, on every device this policy covers." When it is Click to accept and some of its machines run Linux or macOS, the editor tells you how many.

Athena's prompt covers the sessions Athena starts. On a Windows machine set to Click to accept, the RustDesk client itself holds password-click. A standalone RustDesk client that has that machine's RustDesk password, and connects through your Athena RustDesk server with its key, is therefore not asked. Control who can see RustDesk passwords (see Connection passwords).

The policy options#

A policy always holds every option. There is no "not configured", because RustDesk can't undo an option. When a different policy wins on a machine, all of its values replace the old ones. The editor uses checkboxes and lists. The RustDesk option name is what the REST API and PowerShell use.

SectionOption (label)RustDesk nameDefaultValues / notes
ConsentApproval modeapprove-modepassword-clickpassword, click, password-click (see above)
AccessAccess modeaccess-modecustomCustom, Full access (full), View only (view)
Verification methodverification-methoduse-both-passwordsTemporary password, Permanent password, Both passwords
Temporary password lengthtemporary-password-length66, 8 or 10
PermissionsKeyboard and mouseenable-keyboardon
Clipboardenable-clipboardon
File transferenable-file-transferon
Audioenable-audioon
TCP tunnelenable-tunnelon
Remote restartenable-remote-restarton
Block user inputenable-block-inputon
Allow remote config changesallow-remote-config-modificationoffWhen on, the editor warns: "A technician can then change these options from the RustDesk window. Athena does not undo it."
NetworkLAN discoveryenable-lan-discoveryon
Direct IP accessdirect-serveroff
Direct access portdirect-access-port211181–65535. Shown when Direct IP access is on.
Only while the connection window is openallow-only-conn-window-openoff
Use IP whitelisting(Athena only, never sent)offUnticked: any address may connect. The list is kept for later, and the device is sent an empty whitelist.
IP whitelistwhitelistemptyComma-separated addresses or ranges, up to 4,000 characters. Ticked with an empty list is refused: "Add at least one address, or untick Use IP whitelisting."
SessionDisconnect idle sessionsallow-auto-disconnectoff
Idle timeout (minutes)auto-disconnect-timeout101–120. Editable when Disconnect idle sessions is on.
RecordingAllow technician to recordenable-record-sessiononThe technician can start a recording during a session.
Record every session automaticallyallow-auto-record-incomingoffEvery incoming session on these devices is recorded.
Save folder on Windowsvideo-save-directoryemptyUp to 1,024 characters. Editable only while Record every session automatically is on.
Save folder on macOS and Linux(sent as video-save-directory to Linux and macOS agents)emptyEmpty uses RustDesk's own folder for each user. Same rule as the Windows folder.
Auto-record outgoing sessionsallow-auto-record-outgoingoffUnder Advanced. Sessions started from these devices to other computers.
Client windowThemethemesystemFollow system, Dark, Light
LanguagelangdefaultDefault, English, Hebrew, German, French, Spanish, Chinese (Simplified), Japanese, Russian
Hardware codecenable-hwcodecon
Adaptive bitrateenable-abron
Hide wallpaper during sessionsallow-remove-wallpaperoff
Open new connections in tabsenable-open-new-connections-in-tabson
Confirm before closing tabsenable-confirm-closing-tabson

Test a whitelist on one machine first. A wrong address refuses every connection to these devices, including Athena's own sessions.

RustDesk's own recordings are written on the machine by the RustDesk client. They are separate from Athena's screen-share recordings. The agent tab reminds you: "The Record policy in this agent's Info section is Athena's screen-share recording. RustDesk's own recording is set in the RustDesk policy."

What a device receives

The editor's What a device receives card lists the exact options a machine will get for the form as it stands. "All 31 options are always sent. The server address and key come from Settings > Remotes, not from this policy." Empty values are sent too, so clearing a whitelist or a folder reaches every machine. For Click to accept, the card shows two approve-mode lines: one for Windows (password-click, "Windows - Athena asks") and one for Linux and macOS (click).

Assignments and which policy wins#

In the Policies list, the Devices column shows how many machines each policy wins ("N device(s)"), plus "N use a policy above" for machines it matches but loses. In the editor, a warning line names the policy that wins those machines and its priority. The Key options column shows each policy's approve-mode, access-mode and whitelist.

When agents get the change#

The agent RustDesk Policy tab#

FieldWhat it tells you
Effective policyThe winning policy, or None (unmanaged). Below it: the assignment that matched ("Priority N: Tag finance") and "Also matches, loses here: …".
Approval modeThe effective choice and where it comes from: From this device's exception, From its policy, No policy matches this device, From the values seeded from Settings (RustDesk policies are not licensed) or Frozen at the last values (the licence lapsed).
Consent on this device"Athena asks the signed-in user before every session and records the answer", "RustDesk's own Accept dialog asks (Athena does not record the answer)" or "Unattended: nobody is asked". Then "The device holds approve-mode = …" once applied, or "The device is sent approve-mode = … (not applied yet)."
Last config sentThe result of the last send, with "Sent …, answered …" times and any error. Shows Not sent since policies took over until the first send.
ResultMeaning
Sent, waiting for the agentSent, not yet answered.
AppliedThe agent applied the settings.
FailedThe agent reported an error (shown below the result).
RustDesk is not installedInstall the client first (see Installing RustDesk on an agent).
Refused: another Athena server manages this RustDeskThe machine's RustDesk client belongs to a different Athena server, which refused the change.

Approval-mode exception for one machine#

An exception changes only one machine's Approval mode. Everything else still comes from its policy. Use it for a single unattended server inside a "click" collection, without giving it a whole policy of its own. In the tab's Approval-mode exception section, pick an Approval mode, enter a Reason (up to 500 characters) and click Save. You'll see "Approval-mode exception saved and sent to the device." To remove it, click the delete button: "Exception cleared: the device follows its policy again."

The exception wins over the policy, both for the consent check and for what the device is sent. The section shows who set it and when. Setting or clearing an exception needs rustdesk.policies.manage. It is always audited as a Warning, because it changes whether a person is asked.

Licence states#

StatePagesMachinesConsent check
LicensedFull useEach gets its own policyFrom the policy or exception
LapsedShown read-only with "The licence for RustDesk policies has lapsed. Everything is shown read-only: devices keep the options they were last sent, and consent keeps following these values. Nothing is changed or sent until the licence is renewed." Exceptions can't be set.Keep the options they were last sent; nothing new is sentKeeps following the stored values (Frozen)
Not in the licenceHidden; REST returns 403Keep whatever RustDesk options they have; new installs get the connection and password onlyUses the values seeded from your old settings (Legacy)

In every state the consent check still runs at each session start. Your policies are kept, so a renewed licence carries on where it stopped. See Separately licensed modules.

Audit events#

Event typeShown asWhenSeverity
rustdesk.policy-changedRustDesk policy changedA policy is created, updated or deleted. An update lists each changed option before and after. If approve-mode changed, the description adds "Consent change: approval mode … -> …".Information; Warning for a delete or a consent change
rustdesk.assignment-changedRustDesk policy assignment changedAn assignment is added, removed or reorderedInformation
rustdesk.exception-changedRustDesk approval-mode exception changedAn agent's exception is set, changed or cleared (with hostname and reason)Warning
rustdesk.legacy-seededRustDesk Default policy created from SettingsThe Default policy is created on upgradeInformation; Warning if any machine's RustDesk prompt was added

The RustDesk session events (started, denied) also record where the consent decision came from (consentSource: Exception, Policy, Unmanaged, Legacy or Frozen). See Audit Event Types Reference.

REST API#

Every response uses the standard { success, data, message } envelope (see API Reference). Out-of-range values are a 400, never clamped. A write on a server whose licence lacks or lost the module is a 403.

Method & routePermissionNotes
GET api/rustdesk/policiesviewEvery policy with its values
GET api/rustdesk/policies/{id}view404 if unknown
POST api/rustdesk/policiesmanage{ name, description, enabled, values }. Without values, every option is at its default. 409 for a duplicate name.
PUT api/rustdesk/policies/{id}managevalues, when given, must hold every option; leave it out to keep them
DELETE api/rustdesk/policies/{id}manageDeletes its assignments too
GET api/rustdesk/assignmentsviewIn priority order
POST api/rustdesk/assignmentsmanage{ policyId, targetKind, targetKey }. targetKind is All (no key), Agent (the agent id), Collection (its id) or Tag. Added last.
DELETE api/rustdesk/assignments/{id}manage
POST api/rustdesk/assignments/reordermanage{ assignmentIds: [...] }: every assignment id exactly once, highest precedence first
GET api/rustdesk/agents/{id}/effectiveviewEffective policy, matching assignment, superseded policies, exception, approveMode, consentSource, athenaAsks, rustDeskAsks, endpointApproveMode and the last send state
PUT api/rustdesk/agents/{id}/exceptionmanage{ "approveMode": "password|click|password-click", "reason": "..." }
DELETE api/rustdesk/agents/{id}/exceptionmanage404 "This agent has no RustDesk exception."

Option values use RustDesk's names. On/off options are True / False. The connection and password names (server-url, server-key, password and so on) are refused: "'server-url' is set in Settings > Agent > Remotes, never in a policy."

PowerShell#

The Athena PowerShell module 2.18.0 and later includes:

CmdletWhat it does
Get-AthenaRustDeskPolicyAll policies, one by -Id, or filtered by -Name (wildcards)
New-AthenaRustDeskPolicy-Name, -Description, -Disabled, -Option @{ ... } (only the options you name change from the defaults)
Set-AthenaRustDeskPolicy-Id, -Name, -Description, -Enabled, -Option (changes only the options named)
Remove-AthenaRustDeskPolicyDeletes a policy and its assignments (High impact, asks to confirm)
Add-AthenaRustDeskAssignment-PolicyId, -TargetKind All|Agent|Collection|Tag, -TargetKey (omit for All). Added last.
Get-AthenaRustDeskPolicyState-AgentId: effective policy, approval mode and its source, who asks, last send
Set-AthenaRustDeskAgentException-AgentId, -ApproveMode password|click|password-click, -Reason (High impact)
Remove-AthenaRustDeskAgentException-AgentId (High impact)
# A policy that asks the person first, assigned to the "finance" tag
$p = New-AthenaRustDeskPolicy -Name 'Finance - ask first' -Option @{ 'approve-mode' = 'click' }
Add-AthenaRustDeskAssignment -PolicyId $p.Id -TargetKind Tag -TargetKey finance

# Turn off file transfer in an existing policy
Set-AthenaRustDeskPolicy -Id $p.Id -Option @{ 'enable-file-transfer' = $false }

# Who is asked on one machine?
Get-AthenaRustDeskPolicyState -AgentId $agentId

Troubleshooting#

SymptomCause and fix
Every session to a Linux or macOS machine is refusedNo policy matches it, so Athena wants to ask but has no prompt there. Assign a policy (for example, keep the Default on All agents).
The tab stays on Sent, waiting for the agentThe agent hasn't answered yet, or the server restarted after sending. The next send or connect updates it.
RustDesk is not installedInstall RustDesk on the machine, then save or re-send.
Refused: another Athena server manages this RustDeskThe machine's RustDesk client is owned by a different Athena server. Manage it from that server.
A machine got a different policy than expectedOpen its tab: Effective policy names the matching assignment and the policies it beat. Move the wanted assignment higher. More specific targets don't win on their own.
A dynamic collection's new members didn't get the policyMembership changes don't trigger a send. Schedule RustDesk policies: re-send changed configs, or wait for the agent's next connect.
Save fails with "Add at least one address to the IP whitelist, or turn IP whitelisting off."Use IP whitelisting is ticked with an empty list.
A RustDesk user changed an option on the machineAllow remote config changes is on in its policy. Athena doesn't undo local changes. Turn it off.