Hi Nicolas,
thanks for your inputs. I will try to describe what’s existing already:
server/gateway POV: Being able to get records of the which user logged in (with at least timestamp, source IP):
When it comes to accessing a management connection, this is what is logged in Information level:
Request “2bab099f-a9a3-4a2a-b17b-ed9eefad1693”, Payload: RequestID: 2bab099f-a9a3-4a2a-b17b-ed9eefad1693 | ManagementModuleID: RoyalServer.ManagementEndpoint.Module.WindowsServices | RequestCommand: ListServices | RequestUsername: MSADMINDAD8\msadmin | ClientIP: 10.1.0.135 | DestinationHostnames: localhost | DestinationUsername: demoadmin | GatewayUsername: demoadmin | Arguments { WQLWhereClause: , CommandProvider: WMI }
So any given module/command you see for which user towards which IP it was executed.
server/gateway POV: Details of failed authentications attempts (known/unknown user, reason of failure like wrong password or MFA/timeout, …)
We log this as a Warning including what Windows is returning as error code, e.g. this is a log entry when you have configured a wrong password for a Royal Server user:
Failed to logon {“Domain”:“MSADMINDAD8”,“Username”:“demoadmin”,“LogonUserType”:“WindowsAccountName”,“OriginalUsername”:“demoadmin”,“NormalizedUsername”:“MSADMINDAD8\demoadmin”,“IsLocalUser”:true,“$type”:“LogonUser”} with error code 1326
server/gateway POV: Which document(s) has been opened by whom and which rights were applyed and when
This is what we log when someone opened a document via Royal TS:
Request “11cbfb57-b77a-4a97-a3ea-8e95ce6b77de”, Payload: RequestID: 11cbfb57-b77a-4a97-a3ea-8e95ce6b77de | ManagementModuleID: RoyalServer.ManagementEndpoint.Module.RoyalDocumentStore | RequestCommand: GetDocumentList | RequestUsername: [not provided] | ClientIP: 10.1.0.135 | DestinationHostnames: localhost | DestinationUsername: | GatewayUsername: MSADMINDAD8\demoadmin | Arguments { }****
for opening the document and
Request “ad966513-3984-4e9e-a360-3bf95c0fd675”, Payload: RequestID: ad966513-3984-4e9e-a360-3bf95c0fd675 | ManagementModuleID: RoyalServer.ManagementEndpoint.Module.RoyalDocumentStore | RequestCommand: LoadDocument | RequestUsername: MSADMINDAD8\msadmin | ClientIP: 10.1.0.135 | DestinationHostnames: | DestinationUsername: demoadmin1 | GatewayUsername: demoadmin1 | Arguments { DocumentId: 1304f687-054e-4a56-a9e0-18702e839003, DocumentName: doc1, RoyalServerId: 1f4563d5-3b95-4a19-843b-6b8451ad7f03, MfaCode: }
for actually opening a document. MfaCode would be filled out if a 2nd factor was requested (e.g. the TOTP value from the Authenticator App). In the case of a wrong MFA code, this is what is logged:
User demoadmin1 provided invalid MFA code
server/gateway POV: : Which tunnels were opened for an user and to which internal server, …
Technically, we can only log which user requested to which server on which port using which Royal Server username (not the one to the destination server) - Royal Server cannot inspect what’s happening inside the tunnel (e.g. which username is used for the destination server)
2023-09-05 12:57:30.399 [INF] [SECG] Local forwarding connection requested - Session: {“SessionId”:1,“SessionUsername”:“demoadmin”,“RemoteHostName”:“10.1.0.50”,“RemotePort”:22}
admin console POV: Users and groups modifications (added, deleted, modified, changed MFA on/off, …)
Windows Group Memberships are done by Windows and is entirely out of Royal Servers domain. So this is not easily logged by Royal Server.
MFA settings for the MFA feature itself are not logged at the moment directly but when Royal Server starts, it logs the complete configuration (if MFA configuration is on, if Reject Unknown Users is on and for each MFA Provider if its on). Any change of these settings requires a restart of Royal Server. So indirectly, you can see changes from start to start. Though I can see why its interesting to log these changes explicitly and will include this in one of the next versions.
Any configuration changes for a specific MFA user are logged like this:
Request “4ac5595c-d9d7-447d-9c4f-a5a453836c88”, Payload: RequestID: 4ac5595c-d9d7-447d-9c4f-a5a453836c88 | ManagementModuleID: RoyalServer.ManagementEndpoint.Module.RoyalServerManagement | RequestCommand: EditUserMfaConfig | RequestUsername: [not provided] | ClientIP: 10.1.0.135 | DestinationHostnames: localhost | DestinationUsername: | GatewayUsername: MSADMINDAD8\demoadmin | Arguments { MfaID: be2352b0-bc4e-485d-bee7-fc47300e3310, PrincipalSID: S-1-5-21-3408523168-2584769710-3117695478-3642, Username: MSADMINDAD8\demoadmin1, Comment: , CacheSuccessFor: 00:00:00, RequireDocStore: True, RequireSecureGateway: False, ModifiedBy: MSADMINDAD8\msadmin, Provider: Generic_TOTP, Issuer: Royal Server on MSADMINDAD8, Label: MSADMINDAD8\demoadmin1, SelfServiceAllowed: False, SelfServiceVerified: False }
admin console POV: Documents modifications (add/delete)
As with any modules, these operations are logged like this:
2023-09-05 14:51:39.993 [INF] [NORM] Request “87928739-8499-4656-9298-5063125986fe”, Payload: RequestID: 87928739-8499-4656-9298-5063125986fe | ManagementModuleID: RoyalServer.ManagementEndpoint.Module.RoyalDocumentStore | RequestCommand: CreateDocument | RequestUsername: [not provided] | ClientIP: 10.1.0.135 | DestinationHostnames: localhost | DestinationUsername: | GatewayUsername: MSADMINDAD8\demoadmin | Arguments { ServerDocumentName: hugo1, ServerDocumentComment: , AdditionalEncryption: false, ServerDocumentPassword: [hidden], ServerDocumentLockdownPassword: [hidden], UserName: MSADMINDAD8\msadmin }
for creation and for deletion:
2023-09-05 14:53:22.777 [INF] [NORM] Request “d6dfeeed-683e-4639-8619-8b052939b748”, Payload: RequestID: d6dfeeed-683e-4639-8619-8b052939b748 | ManagementModuleID: RoyalServer.ManagementEndpoint.Module.RoyalDocumentStore | RequestCommand: DeleteDocument | RequestUsername: [not provided] | ClientIP: 10.1.0.135 | DestinationHostnames: localhost | DestinationUsername: | GatewayUsername: MSADMINDAD8\demoadmin | Arguments { DocumentId: 8c881b87-e72f-4eaf-9bac-b3566cb30670 }
admin console POV: Documents access rules modifications
same as above:
2023-09-05 14:55:19.018 [INF] [NORM] Request “ae959e35-3b12-4d21-bd41-084214f3adfe”, Payload: RequestID: ae959e35-3b12-4d21-bd41-084214f3adfe | ManagementModuleID: RoyalServer.ManagementEndpoint.Module.RoyalServerManagement | RequestCommand: SetDocumentACL | RequestUsername: [not provided] | ClientIP: 10.1.0.135 | DestinationHostnames: localhost | DestinationUsername: | GatewayUsername: MSADMINDAD8\demoadmin | Arguments { Operation: read, Mode: add, Permission: grant, DocumentID: 1304f687-054e-4a56-a9e0-18702e839003, DocumentName: doc1, ModifiedBy: MSADMINDAD8\msadmin, PrincipalSid: S-1-5-21-3408523168-2584769710-3117695478-1001, PrincipalName: msadmindad8\demoadmin, PrincipalType: user, PrincipalPath: WinNT://WORKGROUP/MSADMINDAD8/demoadmin }
2023-09-05 14:55:19.083 [DBG] [DOCS] SetDocumentACL with mode add for document (uninitialized)_1304f687-054e-4a56-a9e0-18702e839003_read_S-1-5-21-3408523168-2584769710-3117695478-1001_user_grant_DocumentStore
2023-09-05 14:55:22.177 [INF] [NORM] Request “570c4637-23a3-4206-ba5f-988a81c1d562”, Payload: RequestID: 570c4637-23a3-4206-ba5f-988a81c1d562 | ManagementModuleID: RoyalServer.ManagementEndpoint.Module.RoyalServerManagement | RequestCommand: SetDocumentACL | RequestUsername: [not provided] | ClientIP: 10.1.0.135 | DestinationHostnames: localhost | DestinationUsername: | GatewayUsername: MSADMINDAD8\demoadmin | Arguments { Operation: read, Mode: remove, Permission: grant, DocumentID: 1304f687-054e-4a56-a9e0-18702e839003, DocumentName: doc1, PrincipalSid: S-1-5-21-3408523168-2584769710-3117695478-1001, PrincipalName: msadmindad8\demoadmin, PrincipalType: user }
RoyalTS/X clients POV: Is the document was unlocked for modification
True, Document lock or unlock operation are currently not logged in Royal TS/X.
RoyalTS/X clients POV: What have been modified or revealed, …
What do you mean by this? The Document Policies?
If those records can be sent back to the server for central logging it would be nice too!
Ha, for this (centralised logging for Royal TS/X clients via Royal Server) seems to be a good Feature Request . Would you mind creating one so others can discuss/vote for it too? https://www.royalapps.com/go/feature-request-server-main
One more thing: Royal Server also is using Serilog from Version 4 onwards though we do not ship other sinks than the File, the EventLog and the Syslog sinks with Royal Server. Would that be enough for your scenarios?
Let me know if this helps,
cheers,
Michael