Documentation ¶
Index ¶
- Constants
- func GetClevisLuksListOutput() (string, error)
- func GetEncryptedDriveList(lsblkoutput string) []string
- func GetTPMLockoutCounter() (int64, error)
- func GetTPMMaxRetries() (int64, error)
- func IsDiskRoot(lsblkMounts string) bool
- func IsTTYConsole() (bool, error)
- func LuksListContainsPCR1And7(input string) (found bool)
- func LuksListContainsReservedSlot(input string) bool
- func SetTPMLockoutCounterZero() error
- func SetTPMMaxRetries(maxRetries int64) error
- func StringInSlice[T ~string](s []T, str T, contains bool) bool
- func SubSlice(s, sub []string) bool
- func SwapFirstAndSecondSliceItems(slice []string) ([]string, error)
Constants ¶
const ( // DiskPrefix linux disk device prefix. DiskPrefix = "/dev/" // TPM2ReservedSlot TPMv2 reserved slot. TPM2ReservedSlot = "31" // TPM2ReservedSlotContent TPMv2 reserved slot configuration (to disable PCR protection). TPM2ReservedSlotContent = `: tpm2 '{"hash":"sha256","key":"ecc"}'` )
Variables ¶
This section is empty.
Functions ¶
func GetClevisLuksListOutput ¶
GetClevisLuksListOutput Run the clevis luks list -d /dev/sdX command and returns the output.
func GetEncryptedDriveList ¶
GetEncryptedDriveList returns the list of encrypted drives present in the host.
func GetTPMLockoutCounter ¶
GetTPMLockoutCounter Gets TPM max failed retries as an int64 decimal number.
func GetTPMMaxRetries ¶
GetTPMMaxRetries Gets TPM max failed retries as an int64 decimal number.
func IsDiskRoot ¶
IsDiskRoot returs true if the "diskName" drive is the root drive (e.g. /). processes the output of the lsblk -o mountpoints -l /dev/sdaX command.
func IsTTYConsole ¶
IsTTYConsole is true if the TTY console is configure on the kernel command line, false otherwise.
func LuksListContainsPCR1And7 ¶
LuksListContainsPCR1And7 checks the output of sudo clevis luks list -d /dev/sdX for PCR 1 and 7 configuration.
func LuksListContainsReservedSlot ¶
LuksListContainsReservedSlot checks the output of sudo clevis luks list -d /dev/sdX for the reserved slot.
func SetTPMLockoutCounterZero ¶
func SetTPMLockoutCounterZero() error
SetTPMLockoutCounterZero sets the TPM lockout counter to zero.
func SetTPMMaxRetries ¶
SetTPMMaxRetries sets TPM max failed retries as an int64 decimal number. This function also resets the lockout counter to zero.
func StringInSlice ¶
StringInSlice checks a slice for a given string.
func SwapFirstAndSecondSliceItems ¶
SwapFirstAndSecondSliceItems swaps the first and second items in a string slice.
Types ¶
This section is empty.