Join our Newsletter — 33% off our NHI Course
Home› Guides› Beckhoff TwinCAT Security Guide: Harden ADS, Routes and…
Guide OT & IoT Security

Beckhoff TwinCAT Security Guide: Harden ADS, Routes and Legacy Windows CE Controllers

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 20 November 2026 17 min read
On this page

TwinCAT controllers are only as safe as their ADS routes, so the core of hardening a Beckhoff system is deciding which machines may talk ADS to it, over which transport, and with which credentials. Beckhoff TwinCAT turns an industrial PC into a PLC, motion controller and HMI host, and its engineering and runtime traffic rides on the Automation Device Specification (ADS) protocol. That design is fast and convenient for engineers, but Beckhoff itself states that classic ADS was never designed as a security protocol. This guide walks through what the vendor documentation says about ADS exposure, Secure ADS, route trust, key material and older Windows CE based controllers, and turns it into a practical hardening and review routine for OT and security teams.

The guide is written for control engineers, OT security leads and the IT security staff who are increasingly asked to sign off on PC-based control systems. It assumes you already have an OT security programme and focuses on the TwinCAT-specific settings that programme needs to cover.

This is an independent guide from NHI Mgmt Group, based on Beckhoff's public documentation as of November 2026. It is not sponsored or reviewed by Beckhoff. Product features change, so confirm settings against Beckhoff's current documentation.

Key takeaways

  • Beckhoff security advisory 2017-001 states that ADS "has not been designed to achieve security purposes and therefore does not include any encryption algorithms", and recommends using it only in protected environments.
  • Unencrypted ADS listens on TCP 48898 and ADS discovery uses UDP 48899. Both can be blocked at the firewall and switched off in the registry on the target.
  • Secure ADS, available from TwinCAT 3.1 Build 4024.0, wraps ADS traffic between TwinCAT routers in TLS 1.2 on TCP 8016, with no change to existing applications.
  • Secure ADS offers three trust models: self-signed certificates checked by fingerprint, pre-shared keys, and certificates from your own certificate authority. Each has different lifecycle duties.
  • A Secure ADS connection still grants full access to the connected system, so unidirectional routes and tight route inventories matter as much as encryption.
  • Windows CE based controllers carry their own exposure (CERHOST, FTP, SMB, the web server and default share accounts) and need a separate hardening checklist.
  • Treat ADS routes, PSKs, device certificates and the administrator logins used to create routes as non-human identities with owners, inventories and rotation plans.

How TwinCAT and ADS fit together

TwinCAT runs on Beckhoff industrial PCs and embedded controllers alongside a Windows or other host operating system. Engineers use the TwinCAT XAE engineering environment to build and download projects, and the runtime (XAR) executes them in real time. Almost everything that crosses between those components, and between TwinCAT systems on different machines, goes through the TwinCAT router using ADS.

ADS works on the idea of routes. A route tells the local TwinCAT router how to reach a remote AMS Net ID, which address to use and which transport to choose. Beckhoff's Secure ADS documentation explains that applications identify their partners through ADS routes that are defined in the TwinCAT router and are independent of the transport channel. That is why route configuration is the natural control point: if a remote system has a route to your controller, it can talk ADS to it.

From a security point of view this means three questions decide most of the risk on a TwinCAT system:

  • Which network paths can reach the ADS ports at all?
  • Which routes exist, who created them, and are they bidirectional or unidirectional?
  • Is the traffic on those routes encrypted and authenticated with Secure ADS, or sent as classic ADS?

The rest of this guide takes each question in turn.

Why classic ADS needs a protected network

Beckhoff published advisory 2017-001, titled "ADS is only designed for use in protected environments", in March 2017 and last updated it in December 2019 (version 1.4). It covers both TwinCAT 2 and TwinCAT 3. The advisory explains that because ADS includes no encryption, an attacker who can observe legitimate ADS traffic can forge ADS packets, and anyone with ADS access can use various local services on the target.

The vendor's recommended mitigations, as listed in the advisory, are:

  • Use ADS only in protected environments where an attack is not possible.
  • Where all ADS applications run on the same system, block ADS at the firewall.
  • For distributed applications, use another protocol such as ADS over IPsec, ADS over MQTT or OPC UA, or use Secure ADS (available since TwinCAT 3.1 Build 4024.0).
  • Optionally disable non-encrypted ADS and configure unidirectional connections.

