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.
- 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 return403and 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.
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#
| Place | Address | What it shows |
|---|---|---|
| Policies → RustDesk | /policies/rustdesk | The 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 | /policies | Policies and Assignments counts, with the line "Each device gets the policy that wins on it, sent by Athena." |
| Agent details → RustDesk Policy | Agent details tab | One 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/remotes | The RustDesk connection and passwords. While RustDesk is enabled, a box links to Policies > RustDesk. |
Permissions
| Permission | Key | Default roles | Allows |
|---|---|---|---|
| View RustDesk policies | rustdesk.policies.view | Helpdesk, Operator, Admin | See RustDesk policies, their assignments and an agent's effective policy (the page, the read-only editor and the agent tab). |
| Manage RustDesk policies | rustdesk.policies.manage | Operator, Admin | Create, 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:
- It is named Default, or Default (from Remotes) if a policy called Default already exists. Its description reads "Created on upgrade from the old Remotes settings", followed by the date.
- It is assigned to All agents at the last priority, so any policy you add later wins over it.
- Every option keeps the value the server used before. A value no policy accepts falls back to the default, and the server log names the setting. If the old IP whitelist had addresses, Use IP whitelisting is ticked.
- This runs once, and it runs even on a server whose licence doesn't include the module.
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#
- Open Policies → RustDesk and click New policy.
- 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.
- 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.
- 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 (consent)#
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 OS | Who asks | The device is sent |
|---|---|---|---|
Click to accept (ask the person)click | Windows | Athena asks the signed-in user before every session it starts, and records the answer. RustDesk does not ask a second time. | password-click |
| Linux, macOS | RustDesk's own Accept dialog asks. Athena does not ask first and does not record the answer. | click | |
Password or click (unattended)password-click | Any | Nobody. Sessions start with nobody asked. | password-click |
Password only (unattended)password | Any | Nobody. | 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.
- The server checks consent each time a session starts. It uses the policy (or exception) stored on the server, not what the agent last confirmed, so a send that failed or is still waiting never weakens consent.
- A machine that no policy matches keeps its current RustDesk options, and Athena still asks for consent before every session to it. Linux and macOS machines have no Athena prompt, so every Athena session to an unmatched Linux or macOS machine is refused. Its tab says so: "Assign a policy."
- The prompt itself, its outcomes and the messages the technician sees are described in RustDesk Session Consent.
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.
| Section | Option (label) | RustDesk name | Default | Values / notes |
|---|---|---|---|---|
| Consent | Approval mode | approve-mode | password-click | password, click, password-click (see above) |
| Access | Access mode | access-mode | custom | Custom, Full access (full), View only (view) |
| Verification method | verification-method | use-both-passwords | Temporary password, Permanent password, Both passwords | |
| Temporary password length | temporary-password-length | 6 | 6, 8 or 10 | |
| Permissions | Keyboard and mouse | enable-keyboard | on | |
| Clipboard | enable-clipboard | on | ||
| File transfer | enable-file-transfer | on | ||
| Audio | enable-audio | on | ||
| TCP tunnel | enable-tunnel | on | ||
| Remote restart | enable-remote-restart | on | ||
| Block user input | enable-block-input | on | ||
| Allow remote config changes | allow-remote-config-modification | off | When on, the editor warns: "A technician can then change these options from the RustDesk window. Athena does not undo it." | |
| Network | LAN discovery | enable-lan-discovery | on | |
| Direct IP access | direct-server | off | ||
| Direct access port | direct-access-port | 21118 | 1–65535. Shown when Direct IP access is on. | |
| Only while the connection window is open | allow-only-conn-window-open | off | ||
| Use IP whitelisting | (Athena only, never sent) | off | Unticked: any address may connect. The list is kept for later, and the device is sent an empty whitelist. | |
| IP whitelist | whitelist | empty | Comma-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." | |
| Session | Disconnect idle sessions | allow-auto-disconnect | off | |
| Idle timeout (minutes) | auto-disconnect-timeout | 10 | 1–120. Editable when Disconnect idle sessions is on. | |
| Recording | Allow technician to record | enable-record-session | on | The technician can start a recording during a session. |
| Record every session automatically | allow-auto-record-incoming | off | Every incoming session on these devices is recorded. | |
| Save folder on Windows | video-save-directory | empty | Up 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) | empty | Empty uses RustDesk's own folder for each user. Same rule as the Windows folder. | |
| Auto-record outgoing sessions | allow-auto-record-outgoing | off | Under Advanced. Sessions started from these devices to other computers. | |
| Client window | Theme | theme | system | Follow system, Dark, Light |
| Language | lang | default | Default, English, Hebrew, German, French, Spanish, Chinese (Simplified), Japanese, Russian | |
| Hardware codec | enable-hwcodec | on | ||
| Adaptive bitrate | enable-abr | on | ||
| Hide wallpaper during sessions | allow-remove-wallpaper | off | ||
| Open new connections in tabs | enable-open-new-connections-in-tabs | on | ||
| Confirm before closing tabs | enable-confirm-closing-tabs | on |
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#
- Lowest number wins. Athena checks the assignments in priority order. The first one that matches a machine decides its whole policy. Values are never merged.
- Being more specific doesn't win. "An Agent assignment does not beat a Tag above it." To make one machine different, move its assignment above the others, or use an approval-mode exception if only consent should differ.
- Targets: All agents, a Collection, a Tag or one Agent. On the Policies page, Add assignment offers All agents, collections and tags. The editor's Assigned to card also takes an agent by hostname. A deleted collection matches nothing.
- New assignments go to the bottom (lowest precedence). Use Move up / Move down in the Assignments list to reorder.
- A disabled policy is skipped. Its machines fall through to the next matching policy. Untick Policy enabled in the editor to disable one.
- Deleting a policy also deletes its assignments. Its machines fall through to the next match. A machine with no match keeps its current RustDesk options, and Athena asks for consent before every session to it. Deleting the Default policy does this to every machine it covered.
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#
- After every save. Saving a policy, an assignment, a reorder or an exception re-sends the settings to the affected connected agents. Each agent gets its own policy. An agent whose settings didn't change is skipped.
- When an agent connects. An agent that was offline gets its own settings the next time it connects.
- Dynamic collections. When a dynamic collection gains or loses members, nothing is sent
on its own. Schedule the task RustDesk policies: re-send changed configs in the
Scheduler. It re-checks every agent and re-sends only to those whose
settings changed since they last applied them. Scheduling it needs
rustdesk.policies.manage. - If sending fails, the save still stands. The policy is stored and audited, and it is delivered on the next connect or the next re-send.
The agent RustDesk Policy tab#
| Field | What it tells you |
|---|---|
| Effective policy | The winning policy, or None (unmanaged). Below it: the assignment that matched ("Priority N: Tag finance") and "Also matches, loses here: …". |
| Approval mode | The 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 sent | The result of the last send, with "Sent …, answered …" times and any error. Shows Not sent since policies took over until the first send. |
| Result | Meaning |
|---|---|
| Sent, waiting for the agent | Sent, not yet answered. |
| Applied | The agent applied the settings. |
| Failed | The agent reported an error (shown below the result). |
| RustDesk is not installed | Install the client first (see Installing RustDesk on an agent). |
| Refused: another Athena server manages this RustDesk | The 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#
| State | Pages | Machines | Consent check |
|---|---|---|---|
| Licensed | Full use | Each gets its own policy | From the policy or exception |
| Lapsed | Shown 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 sent | Keeps following the stored values (Frozen) |
| Not in the licence | Hidden; REST returns 403 | Keep whatever RustDesk options they have; new installs get the connection and password only | Uses 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 type | Shown as | When | Severity |
|---|---|---|---|
rustdesk.policy-changed | RustDesk policy changed | A 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-changed | RustDesk policy assignment changed | An assignment is added, removed or reordered | Information |
rustdesk.exception-changed | RustDesk approval-mode exception changed | An agent's exception is set, changed or cleared (with hostname and reason) | Warning |
rustdesk.legacy-seeded | RustDesk Default policy created from Settings | The Default policy is created on upgrade | Information; 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 & route | Permission | Notes |
|---|---|---|
GET api/rustdesk/policies | view | Every policy with its values |
GET api/rustdesk/policies/{id} | view | 404 if unknown |
POST api/rustdesk/policies | manage | { name, description, enabled, values }. Without values, every option is at its default. 409 for a duplicate name. |
PUT api/rustdesk/policies/{id} | manage | values, when given, must hold every option; leave it out to keep them |
DELETE api/rustdesk/policies/{id} | manage | Deletes its assignments too |
GET api/rustdesk/assignments | view | In priority order |
POST api/rustdesk/assignments | manage | { 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/reorder | manage | { assignmentIds: [...] }: every assignment id exactly once, highest precedence first |
GET api/rustdesk/agents/{id}/effective | view | Effective policy, matching assignment, superseded policies, exception, approveMode, consentSource, athenaAsks, rustDeskAsks, endpointApproveMode and the last send state |
PUT api/rustdesk/agents/{id}/exception | manage | { "approveMode": "password|click|password-click", "reason": "..." } |
DELETE api/rustdesk/agents/{id}/exception | manage | 404 "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:
| Cmdlet | What it does |
|---|---|
Get-AthenaRustDeskPolicy | All 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-AthenaRustDeskPolicy | Deletes 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#
| Symptom | Cause and fix |
|---|---|
| Every session to a Linux or macOS machine is refused | No 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 agent | The agent hasn't answered yet, or the server restarted after sending. The next send or connect updates it. |
| RustDesk is not installed | Install RustDesk on the machine, then save or re-send. |
| Refused: another Athena server manages this RustDesk | The machine's RustDesk client is owned by a different Athena server. Manage it from that server. |
| A machine got a different policy than expected | Open 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 policy | Membership 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 machine | Allow remote config changes is on in its policy. Athena doesn't undo local changes. Turn it off. |
Related#
- RustDesk Remote Access: enabling RustDesk, the server connection, installing and passwords.
- RustDesk Session Consent: Athena's prompt, its outcomes and reconnects.
- Policies: the Policies group and its other modules.
- Unattended Access: consent for the WebRTC screen-share.
- Collections and Agent Tags: the groups you assign policies to.