variant

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package variant defines Attestation variants for different CSPs.

Each variant defines an OID, a string representation, and a function to compare it to other OIDs.

The OID is used in attested TLS to distinguish the attestation documents. OIDs beginning with 1.3.9900 are reserved and can be used without registration.

* The 1.3.9900.1 branch is reserved for placeholder values and testing.

* The 1.3.9900.2 branch is reserved for AWS.

* The 1.3.9900.3 branch is reserved for GCP.

* The 1.3.9900.4 branch is reserved for Azure.

* The 1.3.9900.5 branch is reserved for QEMU.

Deprecated OIDs should never be reused for different purposes. Instead, new OIDs should be added in the appropriate branch at the next available index.

String representation should be lowercase and contain only letters, numbers, and hyphens. They should be prefixed with the branch name, e.g. all variants in the 1.3.9900.2 (AWS) branch should start with "aws-". Each variant should have a unique string representation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveDuplicate

func RemoveDuplicate[T comparable](sliceList []T) []T

RemoveDuplicate removes duplicate elements from a slice.

func ValidProvider

func ValidProvider(provider cloudprovider.Provider, variant Variant) bool

ValidProvider returns true if the attestation variants is valid for the given provider.

Types

type AWSNitroTPM

type AWSNitroTPM struct{}

AWSNitroTPM holds the AWS nitro TPM OID.

func (AWSNitroTPM) Equal

func (AWSNitroTPM) Equal(other Getter) bool

Equal returns true if the other variant is also AWSNitroTPM.

func (AWSNitroTPM) OID

OID returns the struct's object identifier.

func (AWSNitroTPM) String

func (AWSNitroTPM) String() string

String returns the string representation of the OID.

type AWSSEVSNP

type AWSSEVSNP struct{}

AWSSEVSNP holds the AWS nitro TPM OID.

func (AWSSEVSNP) Equal

func (AWSSEVSNP) Equal(other Getter) bool

Equal returns true if the other variant is also AWSSEVSNP.

func (AWSSEVSNP) OID

OID returns the struct's object identifier.

func (AWSSEVSNP) String

func (AWSSEVSNP) String() string

String returns the string representation of the OID.

type AzureSEVSNP

type AzureSEVSNP struct{}

AzureSEVSNP holds the OID for Azure SNP CVMs.

func (AzureSEVSNP) Equal

func (AzureSEVSNP) Equal(other Getter) bool

Equal returns true if the other variant is also AzureSEVSNP.

func (AzureSEVSNP) OID

OID returns the struct's object identifier.

func (AzureSEVSNP) String

func (AzureSEVSNP) String() string

String returns the string representation of the OID.

type AzureTDX added in v2.15.0

type AzureTDX struct{}

AzureTDX holds the OID for Azure TDX CVMs.

func (AzureTDX) Equal added in v2.15.0

func (AzureTDX) Equal(other Getter) bool

Equal returns true if the other variant is also AzureTDX.

func (AzureTDX) OID added in v2.15.0

OID returns the struct's object identifier.

func (AzureTDX) String added in v2.15.0

func (AzureTDX) String() string

String returns the string representation of the OID.

type AzureTrustedLaunch

type AzureTrustedLaunch struct{}

AzureTrustedLaunch holds the OID for Azure TrustedLaunch VMs.

func (AzureTrustedLaunch) Equal

func (AzureTrustedLaunch) Equal(other Getter) bool

Equal returns true if the other variant is also AzureTrustedLaunch.

func (AzureTrustedLaunch) OID

OID returns the struct's object identifier.

func (AzureTrustedLaunch) String

func (AzureTrustedLaunch) String() string

String returns the string representation of the OID.

type Dummy

type Dummy struct{}

Dummy OID for testing.

func (Dummy) Equal

func (Dummy) Equal(other Getter) bool

Equal returns true if the other variant is also a Default.

func (Dummy) OID

func (Dummy) OID() asn1.ObjectIdentifier

OID returns the struct's object identifier.

func (Dummy) String

func (Dummy) String() string

String returns the string representation of the OID.

type GCPSEVES

type GCPSEVES struct{}

GCPSEVES holds the GCP SEV-ES OID.

func (GCPSEVES) Equal

func (GCPSEVES) Equal(other Getter) bool

Equal returns true if the other variant is also GCPSEVES.

func (GCPSEVES) OID

OID returns the struct's object identifier.

func (GCPSEVES) String

func (GCPSEVES) String() string

String returns the string representation of the OID.

type GCPSEVSNP added in v2.17.0

type GCPSEVSNP struct{}

GCPSEVSNP holds the GCP SEV-SNP OID.

func (GCPSEVSNP) Equal added in v2.17.0

func (GCPSEVSNP) Equal(other Getter) bool

Equal returns true if the other variant is also GCPSEVSNP.

func (GCPSEVSNP) OID added in v2.17.0

OID returns the struct's object identifier.

func (GCPSEVSNP) String added in v2.17.0

func (GCPSEVSNP) String() string

String returns the string representation of the OID.

type Getter

type Getter interface {
	OID() asn1.ObjectIdentifier
}

Getter returns an ASN.1 Object Identifier.

type QEMUTDX

type QEMUTDX struct{}

QEMUTDX holds the QEMU TDX OID. Placeholder for dev-cloud integration.

func (QEMUTDX) Equal

func (QEMUTDX) Equal(other Getter) bool

Equal returns true if the other variant is also QEMUTDX.

func (QEMUTDX) OID

OID returns the struct's object identifier. Placeholder for dev-cloud integration.

func (QEMUTDX) String

func (QEMUTDX) String() string

String returns the string representation of the OID.

type QEMUVTPM

type QEMUVTPM struct{}

QEMUVTPM holds the QEMUVTPM OID.

func (QEMUVTPM) Equal

func (QEMUVTPM) Equal(other Getter) bool

Equal returns true if the other variant is also QEMUVTPM.

func (QEMUVTPM) OID

OID returns the struct's object identifier.

func (QEMUVTPM) String

func (QEMUVTPM) String() string

String returns the string representation of the OID.

type Variant

type Variant interface {
	Getter
	String() string
	Equal(other Getter) bool
}

Variant describes an attestation variant.

func FromString

func FromString(oid string) (Variant, error)

FromString returns the OID for the given string.

func GetAvailableAttestationVariants

func GetAvailableAttestationVariants() []Variant

GetAvailableAttestationVariants returns the available attestation variants.

func GetDefaultAttestation

func GetDefaultAttestation(provider cloudprovider.Provider) Variant

GetDefaultAttestation returns the default attestation variant for the given provider. If not found, it returns the default variant.

Jump to

Keyboard shortcuts

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