In practice, many plants still run classic ADS across flat cell networks, and engineering laptops often hold routes to dozens of controllers. The advisory is a clear basis for asking whether those paths are really "protected environments". If an engineering workstation that also browses the internet can reach TCP 48898 on a line controller, the answer is usually no.

Reducing ADS exposure on the target

Beckhoff's "Deactivating ADS" page documents the ports and switches that control ADS listening on a TwinCAT 3 target. Unencrypted ADS uses TCP 48898 (0xBF02) and discovery ("Broadcast Search") uses UDP 48899 (0xBF03). The page notes that both ports can be blocked in the firewall.

The same page lists three REG_DWORD values under HKEY_LOCAL_MACHINE\SOFTWARE\[WOW6432Node\]Beckhoff\TwinCAT3\System. Setting each to 1 has the following effect:

Registry valueEffect when set to 1
DisableAdsTcpListeningThe TwinCAT router does not open TCP 48898 for unencrypted ADS.
DisableAdsTlsListeningThe router does not open TCP 8016 for incoming Secure ADS.
DisableAdsDiscoveryThe router does not open UDP 48899 for ADS discovery.

There is also a configuration file option. In StaticRoutes.xml, the attribute SecureOnly="True" on the RemoteConnections element keeps port 0xBF02 open but stops any further unencrypted ADS communication through it. This is useful during a migration, where you want to keep the listener for compatibility but refuse plain ADS sessions.

A sensible order of work, as an NHI Mgmt Group recommendation rather than vendor guidance, is:

  1. Inventory which systems genuinely need inbound ADS from other hosts. Many standalone machines only need local ADS between the runtime and an HMI on the same PC.
  2. For local-only systems, block TCP 48898 and UDP 48899 in the host firewall and set the two matching registry values.
  3. For systems that do need remote ADS, move them to Secure ADS, then apply SecureOnly="True" once every partner has a Secure ADS route.
  4. Disable discovery everywhere except on systems actively being commissioned, and re-disable it afterwards.

Changes in StaticRoutes.xml take effect when the router initialises, for example on a RUN to CONFIG or CONFIG to CONFIG transition, according to the Secure ADS manual. Plan these changes into a maintenance window rather than applying them live.

Secure ADS: what it protects and what it does not

The Secure ADS documentation (TE1000, version 1.2) describes Secure ADS as an additional transport channel for the familiar ADS protocol. A TLS 1.2 connection is set up from one TwinCAT router to another, and existing ADS client and server applications use it without being recompiled once the route is parameterised accordingly. The manual notes that Secure ADS is part of TC1000 and carries no licence cost. Incoming Secure ADS uses TCP 8016, and TwinCAT shows a Secure ADS route with a lock icon in the route overview and in the XAE target selection dialog.

Two limits from the vendor documentation are easy to miss:

  • It is transport encryption, not end-to-end encryption. The encrypted channel runs between routers. All applications on the same device share it, so a compromised application on an engineering PC can still use that PC's Secure ADS routes.
  • It does not restrict what a connected peer may do. The manual states that Secure ADS connections grant full access to the connected system, and recommends limiting access with unidirectional routes.

So Secure ADS answers "can someone on the wire read or forge my traffic?" It does not answer "should this engineering workstation be able to change this controller at all?" That second question is about route governance, covered below.

Choosing a Secure ADS trust model

The Secure ADS manual describes three ways to establish trust between routers. Each one is effectively a different credential type for a machine-to-machine identity, so pick deliberately.

Self-signed certificates (SSC)

TwinCAT generates a self-signed certificate on first start, and the manual describes self-signed certificates as the standard from 4024.0. When you add a route, you enter and verify the peer's fingerprint, and the route is authorised with a valid administrator login on the target. The manual says those login details are transmitted encrypted. It also points out that the generated certificates are valid from 1 January 2000 to 1 January 2061, which it calls too long from a security standpoint.

Practical implications: fingerprint verification only helps if someone actually compares the fingerprint through a separate trusted channel, such as reading it on the target's console. Record the expected fingerprint for each controller in your asset inventory so that engineers can check it.

Pre-shared keys (PSK)

PSKs are stored on the TwinCAT system to authorise incoming routes. In StaticRoutes.xml they sit inside a Tls element with Psk, Identity and Pwd children. The manual warns that PSKs are "not protected against direct viewing" and have no validity period. That makes PSKs the trust model that most needs compensating controls: restrict who can read the configuration directory, give each pairing its own key rather than one plant-wide secret, and set your own rotation interval.

