Skip to content

Commit ab15c9a

Browse files
authored
Merge branch 'main' into update-superlinter-v8
2 parents 9181acb + e51b392 commit ab15c9a

9 files changed

Lines changed: 168 additions & 55 deletions

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ keywords:
77
- confidential-containers
88
name: trustee
99
# DO NOT EDIT VERSION HERE, IT IS AUTO-GENERATED BY SEMANTIC-RELEASE
10-
version: 0.2.1
10+
version: 0.3.4

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# trustee
22

3-
![Version: 0.2.1](https://img.shields.io/badge/Version-0.2.1-informational?style=flat-square)
3+
![Version: 0.3.4](https://img.shields.io/badge/Version-0.3.4-informational?style=flat-square)
44

55
A Helm chart to provide an opinionated deployment of Trustee in a validated pattern
66

@@ -31,8 +31,10 @@ In order to use this chart, you will need to:
3131
| global.coco.securityPolicy | string | `"secret/data/hub/securityPolicyConfig"` | |
3232
| global.coco.securityPolicyFlavour | string | `"insecure"` | |
3333
| global.secretStore.backend | string | `""` | |
34+
| kbs.admin.format | string | `"v1.0"` | |
3435
| kbs.cosignKeys | string | `"secret/data/hub/coSignKeys"` | |
3536
| kbs.extraSecrets | list | `[]` | |
37+
| kbs.gpu.enabled | bool | `false` | |
3638
| kbs.publicKey | string | `"secret/data/hub/kbsPublicKey"` | |
3739
| kbs.secretResources[0].key | string | `"secret/data/hub/kbsres1"` | |
3840
| kbs.secretResources[0].name | string | `"kbsres1"` | |

templates/attestation-policy.yaml

Lines changed: 96 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,66 +14,117 @@ data:
1414
default hardware := 97
1515
default configuration := 36
1616
17-
## miminimal but reliable attestation policy
18-
## hardware and firmware changes. This is not in our control. It's up to the user to update acceptable measurements
19-
## In conjuction with verification with the service provider.
20-
## currently setup for azure vTPM
21-
17+
trust_claims := {
18+
"executables": executables,
19+
"hardware": hardware,
20+
"configuration": configuration,
21+
}
2222
2323
##### Azure vTPM SNP
2424
executables := 3 if {
25-
# input.azsnpvtpm.measurement in data.reference.measurement
26-
input.azsnpvtpm.tpm.pcr03 in data.reference.snp_pcr03
27-
input.azsnpvtpm.tpm.pcr08 in data.reference.snp_pcr08
28-
input.azsnpvtpm.tpm.pcr09 in data.reference.snp_pcr09
29-
input.azsnpvtpm.tpm.pcr11 in data.reference.snp_pcr11
30-
input.azsnpvtpm.tpm.pcr12 in data.reference.snp_pcr12
25+
input["az-snp-vtpm"].tpm.pcr03 in query_reference_value("snp_pcr03")
26+
input["az-snp-vtpm"].tpm.pcr08 in query_reference_value("snp_pcr08")
27+
input["az-snp-vtpm"].tpm.pcr09 in query_reference_value("snp_pcr09")
28+
input["az-snp-vtpm"].tpm.pcr11 in query_reference_value("snp_pcr11")
29+
input["az-snp-vtpm"].tpm.pcr12 in query_reference_value("snp_pcr12")
3130
}
3231
3332
hardware := 2 if {
34-
# Check the reported TCB to validate the ASP FW
35-
# input.azsnpvtpm.reported_tcb_bootloader in data.reference.tcb_bootloader
36-
# input.azsnpvtpm.reported_tcb_microcode in data.reference.tcb_microcode
37-
# input.azsnpvtpm.reported_tcb_snp in data.reference.tcb_snp
38-
# input.azsnpvtpm.reported_tcb_tee in data.reference.tcb_tee
39-
input.azsnpvtpm
40-
}
41-
42-
# For the 'configuration' trust claim 2 stands for
43-
# "The configuration is a known and approved config."
44-
#
45-
# For this, we compare all the configuration fields.
33+
input["az-snp-vtpm"]
34+
}
35+
4636
configuration := 2 if {
47-
# input.azsnpvtpm.platform_smt_enabled in data.reference.smt_enabled
48-
# input.azsnpvtpm.platform_tsme_enabled in data.reference.tsme_enabled
49-
# input.azsnpvtpm.policy_abi_major in data.reference.abi_major
50-
# input.azsnpvtpm.policy_abi_minor in data.reference.abi_minor
51-
# input.azsnpvtpm.policy_single_socket in data.reference.single_socket
52-
# input.azsnpvtpm.policy_smt_allowed in data.reference.smt_allowed
53-
input.azsnpvtpm
37+
input["az-snp-vtpm"]
5438
}
5539
5640
##### Azure vTPM TDX
5741
executables := 3 if {
58-
input.aztdxvtpm.tpm.pcr03 in data.reference.tdx_pcr03
59-
input.aztdxvtpm.tpm.pcr08 in data.reference.tdx_pcr08
60-
input.aztdxvtpm.tpm.pcr09 in data.reference.tdx_pcr09
61-
input.aztdxvtpm.tpm.pcr11 in data.reference.tdx_pcr11
62-
input.aztdxvtpm.tpm.pcr12 in data.reference.tdx_pcr12
42+
input["az-tdx-vtpm"].tpm.pcr03 in query_reference_value("tdx_pcr03")
43+
input["az-tdx-vtpm"].tpm.pcr08 in query_reference_value("tdx_pcr08")
44+
input["az-tdx-vtpm"].tpm.pcr09 in query_reference_value("tdx_pcr09")
45+
input["az-tdx-vtpm"].tpm.pcr11 in query_reference_value("tdx_pcr11")
46+
input["az-tdx-vtpm"].tpm.pcr12 in query_reference_value("tdx_pcr12")
6347
}
6448
6549
hardware := 2 if {
66-
# Check the quote is a TDX quote signed by Intel SGX Quoting Enclave
67-
input.aztdxvtpm.quote.header.tee_type == "81000000"
68-
input.aztdxvtpm.quote.header.vendor_id == "939a7233f79c4ca9940a0db3957f0607"
50+
input["az-tdx-vtpm"].quote.header.tee_type == "81000000"
51+
input["az-tdx-vtpm"].quote.header.vendor_id == "939a7233f79c4ca9940a0db3957f0607"
52+
}
6953
70-
# Check TDX Module version and its hash. Also check OVMF code hash.
71-
# input.aztdxvtpm.quote.body.mr_seam in data.reference.mr_seam
72-
# input.aztdxvtpm.quote.body.tcb_svn in data.reference.tcb_svn
73-
# input.aztdxvtpm.quote.body.mr_td in data.reference.mr_td
54+
configuration := 2 if {
55+
input["az-tdx-vtpm"]
56+
}
57+
58+
##### Baremetal TDX
59+
executables := 3 if {
60+
input["tdx"]
61+
input.init_data in query_reference_value("init_data")
62+
}
63+
hardware := 2 if { input["tdx"] }
64+
configuration := 2 if { input["tdx"] }
65+
66+
##### Baremetal SNP
67+
executables := 3 if {
68+
input["snp"]
69+
input.init_data in query_reference_value("init_data")
70+
}
71+
hardware := 2 if { input["snp"] }
72+
configuration := 2 if { input["snp"] }
73+
{{- if .Values.kbs.gpu.enabled }}
74+
75+
##### GPU Attestation (NVIDIA H100/H200) — CPU-class evidence with GPU data
76+
hardware := 2 if {
77+
input["snp"]
78+
input["gpu"]
79+
}
80+
81+
executables := 3 if {
82+
input["snp"]
83+
input["gpu"]
84+
input.init_data in query_reference_value("init_data")
7485
}
7586
7687
configuration := 2 if {
77-
# input.aztdxvtpm.quote.body.xfam in data.reference.xfam
78-
input.aztdxvtpm
79-
}
88+
input["snp"]
89+
input["gpu"]
90+
}
91+
{{- end }}
92+
{{- if .Values.kbs.gpu.enabled }}
93+
default_gpu.rego: |
94+
package policy
95+
96+
import rego.v1
97+
98+
default hardware := 97
99+
default executables := 33
100+
default configuration := 36
101+
102+
trust_claims := {
103+
"executables": executables,
104+
"hardware": hardware,
105+
"configuration": configuration,
106+
}
107+
108+
hardware := 2 if {
109+
input.nvidia
110+
input.nvidia["x-nvidia-gpu-attestation-report-cert-chain"]["x-nvidia-cert-status"] == "valid"
111+
input.nvidia["x-nvidia-gpu-attestation-report-parsed"]
112+
input.nvidia["x-nvidia-gpu-attestation-report-signature-verified"]
113+
input.nvidia["x-nvidia-gpu-arch-check"]
114+
}
115+
116+
configuration := 2 if {
117+
input.nvidia.secboot
118+
input.nvidia.dbgstat == "disabled"
119+
}
120+
121+
executables := 3 if {
122+
input.nvidia["x-nvidia-gpu-driver-rim-fetched"]
123+
input.nvidia["x-nvidia-gpu-driver-rim-schema-validated"]
124+
input.nvidia["x-nvidia-gpu-driver-rim-signature-verified"]
125+
input.nvidia["x-nvidia-gpu-vbios-rim-fetched"]
126+
input.nvidia["x-nvidia-gpu-vbios-rim-schema-validated"]
127+
input.nvidia["x-nvidia-gpu-vbios-rim-signature-verified"]
128+
input.nvidia.measres == "success"
129+
}
130+
{{- end }}

