-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
91 changed files
with
4,160 additions
and
482 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
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,67 @@ | ||
--- | ||
name: Docker KMS SGX | ||
|
||
on: | ||
workflow_call: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
REGISTRY_IMAGE: ghcr.io/cosmian/enclave-kms-insecure | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: [self-hosted, sgx] | ||
defaults: | ||
run: | ||
working-directory: ci/sgx/ | ||
container: docker:19.03.15 | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v1 | ||
|
||
- name: Login to GitHub Packages | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ env.REGISTRY_IMAGE }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# Specify staging features to use Let's Encrypt staging environment in order to be able to request more than 5 certificates by week | ||
# Documentation : https://letsencrypt.org/docs/duplicate-certificate-limit/ | ||
- name: Build and tag docker container | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: ./ci/sgx/Dockerfile.sgx | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
network: host | ||
build-args: | | ||
FEATURES=--features staging | ||
outputs: | ||
image-tag: ${{ steps.meta.outputs.version }} | ||
|
||
tests: | ||
needs: | ||
- build-and-push-image | ||
uses: ./.github/workflows/docker_kms_sgx_tests.yml | ||
secrets: inherit | ||
with: | ||
kms-version: ${{ needs.build-and-push-image.outputs.image-tag }} |
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,63 @@ | ||
--- | ||
name: KMS SGX tests | ||
|
||
env: | ||
KMS_USE_BOOTSTRAP_SERVER: true | ||
KMS_USE_CERTBOT: true | ||
KMS_CERTBOT_HOSTNAME: kms.sgx.ci.cosmian.dev | ||
KMS_CERTBOT_EMAIL: [email protected] | ||
KMS_CERTBOT_USE_TEE_KEY: abcdef0123456789 | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
kms-version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
|
||
run_and_test: | ||
|
||
services: | ||
kms: | ||
image: ghcr.io/cosmian/enclave-kms-insecure:${{ inputs.kms-version }} | ||
|
||
runs-on: [self-hosted, sgx] | ||
steps: | ||
- name: Docker start container | ||
run: | | ||
docker run \ | ||
--device /dev/sgx_enclave \ | ||
--device /dev/sgx_provision \ | ||
-e KMS_USE_BOOTSTRAP_SERVER="${{ env.KMS_USE_BOOTSTRAP_SERVER }}" \ | ||
-e KMS_USE_CERTBOT="${{ env.KMS_USE_CERTBOT }}" \ | ||
-e KMS_CERTBOT_HOSTNAME="${{ env.KMS_CERTBOT_HOSTNAME }}" \ | ||
-e KMS_CERTBOT_EMAIL="${{ env.KMS_CERTBOT_EMAIL }}" \ | ||
-e KMS_CERTBOT_USE_TEE_KEY="${{ env.KMS_CERTBOT_USE_TEE_KEY }}" \ | ||
-v /var/run/aesmd:/var/run/aesmd/ \ | ||
-v /opt/cosmian-internal:/opt/cosmian-internal \ | ||
-p 80:80 \ | ||
-p 9998:9998 \ | ||
-d --rm --name enclave-kms-insecure ghcr.io/cosmian/enclave-kms-insecure:${{ inputs.kms-version }} | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
|
||
- name: Install ckms | ||
run: cargo install --locked --path crate/cli | ||
|
||
- name: Bootstrap | ||
run: | | ||
KMS_CLI_CONF=ci/sgx/kms-test-ci.json ckms bootstrap-start --sqlite-path private_data/ --database-type sqlite | ||
sleep 20 | ||
- name: Verify | ||
run: KMS_CLI_CONF=ci/sgx/kms-test-ci.json ckms verify | ||
|
||
- name: Symmetric key create | ||
run: KMS_CLI_CONF=ci/sgx/kms-test-ci.json ckms sym keys create | ||
|
||
- name: Docker stop container | ||
if: success() || failure() | ||
run: docker stop enclave-kms-insecure |
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.