firmwarewand

package
v0.0.0-...-f44e450 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzeRequestBuilder

type AnalyzeRequestBuilder struct {
	// contains filtered or unexported fields
}

AnalyzeRequestBuilder is a helper function to create AnalyzeRequest

func NewAnalyzeRequestBuilder

func NewAnalyzeRequestBuilder() *AnalyzeRequestBuilder

NewAnalyzeRequestBuilder creates NewAnalyzeRequestBuilder object

func (*AnalyzeRequestBuilder) AddAPCBSecurityTokensInput

func (req *AnalyzeRequestBuilder) AddAPCBSecurityTokensInput(
	actualFirmwareImage *afas.FirmwareImage,
) error

AddAPCBSecurityTokensInput populates AnalyzeRequest with input for APCBSecurityTokens analyzer

func (*AnalyzeRequestBuilder) AddBIOSRTMVolumeInput

func (req *AnalyzeRequestBuilder) AddBIOSRTMVolumeInput(
	actualFirmwareImage *afas.FirmwareImage,
) error

AddBIOSRTMVolumeInput populates AnalyzeRequest with input for PSPSignature analyzer

func (*AnalyzeRequestBuilder) AddDiffMeasuredBootInput

func (req *AnalyzeRequestBuilder) AddDiffMeasuredBootInput(
	firmwareVersion string,
	originalFirmwareImage *afas.FirmwareImage,
	actualFirmwareImage afas.FirmwareImage,
	actualRegisters registers.Registers,
	tpmDevice tpmdetection.Type,
	eventLog *tpmeventlog.TPMEventLog,
	actualPCR0 []byte,
) error

AddDiffMeasuredBootInput populates AnalyzeRequest with input for DiffMeasuredBoot analyzer

func (*AnalyzeRequestBuilder) AddIntelACMInput

func (req *AnalyzeRequestBuilder) AddIntelACMInput(
	firmwareVersion string,
	originalFirmwareImage *afas.FirmwareImage,
	actualFirmwareImage afas.FirmwareImage,
) error

AddIntelACMInput populates AnalyzeRequest with input for IntelACM analyzer

func (*AnalyzeRequestBuilder) AddLocalHostInfo

func (req *AnalyzeRequestBuilder) AddLocalHostInfo() error

AddLocalHostInfo adds information about the local host

func (*AnalyzeRequestBuilder) AddPSPSignatureInput

func (req *AnalyzeRequestBuilder) AddPSPSignatureInput(
	actualFirmwareImage *afas.FirmwareImage,
) error

AddPSPSignatureInput populates AnalyzeRequest with input for PSPSignature analyzer

func (*AnalyzeRequestBuilder) AddReproducePCRInput

func (req *AnalyzeRequestBuilder) AddReproducePCRInput(
	firmwareVersion string,
	originalFirmwareImage *afas.FirmwareImage,
	actualFirmwareImage afas.FirmwareImage,
	actualRegisters registers.Registers,
	tpmDevice tpmdetection.Type,
	eventLog *tpmeventlog.TPMEventLog,
	flow pcr.Flow,
	expectedPCR0 []byte,
) error

AddReproducePCRInput populates AnalyzeRequest with input for ReproducePCR analyzer

func (*AnalyzeRequestBuilder) GetThrift

func (req *AnalyzeRequestBuilder) GetThrift() *afas.AnalyzeRequest

GetThrift returns AnalyzeRequest used for communication with AFAS over thrift

type ErrBIOSInfo

type ErrBIOSInfo struct {
	Err error
}

func (ErrBIOSInfo) Error

func (err ErrBIOSInfo) Error() string

func (ErrBIOSInfo) ExitCode

func (err ErrBIOSInfo) ExitCode() int

func (ErrBIOSInfo) Unwrap

func (err ErrBIOSInfo) Unwrap() error

type ErrCheckFirmware

type ErrCheckFirmware struct {
	Err error
}

func (ErrCheckFirmware) Error

func (err ErrCheckFirmware) Error() string

func (ErrCheckFirmware) ExitCode

func (err ErrCheckFirmware) ExitCode() int

func (ErrCheckFirmware) Unwrap

func (err ErrCheckFirmware) Unwrap() error

type ErrCompress

type ErrCompress struct {
	Err error
}

ErrCompress means a problem while compressing a firmware image.

func (ErrCompress) Error

func (err ErrCompress) Error() string

func (ErrCompress) Unwrap

func (err ErrCompress) Unwrap() error

type ErrDetectHostname

type ErrDetectHostname struct {
	Err error
}

func (ErrDetectHostname) Error

func (err ErrDetectHostname) Error() string

func (ErrDetectHostname) ExitCode

func (err ErrDetectHostname) ExitCode() int

func (ErrDetectHostname) Unwrap

func (err ErrDetectHostname) Unwrap() error

type ErrDumpFirmware

type ErrDumpFirmware struct {
	Err error
}

func (ErrDumpFirmware) Error

