Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host search improvement: Search hosts by username (system user) #3098

Open
Zaulao opened this issue Nov 23, 2021 · 6 comments
Open

Host search improvement: Search hosts by username (system user) #3098

Zaulao opened this issue Nov 23, 2021 · 6 comments

Comments

@Zaulao
Copy link

Zaulao commented Nov 23, 2021

Goal

This suggestion is intended to enable Fleet administrators, maintainers or observers to search for hosts through host usernames.

After fleet 4.5.0 updates, a list of system users is made available on the Host details page. It would be great to be able to enter a username in the search field and get the hosts on which that user is present in response.

How?

Step 1: Insert the username to search for

step1

Step 2: Wait for the hostname to show up

step2

In this example, the user mark.weiser is currently present (or logged in) on machine host-554234.

-[]

@Zaulao Zaulao added the idea label Nov 23, 2021
@mikermcneil mikermcneil changed the title Host search improvement: Search hosts by username Host search improvement: Search hosts by username (system user) Dec 3, 2021
@mikermcneil
Copy link
Member

@Zaulao I love this feature. Some thoughts:

  1. We need to take into consideration how the search will perform for deployments with large numbers of hosts (100k+), in terms of the MySQL database (I think this is "whose" kind of subquery)
  2. Which system user from the host details page (e.g. /hosts/4) would you ideally want to show up as a match when searching? (Thoughts on how to write an osquery query for that?)

@Zaulao
Copy link
Author

Zaulao commented Dec 10, 2021

Hello @mikermcneil

First, I agree with your concern about the performance of such feature in large deployments. The main objective of this feature, at least for me, is to be able to make the link between logged in users and machines. Therefore, the query I use to perform such link is as follows:

SELECT user FROM logged_in_users where user like '...'

I run this query on all machines with the hope that one of them, which is online at the time of execution of the query, presents the referred user.

@mikermcneil
Copy link
Member

Thanks for the info @Zaulao! Fleet is already storing system users as part of host vitals (i.e. what you see on the host details page), so, at a glance, this seems doable to me.

@noahtalerman Shall we look into this next week?

@mikermcneil
Copy link
Member

This search should probably be skipped right?

image

@Zaulao
Copy link
Author

Zaulao commented Dec 10, 2021

Yeah, I agree

@noahtalerman
Copy link
Member

Think about the UX for the one to one device to attribute mapping v. the filter use case when designing the changes to the Fleet UI to support this ability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants