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

Update dm-verity as a separate layer #1

Merged
merged 54 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c200317
allowPriviledgeEscalation is behind a feature flag and not generally …
KenGordon Aug 2, 2023
1479ea9
Copy attestation container (#17)
DomAyre Aug 9, 2023
0e96f81
Update alpine (#28)
BryceDFisher Aug 18, 2023
73ac8bd
Reduce docker layers (#27)
BryceDFisher Aug 18, 2023
2b8adb0
Update key release api version to 7.4 (#22)
BryceDFisher Aug 18, 2023
58cd9a8
Update sidecar version in example ARM templates (#31)
DomAyre Aug 23, 2023
aa50f38
Push all images when vendor is modified (#29)
DomAyre Aug 23, 2023
60a36a6
Sanitise branch names for image tags (#32)
DomAyre Aug 24, 2023
6df8c74
Bump golang.org/x/crypto from 0.0.0-20201217014255-9d1352758620 to 0.…
dependabot[bot] Aug 24, 2023
c8be9e1
Revert "Bump golang.org/x/crypto from 0.0.0-20201217014255-9d13527586…
DomAyre Aug 24, 2023
8dda9ee
Fix image tag name for attestation on push (#35)
DomAyre Aug 24, 2023
e86441b
Output attestation reports as Hex (#37)
DomAyre Aug 29, 2023
1fd438b
Bump github.com/lestrrat-go/jwx from 1.2.7 to 1.2.26 (#3)
dependabot[bot] Aug 31, 2023
a6c92f0
Bump github.com/gin-gonic/gin from 1.7.7 to 1.9.1 (#4)
dependabot[bot] Aug 31, 2023
ce3a8f4
Prevent sanitised tags being cleaned up (#44)
DomAyre Sep 4, 2023
5e58ee2
Update mHSM api to 7.4 (#33)
BryceDFisher Sep 4, 2023
e3f25c9
Get attestation report with kernel 6.x using Go (#43)
takuro-sato Sep 4, 2023
8224e57
Allow push image workflows to be run manually (#45)
DomAyre Sep 5, 2023
7d92a8a
Feature/importkey octfile (#38)
SethHollandsworth Sep 5, 2023
fc14629
incorporate aasp container
stevendongatmsft Sep 5, 2023
d71d394
remove host_data related code and improve readme
stevendongatmsft Sep 12, 2023
3e3d23e
fix pipeline
stevendongatmsft Sep 13, 2023
dc34755
update readme sample template
stevendongatmsft Sep 13, 2023
ad3230d
read/write encrypted filesystem (#24)
hgarvison Sep 20, 2023
745b35e
updating encfs readmes (#51)
hgarvison Sep 27, 2023
3732c3d
remove unnecessary logging (#47)
stevendongatmsft Sep 29, 2023
7b8de1a
Adding Hello World Example (#52)
hgarvison Oct 3, 2023
72ce013
Simplify AASP container docker build (#48)
BryceDFisher Oct 3, 2023
6db94ce
fixed typo in logging flags for skr (#53)
ksayid Oct 5, 2023
edbec72
update alpine version and golang dependencies (#57)
hgarvison Oct 24, 2023
a985415
updating docs for new skr/encfs builds (#58)
hgarvison Oct 25, 2023
2c76c71
removing hello world aks example (#59)
hgarvison Oct 26, 2023
e5ef0a4
Code Refactor (#54)
stevendongatmsft Oct 31, 2023
ff1c0b2
update encfs readme (#60)
stevendongatmsft Nov 1, 2023
82e4c03
update generatefs.sh to revert changes (#63)
stevendongatmsft Nov 2, 2023
8829d7d
making import key tool work on Windows (#61)
hgarvison Nov 3, 2023
f86f070
fixing nonexistent paths (#64)
hgarvison Nov 6, 2023
56a5298
revert hexstring.py script removal change (#65)
stevendongatmsft Nov 6, 2023
46f1931
apk upgrade for openssl (#66)
hgarvison Nov 6, 2023
e9b887f
adding SKR troubleshooting guide (#62)
hgarvison Nov 9, 2023
d3edffe
improve doc explaining salt part (#68)
stevendongatmsft Nov 10, 2023
9ae3e82
initial push to consolidate away aasp container (#67)
SethHollandsworth Nov 13, 2023
d1731e5
Merge remote-tracking branch 'upstream/main'
Jinnan-Guo Nov 27, 2023
759a88a
Remove Verbose Code
Jinnan-Guo Nov 27, 2023
8ef50d5
Add dm-verity info parsing
Jinnan-Guo Nov 28, 2023
b684b36
Update dm-verity as a upper layer of dm-crypt
Jinnan-Guo Nov 28, 2023
752309b
Fix typo
Jinnan-Guo Nov 28, 2023
9c0c678
Fix bug on opening crypt device
Jinnan-Guo Nov 28, 2023
9960776
Remove deprecated functions
Jinnan-Guo Nov 28, 2023
276be82
Fix typo
Jinnan-Guo Nov 28, 2023
665951d
Fix argument mismatch
Jinnan-Guo Nov 28, 2023
4515aae
Add dm-verity in example/encfs
Jinnan-Guo Nov 28, 2023
61cb48a
Update remotefs readme for dm-verity
Jinnan-Guo Nov 28, 2023
def0455
Update encfs example README
Jinnan-Guo Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.19"

- name: Go Build
run: go build -v ./...

- name: Go Tests
run: go test -v ./...
run: |
# Can't use `go test -v ./...` because some of the tests depend on SEV-SNP or Confidential ACI features
go test -v ./... -tags skip_e2e,skip_snp_required


4 changes: 2 additions & 2 deletions .github/workflows/cleanup_registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
REGISTRY_NAME: ${{ secrets.REGISTRY_NAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
repos=("skr" "skr_debug" "encfs")
branches=$(git ls-remote --heads origin)
repos=("skr" "skr_debug" "encfs" "attestation")
branches=$(git ls-remote --heads origin | sed 's/[^a-zA-Z0-9]/-/g')

# Delete any tags which don't have a corresponding branch
for repo in "${repos[@]}"; do
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/push_attestation_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Push Attestation Image

on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- .github/workflows/push_attestation_image.yml
- cmd/attestation-container/**
- docker/attestation-container/**
- pkg/attest
- pkg/common
- vendor/**
- internal/**

push:
branches:
- main
paths:
- .github/workflows/push_attestation_image.yml
- cmd/attestation-container/**
- docker/attestation-container/**
- pkg/attest
- pkg/common
- vendor/**
- internal/**

jobs:
push-attestation-image:
name: Push Attestation Image
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Azure Container Registry
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_NAME }}.${{ secrets.REGISTRY_DOMAIN }}
username: ${{ secrets.REGISTRY_NAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Get Image Tag
id: get_image_tag
run: |
if [ ${{ github.event_name }} == "push" ]; then
branch_name=main
elif [ ${{ github.event_name }} == "workflow_dispatch" ]; then
branch_name=${{ github.ref }}
branch_name=${branch_name:11}
else
branch_name=${{ github.head_ref }}
fi
echo "image_tag=$(echo ${branch_name:0:128} | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_OUTPUT

- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
file: docker/attestation-container/Dockerfile.run
push: true
tags: |
${{ secrets.REGISTRY_NAME }}.${{ secrets.REGISTRY_DOMAIN }}/attestation:${{ steps.get_image_tag.outputs.image_tag }}
22 changes: 15 additions & 7 deletions .github/workflows/push_encfs_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ on:
- cmd/azmount/**
- cmd/remotefs/**
- docker/encfs/**
- tools/get-snp-report/bin/get-snp-report
- tools/get-snp-report/bin/get-fake-snp-report
- tools/get-snp-report/**
- vendor/**
- internal/**
- pkg/**
push:
branches:
- main
Expand All @@ -20,14 +22,16 @@ on:
- cmd/azmount/**
- cmd/remotefs/**
- docker/encfs/**
- tools/get-snp-report/bin/get-snp-report
- tools/get-snp-report/bin/get-fake-snp-report
- tools/get-snp-report/**
- vendor/**
- internal/**
- pkg/**

jobs:
push-encfs-image:
name: Push Encrypted FS Image
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -46,11 +50,15 @@ jobs:
run: |
if [ ${{ github.event_name }} == "push" ]; then
branch_name=main
elif [ ${{ github.event_name }} == "workflow_dispatch" ]; then
branch_name=${{ github.ref }}
branch_name=${branch_name:11}
else
branch_name=$(echo ${{ github.head_ref }})
branch_name=${{ github.head_ref }}
fi
image_tag=$(echo ${branch_name:0:128} | sed 's/[^a-zA-Z0-9]/-/g')
docker/encfs/push.sh \
${{ secrets.REGISTRY_NAME }} \
${{ secrets.REGISTRY_DOMAIN }} \
encfs:$branch_name \
encfs:$image_tag \
--skip-login
32 changes: 19 additions & 13 deletions .github/workflows/push_skr_debug_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,28 @@ on:
- .github/workflows/push_skr_debug_image.yml
- cmd/skr/**
- docker/skr/**
- tools/get-snp-report/bin/get-snp-report
- tools/get-snp-report/bin/get-fake-snp-report
- tools/get-snp-report/bin/verbose-report

- tools/get-snp-report/**
- vendor/**
- internal/**
- pkg/**

push:
branches:
- main
paths:
- .github/workflows/push_skr_debug_image.yml
- cmd/skr/**
- docker/skr/**
- tools/get-snp-report/bin/get-snp-report
- tools/get-snp-report/bin/get-fake-snp-report
- tools/get-snp-report/bin/verbose-report

- tools/get-snp-report/**
- vendor/**
- internal/**
- pkg/**

jobs:
push-skr-debug-image:
push-skr-debug-image:
name: Push SKR Debug Image
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -42,16 +44,20 @@ jobs:

- name: Build Image
run: docker/skr/build-debug.sh

- name: Push Image
run: |
if [ ${{ github.event_name }} == "push" ]; then
branch_name=main
elif [ ${{ github.event_name }} == "workflow_dispatch" ]; then
branch_name=${{ github.ref }}
branch_name=${branch_name:11}
else
branch_name=$(echo ${{ github.head_ref }})
branch_name=${{ github.head_ref }}
fi
image_tag=$(echo ${branch_name:0:128} | sed 's/[^a-zA-Z0-9]/-/g')
docker/skr/push.sh \
${{ secrets.REGISTRY_NAME }} \
${{ secrets.REGISTRY_DOMAIN }} \
skr_debug:$branch_name \
skr_debug:$image_tag \
--skip-login
22 changes: 15 additions & 7 deletions .github/workflows/push_skr_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ on:
- .github/workflows/push_skr_image.yml
- cmd/skr/**
- docker/skr/**
- tools/get-snp-report/bin/get-snp-report
- tools/get-snp-report/bin/get-fake-snp-report
- tools/get-snp-report/**
- vendor/**
- internal/**
- pkg/**

push:
branches:
Expand All @@ -19,14 +21,16 @@ on:
- .github/workflows/push_skr_image.yml
- cmd/skr/**
- docker/skr/**
- tools/get-snp-report/bin/get-snp-report
- tools/get-snp-report/bin/get-fake-snp-report
- tools/get-snp-report/**
- vendor/**
- internal/**
- pkg/**

jobs:
push-skr-image:
name: Push SKR Image
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -45,11 +49,15 @@ jobs:
run: |
if [ ${{ github.event_name }} == "push" ]; then
branch_name=main
elif [ ${{ github.event_name }} == "workflow_dispatch" ]; then
branch_name=${{ github.ref }}
branch_name=${branch_name:11}
else
branch_name=$(echo ${{ github.head_ref }})
branch_name=${{ github.head_ref }}
fi
image_tag=$(echo ${branch_name:0:128} | sed 's/[^a-zA-Z0-9]/-/g')
docker/skr/push.sh \
${{ secrets.REGISTRY_NAME }} \
${{ secrets.REGISTRY_DOMAIN }} \
skr:$branch_name \
skr:$image_tag \
--skip-login
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Create Release

on:
push:
branches:
- main
tags:
- '*'
paths:
- .github/workflows/release.yml
- tools/get-snp-report/**
- tools/importkey/**
- pkg/common/akv.go
- pkg/common/keyblob.go

env:
GO_VERSION: "1.19.x"

jobs:
build:
name: Build Binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Build Linux Executables
run: |
pushd tools/get-snp-report && make && popd
cp -a tools/get-snp-report/bin/* .
go build ./tools/importkey
go build ./cmd/skr

- name: Build Windows Executables
run: |
go build ./tools/importkey
env:
GOOS: windows
GOARCH: amd64

- name: Upload Executables
uses: actions/upload-artifact@v3
with:
name: binaries
path: |
get-snp-report
verbose-report
importkey.exe
importkey
skr

create_release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: binaries

- name: Publish release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
files: |
get-snp-report
verbose-report
importkey.exe
importkey
skr
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/docker/skr/bin
/docker/encfs/bin
/tools/get-snp-report/bin
.vscode
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The skr sidecar can be queried by application containers hosted in the same pod
The ``examples/skr`` shows an example of how the skr sidecar can be deployed and tested within a confidential container group on ACI.

## Fetching an attestion report.
``tools/get-snp-report provides a tool which will return an SNP attestation report from the AMD PSP via linux IOCTLs. it can take a hex encoded report data value on the command line. The output is a hex encoded binary object. If piped through hex2report it can be read by people. There are two implementations inside the one tool to support the different IOCTLs requirements between linux 5.15 and 6.1 and later.
``tools/get-snp-report`` provides a tool which will return an SNP attestation report from the AMD PSP via linux IOCTLs. it can take a hex encoded report data value on the command line. The output is a hex encoded binary object. If piped through hex2report it can be read by people. There are two implementations inside the one tool to support the different IOCTLs requirements between linux 5.15 and 6.1 and later.

### Third-party code
We modified the [AES unwrap key without padding method](https://github.com/NickBall/go-aes-key-wrap/blob/master/keywrap.go) to implement the aes key unwrap with padding method.
Expand All @@ -23,6 +23,7 @@ The ``docker/encfs/build.sh`` script builds all necessary Go tools (for encrypte
The encrypted filesystem sidecar uses the SKR library to release key material from Azure Key Vault instances required for mounting the encrypted filesystems required by the application.

The ``examples/encfs`` shows an example of how the encrypted filesystem sidecar can be deployed within a confidential container group on ACI.

## Dependencies:
- Golang 1.19 or later
- Docker
Expand Down
2 changes: 1 addition & 1 deletion buildall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ popd

echo building get-snp-report
pushd tools/get-snp-report
make
make
popd
cp tools/get-snp-report/bin/get-snp-report ./bin
cp tools/get-snp-report/bin/get-fake-snp-report ./bin
Expand Down
1 change: 1 addition & 0 deletions cmd/attestation-container/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.test
3 changes: 3 additions & 0 deletions cmd/attestation-container/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
attestation-container
attestation-container.test
attest/attest.test
Loading
Loading