Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SEV-SNP on GCP #3011

Merged
merged 30 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
667e041
terraform: enable creation of SEV-SNP VMs on GCP
msanft Apr 4, 2024
3a349b1
variant: add SEV-SNP attestation variant
msanft Apr 4, 2024
b9a982d
config: add SEV-SNP config options for GCP
msanft Apr 4, 2024
3999cbc
measurements: add GCP SEV-SNP measurements
msanft Apr 4, 2024
5488ba1
gcp: separate package for SEV-ES
msanft Apr 4, 2024
afeac3a
attestation: add GCP SEV-SNP attestation logic
msanft Apr 4, 2024
57498a3
gcp: factor out common logic
msanft Apr 4, 2024
68037cf
choose: add GCP SEV-SNP
msanft Apr 4, 2024
4298fcf
cli: add TF variable passthrough for GCP SEV-SNP variables
msanft Apr 4, 2024
640f6c4
cli: support GCP SEV-SNP for `constellation verify`
msanft Apr 4, 2024
cb543c7
Adjust usage of GCP SEV-SNP throughout codebase
msanft Apr 4, 2024
25e1eca
ci: add GCP SEV-SNP
msanft Apr 4, 2024
b7fe2ef
terraform-provider: support GCP SEV-SNP
msanft Apr 4, 2024
2ecffaf
docs: add GCP SEV-SNP reference
msanft Apr 4, 2024
3c07430
linter fixes
msanft Apr 5, 2024
ea897ba
gcp: only run test with TPM simulator
msanft Apr 5, 2024
aec00b2
gcp: remove nonsense test
msanft Apr 5, 2024
1657b12
Update cli/internal/cmd/verify.go
msanft Apr 5, 2024
75be502
Update docs/docs/overview/clouds.md
msanft Apr 5, 2024
bea33f3
Update terraform-provider-constellation/internal/provider/attestation…
msanft Apr 5, 2024
55d8658
linter fixes
msanft Apr 5, 2024
b4811b8
terraform_provider: correctly pass down CC technology
msanft Apr 5, 2024
f7ce3d9
config: mark attestationconfigapi as unimplemented
msanft Apr 5, 2024
5f14a82
gcp: fix comments and typos
msanft Apr 10, 2024
4e3582e
snp: use nonce and PK hash in SNP report
msanft Apr 10, 2024
500196d
snp: ensure we never use ARK supplied by Issuer (#3025)
daniel-weisse Apr 12, 2024
282216d
attestationconfigapi: add GCP to uploading
msanft Apr 12, 2024
694c8b1
snp: use correct cert
msanft Apr 15, 2024
8fb087d
terraform-provider: enable fetching of attestation config values for …
msanft Apr 15, 2024
2129781
linter fixes
msanft Apr 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/e2e_verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ runs:
aws-region: eu-central-1

- name: Upload extracted TCBs
if: github.ref_name == 'main' && (inputs.attestationVariant == 'azure-sev-snp' || inputs.attestationVariant == 'aws-sev-snp')
if: github.ref_name == 'main' && (inputs.attestationVariant == 'azure-sev-snp' || inputs.attestationVariant == 'aws-sev-snp' || inputs.attestationVariant == 'gcp-sev-snp')
shell: bash
env:
COSIGN_PASSWORD: ${{ inputs.cosignPassword }}
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/terraform_apply/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ runs:
"gcpSEVES")
attestationVariant="gcp-sev-es"
;;
"gcpSEVSNP")
attestationVariant="gcp-sev-snp"
;;
*)
echo "Unknown attestation variant: $(yq '.attestation | keys | .[0]' constellation-conf.yaml)"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-attestationconfigapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
csp: ["azure", "aws"]
csp: ["azure", "aws", "gcp"]
runs-on: ubuntu-22.04
permissions:
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
max-parallel: 5
matrix:
kubernetesVersion: ["1.28"] # should be default
attestationVariant: ["gcp-sev-es", "azure-sev-snp", "azure-tdx", "aws-sev-snp"]
attestationVariant: ["gcp-sev-es", "gcp-sev-snp", "azure-sev-snp", "azure-tdx", "aws-sev-snp"]
refStream: ["ref/main/stream/debug/?", "ref/release/stream/stable/?"]
test: ["sonobuoy quick"]
runs-on: ubuntu-22.04
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/e2e-test-internal-lb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ on:
description: "Which attestation variant to use."
type: choice
options:
- "gcp-sev-es"
- "aws-sev-snp"
- "azure-sev-snp"
- "azure-tdx"
- "aws-sev-snp"
- "gcp-sev-es"
- "gcp-sev-snp"
default: "azure-sev-snp"
required: true
runner:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/e2e-test-marketplace-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ on:
description: "Which attestation variant to use."
type: choice
options:
- "gcp-sev-es"
- "aws-sev-snp"
- "azure-sev-snp"
- "azure-tdx"
- "aws-sev-snp"
- "gcp-sev-es"
- "gcp-sev-snp"
default: "azure-sev-snp"
required: true
runner:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/e2e-test-provider-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ on:
- "azure-sev-snp"
- "azure-tdx"
- "gcp-sev-es"
- "gcp-sev-snp"
default: "azure-sev-snp"
required: true
workflow_call:
Expand Down Expand Up @@ -265,11 +266,21 @@ jobs:
run: |
region=$(echo ${{ inputs.regionZone || 'europe-west3-b' }} | rev | cut -c 3- | rev)

