Documentation ¶
Overview ¶
Package measurement provides different collectors to hash files, disks, dmi info and cpuid info.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CPUIDCollector ¶
CPUIDCollector describes the "cpuid" portion of the policy file.
func (*CPUIDCollector) Collect ¶
func (s *CPUIDCollector) Collect() error
Collect gets the cpuid and extends it into the TPM and stores a copy on disk.
It satisfies the Collector interface.
type Collector ¶
type Collector interface {
Collect() error
}
All collectors (e.g., cpuid, dmi, etc.) should satisfy this interface. Collectors collect data and extend its hash into a PCR.
func GetCollector ¶
GetCollector calls the appropriate init handlers for a particular collector JSON object argument and returns a new Collector Interface.
An error is returned if unmarshalling fails or an unsupported collector is passed as an argument.
func NewCPUIDCollector ¶
NewCPUIDCollector extracts the "cpuid" portion from the policy file and initializes a new CPUIDCollector structure.
An error is returned if unmarshalling of CPUIDCollector fails.
func NewDmiCollector ¶
NewDmiCollector extracts the "dmi" portion from the policy file and initializes a new DmiCollector structure.
It returns an error if unmarshalling of DmiCollector fails.
func NewFileCollector ¶
NewFileCollector extracts the "files" portion from the policy file and initializes a new FileCollector structure. It returns an error if unmarshalling of FileCollector fails.
func NewStorageCollector ¶
NewStorageCollector extracts the "storage" portion from the policy file and initializes a new StorageCollector structure.
It returns an error if unmarshalling of StorageCollector fails.
type DmiCollector ¶
type DmiCollector struct { Type string `json:"type"` Clusters []fieldCluster `json:"events"` }
DmiCollector describes the "dmi" portion of policy file.
func (*DmiCollector) Collect ¶
func (s *DmiCollector) Collect() error
Collect gets all smbios data, filters is based on the types provided in the policy file, then measures the filtered data into the TPM.
It satisfies the Collector interface.
type FileCollector ¶
Describes the "files" portion of policy file.
func (*FileCollector) Collect ¶
func (s *FileCollector) Collect() error
Collect loops over the given file paths and for each file path calls HashFile(), which measures a file into the TPM.
It satisfies the Collector interface.
type StorageCollector ¶
StorageCollector describes the "storage" portion of the policy file.
func (*StorageCollector) Collect ¶
func (s *StorageCollector) Collect() error
Collect loops over the given storage paths and for each storage path calls measureStorageDevice(), which measures a storage device into the TPM.
It satisfies the Collector interface.