SDE Devices: settings reference

By Paul Flanders · · Intermediate

This article provides a comprehensive reference for settings related to SDE Devices, including configurations for the sde-redirector unit, gateway settings, and admin page options. It is aimed at engineers involved in deploying and managing SDE systems.

Every setting for SDE Devices: the sde-redirector unit's environment, the gateway's settings, the admin page's devices, profiles and rules, the agent installers and the sde-devlink command.

Applies to: the sde-redirector unit and its admin page at /sde-redirector/, sde-devlink on desktops and Linux laptops · Audience: engineers deploying and running SDE · Time: reference

1. Unit environment

File: /var/glitch-units/sde-redirector/glitch/config/enviroment. After a change, recreate the unit: gl -d sde-redirector && gl -s sde-redirector. The admin page's Settings tab shows the values in use.

SettingWhat it doesDefaultNotes
SDE_REDIRECTOR_SHARED_SECRETSecret the gateway's broker presents on its /v1 calls, and scripts on the admin API (header X-SDE-Devices-Secret).None: the unit won't start without it16 characters or more. Same value as the gateway's SDE_DEVICES_SECRET. openssl rand -hex 32.
SDE_REDIRECTOR_AGENT_KEYKey every desktop agent presents.Not set: no agent can connect, so no device can be connected16 characters or more. The same value goes into each agent's installer.
SDE_REDIRECTOR_GUAC_URLGuacamole, for admin sign-in. Only Guacamole administrators may sign in.Not set: sign-in is off (the API still takes the shared secret)Same as the gateway's SDE_GUAC_URL.
SDE_REDIRECTOR_PUBLIC_URLThe redirector's public address, shown on the admin page and used in the agent install commands.From the requesthttps://<portal>/sde-redirector
SDE_REDIRECTOR_ADMIN_NETWORKSAddresses the admin page may be used from.Private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7)Comma-separated. Addresses in SDE_GUEST_NETWORKS are always refused.
SDE_REDIRECTOR_V1_NETWORKSAddresses that may call /v1 (the broker).Not set: any address with the shared secretFor example the gateway's docker network, 172.16.0.0/12. /v1 is never proxied by nginx.
SDE_REDIRECTOR_AGENT_NETWORKSAddresses desktop agents may connect from.Private ranges, as for admin networksWhere your session hosts live, for example 10.20.0.0/16. When set, SDE_GUEST_NETWORKS is added to it, so desktops on SDE Networks are still accepted.
SDE_REDIRECTOR_TRUSTED_PROXIESProxies whose X-Forwarded-For header is believed for an agent's address.127.0.0.1/32, ::1/128, 172.16.0.0/12nginx on the host or the docker bridge. Agents are known by their address, so don't widen this.
SDE_GUEST_NETWORKSSDE Network guests: never "internal" to the admin page or /v1.Not setThe SDE Network address block. sde-install sets it.
SDE_REDIRECTOR_LISTENAddress and port the unit listens on.:8098Set in the image.
SDE_REDIRECTOR_DATAData folder inside the container: catalogue, profiles, rules and history (state.json)./opt/sde-redirector/dataMapped to data/state, owned by uid 1001, mode 700.
SDE_REDIRECTOR_DISTFolder served at /sde-redirector/dist/: the agent installers and sde-devlink downloads./opt/sde-redirector/distSet in the image.

2. Gateway settings

In the sde-gateway unit's environment. Recreate the gateway after a change (gl -d sde-gateway && gl -s sde-gateway).

SettingWhat it doesDefaultNotes
SDE_DEVICES_URLWhere the broker calls the redirector.Not set: devices are offhttp://<gateway-host>:8098. Needs SDE_DEVICES_SECRET too.
SDE_DEVICES_SECRETSecret for those calls.Not set: devices are offSame as SDE_REDIRECTOR_SHARED_SECRET. sde-install check compares them.
SDE_DEVICES_PUBLIC_URLThe redirector's public address, given to laptops for the device link.Not sethttps://<portal>/sde-redirector

3. Devices

Devices → Add device, or the pencil icon. The catalogue of kinds of device, by USB vendor and product ID.