func (err ErrDumpFirmware) Error() string

func (ErrDumpFirmware) ExitCode

func (err ErrDumpFirmware) ExitCode() int

func (ErrDumpFirmware) Unwrap

func (err ErrDumpFirmware) Unwrap() error

type ErrFirmwareRequest

type ErrFirmwareRequest struct {
	Err error
}

ErrFirmwareRequest means there was an issue when creating a DiffFirmware request object

func (ErrFirmwareRequest) Error

func (err ErrFirmwareRequest) Error() string

func (ErrFirmwareRequest) Unwrap

func (err ErrFirmwareRequest) Unwrap() error

type ErrGetFirmwareSize

type ErrGetFirmwareSize struct {
	Err error
}

func (ErrGetFirmwareSize) Error

func (err ErrGetFirmwareSize) Error() string

func (ErrGetFirmwareSize) ExitCode

func (err ErrGetFirmwareSize) ExitCode() int

func (ErrGetFirmwareSize) Unwrap

func (err ErrGetFirmwareSize) Unwrap() error

type ErrInitFirmwareAnalyzer

type ErrInitFirmwareAnalyzer struct {
	Err error
}

func (ErrInitFirmwareAnalyzer) Error

func (err ErrInitFirmwareAnalyzer) Error() string

func (ErrInitFirmwareAnalyzer) ExitCode

func (err ErrInitFirmwareAnalyzer) ExitCode() int

func (ErrInitFirmwareAnalyzer) Unwrap

func (err ErrInitFirmwareAnalyzer) Unwrap() error

type ErrInvalidInput

type ErrInvalidInput struct {
	Desc string
}

ErrInvalidInput means some function is used incorrectly (invalid input arguments).

func (ErrInvalidInput) Error

func (err ErrInvalidInput) Error() string

type ErrSystemInfo

type ErrSystemInfo struct {
	Err error
}

func (ErrSystemInfo) Error

func (err ErrSystemInfo) Error() string

func (ErrSystemInfo) ExitCode

func (err ErrSystemInfo) ExitCode() int

func (ErrSystemInfo) Unwrap

func (err ErrSystemInfo) Unwrap() error

type ErrUnableToGetDiffReport

type ErrUnableToGetDiffReport struct {
	Err string
}

ErrUnableToGetDiffReport is returned when DiffFirmware returned a report without a DiffReport.

func (ErrUnableToGetDiffReport) Error

func (err ErrUnableToGetDiffReport) Error() string

type FirmwareWand

type FirmwareWand struct {
	// contains filtered or unexported fields
}

FirmwareWand is a collection of client-side analysis tooling for a BIOS firmware

func New

func New(ctx context.Context, opts ...Option) (*FirmwareWand, error)

New creates a new instance of a FirmwareWand

func (*FirmwareWand) Analyze

func (fwwand *FirmwareWand) Analyze(
	ctx context.Context,
	request *afas.AnalyzeRequest,
) (*afas.AnalyzeResult_, error)

Analyze sends a multi-analyzing request to AFAS

func (*FirmwareWand) CheckFirmwareVersion

func (fwwand *FirmwareWand) CheckFirmwareVersion(
	ctx context.Context,
	firmwares []afas.FirmwareVersion,
) ([]bool, error)

CheckFirmwareVersion sends a firmware versions check request to AFAS

func (*FirmwareWand) Close

func (fwwand *FirmwareWand) Close() error

func (*FirmwareWand) Dump

func (fwwand *FirmwareWand) Dump(
	ctx context.Context,
) ([]byte, error)

func (*FirmwareWand) FindImage

func (fwwand *FirmwareWand) FindImage(
	ctx context.Context,
	imageBytes []byte,
) *afas.FirmwareImageMetadata

FindImage returns the metadata of the image stored in BlobStorage

func (*FirmwareWand) Search

func (fwwand *FirmwareWand) Search(
	ctx context.Context,
	filters afas.SearchFirmwareFilters,
	shouldFetchContent bool,
) (*afas.SearchFirmwareResult_, error)

Search asks the firmware analysis service to provide information on already collected images, which satisfies selected filters.

func (*FirmwareWand) SearchReport

func (fwwand *FirmwareWand) SearchReport(
	ctx context.Context,
	filters afas.SearchReportFilters,
	limit uint64,
) (*afas.SearchReportResult_, error)

SearchReport asks the firmware analysis service to provide information on already collected reports, which satisfies selected filters.

type Option

type Option interface {
	// contains filtered or unexported methods
}

type OptionFirmwareAnalyzerEndpoints

type OptionFirmwareAnalyzerEndpoints []string

OptionFirmwareAnalyzerEndpoints specifies an exact endpoint to connect to if present, has priority over SMC tier

type OptionFlashromOptions

type OptionFlashromOptions []flashrom.Option

type OptionRemoteLogLevel

type OptionRemoteLogLevel logger.Level

Jump to

Keyboard shortcuts

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