scratchpad on starting up a GCP AMD-SEV instance
using go-sev-guest and virtee
# create instance
gcloud beta compute instances create snp-instance \
--machine-type=n2d-standard-4 \
--min-cpu-platform="AMD Milan" \
scratchpad on starting up a GCP AMD-SEV instance
using go-sev-guest and virtee
# create instance
gcloud beta compute instances create snp-instance \
--machine-type=n2d-standard-4 \
--min-cpu-platform="AMD Milan" \
Rough procedure to force sign/issue a CA signed certificate that is tied to a TPM's public key.
This procedure uses the -force_pubkey key parameter for openssl
Build container with rules_oci
First run a local registry
crane registry serve --address :4000
package com.test; | |
import com.google.cloud.ServiceOptions; | |
import com.google.cloud.pubsub.v1.TopicAdminClient; | |
import com.google.cloud.pubsub.v1.TopicAdminSettings; | |
import com.google.pubsub.v1.Topic; | |
import com.google.pubsub.v1.ProjectName; | |
import com.google.auth.oauth2.GoogleCredentials; |
ref
bazel build with go gcp library
bazel run :gazelle -- update-repos -from_file=go.mod -prune=true -to_macro=repositories.bzl%go_repositories
bazel run --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 :main
package main | |
/* | |
Sample that prints the EKM value for a TLS connection: | |
https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html | |
https://github.com/salrashid123/go_mtls_scratchpad/tree/main#exported-key-material | |
*/ | |
import ( | |
"context" |
Snippet used to confirm if AMD-SEV
is enabled or not on a GCE VM using TPM PCR0
values.
GCE Shielded VM that have TPMs enabled asserts that PCR0
surfaces the following encoded measurements
0: Contains the value for PCR0, which contains information about firmware components and the memory encryption technology that is active. This PCR diverges from the TCG PCClient platform firmware profile in that it measures only the following events:
package main | |
import ( | |
"fmt" | |
"log" | |
"context" | |
"cloud.google.com/go/storage" |
package main | |
import ( | |
"fmt" | |
"log" | |
"context" | |
"cloud.google.com/go/storage" |