Certificates from your own certificate authority

Where devices trust a common certificate authority, they can communicate encrypted without further configuration, and a route can be created without additional input. In StaticRoutes.xml, the Ca, Cert, Key and optional KeyPwd elements point to the CA, device certificate and key files. Certificates are X.509, and the manual says .der and .pem formats are supported. The certificate's CommonName must match the connection name unless IgnoreCn="true" is set on the Tls element.

The manual's example uses a 3600-day CA certificate and 360-day device certificates and notes that these validity periods require organisational measures. In other words, a CA-based design shifts the work from manual fingerprint checks to certificate lifecycle management: issuance, renewal before expiry and revocation when a device is retired.

Trust modelWhat the manual says about lifecycleMain operational duty
Self-signed certificateGenerated on first start, validity to 2061Verify and record fingerprints; rebuild on compromise
Pre-shared keyNot protected against direct viewing; no validity periodProtect files, unique keys per pairing, own rotation schedule
Own CA certificatesCertificates have an expiry date that must be managedIssue, renew and revoke; keep CN aligned with addresses

Whatever model you choose, the manual's advice on compromise is direct: isolate devices so that secrets such as PSKs and certificates are not exposed, and if secrets are compromised, rebuild the system.

Governing ADS routes as machine identities

Every ADS route is a standing trust relationship between two machines. In identity terms, it behaves like a service account: it has no human in the loop at run time, it often outlives the project that created it, and it can grant broad control. Treating routes as non-human identities gives you a familiar set of controls.

Inventory

Routes live in StaticRoutes.xml (by default under C:\TwinCAT\3.x\Target\ according to the Secure ADS manual) and in the route overview in TwinCAT. Export the route list from every controller and engineering workstation into one register, with the route name, remote address, AMS Net ID, transport (classic or Secure ADS), trust model and direction.

Ownership and purpose

For each route, record why it exists and who owns it: the HMI on the line, the historian collector, a specific integrator's commissioning laptop. Routes without a clear owner are candidates for removal.

Direction

The manual describes unidirectional routes, enabled through a checkbox or the Unidirectional="true" attribute on the Route element. On such a route, the local system ignores ADS command requests from the peer but can still send its own requests and receive the responses. Use this where a controller only needs to push or pull data to a partner and should never accept commands from it.

Route creation credentials

Adding a Secure ADS route with self-signed certificates requires an administrator login on the target. That login is effectively the key that mints new trust relationships. Keep those accounts unique per device or per site, avoid sharing them with integrators by email, and change them after commissioning work by third parties.

Review cadence

As an NHI Mgmt Group recommendation, review the route register at least quarterly and after every project handover, comparing the live configuration against the approved list. A route that appears without a change ticket should be treated as a security event.

Hardening legacy Windows CE controllers

Many installed Beckhoff embedded PCs still run Windows CE images. Beckhoff publishes a separate IPC Security Guideline for Windows CE in its information system, and its older IPC Security document (version 2.0.3, December 2016) includes CE-specific sections. The points below come from that older document; check the current guideline for your image.

  • Device password. CE has one local system account used for logon. The document advises setting its password through Start, Control Panel, Password.
  • CERHOST remote maintenance (TCP 987). The document warns that you should set a password immediately "because otherwise remote users can access the device unauthenticated via Cerhost".
  • SMB and FTP accounts. The document says to change the default password for the guest and webguest user accounts as soon as possible, and to manage these accounts through the CX Configuration tool. FTP uses TCP 21, and SMB uses TCP/UDP 137 to 139 and TCP 445.
  • Web server and diagnostics. The document recommends deactivating the web server completely if its services are not used. It describes setting HKEY_LOCAL_MACHINE\Services\HTTPD\Flags to DWORD 4 to disable it, and notes that dependent services stop working.
  • RAS. The RAS server is deactivated by default. If you enable it, change its default passwords.
  • Firewall. The CE firewall can be configured through the Beckhoff CX Configuration tool, and the document's general guidance is to block all network ports except those needed in your environment.
  • Images and updates. The document states that Beckhoff periodically releases new CE images, and that you can identify the installed image version from a file named after it in the device's hard disk folder.

Windows CE controllers are also the hardest place to deploy modern controls. As an NHI Mgmt Group recommendation, treat them as a segment of their own: put them behind a conduit that only permits the specific flows they need, never expose CERHOST, FTP or SMB beyond the cell, and plan their replacement as part of your OT lifecycle roadmap rather than waiting for a failure.

