Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSNitroVerifierOptions ¶
type AWSNitroVerifierOptions struct {
// SkipTimestampCheck skips certificate timestamp validation.
// Often these certificates need to be validated much later in offline systems,
// so skipping the timestamp check may be necessary.
SkipTimestampCheck bool
// PCRRules defines expected PCR values to validate.
// If provided, the verifier will check that the attestation's PCR values match these rules.
PCRRules []PCRRule
}
AWSNitroVerifierOptions configures the AWS Nitro verifier behavior
type AttestationDocument ¶
type AttestationDocument struct {
ModuleID string `cbor:"module_id"`
Timestamp uint64 `cbor:"timestamp"`
Digest string `cbor:"digest"`
PCRs map[uint][]byte `cbor:"pcrs"`
Certificate []byte `cbor:"certificate"`
CABundle [][]byte `cbor:"cabundle"`
PublicKey []byte `cbor:"public_key,omitempty"`
UserData []byte `cbor:"user_data,omitempty"`
Nonce []byte `cbor:"nonce,omitempty"`
}
AttestationDocument represents a parsed AWS Nitro attestation document
func (*AttestationDocument) Validate ¶
func (a *AttestationDocument) Validate() error
Validate checks for the presence of required fields in the attestation document
type PCRValidationResult ¶
type PCRValidationResult struct {
Index uint // PCR index
Expected []byte // Expected PCR value
Actual []byte // Actual PCR value from attestation
Valid bool // Whether the PCR matches expected value
}
PCRValidationResult represents the result of a single PCR validation
type ValidationResult ¶
type ValidationResult struct {
// Overall validation status - true if all required checks passed
// Valid is true iff all required validations passed, ie.: Errors is empty
Valid bool
// Validation errors - empty if Valid is true
// Each entry describes a specific validation failure
Errors []error
// Certificate chain validation details
ChainTrusted bool // True if certificate chain validated to AWS Nitro root
RootFingerprint string // SHA256 fingerprint of the root certificate (set if ChainTrusted is true)
// Optional fields extracted from attestation document
UserData []byte // Application-specific data included in the attestation
PublicKey []byte // Public key included in the attestation
Nonce []byte // Nonce included in the attestation
// PCR validation results (only set if PCRRules were provided in options)
PCRResults []PCRValidationResult
// Document is added for debugging purposes and for services that may need to inspect it further
Document *AttestationDocument
}
ValidationResult contains the result of AWS Nitro attestation validation
type Verifier ¶
type Verifier interface {
Validate(attestationBytes []byte) (*ValidationResult, error)
}
Verifier defines the interface for verifying AWS Nitro attestation documents
func NewVerifier ¶
func NewVerifier(options AWSNitroVerifierOptions) Verifier
NewVerifier creates a new attestation validator with the given options
Source Files
¶
Click to show internal directories.
Click to hide internal directories.