Skip to content

Commit

Permalink
Rename Cages -> Enclaves
Browse files Browse the repository at this point in the history
rename init flag
  • Loading branch information
hanneary committed Dec 6, 2023
1 parent f8456ce commit ef32e72
Show file tree
Hide file tree
Showing 44 changed files with 877 additions and 841 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-test-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
override: true
components: rustfmt, clippy
- name: Compile project
run: cargo build --all-features -p ev-cage -Z registry-auth
run: cargo build --all-features -p ev-enclave -Z registry-auth
env:
CARGO_REGISTRIES_EVERVAULT_RUST_LIBRARIES_INDEX: ${{ secrets.RUST_CRYPTO_REGISTRY }}
CARGO_REGISTRIES_EVERVAULT_RUST_LIBRARIES_TOKEN: ${{ secrets.CARGO_REGISTRIES_EVERVAULT_RUST_LIBRARIES_TOKEN }}
- name: Test project
run: cargo test -p ev-cage
run: cargo test -p ev-enclave
env:
CARGO_REGISTRIES_EVERVAULT_RUST_LIBRARIES_INDEX: ${{ secrets.RUST_CRYPTO_REGISTRY }}
- name: Format project
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/release-cli-version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Cage CLI version
name: Release Enclave CLI version

on:
push:
Expand Down Expand Up @@ -73,8 +73,8 @@ jobs:
mkdir ${{ env.BIN_DIR }}
mkdir ${{ env.RELEASE_DIR }}
cross build --release --all-features --target ${{ env.LINUX_TARGET }} -Z registry-auth
mv ./target/${{ env.LINUX_TARGET }}/release/ev-cage ./${{ env.BIN_DIR }}/ev-cage
7z a -ttar -so -an ./${{ env.BIN_DIR }} | 7z a -si ./${{ env.RELEASE_DIR }}/ev-cage-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
mv ./target/${{ env.LINUX_TARGET }}/release/ev-enclave ./${{ env.BIN_DIR }}/ev-enclave
7z a -ttar -so -an ./${{ env.BIN_DIR }} | 7z a -si ./${{ env.RELEASE_DIR }}/ev-enclave-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
env:
CARGO_REGISTRIES_EVERVAULT_RUST_LIBRARIES_INDEX: ${{ secrets.RUST_CRYPTO_REGISTRY }}
CARGO_REGISTRIES_EVERVAULT_RUST_LIBRARIES_TOKEN: ${{ secrets.CARGO_REGISTRIES_EVERVAULT_RUST_LIBRARIES_TOKEN }}
Expand Down Expand Up @@ -125,8 +125,8 @@ jobs:
- name: Compress binary
run: |
mv target/${{env.MACOS_TARGET}}/release/ev-cage ${{ env.BIN_DIR }}/ev-cage
7z a -ttar -so -an ./${{ env.BIN_DIR }} | 7z a -si ${{ env.RELEASE_DIR }}/ev-cage-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
mv target/${{env.MACOS_TARGET}}/release/ev-enclave ${{ env.BIN_DIR }}/ev-enclave
7z a -ttar -so -an ./${{ env.BIN_DIR }} | 7z a -si ${{ env.RELEASE_DIR }}/ev-enclave-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
- name: Upload as artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -183,8 +183,8 @@ jobs:
- name: Compress
shell: bash
run: |
mv target/${{ env.WINDOWS_TARGET }}/release/ev-cage.exe ${{ env.BIN_DIR }}/ev-cage.exe
7z a -ttar -so -an ./${{ env.BIN_DIR }} | 7z a -si ./${{ env.RELEASE_DIR }}/ev-cage-${{ env.WINDOWS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
mv target/${{ env.WINDOWS_TARGET }}/release/ev-enclave.exe ${{ env.BIN_DIR }}/ev-enclave.exe
7z a -ttar -so -an ./${{ env.BIN_DIR }} | 7z a -si ./${{ env.RELEASE_DIR }}/ev-enclave-${{ env.WINDOWS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
- name: Upload as artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -227,19 +227,19 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./linux/ev-cage-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
asset_path: ./linux/ev-enclave-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
asset_content_type: application/gzip
asset_name: ev-cage-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
asset_name: ev-enclave-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz

- name: Upload MacOS Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./macos/ev-cage-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
asset_path: ./macos/ev-enclave-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
asset_content_type: application/gzip
asset_name: ev-cage-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz
asset_name: ev-enclave-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz

- name: Upload Windows Release
uses: actions/upload-release-asset@v1
Expand Down Expand Up @@ -279,26 +279,26 @@ jobs:

- name: Upload Windows CLI to S3
run: |
aws s3 cp ./windows/ev-cage-${{ env.WINDOWS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz s3://cage-build-assets-${{ env.STAGE }}/cli/${{ needs.get-version.outputs.major_version }}/${{ needs.get-version.outputs.full_version }}/${{ env.WINDOWS_TARGET }}/ev-cage.tar.gz
aws s3 cp ./windows/ev-enclave-${{ env.WINDOWS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz s3://enclave-build-assets-${{ env.STAGE }}/cli/${{ needs.get-version.outputs.major_version }}/${{ needs.get-version.outputs.full_version }}/${{ env.WINDOWS_TARGET }}/ev-cage.tar.gz
- name: Upload MacOS CLI to S3
run: |
aws s3 cp ./macos/ev-cage-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz s3://cage-build-assets-${{ env.STAGE }}/cli/${{ needs.get-version.outputs.major_version }}/${{ needs.get-version.outputs.full_version }}/${{ env.MACOS_TARGET }}/ev-cage.tar.gz
aws s3 cp ./macos/ev-enclave-${{ env.MACOS_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz s3://enclave-build-assets-${{ env.STAGE }}/cli/${{ needs.get-version.outputs.major_version }}/${{ needs.get-version.outputs.full_version }}/${{ env.MACOS_TARGET }}/ev-cage.tar.gz
- name: Upload Ubuntu CLI to S3
run: |
aws s3 cp ./linux/ev-cage-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz s3://cage-build-assets-${{ env.STAGE }}/cli/${{ needs.get-version.outputs.major_version }}/${{ needs.get-version.outputs.full_version }}/${{ env.LINUX_TARGET }}/ev-cage.tar.gz
aws s3 cp ./linux/ev-enclave-${{ env.LINUX_TARGET }}-${{ needs.get-version.outputs.full_version }}.tar.gz s3://enclave-build-assets-${{ env.STAGE }}/cli/${{ needs.get-version.outputs.major_version }}/${{ needs.get-version.outputs.full_version }}/${{ env.LINUX_TARGET }}/ev-cage.tar.gz
- uses: actions/checkout@v2
- name: Update install script in S3
run: |
sh ./scripts/generate-installer.sh ${{ needs.get-version.outputs.full_version }} ${{ needs.get-version.outputs.major_version }}
sh ./scripts/update-versions.sh ${{ needs.get-version.outputs.full_version }}
aws s3 cp scripts/install s3://cage-build-assets-${{ env.STAGE }}/cli/${{ needs.get-version.outputs.major_version }}/${{needs.get-version.outputs.full_version}}/install
aws s3 cp scripts/install s3://cage-build-assets-${{ env.STAGE }}/cli/install
aws s3 cp scripts/version s3://cage-build-assets-${{ env.STAGE }}/cli/${{needs.get-version.outputs.major_version}}/version
aws s3 cp scripts/version s3://cage-build-assets-${{ env.STAGE }}/cli/version
aws s3 cp scripts/versions s3://cage-build-assets-${{ env.STAGE }}/cli/versions
aws s3 cp scripts/install s3://enclave-build-assets-${{ env.STAGE }}/cli/${{ needs.get-version.outputs.major_version }}/${{needs.get-version.outputs.full_version}}/install
aws s3 cp scripts/install s3://enclave-build-assets-${{ env.STAGE }}/cli/install
aws s3 cp scripts/version s3://enclave-build-assets-${{ env.STAGE }}/cli/${{needs.get-version.outputs.major_version}}/version
aws s3 cp scripts/version s3://enclave-build-assets-${{ env.STAGE }}/cli/version
aws s3 cp scripts/versions s3://enclave-build-assets-${{ env.STAGE }}/cli/versions
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/cli/install"
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/cli/version"
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/cli/versions"
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "ev-cage"
name = "ev-enclave"
version = "0.0.0-dev"
edition = "2021"

Expand Down
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,109 +1,109 @@
<a href="https://evervault.com/cages"><img src="https://evervault.com/images/logo-color.svg" height="45" /></a>

# Cages CLI
# Enclave CLI

Command Line Tool to build, deploy and manage Evervault [Cages](https://github.com/evervault/cages/)
Command Line Tool to build, deploy and manage Evervault [Enclaves](https://github.com/evervault/cages/)

## Notice on Open Source Status of this project
The Evervault Cages product is open source with the aim of providing transparency to users — this is vital given that our process runs in the enclave, and is accounted for in the attestation.
The Evervault Enclaves product is open source with the aim of providing transparency to users — this is vital given that our process runs in the enclave, and is accounted for in the attestation.

The current state of this project does not allow for self-hosting. We plan on addressing this by abstracting away the Evervault-specific elements of the Cages product.
The current state of this project does not allow for self-hosting. We plan on addressing this by abstracting away the Evervault-specific elements of the Enclaves product.

## Subcommands

### init

Initialize a Cage.toml in the current directory. Must provide a cage name.
Initialize a enclave.toml in the current directory. Must provide a enclave name.

`ev-cage init --name my-cage`
`ev-enclave init --name my-enclave`

### build

Build a Cage from a Dockerfile. Defaults to use local `cage.toml` file for configuration. See more options with `-h`.
Build an from a Dockerfile. Defaults to use local `cage.toml` file for configuration. See more options with `-h`.

`ev-cage build`
`ev-enclave build`

### deploy

Deploy a Cage from a toml file. Builds a cage from a Dockerfile and then deploys the cage. You can provide a path to an EIF which was already build. See more options with `-h`.
Deploy an Enclave from a toml file. Builds an Enclave from a Dockerfile and then deploys the Enclave. You can provide a path to an EIF which was already build. See more options with `-h`.

`ev-cage deploy`
`ev-enclave deploy`

### delete

Delete a Cage from a toml file.
Delete a Enclave from a toml file.

`ev-cage delete`
`ev-enclave delete`

### attest

Validate the attestation doc provided by a Cage. Defaults to compare against the local `cage.toml` file.
Validate the attestation doc provided by a Enclave. Defaults to compare against the local `enclave.toml` file.

### env

Manage Cage environment. Any changes to environment variables require a deployment to take effect.
Manage Enclave environment. Any changes to environment variables require a deployment to take effect.

#### add

Add a Cage environment variable. Add `--secret` to encrypt the value.
Add a Enclave environment variable. Add `--secret` to encrypt the value.

`ev-cage env add --key ENV_VAR_1 --value ENV_VAR`
`ev-enclave env add --key ENV_VAR_1 --value ENV_VAR`

#### get

Get Cage environment variables.
Get Enclave environment variables.

`ev-cage env get`
`ev-enclave env get`

#### delete

Delete a Cage environment variable.
Delete a Enclave environment variable.

`ev-cage env delete --key ENV_VAR_1`
`ev-enclave env delete --key ENV_VAR_1`

### describe

Get the PCRs of a built EIF. Defaults to `./enclave.eif`

`ev-cage describe `
`ev-enclave describe `

### list

List your Cages and Deployments.
List your Enclave and Deployments.

#### cages
#### enclave

List Cages
List Enclaves

`ev-cage list cages`
`ev-enclave list enclaves`

#### deployments

List Deployments of a specific cage. Defaults to the local `./cage.toml` file
List Deployments of a specific enclave. Defaults to the local `./enclave.toml` file

`ev-cage list deployments`
`ev-enclave list deployments`

### cert

Create a new Cage signing certificate
Create a new Enclave signing certificate

`ev-cage cert new`
`ev-enclave cert new`

### logs

Pull the logs for a Cage into. Defaults to the local `./cage.toml` file.
Pull the logs for a Enclave into. Defaults to the local `./enclave.toml` file.

`ev-cage logs`
`ev-enclave logs`

### encrypt

Encrypt a string with the CLI.

`ev-cage encrypt super-secret-value`
`ev-enclave encrypt super-secret-value`

### update

Check for new versions of the CLI and install them.

`ev-cage update`
`ev-enclave update`

10 changes: 5 additions & 5 deletions scripts/install.template
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh
set -eu

EV_DOWNLOAD_Darwin_universal="https://cage-build-assets.evervault.com/cli/{{major}}/{{version}}/x86_64-apple-darwin/ev-cage.tar.gz"
EV_DOWNLOAD_Windows_x86_64="https://cage-build-assets.evervault.com/cli/{{major}}/{{version}}/x86_64-pc-windows-msvc/ev-cage.tar.gz"
EV_DOWNLOAD_Linux_x86_64="https://cage-build-assets.evervault.com/cli/{{major}}/{{version}}/x86_64-unknown-linux-musl/ev-cage.tar.gz"
EV_DOWNLOAD_Darwin_universal="https://enclave-build-assets.evervault.com/cli/{{major}}/{{version}}/x86_64-apple-darwin/ev-cage.tar.gz"
EV_DOWNLOAD_Windows_x86_64="https://enclave-build-assets.evervault.com/cli/{{major}}/{{version}}/x86_64-pc-windows-msvc/ev-cage.tar.gz"
EV_DOWNLOAD_Linux_x86_64="https://enclave-build-assets.evervault.com/cli/{{major}}/{{version}}/x86_64-unknown-linux-musl/ev-cage.tar.gz"

VERSION="{{version}}"
PLATFORM=`uname -s`
Expand Down Expand Up @@ -52,7 +52,7 @@ ensure_supported_platform() {
}
ensure_supported_platform

echo "This script will automatically install the Evervault Cage CLI@${VERSION} for you."
echo "This script will automatically install the Evervault Enclave CLI@${VERSION} for you."
echo "Installation path: ${INSTALL_PATH}"
if [ "x$(id -u)" = "x0" ]; then
echo "Warning: this script is currently running as root. This is dangerous. "
Expand All @@ -61,7 +61,7 @@ fi

if [ -f "$INSTALL_PATH" ]; then
if [ -z ${CAGE_CLI_FORCE_INSTALL+x} ]; then
echo "Looks like you already have the Evervault Cage CLI installed. You can update by running ev-cage update"
echo "Looks like you already have the Evervault Enclave CLI installed. You can update by running ev-cage update"
exit 0
else
echo "Proceeding with update..."
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ major_version=$(echo "$release_version" | cut -d '.' -f 1)

echo "Release major version: $major_version"

version_json=$(curl -s "https://cage-build-assets.evervault.com/cli/versions")
version_json=$(curl -s "https://enclave-build-assets.evervault.com/cli/versions")
echo "Version response: $version_json"

if [ $? -eq 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/api/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub trait ApiClient {
}

fn user_agent(&self) -> String {
format!("evervault-cage-cli/{}", env!("CARGO_PKG_VERSION"))
format!("evervault-enclave-cli/{}", env!("CARGO_PKG_VERSION"))
}

fn accept(&self) -> String {
Expand Down
Loading

0 comments on commit ef32e72

Please sign in to comment.