Showing posts with label DCOM. Show all posts
Showing posts with label DCOM. Show all posts

Sunday, September 07, 2025

OPC Classic client least privilege configuration

 The OPC Classic server is running on a different machine and is running a specific account, say opcuser.  The OPC Classic client is running as another user, say u1. My goal is to configure my client machine as secure as possible using subscription/callback, thus say:


Do the following on the client machine

Step 1. Allow DCOM inbound in Windows Firewall. Run on elevated command prompt

netsh advfirewall firewall add rule name="RPC Endpoint Mapper" dir=in action=allow protocol=TCP localport=135


Step 2. Add opcuser to Distributed COM Users

net localgroup "Distributed COM Users" /add opcuser


Step 3. Run Component Services (dcomcnfg.exe) and Distributed COM Users to Default Access Permissions

  1. Navigate to console Root | Component Services | Computers | My Computer

  2. Bring "My Computer" Properties

  3. Navigate to COM Security tab

  4. Click on Access Permissions | Edit Default...

  5. In Access Permission, add Distributed COM Users and check allow for both Local Access and Remote Access


Step 4. Add Windows Firewall rule for the application. Below assumes the application is located in C:\opc directory. 

netsh advfirewall firewall add rule name="OPC Client Inbound" dir=in action=allow program="C:\opc\oclientnet.exe" enable=yes


REF: 20250907-least


Test Code

netsh advfirewall firewall add rule name = "RPC Endpoint Mapper" dir = in action = allow protocol = TCP localport = 135 ...