security

package
v0.0.0-...-f501c68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DMIDecodeBinary = "dmidecode"
)

Variables

This section is empty.

Functions

func GetKey

func GetKey(mac string) (string, error)

func GetMD5Hash

func GetMD5Hash(text string) string

func GetSha512

func GetSha512(text string) string

func ValidateSerial

func ValidateSerial(serialOk string) (bool, error)

Types

type DMI

type DMI struct {
	Data   map[string][]Record
	Binary string
}

func New

func New() *DMI

func (*DMI) ExecDmidecode

func (d *DMI) ExecDmidecode(binary string) (string, error)

ExecDmiDecode will attempt to execute a given binary, capture its output and return it (or an any errors it encounters)

func (*DMI) FindBin

func (d *DMI) FindBin(binary string) (string, error)

FindBin will attempt to find a given binary in common bin paths.

func (*DMI) GenericSearchBy

func (d *DMI) GenericSearchBy(param, value string) ([]Record, error)

GenericSearchBy will search for any param w/ value in the d.Data map.

func (*DMI) ParseDmidecode

func (d *DMI) ParseDmidecode(output string) error

ParseDmiDecode will attempt to parse dmidecode output and place all matching content in d.Data.

func (*DMI) Run

func (d *DMI) Run() error

Run will attempt to find a a valid `dmidecode` bin, attempt to execute it and parse whatever data it gets.

func (*DMI) SearchByName

func (d *DMI) SearchByName(name string) ([]Record, error)

SearchByName will search for a specific DMI record by name in d.Data

func (*DMI) SearchByType

func (d *DMI) SearchByType(id int) ([]Record, error)

SearchByType will search for a specific DMI record by its type in d.Data

type Record

type Record map[string]string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL