Skip to content

Commit 799fdcd

Browse files
committed
bundle: add attestation key registration support
Update bundle to include the attestation-key-register service and AttestationKey CRD introduced in commit 2ea74dc. - Add attestation-key-register to CSV relatedImages and alm-examples - Update bundle generation script to handle ATTESTATION_KEY_REGISTER_IMAGE - Add AttestationKey RBAC viewer and admin roles - Update README with new component documentation Signed-off-by: Yalan Zhang <[email protected]>
1 parent e9f98a8 commit 799fdcd

File tree

5 files changed

+81
-9
lines changed

5 files changed

+81
-9
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ within the cluster.
1313
- `/api`: Defines the `TrustedExecutionCluster` Custom Resource Definition (CRD) and associated CRDs and RBAC definitions in Go. Also contains a program to generate a `TrustedExecutionCluster` CR and associated deployment.
1414
- `/operator`: Contains the source code for the Kubernetes operator itself.
1515
- `/register-server`: A server that provides Clevis PINs for key retrieval with random UUIDs.
16+
- `/attestation-key-register`: A server that accepts attestation key registrations from VMs and creates AttestationKey resources.
1617
- `/compute-pcrs`: A program to compute PCR reference values using the [compute-pcrs library](https://github.com/trusted-execution-clusters/compute-pcrs) and insert them into a ConfigMap, run as a Job.
1718
- `/lib`: Shared Rust definitions, including translated CRDs
1819
- `/scripts`: Helper scripts for managing a local `kind` development cluster.
@@ -63,7 +64,7 @@ make REGISTRY=localhost:5000 manifests
6364
make TRUSTEE_ADDR=$ip install
6465
```
6566

66-
The KBS port will be forwarded to `8080` on your machine; the node register server to `8000`, where new Ignition configs are served at `/register`.
67+
The KBS port will be forwarded to `8080` on your machine; the node register server to `8000`, where new Ignition configs are served at `/register`. The attestation-key-register service runs on port `8001` within the cluster for VM attestation key registration.
6768

6869
### Test
6970

@@ -108,7 +109,7 @@ make push-all
108109

109110
**4. Deploy the Bundle**
110111

111-
Deploy the bundle to your cluster. You can install it in any namespace. This guide uses `trusted-execution-clusters` as the example namespace.
112+
Deploy the bundle to your cluster. You can install it in any namespace.
112113

113114
```bash
114115
# Example: Install in namespace 'trusted-execution-clusters'
@@ -141,8 +142,6 @@ yq -i '.spec.publicTrusteeAddr = "'$TRUSTEE_ADDR':8080"' \
141142
# Apply the configured CRs
142143
kubectl apply -f config/deploy/trusted_execution_cluster_cr.yaml
143144
kubectl apply -f config/deploy/approved_image_cr.yaml
144-
sed 's/<NAMESPACE>/trusted-execution-clusters/g' kind/kbs-forward.yaml | kubectl apply -f -
145-
sed 's/<NAMESPACE>/trusted-execution-clusters/g' kind/register-forward.yaml | kubectl apply -f -
146145
```
147146
148147
#### **Cleaning Up the Bundle Deployment**

bundle/static/manifests/trusted-cluster-operator.clusterserviceversion.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ metadata:
1515
"name": "example-trustedexecutioncluster"
1616
},
1717
"spec": {
18-
"trusteeImage": "quay.io/trusted-execution-clusters/key-broker-service:tpm-verifier-built-in-as-20250711",
18+
"trusteeImage": "quay.io/trusted-execution-clusters/key-broker-service:20260106",
1919
"pcrsComputeImage": "quay.io/trusted-execution-clusters/compute-pcrs:0.1.0",
2020
"registerServerImage": "quay.io/trusted-execution-clusters/registration-server:0.1.0",
21-
"publicTrusteeAddr": "<trustee-address>"
21+
"attestationKeyRegisterImage": "quay.io/trusted-execution-clusters/attestation-key-register:0.1.0",
22+
"publicTrusteeAddr": "kbs-service.trusted-execution-clusters.svc.cluster.local:8080"
2223
}
2324
},
2425
{
@@ -28,7 +29,7 @@ metadata:
2829
"name": "example-approvedimage"
2930
},
3031
"spec": {
31-
"image": "quay.io/fedora/fedora-coreos@sha256:e71dad00aa0e3d70540e726a0c66407e3004d96e045ab6c253186e327a2419e5"
32+
"image": "quay.io/fedora/fedora-coreos@sha256:8f11c87187dfe83145001e9571948f9ab466e9f4a8b1e092a4798e5db1030dc3"
3233
}
3334
}
3435
]
@@ -65,8 +66,10 @@ spec:
6566
image: quay.io/trusted-execution-clusters/compute-pcrs:0.1.0
6667
- name: registration-server
6768
image: quay.io/trusted-execution-clusters/registration-server:0.1.0
69+
- name: attestation-key-register
70+
image: quay.io/trusted-execution-clusters/attestation-key-register:0.1.0
6871
- name: trustee
69-
image: quay.io/trusted-execution-clusters/key-broker-service:tpm-verifier-built-in-as-20250711
72+
image: quay.io/trusted-execution-clusters/key-broker-service:20260106
7073
install:
7174
strategy: deployment
7275
spec:
@@ -151,3 +154,8 @@ spec:
151154
kind: ApprovedImage
152155
displayName: Approved Image
153156
description: Represents a container image approved for execution.
157+
- name: attestationkeys.trusted-execution-clusters.io
158+
version: v1alpha1
159+
kind: AttestationKey
160+
displayName: Attestation Key
161+
description: Represents an attestation key to be registered with the trustee.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-FileCopyrightText: Generated by kubebuilder
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
# This rule is not used by the project trusted-cluster-operator itself.
6+
# It is provided to allow the cluster admin to help manage permissions for users.
7+
#
8+
# Grants full permissions ('*') over trusted-execution-clusters.io.
9+
# This role is intended for users authorized to modify roles and bindings within the cluster,
10+
# enabling them to delegate specific permissions to other users or groups as needed.
11+
12+
apiVersion: rbac.authorization.k8s.io/v1
13+
kind: ClusterRole
14+
metadata:
15+
labels:
16+
app.kubernetes.io/name: trusted-cluster-operator
17+
app.kubernetes.io/managed-by: kustomize
18+
name: attestationkey-admin-role
19+
rules:
20+
- apiGroups:
21+
- trusted-execution-clusters.io
22+
resources:
23+
- attestationkeys
24+
verbs:
25+
- '*'
26+
- apiGroups:
27+
- trusted-execution-clusters.io
28+
resources:
29+
- attestationkeys/status
30+
verbs:
31+
- get
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# SPDX-FileCopyrightText: Generated by kubebuilder
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
# This rule is not used by the project trusted-cluster-operator itself.
6+
# It is provided to allow the cluster admin to help manage permissions for users.
7+
#
8+
# Grants read-only access to trusted-execution-clusters.io resources.
9+
# This role is intended for users who need visibility into these resources
10+
# without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.
11+
12+
apiVersion: rbac.authorization.k8s.io/v1
13+
kind: ClusterRole
14+
metadata:
15+
labels:
16+
app.kubernetes.io/name: trusted-cluster-operator
17+
app.kubernetes.io/managed-by: kustomize
18+
name: attestationkey-viewer-role
19+
rules:
20+
- apiGroups:
21+
- trusted-execution-clusters.io
22+
resources:
23+
- attestationkeys
24+
verbs:
25+
- get
26+
- list
27+
- watch
28+
- apiGroups:
29+
- trusted-execution-clusters.io
30+
resources:
31+
- attestationkeys/status
32+
verbs:
33+
- get

scripts/generate-bundle-prod.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ done
2222
[[ -z "$BUNDLE_VERSION" ]] && { echo "Error: bundle version cannot be empty"; exit 1; }
2323

2424
# Required environment variables
25-
for var in OPERATOR_IMAGE COMPUTE_PCRS_IMAGE REG_SERVER_IMAGE TRUSTEE_IMAGE; do
25+
for var in OPERATOR_IMAGE COMPUTE_PCRS_IMAGE REG_SERVER_IMAGE ATTESTATION_KEY_REGISTER_IMAGE TRUSTEE_IMAGE; do
2626
: "${!var:?Please export $var}"
2727
done
2828

@@ -67,6 +67,7 @@ yq -i ".spec.install.spec.deployments[0].spec.template.spec.containers[0].image
6767
yq -i "(.spec.relatedImages[] | select(.name == \"trusted-cluster-operator\")).image = \"${OPERATOR_IMAGE}\"" "$CSV_FILE"
6868
yq -i "(.spec.relatedImages[] | select(.name == \"compute-pcrs\")).image = \"${COMPUTE_PCRS_IMAGE}\"" "$CSV_FILE"
6969
yq -i "(.spec.relatedImages[] | select(.name == \"registration-server\")).image = \"${REG_SERVER_IMAGE}\"" "$CSV_FILE"
70+
yq -i "(.spec.relatedImages[] | select(.name == \"attestation-key-register\")).image = \"${ATTESTATION_KEY_REGISTER_IMAGE}\"" "$CSV_FILE"
7071
yq -i "(.spec.relatedImages[] | select(.name == \"trustee\")).image = \"${TRUSTEE_IMAGE}\"" "$CSV_FILE"
7172

7273
# Patch RBAC rules

0 commit comments

Comments
 (0)