This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support file rather than env based scheme to acquire policy, uvm info…
… and certs. (#23) Support file rather than env based scheme to acquire policy, uvm info and certs. To match microsoft/hcsshim#1708 This PR supports both methods to decouple testing/deployment. There will be a subsequent PR to remove support for the environment variable scheme. --------- Signed-off-by: Ken Gordon <[email protected]>
- Loading branch information
Showing
10 changed files
with
242 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
**.o | ||
/azmount | ||
/remotefs | ||
/tools/get-snp-report/bin | ||
/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM ubuntu:18.04 | ||
RUN apt update | ||
RUN apt install --fix-missing -y net-tools wget curl bc jq bash vim ssh | ||
|
||
# clearly this is extremely insecure but is only for debugging | ||
# do not copy this. | ||
RUN useradd --uid 1000 --gid 0 --non-unique -ms /bin/bash auserwithalongname | ||
RUN echo "auserwithalongname:shortpassword" | chpasswd | ||
RUN mkdir /run/sshd | ||
|
||
# set the start command which will be used by default by ACI | ||
# note that this script exposes attestation on an external port | ||
# NEVER DO THIS IN PRODUCTION as it exposes the attestations | ||
# which can be used to trick an attestation agent or relying party | ||
|
||
COPY ./bin/skr ./bin/get-snp-report ./bin/verbose-report /bin/ | ||
COPY skr.sh skr-debug.sh tests/*_client.sh / | ||
RUN mkdir -p /tests/skr; mv *_client.sh /tests/skr | ||
RUN chmod +x /*.sh /tests/skr/*.sh; date > /made-date | ||
|
||
# set the start command | ||
CMD [ "sleep", "1000000" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
set -e | ||
|
||
# This script builds the binaries and sets up the docker image | ||
|
||
mkdir -p bin | ||
pushd bin | ||
CGO_ENABLED=0 GOOS=linux go build github.com/Microsoft/confidential-sidecar-containers/cmd/skr | ||
popd | ||
|
||
pushd ../../tools/get-snp-report | ||
make | ||
popd | ||
|
||
cp ../../tools/get-snp-report/bin/get-snp-report ./bin | ||
cp ../../tools/get-snp-report/bin/get-fake-snp-report ./bin | ||
cp ../../tools/get-snp-report/bin/verbose-report ./bin | ||
|
||
docker build --tag skr -f Dockerfile.debug . | ||
|
||
# cleanup | ||
rm -rf bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
# Important note: This script is meant to run from inside the container | ||
|
||
echo starting sshd | ||
/usr/sbin/sshd & | ||
|
||
CmdlineArgs="-logfile ./log.txt" | ||
|
||
if [ -z "${SkrSideCarArgs}" ]; then | ||
SkrSideCarArgs=$1 | ||
fi | ||
|
||
echo SkrSideCarArgs = $SkrSideCarArgs | ||
|
||
if [ -n "${SkrSideCarArgs}" ]; then | ||
CmdlineArgs="${CmdlineArgs} -base64 ${SkrSideCarArgs}" | ||
fi | ||
|
||
if [ -z "${Port}" ]; then | ||
Port=$2 | ||
fi | ||
|
||
echo Port = $Port | ||
|
||
if [ -n "${Port}" ]; then | ||
CmdlineArgs="${CmdlineArgs} -port ${Port}" | ||
fi | ||
|
||
echo CmdlineArgs = $CmdlineArgs | ||
|
||
if /bin/skr $CmdlineArgs; then | ||
echo "1" > result | ||
else | ||
echo "0" > result | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.