api

package
v3.13.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Keep in sync with agent/pkg/api/types.go

Index

Constants

View Source
const (
	Unsupported = "unsupported"
	Trusted     = "trusted"
	Vulnerable  = "vulnerable"
)
View Source
const (
	OSWindows = "windows"
	OSLinux   = "linux"
	OSUnknown = "unknown"
)
View Source
const (
	EFICertificate = "certificate"
	EFIFingerprint = "fingerprint"
)
View Source
const (
	ModeSetup    = "setup"
	ModeAudit    = "audit"
	ModeUser     = "user"
	ModeDeployed = "deployed"
)
View Source
const (
	ICU        = "ICU"
	TXE        = "TXE"
	ConsumerME = "Consumer CSME"
	BusinessME = "Business CSME"
	LightME    = "Light ME"
	SPS        = "SPS"
	UnknownME  = "Unrecognized"
)
View Source
const DefaultHTTPRequestTimeoutSec = 30
View Source
const DefaultPostRequestTimeoutSec = 60
View Source
const EvidenceType = "evidence/1"
View Source
const ReportType = "report/2"
View Source
const VerdictType = "verdict/3"

Variables

View Source
var (
	ServerError  = errors.New("API server error")
	NetworkError = errors.New("Connection error")
	AuthError    = errors.New("Authentication token invalid")
	FormatError  = errors.New("Data invalid")
	PaymentError = errors.New("Payment required")
)

Functions

func Cookie(rng io.Reader) (string, error)

func EqualNames

func EqualNames(n1 *Name, n2 *Name) bool

func GenerateAttestationCreation

func GenerateAttestationCreation(rand *rand.Rand) tpm2.AttestationData

func GenerateAttestationData

func GenerateAttestationData(rand *rand.Rand) tpm2.AttestationData

func GenerateCertifyInfo

func GenerateCertifyInfo(rand *rand.Rand) tpm2.CertifyInfo

func GenerateClockInfo

func GenerateClockInfo(rand *rand.Rand) tpm2.ClockInfo

func GenerateCreationInfo

func GenerateCreationInfo(rand *rand.Rand) tpm2.CreationInfo

func GenerateECPoint

func GenerateECPoint(rand *rand.Rand, cv elliptic.Curve, size uint) tpm2.ECPoint

func GenerateEK

func GenerateEK(rand *rand.Rand) tpm2.Public

func GenerateKDFScheme

func GenerateKDFScheme(rand *rand.Rand) tpm2.KDFScheme

func GenerateName

func GenerateName(rand *rand.Rand) tpm2.Name

func GenerateParamsECC

func GenerateParamsECC(rand *rand.Rand, prop tpm2.KeyProp) tpm2.ECCParams

func GenerateParamsRSA

func GenerateParamsRSA(rand *rand.Rand, prop tpm2.KeyProp) tpm2.RSAParams

func GeneratePublic

func GeneratePublic(rand *rand.Rand) tpm2.Public

func GeneratePublicECC

func GeneratePublicECC(rand *rand.Rand) tpm2.Public

func GeneratePublicRSA

func GeneratePublicRSA(rand *rand.Rand) tpm2.Public

func GenerateSigScheme

func GenerateSigScheme(rand *rand.Rand, ecc bool) tpm2.SigScheme

func GenerateSignature

func GenerateSignature(rand *rand.Rand) tpm2.Signature

func GenerateSignatureECC

func GenerateSignatureECC(rand *rand.Rand) tpm2.SignatureECC

func GenerateSignatureRSA

func GenerateSignatureRSA(rand *rand.Rand) tpm2.SignatureRSA

func GenerateSymScheme

func GenerateSymScheme(rand *rand.Rand) tpm2.SymScheme

func ProcessFirmwarePropertiesHashBlobs added in v3.13.2

func ProcessFirmwarePropertiesHashBlobs(fw *FirmwareProperties) map[string][]byte

