diff --git a/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/cca-veraison-aws-upstream-fixes.tar.gz b/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/cca-veraison-aws-upstream-fixes.tar.gz new file mode 100644 index 0000000000..c869f8e2f3 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/cca-veraison-aws-upstream-fixes.tar.gz differ diff --git a/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/deployment.md b/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/deployment.md index b96224e4f6..61196d4c72 100644 --- a/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/deployment.md +++ b/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/deployment.md @@ -24,7 +24,7 @@ hash -r # Install virtual-environment support for Ubuntu's Python 3.12. sudo apt update -sudo apt install python3.12-venv +sudo apt install python3.12-venv jq # Use a fresh directory, preserving the existing ~/venv/aws environment. export VERAISON_AWS_VENV="$HOME/venv/veraison-aws-py312" @@ -33,7 +33,7 @@ export VERAISON_AWS_VENV="$HOME/venv/veraison-aws-py312" source "$VERAISON_AWS_VENV/bin/activate" # Set this to fix issues with the make deploy scripts -export VERAISON_DEB="/tmp/veraison_0.0.261100+ebadb73_amd64.deb" +export VERAISON_DEB= # Fixes and requirements for make deploy sudo apt install gettext-base @@ -68,22 +68,22 @@ Use the [Bootstrap](https://github.com/veraison/services/blob/ebadb733d44ba2f8ff The pinned services revision uses CoRIM-store commit `a2a60b6a11ad`, as specified in its [dependency file](https://github.com/veraison/services/blob/ebadb733d44ba2f8ffefdae49a0f0d3c1bfc9800/go.mod#L44). Its AWS deployment script still selects an older CoRIM-store tool for the sentinel image. Update that tool's pin before creating the image so database initialization includes the migrations required by the services, including the `tokens` table. +Lets initialize our deployment build environment: + ```bash mkdir $HOME/cca_veraison cd $HOME/cca_veraison git clone https://github.com/veraison/services.git -git -C services checkout ebadb733d44ba2f8ffefdae49a0f0d3c1bfc9800 -cd services/deployments/aws +git -C services checkout 61cf6088c1dc4f69cdd08e6a05f75c9fd3b2c6a6 +``` -# Match the sentinel's CoRIM-store tool to the services dependency. -sed -i "s/default='9e4ba68b'/default='a2a60b6a11ad'/" bin/veraison -grep -F "default='a2a60b6a11ad'" bin/veraison +Then, we can bootstrap our deployment: +```bash +cd services/deployments/aws make bootstrap ``` -The `grep` command should show the `--rev` argument with `default='a2a60b6a11ad'`. Keep the sentinel tool's revision aligned with `services/go.mod` when changing the services revision. - Once your build environment is bootstrapped, you will use the [Quickstart](https://github.com/veraison/services/blob/ebadb733d44ba2f8ffefdae49a0f0d3c1bfc9800/deployments/aws/README.md#quickstart) procedure to provide some AWS configuration and create the deployment. Next lets confirm that we have some additional requirements setup for the deployment to succeed: @@ -124,10 +124,36 @@ AWS_DEFAULT_REGION="$VERAISON_AWS_REGION" AWS_REGION="$VERAISON_AWS_REGION" ``` +An example of a configured `misc/arm.cfg` looks something like this (your AWS region and DNS name may/will likely be different though): + +```output +############################################################################## +# Veraison Deployment Account-specific settings. +# These settings are specific to the Arm account used by the core development +# team. Users without access to this account must provide their own version of +# this file (or configure these settings inside deployment.cfg). +############################################################################## +VERAISON_AWS_REGION=us-east-1 +AWS_DEFAULT_REGION="$VERAISON_AWS_REGION" +AWS_REGION="$VERAISON_AWS_REGION" +VERAISON_AWS_ADMIN_CIDR=217.140.96.0/20 +VERAISON_AWS_VPC_CIDR=10.1.0.0/16 +VERAISON_AWS_DNS_NAME=veraison-example.com +IAM_LOGGER_ROLE_NAME= +IAM_INSTANCE_PROFILE_NAME= +IAM_PERMISSION_BOUNDARY_ARN= +``` + +{{% notice Note %}} +Some AWS accounts may have permissions boundaries enabled (such as assumed role accounts). In this case you will need to create the logger and instance profile roles and specify the permissions boundary arn specifically. Most standard AWS accounts do not require this though so you can just leave them empty. +{{% /notice %}} + Once the account-specific config file is created, define `AWS_ACCOUNT_CFG` environment variable to point to it and then create the deployment: ```bash -export AWS_ACCOUNT_CFG=misc/arm.cfg # replace with path to your config +cp ./misc/arm.cfg $HOME/veraison-aws.cfg +export AWS_ACCOUNT_CFG="$HOME/veraison-aws.cfg" +source env/env.bash "$AWS_ACCOUNT_CFG" make deploy ``` @@ -154,7 +180,7 @@ This command outputs a status report for the deployment. If successful, it inclu Use the following command to test the REST API endpoint of the verification service. Remember to substitute `example-veraison.com` with the domain name that you used in the initial step, but you will need to keep the `services` prefix as shown. ```bash -curl https://services.example-veraison.com:8443/.well-known/veraison/verification +curl https://services.example-veraison.com:8443/.well-known/veraison/verification | jq ``` If it succeeds, this command produces some JSON output, including the EAR verification key. @@ -162,7 +188,7 @@ If it succeeds, this command produces some JSON output, including the EAR verifi Use the following command to test the REST API endpoint of the endorsement provisioning service. Remember to substitute `example-veraison.com` with the domain name that you used in the initial step. ```bash -curl https://services.example-veraison.com:9443/.well-known/veraison/provisioning +curl https://services.example-veraison.com:9443/.well-known/veraison/provisioning | jq ``` This command produces JSON output containing the list of supported media types for endorsement. diff --git a/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/endorsements.md b/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/endorsements.md index 96e5b606b7..f3d38c4f35 100644 --- a/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/endorsements.md +++ b/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/endorsements.md @@ -14,6 +14,18 @@ Now that your Veraison services are deployed into AWS, the next step is to provi Return to the command shell where you created the Veraison AWS deployment, and run the following command: ```bash +# make sure we have cocli +mkdir -p "$HOME/.local/bin" + +GOBIN="$HOME/.local/bin" go install github.com/veraison/cocli@v0.1.0 +GOBIN="$HOME/.local/bin" go install github.com/veraison/evcli/v2@0e253e8 + +export PATH="$HOME/.local/bin:$PATH" +hash -r + +command -v cocli +command -v evcli + cd $HOME/cca_veraison/services/end-to-end SCHEME=cca ./end-to-end-aws provision ``` @@ -21,6 +33,10 @@ SCHEME=cca ./end-to-end-aws provision This command sends the CCA endorsements to your AWS-hosted Veraison deployment. You should see output similar to the following: ```output +go: github.com/veraison/cocli@v0.1.0 requires go >= 1.25.0; switching to go1.26.11 +go: github.com/veraison/evcli/v2@v2.2.1-0.20261013091050-0e253e803cfb requires go >= 1.25.0; switching to go1.26.11 +/home/danson/.local/bin/cocli +/home/danson/.local/bin/evcli cocli corim submit --config=/tmp/veraison-aws-client-configs/cocli/config.yaml --corim-file=/home/danson/cca_veraison/services/end-to-end/input/cca-endorsements.cbor '--media-type=application/rim+cbor; profile="tag:arm.com,2025:cca_platform#1.0.0"' cocli corim submit --config=/tmp/veraison-aws-client-configs/cocli/config.yaml --corim-file=/home/danson/cca_veraison/services/end-to-end/input/cca-realm-endorsements.cbor '--media-type=application/rim+cbor; profile="tag:arm.com,2025:cca_realm#1.0.0"' ``` diff --git a/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/use-verifier.md b/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/use-verifier.md index 5b9b0c5c67..5aaf044eb8 100644 --- a/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/use-verifier.md +++ b/content/learning-paths/servers-and-cloud-computing/cca-veraison-aws/use-verifier.md @@ -21,3 +21,53 @@ When cloning `evcli` source code use commit: ``` bash git -C evcli checkout 0e253e8 ``` + + +## Cleanup + +Once you are done with your AWS services for this learning path, you can clean things up to save on AWS costs. Back on the Ubuntu host: + +```bash +cd $HOME/cca_veraison/services/deployments/aws + +# Confirm that we still have the correct environment (both should be set prior) +echo $AWS_REGION +echo $VERAISON_DEB + +# Delete all AWS resources we created in this learning path (from veraison repo readme) +./bin/veraison delete-stack services +./bin/veraison delete-stack rds +./bin/veraison delete-image keycloak +./bin/veraison delete-image services +./bin/veraison delete-image sentinel +./bin/veraison delete-signing-key +./bin/veraison delete-key-pair +./bin/veraison delete-deb + +# Force delete the Cloud Formation stacks +aws cloudformation delete-stack --stack-name veraison-support +aws cloudformation wait stack-delete-complete --stack-name veraison-support || \ +aws cloudformation delete-stack --stack-name veraison-support --deletion-mode FORCE_DELETE_STACK + +aws cloudformation delete-stack --stack-name veraison-vpc +aws cloudformation wait stack-delete-complete --stack-name veraison-vpc || \ +aws cloudformation delete-stack --stack-name veraison-vpc --deletion-mode FORCE_DELETE_STACK + +# Force delete the secret without deletion delay +aws secretsmanager delete-secret \ + --secret-id veraison-ear-signer \ + --force-delete-without-recovery \ + --region ${AWS_REGION} + +# Clean up the local cache +state_dir="${XDG_DATA_HOME:-$HOME/.local/share}/veraison/aws" +state_backup="${state_dir}.backup-$(date +%Y%m%d-%H%M%S)" +cp -a -- "$state_dir" "$state_backup" +for entry in key vpc support services images signer-key-arn; do + ./bin/veraison --deployment-name veraison cache --delete "$entry" || break +done +``` + +{{% notice Note %}} +The above deletion steps will delete most of the AWS resources created by this learning path. However, any failed deployments may partially/wholly remain and will require manual deletion from the AWS console. Be sure to double check via the AWS console including examining AWS dashboards for: Cloud Formation, ElastiCache, RDS and Aurora, Secrets Manager, and EC2 for any residual resources that might be dangling after the above deletions. +{{% /notice %}}