Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sgx): put all python packages into trusted_files #1095

Merged
merged 8 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions deploy/scripts/sgx/get_token.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
#!/bin/bash

cd /gramine/CI-Examples/generate-token/
make clean > /dev/null
export SGX=1
export SGX_SIGNER_KEY=/root/.config/gramine/enclave-key.pem
make all > /dev/null
if [ $? -eq 0 ]; then
gramine-sgx-get-token -s python.sig -o /dev/null
fi
make clean > /dev/null
function get_token(){
local need_clean=0
cd /gramine/CI-Examples/generate-token/
make clean > /dev/null
export SGX=1
export SGX_SIGNER_KEY=/root/.config/gramine/enclave-key.pem

# mkdir and make
if [ ! -d "/gramine/leader" ] || [ ! -d "/gramine/follower" ]; then
mkdir -p /gramine/leader
mkdir -p /gramine/follower
need_clean=1
fi
make all > /dev/null
if [ $? -eq 0 ]; then
gramine-sgx-get-token -s python.sig -o /dev/null
fi

# clean
make clean > /dev/null
if [ $need_clean==1 ]; then
rm -rf /gramine/leader
rm -rf /gramine/follower
fi
cd -
}

get_token
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ sgx.trusted_files = [
"file:/usr/{{ arch_libdir }}/",
"file:/etc/ssl/certs/ca-certificates.crt",
"file:/etc/default/apport",
"file:/usr/local/lib/",
"file:{{ python.stdlib }}/",
"file:{{ python.distlib }}/",
"file:/etc/mime.types",
"file:/gramine/leader/",
"file:/gramine/follower/"
Expand All @@ -76,8 +79,6 @@ sgx.allowed_files = [
"file:tensorflow_io.py",
"file:/opt/tiger/",
"file:/opt/meituan/",
"file:{{ python.stdlib }}/",
"file:{{ python.distlib }}/",
"file:/usr/lib/ssl/openssl.cnf",
"file:/usr/lib/gcc",
"file:/etc/ethers",
Expand All @@ -99,7 +100,6 @@ sgx.allowed_files = [
"file:/root/.keras/keras.json",
"file:dynamic_config.json",
"file:/usr/bin/",
"file:/usr/local/lib",
"file:/lib/",
"file:/bin/",
"file:/data/",
Expand Down
Loading