case "${{ inputs.attestationVariant }}" in
"gcp-sev-snp")
cc_tech="SEV_SNP"
;;
*)
cc_tech="SEV"
;;
esac

cat >> _override.tf <<EOF
locals {
project_id = "constellation-e2e"
region = "${region}"
zone = "${{ inputs.regionZone || 'europe-west3-b' }}"
cc_technology = "${cc_tech}"
}
EOF
cat _override.tf
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/e2e-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
- test: "sonobuoy full"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "sonobuoy full"
attestationVariant: "azure-sev-snp"
Expand All @@ -72,6 +76,11 @@ jobs:
kubernetes-version: "v1.28"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "sonobuoy full"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.28"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "sonobuoy full"
attestationVariant: "azure-sev-snp"
kubernetes-version: "v1.28"
Expand All @@ -93,6 +102,11 @@ jobs:
kubernetes-version: "v1.27"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "sonobuoy full"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.27"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "sonobuoy full"
attestationVariant: "azure-sev-snp"
kubernetes-version: "v1.27"
Expand All @@ -115,6 +129,11 @@ jobs:
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "verify"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "verify"
attestationVariant: "azure-sev-snp"
kubernetes-version: "v1.29"
Expand All @@ -137,6 +156,11 @@ jobs:
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "recover"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "recover"
attestationVariant: "azure-sev-snp"
kubernetes-version: "v1.29"
Expand All @@ -159,6 +183,11 @@ jobs:
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "lb"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "lb"
attestationVariant: "azure-sev-snp"
kubernetes-version: "v1.29"
Expand All @@ -181,6 +210,11 @@ jobs:
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "autoscaling"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "autoscaling"
attestationVariant: "azure-sev-snp"
kubernetes-version: "v1.29"
Expand All @@ -203,6 +237,11 @@ jobs:
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "perf-bench"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
runner: "ubuntu-22.04"
clusterCreation: "cli"
- test: "perf-bench"
attestationVariant: "azure-sev-snp"
kubernetes-version: "v1.29"
Expand All @@ -223,6 +262,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "malicious join"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "malicious join"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/e2e-test-terraform-provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ on:
description: "Which attestation variant to use."
type: choice
options:
- "gcp-sev-es"
- "aws-sev-snp"
- "azure-sev-snp"
- "azure-tdx"
- "aws-sev-snp"
- "gcp-sev-es"
- "gcp-sev-snp"
default: "azure-sev-snp"
required: true
runner:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/e2e-test-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "sonobuoy full"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "sonobuoy full"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand All @@ -79,6 +84,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.28"
clusterCreation: "cli"
- test: "sonobuoy quick"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.28"
clusterCreation: "cli"
- test: "sonobuoy quick"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand All @@ -100,6 +110,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.27"
clusterCreation: "cli"
- test: "sonobuoy quick"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.27"
clusterCreation: "cli"
- test: "sonobuoy quick"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand All @@ -123,6 +138,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "verify"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "verify"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand All @@ -146,6 +166,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "recover"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "recover"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand All @@ -168,6 +193,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "lb"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "lb"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand All @@ -190,6 +220,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "autoscaling"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "autoscaling"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand All @@ -212,6 +247,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "perf-bench"
refStream: "ref/main/stream/debug/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.29"
clusterCreation: "cli"
- test: "perf-bench"
refStream: "ref/main/stream/debug/?"
attestationVariant: "azure-sev-snp"
Expand Down Expand Up @@ -241,6 +281,11 @@ jobs:
attestationVariant: "gcp-sev-es"
kubernetes-version: "v1.28"
clusterCreation: "cli"
- test: "verify"
refStream: "ref/release/stream/stable/?"
attestationVariant: "gcp-sev-snp"
kubernetes-version: "v1.28"
clusterCreation: "cli"
- test: "verify"
refStream: "ref/release/stream/stable/?"
attestationVariant: "azure-sev-snp"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
type: choice
options:
- "gcp-sev-es"
- "gcp-sev-snp"
- "azure-sev-snp"
- "azure-tdx"
- "aws-sev-snp"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/e2e-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ on:
description: "Which attestation variant to use."
type: choice
options:
- "gcp-sev-es"
- "aws-sev-snp"
- "azure-sev-snp"
- "azure-tdx"
- "aws-sev-snp"
- "gcp-sev-es"
- "gcp-sev-snp"
default: "azure-sev-snp"
required: true
nodeCount:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ jobs:
id: fetch-reference
shell: bash
run: |
# TODO(msanft): Implement marketplace images for GCP SEV-SNP
aws s3 cp s3://cdn-constellation-backend/constellation/v2/ref/-/stream/stable/${{ steps.fetch-version.outputs.output }}/image/info.json .
FULL_REF=$(yq e -r -oy '.list.[] | select(.attestationVariant == "gcp-sev-es") | .reference' info.json)
IMAGE_NAME=$(echo "${FULL_REF}" | cut -d / -f 5)
Expand Down
7 changes: 7 additions & 0 deletions cli/internal/cloudcmd/tfvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ func gcpTerraformVars(conf *config.Config, imageRef string) *terraform.GCPCluste
DiskType: group.StateDiskType,
}
}

