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

Graceful handling of duplicate host enrollment #373

Closed
zwass opened this issue Mar 3, 2021 · 1 comment · Fixed by #417
Closed

Graceful handling of duplicate host enrollment #373

zwass opened this issue Mar 3, 2021 · 1 comment · Fixed by #417
Assignees
Labels
:troubleshooting We have responded and requested next steps/help
Milestone

Comments

@zwass
Copy link
Member

zwass commented Mar 3, 2021

Context

Osquery hosts provide a configurable identifier when enrolling to a TLS server. Common values for this are uuid (hardware UUID), hostname, and instance (a UUID generated and stored in the osquery database).

Fleet uses this identifier to determine whether the host in an enrollment request is the same as an existing host.

Problems occur when multiple hosts share the same identifier. This is a relatively common case when using hostname (due to clients with the same hostname) and uuid (due to cloned VMs with the same hardware UUID).

This is an issue that users run into as evidenced by #200 and various reports through Slack and other channels.

Because of this, we have added an enrollment cooldown period (#112) and changed the recommended deployment to use --host_identifier=instance. Using instance does prevent duplicates, but it means that Fleet cannot recognize when the same host re-enrolls after the osquery database being deleted or becoming corrupted.

Reports continue to surface that users are having problems with duplicate identifiers.

Proposal

Osquery provides the full contents of the osquery_info table in each enrollment request, which includes both the equivalent of the uuid and the instance identifiers.

We could choose to look only at the instance identifier for determining uniqueness when a host enrolls. This is likely to resolve duplicate issues without folks having to change the startup flags for osquery (often a difficult task).

On the downside, it is no longer possible to determine when the same host has re-enrolled with a fresh osquery database. This can be mitigated by letting the old host record "age out" and be cleaned up by the offline host cleanup feature.

@zwass zwass added the :troubleshooting We have responded and requested next steps/help label Mar 3, 2021
@noahtalerman noahtalerman added this to the 3.9.0 milestone Mar 3, 2021
@zwass zwass self-assigned this Mar 8, 2021
zwass added a commit to zwass/fleet that referenced this issue Mar 9, 2021
Osquery now exposes more information during host enrollment than Fleet
previously handled. We can use this to provide more options to users in
problematic enrollment scenarios.

Users can configure `--osquery_host_identifier` in Fleet to set which
identifier is used to determine uniqueness of hosts. The
default (`provided`) replicates existing behavior in Fleet. For many
users, setting this to `instance` will provide better enrollment
stability.

Closes fleetdm#373
@zwass
Copy link
Member Author

zwass commented Mar 9, 2021

I've gone ahead with not changing the default, but allowing instance to be configured as the host identifier to use in #417.

@zwass zwass closed this as completed in #417 Mar 9, 2021
zwass added a commit that referenced this issue Mar 9, 2021
Osquery now exposes more information during host enrollment than Fleet
previously handled. We can use this to provide more options to users in
problematic enrollment scenarios.

Users can configure --osquery_host_identifier in Fleet to set which
identifier is used to determine uniqueness of hosts. The
default (provided) replicates existing behavior in Fleet. For many
users, setting this to instance will provide better enrollment
stability.

Closes #373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:troubleshooting We have responded and requested next steps/help
Development

Successfully merging a pull request may close this issue.

2 participants