Skip to content

Commit

Permalink
Update docker compose deployment to support configfs-tsm
Browse files Browse the repository at this point in the history
Signed-off-by: Hao, Ruomeng <[email protected]>
  • Loading branch information
ruomengh authored and Ruoyu-y committed May 13, 2024
1 parent 74d8313 commit 78c9497
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 9 additions & 1 deletion deployment/docker-compose/configs/ccnp-compose.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ services:
chmod -R 0444 /run/firmware/acpi/tables/data/CCEL &&
chmod -R 0444 /run/kernel/security/integrity/ima/ascii_runtime_measurements &&
chmod -R 0757 /run/ccnp/uds &&
chmod -R 0444 /etc/tdx-attest.conf"
chmod -R 0444 /etc/tdx-attest.conf &&
chmod -R 0757 /run/kernel/config/tsm/report/ccnp &&
chmod -R 0666 /run/kernel/config/tsm/report/ccnp/inblob"
volumes:
- /sys/firmware/acpi/tables/CCEL:/run/firmware/acpi/tables/CCEL
- /sys/firmware/acpi/tables/data/CCEL:/run/firmware/acpi/tables/data/CCEL
- /sys/kernel/security/integrity/ima/ascii_runtime_measurements:/run/kernel/security/integrity/ima/ascii_runtime_measurements
- /run/ccnp/uds:/run/ccnp/uds
- /etc/tdx-attest.conf:/etc/tdx-attest.conf
- /sys/kernel/config/tsm/report/ccnp:/run/kernel/config/tsm/report/ccnp
- /sys/kernel/config/tsm/report/ccnp/inblob:/run/kernel/config/tsm/report/ccnp/inblob

ccnp-server:
image: #CCNP_SERVER_IMAGE
Expand All @@ -36,6 +40,10 @@ services:
- /sys/kernel/security/integrity/ima/ascii_runtime_measurements:/run/kernel/security/integrity/ima/ascii_runtime_measurements
- /run/ccnp/uds:/run/ccnp/uds
- /etc/tdx-attest.conf:/etc/tdx-attest.conf
- /sys/kernel/config/tsm/report/ccnp:/run/kernel/config/tsm/report/ccnp
- /sys/kernel/config/tsm/report/ccnp/inblob:/run/kernel/config/tsm/report/ccnp/inblob
environment:
- TSM_REPORT=/run/kernel/config/tsm/report/ccnp
devices:
- #DEV_TDX:#DEV_TDX
security_opt:
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions deployment/docker-compose/exec-ccnp-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ validate_on_container() {
info "Execute example Container ccnp-example"
ctr_id=$(docker ps | grep ccnp-example-ctr | awk '{print $1}')
if [[ "$ctr_id" == "" ]]; then
info "Example Container No Avaliable. Attempt Deploy It"
info "Example Container is NOT Avaliable. Deploying Example Container"
sed "s@\#EXAMPLE_IMAGE@$EXAMPLE_IMAGE@g" "$CONFIG_DIR"/ccnp-example.yaml.template \
> "$COMPOSE_CACHE_DIR"/ccnp-example.yaml
sed -i "s@\#DEV_TDX@$DEV_TDX@g" "$COMPOSE_CACHE_DIR"/ccnp-example.yaml
Expand All @@ -79,25 +79,25 @@ validate_on_container() {

ctr_id=$(docker ps | grep ccnp-example-ctr | awk '{print $1}')
if [[ "$ctr_id" == "" ]]; then
error "Example Container Deploy Failed"
error "Fail to deploy Example Container"
fi

ok "Example Container Avaliable. Compose file: $COMPOSE_CACHE_DIR/ccnp-example.yaml"
ok "=============== Get Measurement ==============="
docker exec -it "$ctr_id" python3 py_sdk_example.py -m > "$CCNP_CACHE_DIR"/example.log
ok "Measurement Log Saved in File $CCNP_CACHE_DIR/example.log"
ok "Measurement is saved in file $CCNP_CACHE_DIR/example.log"

ok "=============== Get Event Logs ==============="
docker exec -it "$ctr_id" python3 py_sdk_example.py -e >> "$CCNP_CACHE_DIR"/example.log
ok "Eventlog Saved in File $CCNP_CACHE_DIR/example.log"
ok "Eventlog is saved in file $CCNP_CACHE_DIR/example.log"

ok "=============== Get CC Report ==============="
docker exec -it "$ctr_id" python3 py_sdk_example.py -r >> "$CCNP_CACHE_DIR"/example.log
ok "Eventlog Saved in File $CCNP_CACHE_DIR/example.log"
ok "CC Report is saved in file $CCNP_CACHE_DIR/example.log"

ok "=============== Verify Event Logs ==============="
docker exec -it "$ctr_id" python3 py_sdk_example.py -v >> "$CCNP_CACHE_DIR"/example.log
ok "Eventlog Saved in File $CCNP_CACHE_DIR/example.log"
ok "Eventlog is verified in file $CCNP_CACHE_DIR/example.log"
}

process_args "$@"
Expand Down

0 comments on commit 78c9497

Please sign in to comment.