Network design and remote access around TwinCAT

Vendor controls on the controller work best inside a segmented architecture. General OT guidance such as NIST SP 800-82 Rev. 3 and the IEC 62443 series recommends zones and conduits, and the same principles apply to TwinCAT cells. For TwinCAT specifically, NHI Mgmt Group suggests the following design points:

  • Keep ADS inside the cell. Classic ADS should not cross zone boundaries. If data must leave the cell, use a protocol designed for that purpose, such as Secure ADS between known routers, OPC UA with security enabled, or ADS over MQTT through a broker you control, all of which the vendor advisory lists as alternatives.
  • Control engineering workstations. The machines that hold routes to many controllers are high-value targets. Restrict their internet access, require multi-factor authentication for logon, and keep a separate route set per project rather than one laptop with routes to the whole plant.
  • Broker third-party access. Integrators and machine builders should reach TwinCAT systems through an approved remote access path with session recording and time limits, not through their own routes from an unmanaged laptop. See the OT Remote Access Guide for the wider pattern.
  • Watch the ports. Network monitoring that alerts on new sources talking to TCP 48898, TCP 8016 or UDP 48899 is a cheap way to spot unexpected route creation or discovery scans.

Monitoring, patching and advisories

Beckhoff publishes product security advisories on its download site, including advisory 2017-001 discussed above. Add that advisory feed to your ICS advisory triage process alongside government sources such as CISA ICS advisories, and map each advisory to the TwinCAT builds and IPC images in your inventory.

For day-to-day monitoring, focus on changes rather than signatures:

  • Changes to StaticRoutes.xml or the TwinCAT system registry key on controllers.
  • New routes appearing in the route overview, especially classic ADS routes on systems that should be Secure ADS only.
  • Changes to the three Disable* registry values, which could indicate someone reopening ADS listeners.
  • Logons with the administrator accounts used to authorise Secure ADS routes.
  • For CE devices, any CERHOST, FTP or SMB connection from outside the cell.

File integrity monitoring or configuration backup tools that diff these files and keys on a schedule are usually enough for a first iteration.

Common failure patterns

  • Plant-wide classic ADS. ADS is reachable across a flat network from office and engineering systems, contrary to the "protected environment" assumption in the vendor advisory.
  • Encryption without restriction. Secure ADS is enabled, but every route is bidirectional and engineering laptops keep full access to every controller indefinitely.
  • Unchecked fingerprints. Self-signed certificate routes are accepted without anyone comparing the fingerprint, which weakens the main protection that model offers.
  • One PSK everywhere. A single pre-shared key is reused across a site, stored in readable configuration files and never rotated.
  • Expired CA certificates. A CA-based rollout works on day one but stops production a year later because nobody owned renewal of 360-day device certificates.
  • Discovery left on. UDP 48899 discovery stays open after commissioning, making it easy to enumerate controllers.
  • Forgotten CE devices. Older CE controllers keep default guest and webguest passwords, an unprotected CERHOST service or an unused web server.
  • Integrator routes that never leave. Routes and administrator logins created during commissioning remain after handover.

Practitioner checklist

  • Export and register every ADS route on controllers and engineering workstations, with owner, purpose, transport, trust model and direction.
  • Block TCP 48898 and UDP 48899 on systems that only need local ADS, and set DisableAdsTcpListening and DisableAdsDiscovery to 1.
  • Move remote ADS partners to Secure ADS on TwinCAT 3.1 Build 4024.0 or later, then set SecureOnly="True" once migration is complete.
  • Choose one trust model per site, document its lifecycle duties, and record expected fingerprints or certificate expiry dates in the asset inventory.
  • Make routes unidirectional wherever a peer should not send commands.
  • Use unique administrator credentials for route creation and change them after third-party work.
  • Restrict read access to StaticRoutes.xml, PSKs, keys and certificate files, and rebuild any system whose secrets may have been exposed.
  • On Windows CE devices, set the device password, protect or disable CERHOST, change guest and webguest passwords, disable the unused web server and configure the firewall.
  • Alert on new sources reaching TCP 48898, TCP 8016 and UDP 48899, and on changes to route files and TwinCAT registry values.
  • Add Beckhoff product security advisories to your ICS advisory triage process.

Standards and references

Related NHI Mgmt Group resources: OT Security Guide · PLC Security Guide · OT Remote Access Guide · ICS Advisory Triage and OT Vulnerability Management Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.