Skip to content

Commit

Permalink
feat: Added support for signed container image and custom audience an…
Browse files Browse the repository at this point in the history
…d nonce requests

New fields have been incorporated into the VerifyAttestationRequest proto message to accommodate two additional features: signed container image and custom audience and nonce.

PiperOrigin-RevId: 551026956
  • Loading branch information
Google APIs authored and Copybara-Service committed Jul 25, 2023
1 parent 347ee97 commit a31b53e
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 7 deletions.
14 changes: 8 additions & 6 deletions google/cloud/confidentialcomputing/v1/BUILD.bazel
Expand Up @@ -72,8 +72,8 @@ java_gapic_library(
rest_numeric_enums = True,
service_yaml = "confidentialcomputing_v1.yaml",
test_deps = [
":confidentialcomputing_java_grpc",
"//google/cloud/location:location_java_grpc",
":confidentialcomputing_java_grpc",
],
transport = "grpc+rest",
deps = [
Expand Down Expand Up @@ -170,7 +170,8 @@ py_gapic_library(
rest_numeric_enums = True,
service_yaml = "confidentialcomputing_v1.yaml",
transport = "grpc+rest",
deps = [],
deps = [
],
)

py_test(
Expand Down Expand Up @@ -214,7 +215,9 @@ php_gapic_library(
rest_numeric_enums = True,
service_yaml = "confidentialcomputing_v1.yaml",
transport = "grpc+rest",
deps = [":confidentialcomputing_php_proto"],
deps = [
":confidentialcomputing_php_proto",
],
)

# Open Source Packages
Expand Down Expand Up @@ -281,9 +284,7 @@ ruby_grpc_library(
ruby_cloud_gapic_library(
name = "confidentialcomputing_ruby_gapic",
srcs = [":confidentialcomputing_proto_with_info"],
extra_protoc_parameters = [
"ruby-cloud-gem-name=google-cloud-confidential_computing-v1",
],
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-confidential_computing-v1"],
grpc_service_config = "confidentialcomputing_v1_grpc_service_config.json",
rest_numeric_enums = True,
service_yaml = "confidentialcomputing_v1.yaml",
Expand Down Expand Up @@ -317,6 +318,7 @@ load(

csharp_proto_library(
name = "confidentialcomputing_csharp_proto",
extra_opts = [],
deps = [":confidentialcomputing_proto"],
)

Expand Down
Expand Up @@ -8,6 +8,7 @@ apis:
- name: google.cloud.location.Locations

documentation:
summary: Attestation verifier for Confidential Space.
rules:
- selector: google.cloud.location.Locations.GetLocation
description: Gets information about a location.
Expand Down Expand Up @@ -53,7 +54,7 @@ authentication:
https://www.googleapis.com/auth/cloud-platform
publishing:
new_issue_uri: https://issuetracker.google.com/issues/new?component=1166820
new_issue_uri: https://issuetracker.google.com/issues/new?component=1134314&template=1640550
documentation_uri: https://cloud.google.com/confidential-computing
api_short_name: confidentialcomputing
github_label: 'api: confidentialcomputing'
Expand Down
77 changes: 77 additions & 0 deletions google/cloud/confidentialcomputing/v1/service.proto
Expand Up @@ -55,6 +55,21 @@ service ConfidentialComputing {
}
}

// SigningAlgorithm enumerates all the supported signing algorithms.
enum SigningAlgorithm {
// Unspecified signing algorithm.
SIGNING_ALGORITHM_UNSPECIFIED = 0;

// RSASSA-PSS with a SHA256 digest.
RSASSA_PSS_SHA256 = 1;

// RSASSA-PKCS1 v1.5 with a SHA256 digest.
RSASSA_PKCS1V15_SHA256 = 2;

// ECDSA on the P-256 Curve with a SHA256 digest.
ECDSA_P256_SHA256 = 3;
}

// A Challenge from the server used to guarantee freshness of attestations
message Challenge {
option (google.api.resource) = {
Expand Down Expand Up @@ -118,6 +133,14 @@ message VerifyAttestationRequest {
// Required. The TPM-specific data provided by the attesting platform, used to
// populate any of the claims regarding platform state.
TpmAttestation tpm_attestation = 3 [(google.api.field_behavior) = REQUIRED];

// Optional. Optional information related to the Confidential Space TEE.
ConfidentialSpaceInfo confidential_space_info = 4
[(google.api.field_behavior) = OPTIONAL];

// Optional. A collection of optional, workload-specified claims that modify
// the token output.
TokenOptions token_options = 5 [(google.api.field_behavior) = OPTIONAL];
}

// A response once an attestation has been successfully verified, containing a
Expand All @@ -134,6 +157,18 @@ message GcpCredentials {
repeated string service_account_id_tokens = 2;
}

// Options to modify claims in the token to generate custom-purpose tokens.
message TokenOptions {
// Optional. Optional string to issue the token with a custom audience claim.
// Required if one or more nonces are specified.
string audience = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. Optional parameter to place one or more nonces in the eat_nonce
// claim in the output token. The minimum size for JSON-encoded EATs is 10
// bytes and the maximum size is 74 bytes.
repeated string nonce = 2 [(google.api.field_behavior) = OPTIONAL];
}

// TPM2 data containing everything necessary to validate any platform state
// measured into the TPM.
message TpmAttestation {
Expand Down Expand Up @@ -174,3 +209,45 @@ message TpmAttestation {
// chain back to a trusted Root Certificate.
repeated bytes cert_chain = 5;
}

// ConfidentialSpaceInfo contains information related to the Confidential Space
// TEE.
message ConfidentialSpaceInfo {
// Optional. A list of signed entities containing container image signatures
// that can be used for server-side signature verification.
repeated SignedEntity signed_entities = 1
[(google.api.field_behavior) = OPTIONAL];
}

// SignedEntity represents an OCI image object containing everything necessary
// to verify container image signatures.
message SignedEntity {
// Optional. A list of container image signatures attached to an OCI image
// object.
repeated ContainerImageSignature container_image_signatures = 1
[(google.api.field_behavior) = OPTIONAL];
}

// ContainerImageSignature holds necessary metadata to verify a container image
// signature.
message ContainerImageSignature {
// Required. The binary signature payload following the SimpleSigning format
// https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing.
// This payload includes the container image digest.
bytes payload = 1 [(google.api.field_behavior) = REQUIRED];

// Required. A signature over the payload.
// The container image digest is incorporated into the signature as follows:
// 1. Generate a SimpleSigning format payload that includes the container
// image digest.
// 2. Generate a signature over SHA256 digest of the payload.
// The signature generation process can be represented as follows:
// `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
bytes signature = 2 [(google.api.field_behavior) = REQUIRED];

// Required. An associated public key used to verify the signature.
bytes public_key = 3 [(google.api.field_behavior) = REQUIRED];

// Required. The algorithm used to produce the container image signature.
SigningAlgorithm sig_alg = 4 [(google.api.field_behavior) = REQUIRED];
}

0 comments on commit a31b53e

Please sign in to comment.