ProcessFirmwarePropertiesHashBlobs compresses and strips hash blobs from the given firmware properties only leaving their hashes; the blobs can then be transmitted out-of-band

Types

type ACPITables

type ACPITables struct {
	Blobs map[string]HashBlob `json:"blobs,omitempty"`
	Error FirmwareError       `json:"error,omitempty"` // FirmwareErr*
}

type Agent

type Agent struct {
	Release   string      `json:"release"`
	ImageSHA2 ErrorBuffer `json:"sha,omitempty"`
}

type Annotation

type Annotation struct {
	Id       AnnotationID `json:"id"`
	Expected string       `json:"expected,omitempty"`
	Path     string       `json:"path"`
	Fatal    bool         `json:"fatal"`
}

/v2/devices (apisrv)

type AnnotationID

type AnnotationID string

type Appraisal

type Appraisal struct {
	Id        string    `jsonapi:"primary,appraisals" json:"id"`
	Received  time.Time `jsonapi:"attr,received,rfc3339" json:"received"`
	Appraised time.Time `jsonapi:"attr,appraised,rfc3339" json:"appraised"`
	Expires   time.Time `jsonapi:"attr,expires,rfc3339" json:"expires"`
	Verdict   Verdict   `jsonapi:"attr,verdict" json:"verdict"`
	Report    Report    `jsonapi:"attr,report" json:"report"`
}

/v2/devices (apisrv)

type Attest

type Attest tpm2.AttestationData

TPM2B_ATTEST wrapper type

func (Attest) Generate

func (Attest) Generate(rand *rand.Rand, size int) reflect.Value

func (Attest) MarshalJSON

func (a Attest) MarshalJSON() ([]byte, error)

func (*Attest) UnmarshalJSON

func (a *Attest) UnmarshalJSON(data []byte) error

type BootApps added in v3.13.0

type BootApps struct {
	Images    map[string]HashBlob `json:"images,omitempty"` // path -> pe file
	ImagesErr FirmwareError       `json:"images_err,omitempty"`
}

type Buffer

type Buffer []byte

func (Buffer) MarshalJSON

func (a Buffer) MarshalJSON() ([]byte, error)

func (*Buffer) UnmarshalJSON

func (a *Buffer) UnmarshalJSON(data []byte) error

type CPUIDLeaf

