User's Guide: Create an Image

Introduction

A Fortanix Confidential Computing Manager (CCM) image is a particular software release or a version of an application. Each image is associated with one enclave hash (MRENCLAVE).

When an image is first created in Fortanix CCM, it is in an unapproved state. After configurable approval actions are taken, the image is considered approved. When an image is approved, Fortanix CCM knows that enclaves with the associated hash (MRENCLAVE) are trusted instances of the corresponding application, and will issue certs with the application’s domain name(s) to those enclaves.

Prerequisites

  • For Enclave OS application - the Tag of the Docker image for the application.
  • For EDP application - The sigstruct.bin file which is used to register the enclave with Fortanix CCM.

Create an Image for Enclave OS Applications

  1. After you create an Enclave OS application and click NEXT, you will see the Add image page where you have to configure the image of the Enclave OS application as shown in Figure 2 below. You can also configure an application image from the detailed view of an application (Figure 1) using the +IMAGES button. CCMAppNew18a.pngFigure 1: Image tab
  2. In the Add image form, select the Image Type as Intel SGX  or AWS Nitro Enclaves depending on the platform used.
  3. Enter the REGISTRY CREDENTIALS for the Output image name. Here, the registry credentials are the credentials needed to access the private docker registry where the image will be pushed. Since the input image is stored in a public registry, there is no need to provide credentials for the input image.
    • If you have added a registry in a particular account as described in the article User's Guide: Image Registry of Fortanix CCM, then the check box Use saved credentials will be selected by default and the registry names for the output image will be filled automatically for the Add Registry Credentials fields.
        Nitro_CreateEOSImage.pngNitro_CreateEOSImage1.pngFigure 2: Add saved registry credentials
    • If you have not saved any Registry Credentials, then manually enter the registry credentials for the Output image name
  4. Enter the image Tag which is the tag value of the Docker image.
  5. If you selected the Image Type as Intel SGX, enter the following details:
    • ISVPRODID is a numeric product identifier. A user must choose a unique value in the range of 0-65535 for their applications.
    • ISVSVN is a numeric security version to be assigned to the Enclave. This number should be incremented if security-relevant change is made to the application.
    • Memory size – Choose the memory size from the drop-down to change the memory size of the enclave.
    • Thread count – Change the thread count to support the application.
  6. If you selected the Image Type as AWS Nitro, enter the following details:

    • Memory size
    • CPU count - CPU count is the number of CPUs dedicated to an enclave out of all the CPUs available to the host machine.
    NOTE
    The Memory size and CPU count can be overridden at runtime with the following environment variables:
    • MEM_SIZE
    • CPU_COUNT
  7. Click CREATE to create the image (Figure 2).                                                               
  8. An image approval task is created and added which is visible on the Tasks page. You can approve the task to approve the image. After it is approved, a green tick would appear in the Approval status column for that image.
      Nitro_EOSImageCreated.pngFigure 3: Image created and approved
    NOTE

    The Source Image tag and Output Image tag are optional fields and by default, the tag value is “latest” internally. If the user is entering a different tag value, then it can either be different values or the same. Once an image of an application is created, it will be pushed to the specified location in the Output Image Name of the application.

SGX1 and SGX2 Application Support

When an application is converted, the converter app supports signing and running the application in both SGX1 and SGX2 hardware. After the application is converted, the application will have both SGX1 and SGX2 signatures, and the correct signature would be used depending on the hardware available.

The converted container will have two different MRENCLAVE values corresponding to SGX1 and SGX2 respectively. This allows you to run the same converted container on both SGX1 and SGX2 hardware.

On the hardware that supports dynamically adding pages to an enclave, pages for unallocated memory are not included in the initial enclave image, so the enclave can start faster. On hardware without that support, the initial enclave image includes zeroed pages for unallocated memory.

To view the MRENCLAVE values in the Fortanix CCM UI:

  1. Go to the detailed view of an image, and select the ENCLAVE tab.
  2. Notice the MRENCLAVE (SGX1) and MRENCLAVE (SGX2) fields under the MRENCLAVE Values section. MRENCLAVE.pngFigure 4: MRENCLAVE values

Create an Image for EDP Applications

  1. After you create an EDP application and click NEXT, you will see the Add image page where you have to configure the image of the EDP application as shown in Figure 5 below. You can also configure an application image from the detailed view of an application (Figure 5) using the +IMAGES button. CCMAppNew20.png
    Figure 5: Images tab
  2. In the Add image form, enter the Image Version.
  3. In the Image Type section, select Intel SGX or AWS Nitro Enclaves as the platform.
  4. If you select the Image Type as Intel SGX, you have to add the Sigstruct details. The SIGSTRUCT for an enclave is generated when an application is signed. It is used to register the enclave with Fortanix CCM. In the Enclave Configuration SIGSTRUCT section, you will see three options to add SIGSTRUCT:
     
    1. Upload Enclave SIGSTRUCT: To upload an enclave sigstruct.bin file, click the UPLOAD button as shown in Figure 6. Here is a sample sigstruct.bin file.
                                                            OR
    2. Paste Base64-encoded Enclave SIGSTRUCT: You can also paste a Base64-encoded SIGSTRUCT binary in the text box provided.
                                                            OR
    3. Enter Enclave SIGSTRUCT Parameters: Enter the following parameters:
      • MRENCLAVE: This is the identity or hash of the enclave.
      • MRSIGNER: This is the identity of the signer of the enclave.
      • ISVPRODID: This is the numeric product identifier to be assigned to the enclave. Choose a unique value in the range 0-65535 for each application.
      • ISVSVN: This is the numeric security version to be assigned to the enclave. Increment this value when a security-relevant change is made to the application.
        NOTE
        The Enclave SIGSTRUCT Parameters section is automatically filled when you either upload a sigstruct.bin file or paste a base64 encoded enclave SIGSTRUCT.
  5. If you select the Image Type as AWS Nitro Enclaves, you have to add the Enclave Configuration JSON details which are unique enclave measurements that include a series of Hashes and Platform. The JSON measurements for an enclave are generated when an application is signed. It is used to register the enclave with Fortanix Confidential Computing Manager. In the Enclave Configuration JSON section, you will see three options to add measurements:
    1. Upload Measurement JSON: To upload an enclave measurement.json file, click the UPLOAD button as shown in Figure 7.            OR
    2. Paste Measurement JSON: You can also paste the JSON enclave measurements in the text box provided.
                                                            OR
    3. Enter Measurement: Enter the following parameters:
      • PCR0: This is the hash of the enclave image file.
      • PCR1: This is the hash of the Linux kernel and bootstrap.
      • PCR2: This is the Hash of the user application.
        NOTE
        The Enter Measurement section is automatically filled when you either upload a measurement.json file or paste a base64 encoded enclave SIGSTRUCT.
        CCMAppNew21.pngCCMAppNew22.png
        Figure 6: Create an EDP Application Image for Intel SGX platform Nitro_CreateEDP1.pngNitro_CreateEDP2.png
        Figure 7: Create an EDP Application image for AWS Nitro platform
  6. Click CREATE to create the EDP application image.
  7. An image approval task is created and added which is visible on the Tasks page. You can approve the task to approve the image.
  8. After the image is approved, a green tick would appear in the Approval status column for that image.
    Nitro_EDPImageCreated.png
    Figure 8: Image created and approved

 

Comments

Please sign in to leave a comment.

Was this article helpful?
0 out of 0 found this helpful