Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

gudgl/use session id as agent name #2

Closed
wants to merge 7 commits into from

Conversation

gudgl
Copy link
Contributor

@gudgl gudgl commented Sep 29, 2021

Problem

Connected agents are registered with the local hostname on the meshcentral server. This can quickly lead to conflicts if sessions run concurrently. Also, we cannot identify which session on Plexus belongs to which host on Meshcentral.

Task

On the generated msh config, include the setting agentName and set it to the session id. This way, the session of plexus and the client name on Meshcentral always match.
https://github.com/Ylianst/MeshAgent#msh-format

Example of the AgentConfig including the agentName.
curl -ks "https://localhost:8080/config/helping-joe:PFoRPrf1l2MbTafIIgTY"

ServerID=CAC3E1AA1E3DE7D03691237B687C4B554365FD29640AE56E23A5000138DA73E8ED483EE40E1900C355AB51694D15C070
MeshName=plexus/helping-joe/tcG7C
MeshType=2
MeshID=0xA67B726149B1448386B8CD41A53A47EAF3E26A045CF8422C4236A98B5B4656DC1C6FEB773A7FBCDA46A2382CEEEC07F7
MeshServer=wss://localhost:8080/agent/helping-joe:PFoRPrf1l2MbTafIIgTY
agentName=helping-joe
  • Note that the key name must have the exact capitalization.
  • Blanks are not allowed inside the agent name. Replace by underscores.

@@ -1,6 +1,9 @@
package api
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connected agents are registered with the local hostname on the meshcentral server. This can quickly lead to conflicts if sessions run concurrently.

There should not be a limitation on MeshCentral that requires the agent names to be unique. You can f.ex. connect multiple times with the same machine and MeshCentral & plexus will still work fine:

image

Also, we cannot identify which session on Plexus belongs to which host on Meshcentral.

Plexus creates a mesh (or also called device group) for each session (internally in MeshCentral, each mesh has a different MeshID that will be included inside the meshagent.msh). When you open the share ui in Plexus, then plexus will find the connected client by the mesh. This way, the agent name can be anything.

See https://github.com/cloudradar-monitoring/plexus/blob/main/handler/create.go#L57 & https://github.com/cloudradar-monitoring/plexus/blob/main/handler/share.go#L85

I'll talk with Thorsten because he created the ticket.

@jmattheis
Copy link
Contributor

@jmattheis jmattheis closed this Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants