Package dev.demeng.sentinel.client.util
Class MachineFingerprint
java.lang.Object
dev.demeng.sentinel.client.util.MachineFingerprint
Generates a stable, unique fingerprint for the current machine.
This is intended to be used as the server value in a ValidationRequest, allowing Sentinel to track
which machine instances are using a license.
The fingerprint is resolved using the following strategy, in order:
- Platform-specific identifier:
- Linux:
/etc/machine-id(persistent per OS installation) - macOS:
IOPlatformUUID(hardware UUID) - Windows:
MachineGuidfrom the registry (persistent per OS installation) - FreeBSD:
kern.hostuuidvia sysctl
- Linux:
- Fallback: zero-configuration signals that remain available to unprivileged processes, prioritizing host-visible hardware or virtualization identifiers, supplemented by OS properties, hostname, and stable MAC addresses. In containers, locally administered (randomly assigned) MAC addresses are excluded to avoid fingerprint churn across restarts.
The result is always a 32-character lowercase hex string (SHA-256 truncated to 128 bits).
Limitation: Cloned VMs may share the same fingerprint as the source machine until the
OS regenerates its platform identifier (e.g., /etc/machine-id on Linux). macOS and
Windows do not automatically regenerate their identifiers after cloning.
-
Method Summary
-
Method Details
-
generate
Generates a fingerprint for the current machine.- Returns:
- a 32-character lowercase hex string
-