The Intel® Trust Authority CLI is an open-source tool tenants use to make API calls to Intel's Trust Authority. The source code for the Intel® Trust Authority CLI is available on GitHub.
Ubuntu LTS 20.04
The make, makeself, and golang packages are required before installing the Intel Trust Authority CLI. The steps below explain how to install these packages.
-
Install make and makeself.
- Run the following command to install the make and makeself packages.
apt -y install make makeself
-
Installing golang.
- Supported golang version is 1.22.7
- To install golang, follow the instructions at the following link:https://go.dev/doc/install
-
Add the local binary path,
$HOME/.local/bin/
, to your PATH environment variable if not already present.
Follow the steps below to build the Intel Trust Authority CLI.
- Create a cli directory.
mkdir cli
- Clone the trustauthority-cli repository by running the following command.
git clone https://github.com/intel/trustauthority-cli.git trustauthority-cli
- Create the CLI installer in the cli directory.
cd trustauthority-cli and run "make installer"
- Copy the binary installer trustauthorityctl-{version}.bin to the system where it needs to be deployed.
- Create an env file trustauthorityctl.env in your home directory and add the following mandatory contents:
a. TRUSTAUTHORITY_URL=< URL for Intel Trust Authority >
b. TRUSTAUTHORITY_API_KEY="< Admin API Key of the Tenant >" - To install the CLI to your system, run the following command:
./trustauthorityctl-{version}.bin
- To use the CLI, follow this syntax:
trustauthorityctl < command > < resource >
All files are stored in the user's home directory. The contents of the directories are listed below:
- Configuration: $HOME/.config/trustauthorityctl/config.yaml
- Logs: $HOME/.config/trustauthorityctl/logs/trustauthorityctl.log
- Bin: $HOME/.local/bin/trustauthorityctl
Note
If you cannot access the command, add the binary path to the PATH env variable.
Note
The Request ID could be a randomly generated string of 128 bytes or less, which can be a unique identifier for each CRUD operation. The Request ID can only be provided as an optional parameter for CRUD commands.
To uninstall the Intel Trust Authority CLI, run the following command:
trustauthorityctl uninstall
The file path to the trustauthorityctl.env file created in the previous step is needed to complete this step.
To configure the Intel Trust Authority CLI, run the command below.
trustauthorityctl config -v < env file path >
To install bash completion for the Intel Trust Authority CLI, run the following command:
trustauthorityctl completion
To get the version number of the tenant CLI installed on your system, run the following command:
trustauthorityctl version
trustauthorityctl create user -q < request id > -e < email Id> -r < Role (Tenant Admin/User) >
trustauthorityctl list user -q < request id >
trustauthorityctl list user -q < request id > -e
trustauthorityctl update user role -q < request id > -u < user id > -r < Role (Tenant Admin/User) >
trustauthorityctl delete user -q < request id > -u < user id >
trustauthorityctl delete tag -q < request id > -t < tag id >
trustauthorityctl list serviceOffer
trustauthorityctl list plan -q < request id > -r < service offer id >
trustauthorityctl list plan -q < request id > -r < service offer id > -p < plan id >
trustauthorityctl list product -q < request id > -r < service offer id >
trustauthorityctl list service -q < request id >
trustauthorityctl list service -q < request id > -r < service Id >
trustauthorityctl create apiClient -q < request id > -r < service id > -p < product id > -n < api client name > -i "comma separated policy Ids" -v "tag-key1:tag-value1,tag-key2:tag-value2"
trustauthorityctl update apiClient -q < request id > -r < service id > -p < product id > -c < api client id > -i "comma separated policy Ids" -v "tag-key1:tag-value1,tag-key2:tag-value2" -s < Active/Inactive/Cancelled >
trustauthorityctl list apiClient -q < request id > -r < service id >
trustauthorityctl list apiClient -q < request id > -r < service id > -c < api client id >
trustauthorityctl delete apiClient -q < request id > -r < service id > -c < api client id >
trustauthorityctl create tag -q < request id > -n < tag name >
trustauthorityctl list tag -q < request id >
trustauthorityctl list apiClient policy -q < request id > -r < service id > -c < api client id >
trustauthorityctl list apiClient tag -q < request id > -r < service id > -c < api client id >
trustauthorityctl update tenant-settings -q < request id > -e < email id >
trustauthorityctl update tenant-settings -q < request id > -d
trustauthorityctl list tenant-settings -q < request id >
trustauthorityctl create policy -q < request id > -n < name of policy > -t < policy type > -a < attestation type > -r < service offer id > -f < rego policy file path > Note: Policy file size should be <= 10KB
trustauthorityctl list policy -q < request id >
trustauthorityctl list policy -q < request id > -p < policy id >
trustauthorityctl delete policy -q < request id > -p < policy id >
trustauthorityctl update policy -q < request id > -i < policy id > -n < name of policy > -f < rego policy file path > Note: Policy file size should be <= 10KB
- Sample rego policy for create/update policy command:
default matches_sgx_policy = false
matches_sgx_policy = true
{ input.sgx_is_debuggable == false
input.sgx_isvsvn == 0
input.sgx_isvprodid == 0
input.sgx_mrsigner == \"d412a4f07ef83892a5915fb2ab584be31e186e5a4f95ab5f6950fd4eb8694d7b\"
input.sgx_mrenclave == \"bab91f200038076ac25f87de0ca67472443c2ebe17ed9ba95314e609038f51ab\"
}
trustauthorityctl create policy-jwt -q < request id > -f < rego policy file path > -p < signing key path > -c < cert path > -a < algorithm > -s
Create a self-signed key and certificate for policy JWT token creation:
- Generate key and cert files for -algorithm (PS384 | RS384) (Recommend)
openssl req -x509 -nodes -days 365 -newkey rsa:3072 -keyout ta-jwt.key -out ta-jwt.crt
- Generate key and cert files for -algorithm (PS256 | RS256)
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ta-jwt.key -out ta-jwt.crt
- The signed policy token could be self-verified at jwt.io.
- The output file name of this command is the input policy file name suffixed with the ".signed.current_timestamp.txt" extension.
- The policy payload for Trust Authority uses the rego format, which is different from Azure MAA.
- Supported signing algorithms are "RS256", "PS256", "RS384", "PS384", and the default algorithm is PS384.
- The signing algorithm needs to match the certificate algorithm.