ccTech := "SEV"
if conf.GetAttestationConfig().GetVariant().Equal(variant.GCPSEVSNP{}) {
ccTech = "SEV_SNP"
}

return &terraform.GCPClusterVariables{
Name: conf.Name,
NodeGroups: nodeGroups,
Expand All @@ -219,6 +225,7 @@ func gcpTerraformVars(conf *config.Config, imageRef string) *terraform.GCPCluste
Debug: conf.IsDebugCluster(),
CustomEndpoint: conf.CustomEndpoint,
InternalLoadBalancer: conf.InternalLoadBalancer,
CCTechnology: ccTech,
}
}

Expand Down
9 changes: 9 additions & 0 deletions cli/internal/cmd/configgenerate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ func TestValidProviderAttestationCombination(t *testing.T) {
variant.GCPSEVES{},
config.AttestationConfig{GCPSEVES: defaultAttestation.GCPSEVES},
},
{
cloudprovider.GCP,
variant.GCPSEVSNP{},
config.AttestationConfig{GCPSEVSNP: defaultAttestation.GCPSEVSNP},
},
{
cloudprovider.QEMU,
variant.QEMUVTPM{},
Expand Down Expand Up @@ -286,6 +291,10 @@ func TestParseAttestationFlag(t *testing.T) {
attestationFlag: "gcp-sev-es",
wantVariant: variant.GCPSEVES{},
},
"GCPSEVSNP": {
attestationFlag: "gcp-sev-snp",
wantVariant: variant.GCPSEVSNP{},
},
"QEMUVTPM": {
attestationFlag: "qemu-vtpm",
wantVariant: variant.QEMUVTPM{},
Expand Down
Loading
Loading