Documentation ¶
Overview ¶
Package domain_service is a generated protocol buffer package.
It is generated from these files:
service.proto
It has these top-level messages:
DomainServiceRequest DomainServiceResponse TrustedEntities
Index ¶
- Variables
- func GenerateProgramCert(domain *tao.Domain, serialNumber int, programPrin *auth.Prin, ...) (*x509.Certificate, error)
- func InitAcls(domain *tao.Domain, trustedEntitiesPath string) error
- func RequestCrl(network, addr string) (*pkix.CertificateList, error)
- func RequestProgramCert(hostAtt *tao.Attestation, verifier *tao.Verifier, network string, addr string) (*x509.Certificate, error)
- func RequestRevokeCertificate(att *tao.Attestation, network, addr string) error
- func RevokeCertificate(serAtt []byte, revokedCerts []pkix.RevokedCertificate, domain *tao.Domain) ([]pkix.RevokedCertificate, error)
- func VerifyAttestation(serializedHostAttestation []byte, domain *tao.Domain) (*auth.Prin, *auth.Prin, *auth.Prin, error)
- func VerifyHostAttestation(serializedHostAttestation []byte, domain *tao.Domain, rootCerts *x509.CertPool) (*auth.Prin, *auth.Prin, *auth.Prin, error)
- type DomainServiceRequest
- func (*DomainServiceRequest) Descriptor() ([]byte, []int)
- func (m *DomainServiceRequest) GetProgramKey() []byte
- func (m *DomainServiceRequest) GetSerializedHostAttestation() []byte
- func (m *DomainServiceRequest) GetSerializedPolicyAttestation() []byte
- func (m *DomainServiceRequest) GetType() DomainServiceRequestRequestType
- func (*DomainServiceRequest) ProtoMessage()
- func (m *DomainServiceRequest) Reset()
- func (m *DomainServiceRequest) String() string
- type DomainServiceRequestRequestType
- type DomainServiceResponse
- func (*DomainServiceResponse) Descriptor() ([]byte, []int)
- func (m *DomainServiceResponse) GetCrl() []byte
- func (m *DomainServiceResponse) GetDerProgramCert() []byte
- func (m *DomainServiceResponse) GetErrorMessage() string
- func (*DomainServiceResponse) ProtoMessage()
- func (m *DomainServiceResponse) Reset()
- func (m *DomainServiceResponse) String() string
- type TrustedEntities
- func (*TrustedEntities) Descriptor() ([]byte, []int)
- func (m *TrustedEntities) GetTrustedHostTaoNames() []string
- func (m *TrustedEntities) GetTrustedMachineInfos() []string
- func (m *TrustedEntities) GetTrustedProgramTaoNames() []string
- func (m *TrustedEntities) GetTrustedRootCerts() [][]byte
- func (*TrustedEntities) ProtoMessage()
- func (m *TrustedEntities) Reset()
- func (m *TrustedEntities) String() string
Constants ¶
This section is empty.
Variables ¶
var DomainServiceRequestRequestType_name = map[int32]string{
1: "DOMAIN_CERT_REQUEST",
2: "MANAGE_POLICY",
3: "REVOKE_CERTIFICATE",
4: "GET_CRL",
}
var DomainServiceRequestRequestType_value = map[string]int32{
"DOMAIN_CERT_REQUEST": 1,
"MANAGE_POLICY": 2,
"REVOKE_CERTIFICATE": 3,
"GET_CRL": 4,
}
Functions ¶
func GenerateProgramCert ¶
func GenerateProgramCert(domain *tao.Domain, serialNumber int, programPrin *auth.Prin, verifier *tao.Verifier, now, expiry time.Time) (*x509.Certificate, error)
This function generates a Program Certificate. In particular, it generates an attestation signed by the domain policy key, with a statement of the form 'policyKey says programCert speaksFor program' where programCert is a X509 cert signed by the policy key with subject CommonName being the Tao name of the program and subject public key being programKey. Certificate expiration time is one year from issuing time.
func InitAcls ¶
This function reads in trusted entities from a file at trustedEntitiesPath. In particular, this file contains the text representation of a trusted_entities proto message, which contains the Tao names of trusted programs and hosts, information about trusted machines and trusted machine certificates. For each such trusted entity, this function adds ACL rules to the domain guard, and saves the changes before returning.
func RequestCrl ¶
func RequestCrl(network, addr string) (*pkix.CertificateList, error)
This function sends a DomainServiceRequest of the type GET_CRL to the domain service, and deserializes the response into a pkix.CertificateList containing the revoked certificates.
func RequestProgramCert ¶
func RequestProgramCert(hostAtt *tao.Attestation, verifier *tao.Verifier, network string, addr string) (*x509.Certificate, error)
This function packages a host attestation into a DomainServiceRequest of the type DOMAIN_CERT_REQUEST, sends it to the domain service and deserializes the response into an attestation that contains the domain program certificate.
func RequestRevokeCertificate ¶
func RequestRevokeCertificate(att *tao.Attestation, network, addr string) error
This function packages a certificate revoke request into a DomainServiceRequest of type REVOKE_CERTIFICATE and sends it to the domain service. It expects att to be an attestation signed by the domain policy key with a statement of the form: policyKey says revoke certificateSerialNumber
func RevokeCertificate ¶
func RevokeCertificate(serAtt []byte, revokedCerts []pkix.RevokedCertificate, domain *tao.Domain) ([]pkix.RevokedCertificate, error)
This function helps process a certificate revocation request. It expects serAtt to be a serialized attestation signed by the domain policy key, with a statement of the form: policyKey says revoke certificateSerialNumber This function gets a list of revoked certificates, updates it if the cert revocation request is valid, and returns the updated list.
func VerifyAttestation ¶
func VerifyHostAttestation ¶
func VerifyHostAttestation(serializedHostAttestation []byte, domain *tao.Domain, rootCerts *x509.CertPool) (*auth.Prin, *auth.Prin, *auth.Prin, error)
This function makes the following checks (1) Checks if the attestation signature is valid and the statement is of the form
'Speaker says Key speaks for Program'.
(2) Checks that 'Program' in the above statement is allowed to Execute in the domain policy.
In particular, the policy should allow the predicate: Authorized(ProgramTaoName, "Execute")
(3) Checks that 'Speaker' in the above statement is a key principal endorsed by the policy key,
or rootCerts, via an endorsement chain. Each endorsement in this chain endorses the key signing the previous endorsement (starting with the 'Speaker' key). An endorsement endorses either a host key, in which case it is an attestation, or the root hardware key, in which case it is certificate. This function also checks that each host or root hardware encoutered along this endorsement chain is allowed as per domain policy. In particular the policy should allow the predicates Authorized(HostTaoName, "Host") and Authorized(EncodedMachineInformation, "Root") A valid attestation chain must either end in a attestation signed by the policy key or a certificate signed by one of the rootCerts.
If all above checks go through, the function returns the principals: Speaker, Key, Program.
Types ¶
type DomainServiceRequest ¶
type DomainServiceRequest struct { Type *DomainServiceRequestRequestType `protobuf:"varint,1,opt,name=type,enum=domain_service.DomainServiceRequestRequestType" json:"type,omitempty"` // Fields for type: DOMAIN_CERT_REQUEST. SerializedHostAttestation []byte `protobuf:"bytes,2,opt,name=serialized_host_attestation" json:"serialized_host_attestation,omitempty"` // The program key, serialized in the format that // auth.NewKeyPrin() accepts. ProgramKey []byte `protobuf:"bytes,3,opt,name=program_key" json:"program_key,omitempty"` // Fields for type: REVOKE_CERTIFICATE. // This is an attestation signed by the policy key with the statement: // policyKey says revoke certificateSerialNumber SerializedPolicyAttestation []byte `protobuf:"bytes,4,opt,name=serialized_policy_attestation" json:"serialized_policy_attestation,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*DomainServiceRequest) Descriptor ¶
func (*DomainServiceRequest) Descriptor() ([]byte, []int)
func (*DomainServiceRequest) GetProgramKey ¶
func (m *DomainServiceRequest) GetProgramKey() []byte
func (*DomainServiceRequest) GetSerializedHostAttestation ¶
func (m *DomainServiceRequest) GetSerializedHostAttestation() []byte
func (*DomainServiceRequest) GetSerializedPolicyAttestation ¶
func (m *DomainServiceRequest) GetSerializedPolicyAttestation() []byte
func (*DomainServiceRequest) GetType ¶
func (m *DomainServiceRequest) GetType() DomainServiceRequestRequestType
func (*DomainServiceRequest) ProtoMessage ¶
func (*DomainServiceRequest) ProtoMessage()
func (*DomainServiceRequest) Reset ¶
func (m *DomainServiceRequest) Reset()
func (*DomainServiceRequest) String ¶
func (m *DomainServiceRequest) String() string
type DomainServiceRequestRequestType ¶
type DomainServiceRequestRequestType int32
TODO: explain different types
const ( DomainServiceRequest_DOMAIN_CERT_REQUEST DomainServiceRequestRequestType = 1 DomainServiceRequest_MANAGE_POLICY DomainServiceRequestRequestType = 2 DomainServiceRequest_REVOKE_CERTIFICATE DomainServiceRequestRequestType = 3 DomainServiceRequest_GET_CRL DomainServiceRequestRequestType = 4 )
func (DomainServiceRequestRequestType) Enum ¶
func (x DomainServiceRequestRequestType) Enum() *DomainServiceRequestRequestType
func (DomainServiceRequestRequestType) EnumDescriptor ¶
func (DomainServiceRequestRequestType) EnumDescriptor() ([]byte, []int)
func (DomainServiceRequestRequestType) String ¶
func (x DomainServiceRequestRequestType) String() string
func (*DomainServiceRequestRequestType) UnmarshalJSON ¶
func (x *DomainServiceRequestRequestType) UnmarshalJSON(data []byte) error
type DomainServiceResponse ¶
type DomainServiceResponse struct { ErrorMessage *string `protobuf:"bytes,1,opt,name=error_message" json:"error_message,omitempty"` // Fields for response to DOMAIN_CERT_REQUEST. DerProgramCert []byte `protobuf:"bytes,2,opt,name=der_program_cert" json:"der_program_cert,omitempty"` // Fields for response to GET_CRL. Crl []byte `protobuf:"bytes,3,opt,name=crl" json:"crl,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*DomainServiceResponse) Descriptor ¶
func (*DomainServiceResponse) Descriptor() ([]byte, []int)
func (*DomainServiceResponse) GetCrl ¶
func (m *DomainServiceResponse) GetCrl() []byte
func (*DomainServiceResponse) GetDerProgramCert ¶
func (m *DomainServiceResponse) GetDerProgramCert() []byte
func (*DomainServiceResponse) GetErrorMessage ¶
func (m *DomainServiceResponse) GetErrorMessage() string
func (*DomainServiceResponse) ProtoMessage ¶
func (*DomainServiceResponse) ProtoMessage()
func (*DomainServiceResponse) Reset ¶
func (m *DomainServiceResponse) Reset()
func (*DomainServiceResponse) String ¶
func (m *DomainServiceResponse) String() string
type TrustedEntities ¶
type TrustedEntities struct { TrustedProgramTaoNames []string `protobuf:"bytes,1,rep,name=trusted_program_tao_names" json:"trusted_program_tao_names,omitempty"` TrustedHostTaoNames []string `protobuf:"bytes,2,rep,name=trusted_host_tao_names" json:"trusted_host_tao_names,omitempty"` TrustedMachineInfos []string `protobuf:"bytes,3,rep,name=trusted_machine_infos" json:"trusted_machine_infos,omitempty"` TrustedRootCerts [][]byte `protobuf:"bytes,4,rep,name=trusted_root_certs" json:"trusted_root_certs,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*TrustedEntities) Descriptor ¶
func (*TrustedEntities) Descriptor() ([]byte, []int)
func (*TrustedEntities) GetTrustedHostTaoNames ¶
func (m *TrustedEntities) GetTrustedHostTaoNames() []string
func (*TrustedEntities) GetTrustedMachineInfos ¶
func (m *TrustedEntities) GetTrustedMachineInfos() []string
func (*TrustedEntities) GetTrustedProgramTaoNames ¶
func (m *TrustedEntities) GetTrustedProgramTaoNames() []string
func (*TrustedEntities) GetTrustedRootCerts ¶
func (m *TrustedEntities) GetTrustedRootCerts() [][]byte
func (*TrustedEntities) ProtoMessage ¶
func (*TrustedEntities) ProtoMessage()
func (*TrustedEntities) Reset ¶
func (m *TrustedEntities) Reset()
func (*TrustedEntities) String ¶
func (m *TrustedEntities) String() string