type CPUIDLeaf struct {
	LeafEAX uint32        `json:"leaf_eax,string"`
	LeafECX uint32        `json:"leaf_ecx,string"`
	EAX     *uint32       `json:"eax,string,omitempty"`
	EBX     *uint32       `json:"ebx,string,omitempty"`
	ECX     *uint32       `json:"ecx,string,omitempty"`
	EDX     *uint32       `json:"edx,string,omitempty"`
	Error   FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type CPUVendor

type CPUVendor string
const (
	IntelCPU CPUVendor = "GenuineIntel"
	AMDCPU   CPUVendor = "AuthenticAMD"
)

type Certificate

type Certificate x509.Certificate

Certificate wrapper type

func (Certificate) MarshalJSON

func (c Certificate) MarshalJSON() ([]byte, error)

func (*Certificate) UnmarshalJSON

func (c *Certificate) UnmarshalJSON(data []byte) error

type Client

type Client struct {
	HTTP               *http.Client
	Base               *url.URL
	Auth               string
	HTTPRequestTimeout time.Duration // Timeout for all HTTP requests except POST
	PostRequestTimeout time.Duration // POST requests may contain lots of data and need a different timeout
	AgentVersion       string
}

func NewClient

func NewClient(base *url.URL, ca *x509.Certificate, agentVersion string) Client

func (*Client) Attest

func (c *Client) Attest(ctx context.Context, quoteCredential string, ev Evidence, multiPartFiles map[string][]byte) (*Appraisal, string, error)

func (*Client) Configuration

func (c *Client) Configuration(ctx context.Context, lastUpdate *time.Time) (*Configuration, error)

Client.Configuration returns a nil Configuration when lastUpdate is not nil and the server tells us to use a cached configuration

func (*Client) Enroll

func (c *Client) Enroll(ctx context.Context, enrollToken string, enroll Enrollment) ([]*EncryptedCredential, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, route string, ifModifiedSince *time.Time) (jsonapi.Payloader, error)

Client.Get returns a nil jsonapi.Payloader if the server sent no body in case of a 304

func (*Client) Post

func (c *Client) Post(ctx context.Context, route string, doc interface{}, multiPartFiles map[string][]byte) (jsonapi.Payloader, error)

type Configuration

type Configuration struct {
	Root            KeyTemplate            `jsonapi:"attr,root" json:"root"`
	Keys            map[string]KeyTemplate `jsonapi:"attr,keys" json:"keys"`
	PCRBank         uint16                 `jsonapi:"attr,pcr_bank" json:"pcr_bank"`
	PCRs            []int                  `jsonapi:"attr,pcrs" json:"pcrs"`
	UEFIVariables   []UEFIVariable         `jsonapi:"attr,uefi" json:"uefi"`
	MSRs            []MSR                  `jsonapi:"attr,msrs" json:"msrs"`
	CPUIDLeafs      []CPUIDLeaf            `jsonapi:"attr,cpuid" json:"cpuid"`
	TPM2NVRAM       []uint32               `jsonapi:"attr,tpm2_nvram" json:"tpm2_nvram,string"`
	SEV             []SEVCommand           `jsonapi:"attr,sev" json:"sev"`
	ME              []MEClientCommands     `jsonapi:"attr,me" json:"me"`
	TPM2Properties  []TPM2Property         `jsonapi:"attr,tpm2_properties" json:"tpm2_properties"`
	PCIConfigSpaces []PCIConfigSpace       `jsonapi:"attr,pci" json:"pci"`
}

/v2/configuration (apisrv)

type Devices added in v3.6.0

type Devices struct {
	FWUPdVersion string                        `json:"fwupd_version"`
	Topology     []FWUPdDevice                 `json:"topology"`
	Releases     map[string][]FWUPdReleaseInfo `json:"releases,omitempty"`
}

type EFISignature

type EFISignature struct {
	Type        string     `json:"type"`              // EFIFingerprint or EFICertificate
	Subject     *string    `json:"subject,omitempty"` // certificate only
	Issuer      *string    `json:"issuer,omitempty"`  // certificate only
	Fingerprint string     `json:"fingerprint"`
	NotBefore   *time.Time `json:"not_before,omitempty,rfc3339"` // certificate only
	NotAfter    *time.Time `json:"not_after,omitempty,rfc3339"`  // certificate only
	Algorithm   *string    `json:"algorithm,omitempty"`          // certificate only
}

type EPPInfo added in v3.8.0

type EPPInfo struct {
	AntimalwareProcesses    map[string]HashBlob `json:"antimalware_processes,omitempty"` // path -> exe file
	AntimalwareProcessesErr FirmwareError       `json:"antimalware_processes_err,omitempty"`
	EarlyLaunchDrivers      map[string]HashBlob `json:"early_launch_drivers,omitempty"` // path -> sys file
	EarlyLaunchDriversErr   FirmwareError       `json:"early_launch_drivers_err,omitempty"`
	ESET                    *ESETConfig         `json:"eset,omitempty"` // Linux only
}

type ESETConfig added in v3.8.0

type ESETConfig struct {
	Enabled           ErrorBuffer `json:"enabled"`
	ExcludedFiles     ErrorBuffer `json:"excluded_files"`
	ExcludedProcesses ErrorBuffer `json:"excluded_processes"`
}

type EnclavePageCache

type EnclavePageCache struct {
	Base          uint64 `json:"base"`
	Size          uint64 `json:"size"`
	CIRProtection bool   `json:"cir_protection"`
}

/v2/devices (apisrv)

type EncryptedCredential

type EncryptedCredential struct {
	Name       string `jsonapi:"attr,name" json:"name"`
	KeyID      Buffer `jsonapi:"attr,key_id" json:"key_id"`
	Credential Buffer `jsonapi:"attr,credential" json:"credential"` // encrypted JWT
	Secret     Buffer `jsonapi:"attr,secret" json:"secret"`
	Nonce      Buffer `jsonapi:"attr,nonce" json:"nonce"`
}

/v2/enroll (apisrv)

type Enrollment

type Enrollment struct {
	NameHint               string         `jsonapi:"attr,name_hint" json:"name_hint"`
	EndoresmentKey         PublicKey      `jsonapi:"attr,endoresment_key" json:"endoresment_key"`
	EndoresmentCertificate *Certificate   `jsonapi:"attr,endoresment_certificate" json:"endoresment_certificate"`
	Root                   PublicKey      `jsonapi:"attr,root" json:"root"`
	Keys                   map[string]Key `jsonapi:"attr,keys" json:"keys"`
	Cookie                 string         `jsonapi:"attr,cookie" json:"cookie"`
}

/v2/enroll (apisrv)

type ErrorBuffer

type ErrorBuffer struct {
	Data  Buffer        `json:"data,omitempty"`
	Error FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type Evidence

type Evidence struct {
	Type      string                       `jsonapi:"attr,type" json:"type"`
	Quote     *Attest                      `jsonapi:"attr,quote,omitempty" json:"quote,omitempty"`
	Signature *Signature                   `jsonapi:"attr,signature,omitempty" json:"signature,omitempty"`
	Algorithm string                       `jsonapi:"attr,algorithm" json:"algorithm"`
	PCRs      map[string]Buffer            `jsonapi:"attr,pcrs" json:"pcrs"`
	AllPCRs   map[string]map[string]Buffer `jsonapi:"attr,allpcrs" json:"allpcrs"`
	Firmware  FirmwareProperties           `jsonapi:"attr,firmware" json:"firmware"`
	Cookie    string                       `jsonapi:"attr,cookie" json:"cookie"`
}

/v2/attest (apisrv)

type FWUPdDevice added in v3.6.0

type FWUPdDevice = map[string]interface{}

type FWUPdReleaseInfo added in v3.8.6

type FWUPdReleaseInfo = map[string]interface{}

type FirmwareError

type FirmwareError string
const (
	NoError        FirmwareError = ""
	UnknownError   FirmwareError = "unkn"
	NoPermission   FirmwareError = "no-perm"
	NoResponse     FirmwareError = "no-resp"
	NotImplemented FirmwareError = "not-impl"
)

type FirmwareProperties

type FirmwareProperties struct {
	UEFIVariables   []UEFIVariable     `json:"uefi,omitempty"`
	MSRs            []MSR              `json:"msrs,omitempty"`
	CPUIDLeafs      []CPUIDLeaf        `json:"cpuid,omitempty"`
	SEV             []SEVCommand       `json:"sev,omitempty"`
	ME              []MEClientCommands `json:"me,omitempty"`
	TPM2Properties  []TPM2Property     `json:"tpm2_properties,omitempty"`
	TPM2NVRAM       []TPM2NVIndex      `json:"tpm2_nvram,omitempty"`
	PCIConfigSpaces []PCIConfigSpace   `json:"pci,omitempty"`
	ACPI            ACPITables         `json:"acpi"`
	SMBIOS          HashBlob           `json:"smbios"`
	TXTPublicSpace  HashBlob           `json:"txt"`
	VTdRegisterSet  HashBlob           `json:"vtd"`
	Flash           HashBlob           `json:"flash"`
	TPM2EventLog    ErrorBuffer        `json:"event_log"`             // deprecated
	TPM2EventLogZ   *ErrorBuffer       `json:"event_log_z,omitempty"` // deprecated
	TPM2EventLogs   []HashBlob         `json:"event_logs,omitempty"`
	PCPQuoteKeys    map[string]Buffer  `json:"pcp_quote_keys,omitempty"` // windows only
	MACAddresses    MACAddresses       `json:"mac"`
	OS              OS                 `json:"os"`
	NICs            *NICList           `json:"nic,omitempty"`
	Memory          Memory             `json:"memory"`
	Agent           *Agent             `json:"agent,omitempty"`
	Devices         *Devices           `json:"devices,omitempty"`
	IMALog          *ErrorBuffer       `json:"ima_log,omitempty"`
	EPPInfo         *EPPInfo           `json:"epp_info,omitempty"`
	BootApps        *BootApps          `json:"boot_apps,omitempty"`
}

/v2/attest (apisrv)

type HashBlob added in v3.8.0

type HashBlob struct {
	Sha256 Buffer        `json:"sha256,omitempty"` // hash of uncompressed data
	ZData  Buffer        `json:"z_data,omitempty"` // zstd compressed data, maybe omitted if data is assumed to be known
	Data   Buffer        `json:"data,omitempty"`   // deprecated: uncompressed data for backwards compatibility to ErrorBuffer
	Error  FirmwareError `json:"error,omitempty"`  // FirmwareErr*
}

type Host

type Host struct {
	// Windows: <ProductName> <CurrentMajorVersionNumber>.<CurrentMinorVersionNumber> Build <CurrentBuild>
	// Linux: /etc/os-release PRETTY_NAME or lsb_release -d
	OSName    string    `json:"name"`
	Hostname  string    `json:"hostname"`
	OSType    string    `json:"type"` // OS*
	CPUVendor CPUVendor `json:"cpu_vendor"`
}

type Info

type Info struct {
	APIVersion string `jsonapi:"attr,api_version" json:"api_version"`
}

/v2/info (apisrv)

type Key

type Key struct {
	Public                 PublicKey `json:"public"`
	CreationProof          Attest    `json:"certify_info"`
	CreationProofSignature Signature `json:"certify_signature"`
}

/v2/enroll (apisrv)

type KeyTemplate

type KeyTemplate struct {
	Public PublicKey `json:"public"`
	Label  string    `json:"label"`
}

/v2/configuration (apisrv)

type MACAddresses

type MACAddresses struct {
	Addresses []string      `json:"addrs"`
	Error     FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type ME

type ME struct {
	Features        []string `json:"features"`
	Variant         string   `json:"variant"` // constants above
	Version         []uint16 `json:"version"`
	RecoveryVersion []uint16 `json:"recovery_version"`
	FITCVersion     []uint16 `json:"fitc_version"`
	API             []uint   `json:"api_version,string"`
	MEUpdate        string   `json:"updatable"`
	ChipsetVersion  uint     `json:"chipset_version,string"`
	ChipID          uint     `json:"chip_id,string"`
	Manufacturer    string   `json:"manufacturer,omitempty"`
	Size            uint     `json:"size,string"`
	Signature       string   `json:"signature"`
}

type MEClientCommands

type MEClientCommands struct {
	GUID     *uuid.UUID    `json:"guid,omitempty"`
	Address  string        `json:"address,omitempty"`
	Commands []MECommand   `json:"commands"`
	Error    FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type MECommand

type MECommand struct {
	Command  Buffer        `json:"command"`
	Response Buffer        `json:"response,omitempty"`
	Error    FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type MSR

type MSR struct {
	MSR    uint32        `json:"msr,string"`
	Values []uint64      `json:"value,omitempty"`
	Error  FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type Memory

type Memory struct {
	Values []MemoryRange `json:"values,omitempty"`
	Error  FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type MemoryRange

type MemoryRange struct {
	Start    uint64 `json:"start,string"`
	Bytes    uint64 `json:"bytes,string"`
	Reserved bool   `json:"reserved"`
}

type NIC

type NIC struct {
	Name  string        `json:"name,omitempty"`
	IPv4  []string      `json:"ipv4,omitempty"`
	IPv6  []string      `json:"ipv6,omitempty"`
	MAC   string        `json:"mac"`
	Error FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type NICList

type NICList struct {
	List  []NIC         `json:"list,omitempty"`
	Error FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type NVPublic

type NVPublic tpm2.NVPublic

TPMS_NV_PUBLIC wrapper type

func (NVPublic) MarshalJSON

func (a NVPublic) MarshalJSON() ([]byte, error)

func (*NVPublic) Scan

func (pub *NVPublic) Scan(src interface{}) error

func (*NVPublic) UnmarshalJSON

func (a *NVPublic) UnmarshalJSON(data []byte) error

func (NVPublic) Value

func (pub NVPublic) Value() (driver.Value, error)

type Name

type Name tpm2.Name

TPM2_Name wrapper type

func ComputeName

func ComputeName(path ...interface{}) (Name, error)

Comptes the TCG Name and Qualified Name of TPM 2.0 entities.

func (Name) Generate

func (Name) Generate(rand *rand.Rand, size int) reflect.Value

func (Name) MarshalJSON

func (n Name) MarshalJSON() ([]byte, error)

func (*Name) Scan

func (nam *Name) Scan(src interface{}) error

func (*Name) UnmarshalJSON

func (n *Name) UnmarshalJSON(data []byte) error

func (Name) Value

func (nam Name) Value() (driver.Value, error)

type OS

type OS struct {
	Hostname string        `json:"hostname"`
	Release  string        `json:"name"`
	Error    FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type PCIConfigSpace

type PCIConfigSpace struct {
	Bus      uint16        `json:"bus,string"`
	Device   uint16        `json:"device,string"`
	Function uint8         `json:"function,string"`
	Value    Buffer        `json:"value,omitempty"`
	Error    FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type PublicKey

type PublicKey tpm2.Public

TPMT_PUBLIC wrapper type

func (*PublicKey) Encode

func (p *PublicKey) Encode() (Buffer, error)

func (PublicKey) Generate

func (PublicKey) Generate(rand *rand.Rand, size int) reflect.Value

func (PublicKey) MarshalJSON

func (a PublicKey) MarshalJSON() ([]byte, error)

func (*PublicKey) Name

func (p *PublicKey) Name() (Name, error)

func (*PublicKey) Scan

func (pub *PublicKey) Scan(src interface{}) error

func (*PublicKey) UnmarshalJSON

func (a *PublicKey) UnmarshalJSON(data []byte) error

func (PublicKey) Value

func (pub PublicKey) Value() (driver.Value, error)

type Report

type Report struct {
	Type        string       `json:"type"`
	Values      ReportValues `json:"values"`
	Annotations []Annotation `json:"annotations"`
}

/v2/devices (apisrv)

type ReportValues

type ReportValues struct {
	Host   Host    `json:"host"`
	SMBIOS *SMBIOS `json:"smbios,omitempty"`
	UEFI   *UEFI   `json:"uefi,omitempty"`
	TPM    *TPM    `json:"tpm,omitempty"`
	ME     *ME     `json:"me,omitempty"`
	SGX    *SGX    `json:"sgx,omitempty"`
	TXT    *TXT    `json:"txt,omitempty"`
	SEV    *SEV    `json:"sev,omitempty"`
	NICs   []NIC   `json:"nics,omitempty"`
}

type SEV

type SEV struct {
	Enabled bool   `json:"enabled"`
	Version []uint `json:"version"`
	SME     bool   `json:"sme"`
	ES      bool   `json:"es"`
	VTE     bool   `json:"vte"`
	SNP     bool   `json:"snp"`
	VMPL    bool   `json:"vmpl"`
	Guests  uint   `json:"guests"`
	MinASID uint   `json:"min_asid"`
}

type SEVCommand

type SEVCommand struct {
	Command    uint32        `json:"command"` // firmware.SEV*
	ReadLength uint32        `json:"read_length"`
	Response   *Buffer       `json:"response,omitempty"`
	Error      FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type SGX

type SGX struct {
	Version          uint               `json:"version"`
	Enabled          bool               `json:"enabled"`
	FLC              bool               `json:"flc"`
	KSS              bool               `json:"kss"`
	MaxEnclaveSize32 uint               `json:"enclave_size_32"`
	MaxEnclaveSize64 uint               `json:"enclave_size_64"`
	EPC              []EnclavePageCache `json:"epc"`
}

type SMBIOS

type SMBIOS struct {
	Manufacturer    string `json:"manufacturer"`
	Product         string `json:"product"`
	Serial          string `json:"serial,omitempty"`
	UUID            string `json:"uuid,omitempty"`
	BIOSReleaseDate string `json:"bios_release_date"`
	BIOSVendor      string `json:"bios_vendor"`
	BIOSVersion     string `json:"bios_version"`
}

type Signature

type Signature tpm2.Signature

TPMT_SIGNATURE wrapper type

func (Signature) Generate

func (Signature) Generate(rand *rand.Rand, size int) reflect.Value

func (Signature) MarshalJSON

func (a Signature) MarshalJSON() ([]byte, error)

func (*Signature) UnmarshalJSON

func (a *Signature) UnmarshalJSON(data []byte) error

type TPM

type TPM struct {
	Manufacturer string            `json:"manufacturer"`
	VendorID     string            `json:"vendor_id"`
	SpecVersion  string            `json:"spec_version"`
	EventLog     []TPMEvent        `json:"eventlog"`
	PCR          map[string]string `json:"pcr"`
}

type TPM2NVIndex

type TPM2NVIndex struct {
	Index  uint32        `json:"index,string"`
	Public *NVPublic     `json:"public,omitempty"`
	Value  *Buffer       `json:"value,omitempty"`
	Error  FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type TPM2Property

type TPM2Property struct {
	Property uint32        `json:"property,string"`
	Value    *uint32       `json:"value,omitempty,string"`
	Error    FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type TPMEvent

type TPMEvent struct {
	PCR       uint   `json:"pcr"`
	Value     string `json:"value"`
	Algorithm uint   `json:"algorithm"`
	Note      string `json:"note"`
}

/v2/devices (apisrv)

type TXT

type TXT struct {
	Ready bool `json:"ready"`
}

type UEFI

type UEFI struct {
	Mode          string          `json:"mode"` // Mode*
	SecureBoot    bool            `json:"secureboot"`
	PlatformKeys  *[]EFISignature `json:"platform_keys"`
	ExchangeKeys  *[]EFISignature `json:"exchange_keys"`
	PermittedKeys *[]EFISignature `json:"permitted_keys"`
	ForbiddenKeys *[]EFISignature `json:"forbidden_keys"`
}

type UEFIVariable

type UEFIVariable struct {
	Vendor string        `json:"vendor"`
	Name   string        `json:"name"`
	Value  *Buffer       `json:"value,omitempty"`
	Error  FirmwareError `json:"error,omitempty"` // FirmwareErr*
}

type Verdict

type Verdict struct {
	Type string `json:"type"`

	Result             string `json:"result"`
	SupplyChain        string `json:"supply_chain"`
	Configuration      string `json:"configuration"`
	Firmware           string `json:"firmware"`
	Bootloader         string `json:"bootloader"`
	OperatingSystem    string `json:"operating_system"`
	EndpointProtection string `json:"endpoint_protection"`
}

/v2/devices (apisrv)

Jump to

Keyboard shortcuts

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