Skip to content

Commit

Permalink
install-helper: Add DCAP support for coco-as deployments
Browse files Browse the repository at this point in the history
Not using ITA is also an option for Intel TDX machines, and when not
using ITA we can rely on DCAP and the CoCo AS to deal with the
attestation.  For this case, the changes here is what's needed.

Signed-off-by: Fabiano Fidêncio <[email protected]>
  • Loading branch information
fidencio committed Jan 10, 2025
1 parent ddec700 commit a83e8ff
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 18 deletions.
2 changes: 1 addition & 1 deletion scripts/install-helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You can edit the `resource-policy` configMap and set `default allow = true`.
Create the TDX configmap

```sh
oc apply -f tdx-cm.yaml
oc apply -f tdx-coco-as-cm.yaml
```

Update the KbsConfig CR
Expand Down
32 changes: 26 additions & 6 deletions scripts/install-helpers/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ OCP_PULL_SECRET_LOCATION="${OCP_PULL_SECRET_LOCATION:-$HOME/pull-secret.json}"
MIRRORING=false
ADD_IMAGE_PULL_SECRET=false
GA_RELEASE=true
TDX=${TDX:-false}
ITA_KEY="${ITA_KEY:-}"
if [ -n "$ITA_KEY" ]; then
TDX=true
fi
DEFAULT_IMAGE=quay.io/openshift_sandboxed_containers/kbs:v0.10.1
if [ -n "$ITA_KEY" ]; then
DEFAULT_IMAGE+="-ita"
Expand Down Expand Up @@ -129,13 +133,21 @@ function create_trustee_artefacts() {
local kbs_cm="kbs-cm.yaml"
local rvps_cm="rvps-cm.yaml"
local resource_policy_cm="resource-policy-cm.yaml"
local tdx_coco_as_cm=""
local config="kbsconfig.yaml"
if [ -n "$ITA_KEY" ]; then
kbs_cm="tdx-ita-$kbs_cm"
resource_policy_cm="tdx-ita-$resource_policy_cm"
config="tdx-ita-$config"

sed -i -e "s/tBfd5kKX2x9ahbodKV1.../${ITA_KEY}/g" $kbs_cm
if [ "$TDX" = "true" ]; then
if [ -n "$ITA_KEY" ]; then
kbs_cm="tdx-ita-$kbs_cm"
resource_policy_cm="tdx-ita-$resource_policy_cm"
config="tdx-ita-$config"

sed -i -e "s/tBfd5kKX2x9ahbodKV1.../${ITA_KEY}/g" $kbs_cm
else
tdx_coco_as_cm="tdx-coco-as-cm.yaml"

sed -i -e "s/\# tdxConfigSpec/tdxConfigSpec/g" $config
sed -i -e "s/\# kbsTdxConfigMapName/ kbsTdxConfigMapName/g" $config
fi
fi

# Create secret
Expand Down Expand Up @@ -169,6 +181,11 @@ function create_trustee_artefacts() {
echo "Secret kbsres1 already exists, skipping creation"
fi

# Create TDX configmap
if [ -n "$tdx_coco_as_cm" ]; then
oc apply -f "$tdx_coco_as_cm" || return 1
fi

# Create KBSConfig
oc apply -f "$config" || return 1

Expand Down Expand Up @@ -272,6 +289,9 @@ function display_help() {
echo "# Install the GA operator with ITA support"
echo " ITA_KEY="tBfd5kKX2x9ahbodKV1..." ./install.sh"
echo " "
echo "# Install the GA operator with DCAP support"
echo " TDX=true ./install.sh"
echo " "
echo "# Install the GA operator with image mirroring"
echo " ./install.sh -m"
echo " "
Expand Down
11 changes: 0 additions & 11 deletions scripts/install-helpers/tdx-cm.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions scripts/install-helpers/tdx-coco-as-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: tdx-config
namespace: trustee-operator-system
data:
sgx_default_qcnl.conf: |
{
"pccs_url": "https://pccs-service.intel-dcap:8042/sgx/certification/v4/",
"use_secure_cert": false,
"retry_times": 6,
"retry_delay": 10,
"pck_cache_expire_hours": 168,
"verify_collateral_cache_expire_hours": 168,
"local_cache_only": false
}

0 comments on commit a83e8ff

Please sign in to comment.