templates/kbs-config-map.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,24 @@ data:
99
kbs-config.toml: |
1010
[http_server]
1111
sockets = ["0.0.0.0:8080"]
12+
{{- if .Values.kbs.workerCount }}
13+
worker_count = {{ .Values.kbs.workerCount }}
14+
{{- end }}
1215
insecure_http = false
1316
private_key = "/etc/https-key/tls.key"
1417
certificate = "/etc/https-cert/tls.crt"
1518
[admin]
19+
{{- if eq (default "v1.0" .Values.kbs.admin.format) "v1.1" }}
20+
type = "Simple"
21+
insecure_api = false
22+
23+
[[admin.personas]]
24+
id = "admin"
25+
public_key_path = "/etc/auth-secret/publicKey"
26+
{{- else }}
1627
insecure_api = false
1728
auth_public_key = "/etc/auth-secret/publicKey"
29+
{{- end }}
1830
1931
[attestation_token]
2032
insecure_key = false
@@ -43,6 +55,11 @@ data:
4355
[attestation_service.rvps_config.storage]
4456
type = "LocalJson"
4557
file_path = "/opt/confidential-containers/rvps/reference-values/reference-values.json"
58+
{{- if .Values.kbs.gpu.enabled }}
59+
60+
[attestation_service.verifier_config.nvidia_verifier]
61+
type = "Remote"
62+
{{- end }}
4663
4764
[[plugins]]
4865
name = "resource"