SettingWhat it doesDefaultNotes
NameAs admins and users see it.RequiredFor example Arduino Uno.
IDShort name used by profiles.Made from the nameLower-case letters, digits and dashes. Fixed once added.
Vendor IDUSB vendor ID.Required4 hex digits, for example 2341.
Product IDUSB product ID.*4 hex digits, or * for any of the vendor's products.
NotesFor admins.Empty

A device can't be deleted while a profile uses it. The catalogue starts with:

DeviceVendor:Product
Arduino (genuine boards)2341:*
Arduino (arduino.org boards)2a03:*
CH340 USB serial (Arduino clones, many 3D printers)1a86:7523
FTDI USB serial0403:6001
Silicon Labs CP210x USB serial (ESP32 boards, printers)10c4:ea60
Raspberry Pi Pico / RP2040 / RP23502e8a:*
BBC micro:bit0d28:0204
Espressif ESP32-S2/S3/C3 (native USB)303a:*
Prusa 3D printers2c99:*

4. Profiles

Profiles → Add profile. Groups of devices that rules allow together.

SettingWhat it doesDefaultNotes
NameAs shown in rules.RequiredFor example Microcontrollers.
IDShort name used by rules.Made from the nameLower-case letters, digits and dashes.
DevicesThe catalogue entries in the profile.None
Allow devices that include a storage driveLets a device with a mass-storage function through.OffNeeded to flash a Pico or micro:bit by copying a file. A drive is also the easiest way for files to leave a secure session.

Built-in profiles: Microcontrollers (Arduino, Arduino.org, CH340, FTDI, CP210x, Raspberry Pi Pico, micro:bit, Espressif) and 3D printers (Prusa, CH340, FTDI, CP210x). Neither allows drives. A profile can't be deleted while a rule uses it.

5. Rules

Rules → Add rule. Who may connect which profiles to which desktops. Nothing is allowed until a rule allows it. A device is allowed when any rule that's on matches the user, the desktop and the device.

SettingWhat it doesDefaultNotes
NameAs shown in the list and the test result.RequiredFor example Engineering students: microcontrollers.
IDShort name.Made from the nameLower-case letters, digits and dashes.
OnWhether the rule applies.OnA rule that's off shows Off in the list.
ProfilesDevices the rule allows.NoneAt least one.
GroupsGuacamole user groups (synced from AD), one per line.NoneAt least one group or user. Not case-sensitive.
UsersUsernames, one per line.NoneNot case-sensitive.
DesktopsDesktops the rule covers, one per line: host names, addresses, ranges (10.20.0.0/16) or patterns (vdi-*).Empty: any desktop with the agentA pattern matches the full name or the part before the first dot.

6. Rules test

Rules → Test… answers "would this be allowed?" without a device. It shows Allowed with the rule, or Refused with the reason, and warns if that desktop has no agent connected.

FieldEnter
UserA username, for example student1
Their groupsComma-separated groups
DesktopA host name or address
Device (vendor:product)For example 2341:0043

7. Never connected

These are refused whatever the rules say. The redirector checks the device it sees in the stream; a Linux desktop's agent also never switches on a keyboard, mouse or hub function.

USB classWhy
Keyboards, mice and other input devices (HID, class 03)A small board can pretend to be a keyboard and type commands.
USB hubs (class 09)Connect the device itself.
Wireless and Bluetooth adapters (class e0)
Storage (class 08)Only when the profile ticks Allow devices that include a storage drive.

8. Agent installers

Served by the redirector at https://<portal>/sde-redirector/dist/. The Agents tab shows the commands for your portal.

Linux: install-agent.sh

curl -fsSL https://<portal>/sde-redirector/dist/install-agent.sh | sudo SDE_DEVLINK_KEY=<agent key> sh
SettingWhat it doesDefaultNotes
SDE_DEVLINK_KEYThe agent key.RequiredSDE_REDIRECTOR_AGENT_KEY
SDE_DEVLINK_SERVERThe redirector's public address.Where the script was downloaded fromhttps://<portal>/sde-redirector
SDE_DEVLINK_INSECURE1 accepts a self-signed portal certificate.0Test sites only.

