Skip to content

Commit

Permalink
update skr maa token test Dockerfile to base64url encode MAA request
Browse files Browse the repository at this point in the history
  • Loading branch information
hgarvison committed Nov 21, 2024
1 parent 5562b03 commit 8b7f6b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/skr/Dockerfile.maa_test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM mcr.microsoft.com/cbl-mariner/base/python:3.9
USER root
RUN tdnf update -y && tdnf upgrade -y && tdnf install curl && tdnf clean all
RUN tdnf update -y && tdnf upgrade -y && tdnf install curl coreutils && tdnf clean all
RUN pip install jwcrypto
# create a key for attaching to our request
RUN python3 -c "from jwcrypto import jwk; print(jwk.JWK.generate(kty='RSA', size=2048, alg='RSA256').export_private())" > rsa.jwk
# send request to get token from MAA via SKR container
CMD sh -c 'until curl --fail --silent http://localhost:8080/status; do sleep 5; done; curl --fail-with-body -XPOST http://localhost:8080/attest/maa -d "{\"runtime_data\":\"$(cat rsa.jwk | base64 -w 0)\", \"maa_endpoint\": \"sharedeus2.eus2.test.attest.azure.net\"}"'
CMD sh -c 'until curl --fail --silent http://localhost:8080/status; do sleep 5; done; curl --fail-with-body -XPOST http://localhost:8080/attest/maa -d "{\"runtime_data\":\"$(cat rsa.jwk | basenc --base64url -w 0)\", \"maa_endpoint\": \"sharedeus2.eus2.test.attest.azure.net\"}"'

0 comments on commit 8b7f6b8

Please sign in to comment.