posture: add get serial support for Windows/Linux

This commit adds support for getting serial numbers from SMBIOS
on Windows/Linux (and BSD) using go-smbios.

Updates #5902

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby
2023-10-05 13:38:20 +02:00
committed by Kristoffer Dalby
parent 249edaa349
commit 9eedf86563
8 changed files with 217 additions and 3 deletions

View File

@@ -232,7 +232,7 @@ func (b *LocalBackend) handleC2NPostureIdentityGet(w http.ResponseWriter, r *htt
// TODO(kradalby): Use syspolicy + envknob to allow Win registry,
// macOS defaults and env to override this setting.
if b.Prefs().PostureChecking() {
sns, err := posture.GetSerialNumbers()
sns, err := posture.GetSerialNumbers(b.logf)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return