templates/reference-values.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@ metadata:
77
annotations:
88
argocd.argoproj.io/sync-wave: "4"
99
data:
10-
reference-values.json: |
11-
[
12-
]
10+
reference-values.json: '[]'
1311
{{ end }}

templates/resource-policy.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ metadata:
88
data:
99
policy.rego: |
1010
package policy
11+
import rego.v1
12+
1113
default allow = false
12-
allow {
13-
input["submods"]["cpu0"]["ear.status"] == "affirming"
14+
15+
allow if {
16+
not any_not_affirming
17+
count(input.submods) > 0
18+
19+
}
20+
21+
any_not_affirming if {
22+
some _, submod in input.submods
23+
submod["ear.status"] != "affirming"
1424
}

templates/rvps-values-policies.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,30 @@ spec:
2020
severity: medium
2121
object-templates-raw: |
2222
{{`{{- $pcr8Hash := fromConfigMap "imperative" "initdata" "PCR8_HASH" -}}`}}
23-
{{`{{- $secretData := (lookup "v1" "Secret" "trustee-operator-system" "pcr-stash").data.json | base64dec | fromJson -}}`}}
23+
{{`{{- $debugPcr8Hash := fromConfigMap "imperative" "debug-initdata" "PCR8_HASH" -}}`}}
24+
{{`{{- $rawHash := fromConfigMap "imperative" "initdata" "RAW_HASH" -}}`}}
25+
{{`{{- $debugRawHash := fromConfigMap "imperative" "debug-initdata" "RAW_HASH" -}}`}}
26+
{{`{{- $rawHashPadded := printf "%s00000000000000000000000000000000" $rawHash -}}`}}
27+
{{`{{- $debugRawHashPadded := printf "%s00000000000000000000000000000000" $debugRawHash -}}`}}
28+
{{`{{- $referenceValues := list (dict "name" "init_data" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr8Hash $debugPcr8Hash $rawHash $debugRawHash $rawHashPadded $debugRawHashPadded)) -}}`}}
29+
{{`{{- $pcrStash := (lookup "v1" "Secret" "trustee-operator-system" "pcr-stash") -}}`}}
30+
{{`{{- if $pcrStash -}}`}}
31+
{{`{{- $secretData := $pcrStash.data.json | base64dec | fromJson -}}`}}
2432
{{`{{- $pcr03 := $secretData.measurements.sha256.pcr03 -}}`}}
2533
{{`{{- $pcr09 := $secretData.measurements.sha256.pcr09 -}}`}}
2634
{{`{{- $pcr11 := $secretData.measurements.sha256.pcr11 -}}`}}
2735
{{`{{- $pcr12 := $secretData.measurements.sha256.pcr12 -}}`}}
28-
{{`{{- $referenceValues := list (dict "name" "snp_pcr03" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr03)) (dict "name" "tdx_pcr03" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr03)) (dict "name" "snp_pcr08" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr8Hash)) (dict "name" "tdx_pcr08" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr8Hash)) (dict "name" "snp_pcr09" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr09)) (dict "name" "tdx_pcr09" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr09)) (dict "name" "snp_pcr11" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr11)) (dict "name" "tdx_pcr11" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr11)) (dict "name" "snp_pcr12" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr12)) (dict "name" "tdx_pcr12" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr12)) -}}`}}
36+
{{`{{- $referenceValues = append $referenceValues (dict "name" "snp_pcr03" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr03)) -}}`}}
37+
{{`{{- $referenceValues = append $referenceValues (dict "name" "tdx_pcr03" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr03)) -}}`}}
38+
{{`{{- $referenceValues = append $referenceValues (dict "name" "snp_pcr08" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr8Hash $debugPcr8Hash)) -}}`}}
39+
{{`{{- $referenceValues = append $referenceValues (dict "name" "tdx_pcr08" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr8Hash $debugPcr8Hash)) -}}`}}
40+
{{`{{- $referenceValues = append $referenceValues (dict "name" "snp_pcr09" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr09)) -}}`}}
41+
{{`{{- $referenceValues = append $referenceValues (dict "name" "tdx_pcr09" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr09)) -}}`}}
42+
{{`{{- $referenceValues = append $referenceValues (dict "name" "snp_pcr11" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr11)) -}}`}}
43+
{{`{{- $referenceValues = append $referenceValues (dict "name" "tdx_pcr11" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr11)) -}}`}}
44+
{{`{{- $referenceValues = append $referenceValues (dict "name" "snp_pcr12" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr12)) -}}`}}
45+
{{`{{- $referenceValues = append $referenceValues (dict "name" "tdx_pcr12" "expiration" "2027-12-12T00:00:00Z" "value" (list $pcr12)) -}}`}}
46+
{{`{{- end -}}`}}
2947
- complianceType: mustonlyhave
3048
objectDefinition:
3149
apiVersion: v1

templates/tdx-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ metadata:
99
data:
1010
sgx_default_qcnl.conf: |
1111
{
12-
"collateral_service": "{{ .Values.kbs.tdx.collateralService }}"
12+
"collateral_service": "{{ .Values.kbs.tdx.collateralService }}",
13+
"use_secure_cert": false
1314
}
1415
{{- end }}

values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ global:
2020

2121
# KBS (Key Broker Service) configuration
2222
kbs:
23+
admin:
24+
# Admin config format: "v1.0" for Trustee 1.0 (auth_public_key),
25+
# "v1.1" for Trustee 1.1+ (type = "Simple" with [[admin.personas]])
26+
format: "v1.0"
27+
2328
# Security policy is an expected secret and is required to be pushed into the KBS
2429
# presumes security policy flavour is signed
2530
cosignKeys: secret/data/hub/coSignKeys
@@ -43,6 +48,17 @@ kbs:
4348
# exist in the trustee-operator-system namespace.
4449
extraSecrets: []
4550

51+
# Number of HTTP worker threads for the KBS server.
52+
# If unset, the KBS binary defaults to one worker per logical CPU core,
53+
# which can cause "too many open files" crashes on high-core-count systems
54+
# where the container's nofile ulimit is lower than the worker count.
55+
# Set this to a reasonable value (e.g., 4-8) on systems with many cores.
56+
# workerCount: 4
57+
58+
# NVIDIA GPU confidential computing configuration
59+
gpu:
60+
enabled: false
61+
4662
# Intel TDX (Trust Domain Extensions) configuration
4763
tdx:
4864
# Enable TDX attestation support

0 commit comments

Comments
 (0)