Documentation
¶
Index ¶
- Constants
- func CompareStringSliceMap(s []string, m map[string]bool) error
- func ComputeConfigElementSha(h hash.Hash, msg interface{})
- func CreateBaseConfig(u uuid.UUID) []byte
- func CreateBaseDeviceOptions(_ uuid.UUID) []byte
- func CreateBaseGlobalOptions() []byte
- func EqualStringSlice(a, b []string) bool
- func EqualUUIDSlice(a, b []*uuid.UUID) bool
- func GetOnboardCertName(cn string) string
- func MismatchedErrors(e1, e2 error) bool
- func RandomString(len int) string
- type ApiRequest
- type BigData
- type ChunkReader
- type DeviceOptions
- type DeviceStorage
- func (d *DeviceStorage) AddAppLog(instanceID uuid.UUID, b []byte) error
- func (d *DeviceStorage) AddFlowRecord(b []byte) error
- func (d *DeviceStorage) AddInfo(b []byte) error
- func (d *DeviceStorage) AddLogs(b []byte) error
- func (d *DeviceStorage) AddMetrics(b []byte) error
- func (d *DeviceStorage) AddRequest(b []byte) error
- type FullCertsEntry
- type FullLogEntry
- type GlobalOptions
- type InvalidCertError
- type InvalidSerialError
- type MaxSizes
- type NotFoundError
- type PCRTemplate
- type PCRValue
- type UsedSerialError
- type Zcerts
Constants ¶
const ( KB = 1024 MB = 1024 * KB )
Variables ¶
This section is empty.
Functions ¶
func ComputeConfigElementSha ¶
func CreateBaseConfig ¶
func CreateBaseDeviceOptions ¶
func CreateBaseGlobalOptions ¶
func CreateBaseGlobalOptions() []byte
func EqualStringSlice ¶
func EqualUUIDSlice ¶
func GetOnboardCertName ¶
func MismatchedErrors ¶
func RandomString ¶
Types ¶
type ApiRequest ¶
type ApiRequest struct {
Timestamp time.Time `json:"timestamp"`
UUID uuid.UUID `json:"uuid,omitempty"`
ClientIP string `json:"client-ip"`
Forwarded string `json:"forwarded,omitempty"`
Method string `json:"method"`
URL string `json:"url"`
}
ApiRequest stores information about requests from EVE
type ChunkReader ¶
type ChunkReader interface {
// Next will return reader for the next chunk and the size of the chunk
// in case of no next chunk available, will return io.EOF
Next() (io.Reader, int64, error)
}
ChunkReader provides ability to request reader for the data for every available chunk device managers stores the data in separate chunks (e.g. files/slices/messages) we need readers for every chunk to be separated to be able to process data before present
type DeviceOptions ¶
type DeviceOptions struct {
Nonce string `json:"nonce"`
IntegrityToken string `json:"integrityToken"`
ReceivedPCRTemplate *PCRTemplate `json:"receivedPCRTemplate"`
Attested bool `json:"attested"`
EventLog []*attest.TpmEventLogEntry `json:"eventLog,omitempty"`
}
DeviceOptions stores received nonce, PCRTemplate structure received from device and IntegrityToken generated by controller
type DeviceStorage ¶
type DeviceStorage struct {
Cert *x509.Certificate
Info BigData
Metrics BigData
Logs BigData
Requests BigData
FlowMessage BigData
Certs BigData
AppLogs map[uuid.UUID]BigData
CurrentLog int
Config []byte
AttestCerts []byte
StorageKeys []byte
Serial string
Onboard *x509.Certificate
Options []byte // stores json representation of DeviceOptions
}
func (*DeviceStorage) AddAppLog ¶
func (d *DeviceStorage) AddAppLog(instanceID uuid.UUID, b []byte) error
func (*DeviceStorage) AddFlowRecord ¶
func (d *DeviceStorage) AddFlowRecord(b []byte) error
func (*DeviceStorage) AddInfo ¶
func (d *DeviceStorage) AddInfo(b []byte) error
func (*DeviceStorage) AddLogs ¶
func (d *DeviceStorage) AddLogs(b []byte) error
func (*DeviceStorage) AddMetrics ¶
func (d *DeviceStorage) AddMetrics(b []byte) error
func (*DeviceStorage) AddRequest ¶
func (d *DeviceStorage) AddRequest(b []byte) error
type FullCertsEntry ¶
type FullLogEntry ¶
type FullLogEntry struct {
*logs.LogEntry
Image string `json:"image,omitempty"` // SW image the log got emitted from
EveVersion string `json:"eveVersion,omitempty"` // EVE software version
}
func (FullLogEntry) Json ¶
func (f FullLogEntry) Json() ([]byte, error)
Bytes convenience to convert to json bytes
type GlobalOptions ¶
type GlobalOptions struct {
EnforceTemplateAttestation bool `json:"enforceTemplateAttestation"`
PCRTemplates []*PCRTemplate `json:"PCRTemplates"`
}
GlobalOptions configure controller behaviour for attestation requests
type InvalidCertError ¶
type InvalidCertError struct {
Err string
}
InvalidCertError error representing that a certificate is not valid
func (*InvalidCertError) Error ¶
func (n *InvalidCertError) Error() string
type InvalidSerialError ¶
type InvalidSerialError struct {
Err string
}
InvalidSerialError error representing that a serial is not valid
func (*InvalidSerialError) Error ¶
func (n *InvalidSerialError) Error() string
type MaxSizes ¶
type MaxSizes struct {
MaxLogSize int
MaxInfoSize int
MaxMetricSize int
MaxRequestsSize int
MaxAppLogsSize int
MaxFlowMessageSize int
}
MaxSizes defines maximum sizes of objects storage
type NotFoundError ¶
type NotFoundError struct {
Err string
}
NotFoundError error representing that an item was not found
func (*NotFoundError) Error ¶
func (n *NotFoundError) Error() string
type PCRTemplate ¶
type PCRTemplate struct {
EveVersion string `json:"eveVersion"`
FirmwareVersion string `json:"firmwareVersion"`
PCRValues []*PCRValue `json:"PCRValues"`
}
PCRTemplate stores template with EVE version, Firmware version, GPSInfo and set of PCRValues
type PCRValue ¶
type PCRValue struct {
Index uint32 `json:"index"`
Value string `json:"value"` // may contain '*' to allow any value in template
}
PCRValue stores one single PCR value from TPM, from a particular hash bank
type UsedSerialError ¶
type UsedSerialError struct {
Err string
}
UsedSerialError error representing that a serial was used already
func (*UsedSerialError) Error ¶
func (n *UsedSerialError) Error() string