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
+15 -2
View File
@@ -1,11 +1,24 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// darwin: not implemented
// andoird: not implemented
// js: not implemented
// plan9: not implemented
// solaris: currently unsupported by go-smbios:
// https://github.com/digitalocean/go-smbios/pull/21
//go:build darwin || android || js || plan9 || solaris
package posture
import "errors"
import (
"errors"
"tailscale.com/types/logger"
)
// GetSerialNumber returns client machine serial number(s).
func GetSerialNumbers() ([]string, error) {
func GetSerialNumbers(_ logger.Logf) ([]string, error) {
return nil, errors.New("not implemented")
}