Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Overview

Security Monitor (Reference) displays real-time client connections and user sessions during runtime, providing visibility into system access and usage. 

The Security Monitor

page, when the solution is running, showcases the list of processes and users connected with the server.

shows:

  • Active user sessions
  • Client connections
  • Process identification
  • Network addresses
  • Connection duration

Access via Security → Security Monitor when connected to runtime.

In

On

this page:

Table of Contents
maxLevel

3

2
minLevel2
indent10px
excludeSteps
stylenone

Image Removed

Monitor Table Properties

The monitor displays results from @Server.GetAllConnections():

PropertyDescriptionExample
UserNameLogged-in user credentialsjohn.doe, Administrator
ConnectionTimeSession duration since login00:45:32
IPClient network address192.168.1.100
ModuleNameConnected process nameTDisplayClient.exe

Runtime Access

Programmatic Monitoring

csharp

// Get all active connections
DataTable connections = @Server.GetAllConnections();

// Process connection data
foreach(DataRow row in connections.Rows)
{
    string user = row["UserName"].ToString();
    string ip = row["IP"].ToString();
    TimeSpan duration = (TimeSpan)row["ConnectionTime"];
    string process = row["ModuleName"].ToString();
    
    @Info.Trace($"User: {user} from {ip} via {process}");
}

Display Integration

csharp

// Show connections in DataGrid
DataGrid1.DataSource = @Server.GetAllConnections();
DataGrid1.Refresh();

Connection Types

ModuleProcessDescription
TDisplayClientDisplay clientWPF display runtime
TWebClientWeb browserHTML5 client
TDataAccessExternal APIREST/OPC connections
TEngineeringDesignerEngineering connection

Monitoring Use Cases

Active User Count

csharp

int activeUsers = @Server.GetAllConnections().Rows.Count;
@Tag.ActiveUserCount = activeUsers;

Session Duration Check

csharp

var connections = @Server.GetAllConnections();
foreach(DataRow row in connections.Rows)
{
    TimeSpan duration = (TimeSpan)row["ConnectionTime"];
    if (duration.TotalHours > 8)
    {
        // Alert for extended session
        @Alarm.LongSession = true;
    }
}

Concurrent User Limit

csharp

public void CheckUserLimit()
{
    int maxUsers = 10;
    int current = @Server.GetAllConnections().Rows.Count;
    
    if (current >= maxUsers)
    {
        @Tag.MaxUsersReached = true;
        // Prevent new logins
    }
}

Security Auditing

Log Connections

csharp

public void LogConnections()
{
    var connections = @Server.GetAllConnections();
    
    foreach(DataRow row in connections.Rows)
    {
        @Dataset.Query.AuditLog.Insert(
            DateTime.Now,
            row["UserName"],
            row["IP"],
            row["ModuleName"],
            row["ConnectionTime"]
        );
    }
}

Detect Suspicious Activity

csharp

// Check for multiple IPs per user
var connections = @Server.GetAllConnections();
var userIPs = new Dictionary<string, List<string>>();

foreach(DataRow row in connections.Rows)
{
    string user = row["UserName"].ToString();
    string ip = row["IP"].ToString();
    
    if (!userIPs.ContainsKey(user))
        userIPs[user] = new List<string>();
    
    if (!userIPs[user].Contains(ip))
        userIPs[user].Add(ip);
}

// Alert if user from multiple locations
foreach(var kvp in userIPs)
{
    if (kvp.Value.Count > 1)
    {
        @Alarm.MultipleLocationLogin = true;
    }
}

Best Practices

  1. Regular monitoring - Check connections periodically
  2. Set user limits - Enforce concurrent user restrictions
  3. Log sessions - Maintain audit trail
  4. Monitor duration - Track extended sessions
  5. Check patterns - Identify unusual access
  6. Document processes - Know expected connections
  7. Alert on anomalies - Detect security issues

Troubleshooting

No connections shown:

  • Verify runtime is active
  • Check server connectivity
  • Confirm monitor permissions
  • Review server status

Unknown process:

  • Check third-party integrations
  • Review custom modules
  • Verify client types
  • Document all processes

Duplicate users:

  • Check AllowShareUser policy
  • Review session management
  • Verify logout procedures
  • Monitor IP addresses

In this section...

Page Tree
root@parent
spaces93DRAF

Monitoring  Client Connections

To access the Scripts Monitor in your solution, click on Security → Security Monitor.

The contents on that tables are the result from calling the method:

Code Block
@Server.GetAllConnections()

That method returns a DataTable with the following columns:

Security Monitor Table - GetAllConnections() method

Field

Description

UserName

Credentials used on the the connections

ConnectionTime

Session duration

IP

Connection Network address 

ModuleName

Process Name

In this section:

Page Tree
rootV10:@parent
spacesV10