It loads vhci-hcd now and at boot, installs /usr/local/bin/sde-devlink, writes the three settings to /etc/sde/devlink.conf (root only) and runs the sde-devlink-agent service, which restarts after 5 seconds if it stops.

Windows: install-agent.ps1

curl.exe -fsSLo $env:TEMP\i.ps1 https://<portal>/sde-redirector/dist/install-agent.ps1; powershell -ExecutionPolicy Bypass -File $env:TEMP\i.ps1 -Server https://<portal>/sde-redirector -Key <agent key>
SettingWhat it doesDefaultNotes
-ServerThe redirector's public address.Required
-KeyThe agent key.RequiredSaved in C:\ProgramData\SDE\devlink.key, readable by Administrators and SYSTEM only.
-InsecureAccepts a self-signed portal certificate.OffTest sites only. Use curl.exe -k for the download too.

It needs usbip-win2 installed first, puts sde-devlink.exe in C:\Program Files\SDE, and creates the sde-devlink-agent service (SDE device agent, automatic, restarts on failure). The log is C:\ProgramData\SDE\devlink.log.

One program for both ends: the agent on desktops, and sharing a device from a Linux laptop. Downloads: sde-devlink-linux-amd64, sde-devlink-linux-arm64, sde-devlink-windows-amd64.exe.

CommandWhat it doesOptions
shareLaptop: signs in as you, lists your desktops and devices with the verdict for each, and connects one through the broker until Ctrl+C. Run with sudo.-portal URL (required, for example https://sde.example.ac.uk), -user U (default: your login name), -desktop NAME (the connection name or part of it), -busid B, -lease ID (pool desktops: the lease ID SDE Remote shows), -insecure
listLists the USB devices plugged in here, with bus IDs.-json
releaseLinux: gives back devices a crashed share left held. Also done automatically on the next run.
agentDesktop: the service that attaches devices the redirector sends. The installers set it up.-server URL (required), -key K or -keyfile F, -name N (default: the host name), -log F, -insecure
exportLaptop: shares one device with a ticket from the broker. Used by share.-server URL -ticket T -busid B, -insecure
connectTesting: asks the redirector directly, as the broker would, then shares. Needs the shared secret.-server URL -api URL -secret S -user U -host H -busid B, -groups G,G, -insecure
versionPrints the version.
SettingWhat it doesDefaultNotes
SDE_DEVLINK_KEYAgent key, instead of -key.Not set
SDE_PASSWORDPassword for share, instead of the prompt.Not set: share asksFor scripted tests.
SDE_DEVLINK_USERSPACE1: share from Linux through SDE's own USB/IP server (usbfs) instead of the kernel's usbip-host.Used automatically when usbip-host isn't available
SDE_DEVLINK_USBIPWindows agent: path to usbip.exe.C:\Program Files\USBip\usbip.exe, then C:\Program Files\usbip-win2\usbip.exe
SDE_REDIRECTOR_SHARED_SECRETSecret for connect, instead of -secret.Not setTesting only.
Windows laptopsThe Windows build also has list, export and share, through the UsbDk driver. This is being proven and isn't yet supported for users; the Devices panel in the SDE Remote app comes next.

10. Limits and fixed values

ItemValue
TicketsSingle-use; both sides must connect within 90 seconds
History kept2,000 connections (the page shows the latest 300; Export CSV for the rest)
Activity shownThe most recent 500 events (full log: docker logs sde-redirector)
Admin sign-in lasts8 hours
Agent reconnectsAfter 1 second, backing off to 30 seconds

11. Admin page tabs

TabWhat's there
OverviewConnected now (with Disconnect), desktops with the agent, connections and refusals in the last 24 hours, recent connections. Warns when there's no agent key, no rule or no agent.
DevicesThe catalogue.
ProfilesGroups of devices, and which rules use them.
RulesWho may connect what, where; Test….
HistoryEvery connection: user, device and serial number, desktop, state and reason, start, traffic. Filter, Export CSV.
AgentsDesktops with the agent connected (name, address, system, version, for how long) and the install commands.
ActivityEvents, with a filter.
SettingsThe values from the unit's environment (read-only).

person people found this useful.