Intel Software Guard Extensions Intel Sgx Key Management Reference Application Kmra on Intel Xeon Processors Technology Guide 1658482773
Intel Software Guard Extensions Intel Sgx Key Management Reference Application Kmra on Intel Xeon Processors Technology Guide 1658482773
Intel Corporation
Authors 1 Introduction
Kapil Sood Intel® Software Guard Extensions (Intel® SGX) is a set of instructions that helps increase the
Veronika Karpenko security of application code and data. Developers can partition security sensitive code and data
into an “SGX Enclave”, which is executed in a CPU protected region.
Jon Strang
NGINX is a prevalent open-source transport layer security (TLS) web service that is widely
David Lu
deployed in multiple applications. NGINX relies on the private key to perform authentication and
Seosamh O'Riordain
key agreement operations for TLS handshake. As such, the security of these private keys is of
Darragh Coen utmost importance for customers.
Kamil Lorek Key Management Reference Application (KMRA) is proof-of-concept software created to
demonstrate the integration of Intel® Software Guard Extensions (Intel® SGX) asymmetric key
capability with a hardware security model (HSM) on a centralized key server. The goal of this
document is to outline the steps to set up an NGINX workload to access the private key in an
Intel® SGX enclave on the 3rd and 4th Gen Intel® Xeon® Scalable processor by using the Public-
Key Cryptography Standard (PKCS) #11 interface and OpenSSL. This paper describes the use of
Intel SGX to help secure the NGINX private key on a general-purpose Intel® Xeon® platform. The
unique security properties of Intel SGX, combined with the broad use of NGINX in web and
cloud services, show an example of how Intel SGX can be used to more securely provision
private keys into the enclave on a cloud platform, and then use those keys while they are
protected inside the enclave.
KMRA can be deployed using Ansible automation scripts and Docker containers. It is also
integrated into BMRA (Bare Metal Reference Architecture), Service Mesh, and Intel® Smart Edge
Open.
Another significant contribution of this white paper is to illustrate the ease-of-use and ease-of-
deployment for a complete end-to-end Intel SGX system. Customers can use this white paper
and associated collateral as a reference to replicate Intel SGX deployments and customizations
within their unique environments.
Intel SGX enclaves can be used for applications ranging from private key protection, security
credentials management, and providing security services. In addition, industry security
standards like ETSI NFV SEC have defined and published security requirements for hardware-
mediated execution enclaves like Intel SGX for purposes of network functions virtualization
(NFV), 5G, and edge security. Intel SGX addresses multi-administration security requirements for
these emerging cloud networking systems, which are increasingly software-defined and highly
distributed. The intended audience for this document is Technical Architects, Solution
Architects, Product Managers, Software Engineers, Engineering Managers, System and Security
Architects, and Application Engineers.
This document can act as a reference to implement Intel SGX for Intel platforms to help secure
workload keys, credential management, and Intel SGX deployment in a data center. It is highly
recommended that readers refer to widely available documents for Intel SGX design and
enabling.
This document is part of the Network Transformation Experience Kit, which is available at
https://networkbuilders.intel.com/network-technologies/network-transformation-exp-kits.
1
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
Table of Contents
1 Introduction........................................................................................................................................................................................................................ 1
1.1 Terminology .......................................................................................................................................................................................................................................................3
1.2 Reference Documentation ...........................................................................................................................................................................................................................3
2 Overview ............................................................................................................................................................................................................................. 4
4 Deployment ...................................................................................................................................................................................................................... 10
4.1 Automated Intel® SGX Deployment with Ansible ........................................................................................................................................................................... 10
4.2 Containerized KMRA.................................................................................................................................................................................................................................... 10
6 Summary ........................................................................................................................................................................................................................... 12
Figures
Figure 1: Intel® SGX Security Model ........................................................................................................................................................................................................................... 4
Figure 2: Application Refactoring for an Enclave ................................................................................................................................................................................................. 5
Figure 3: Intel® SGX Data Center Attestation Deployment Architecture .................................................................................................................................................... 6
Figure 4: Intel® SGX Remote Attestation .................................................................................................................................................................................................................. 7
Figure 5. NGINX KMRA Flow with Intel SGX ........................................................................................................................................................................................................... 8
Figure 6: KMRA NGINX/Intel® SGX Key Management Software Design ...................................................................................................................................................... 9
Figure 7: Crypto API Toolkit for Intel® SGX Software Architecture............................................................................................................................................................... 9
Figure 8: KMRA SW Design and Deployment Using Docker Images ......................................................................................................................................................... 10
Figure 9. km-wrap and km-attest Sample App SW Design in KMRA ........................................................................................................................................................ 11
Tables
Table 1. Terminology ...................................................................................................................................................................................................................................................... 3
Table 2. Reference Documents .................................................................................................................................................................................................................................. 3
2
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
1.1 Terminology
Table 1. Terminology
ABBREVIATION DESCRIPTION
Ansible Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management,
application deployment, and intra-service orchestration.
Ansible-playbook Playbooks are the files where Ansible code is written.
BIOS Basic Input/Output System is a set of computer instructions in firmware that controls input and output operations.
CA Certificate authority
CDN Content Delivery Network is a system of distributed servers (network). It delivers pages and other web content to a
user, based on the geographic locations of the user, the origin of the webpage, and the content delivery server.
DCAP Data Center Attestation Primitives. Intel® Software Guard Extensions Data Center Attestation Primitives (Intel® SGX
DCAP) provides SGX attestation support targeted for data centers, cloud services providers, and enterprises.
ECDSA Elliptic curve digital signature algorithm
Enclave Ring 3 application software running inside the Intel® SGX protections
FLC Flexible launch control
FW, UEFI FW Firmware, Unified Extensible Firmware Interface FW
HSM Hardware security module
Intel® SGX-TEM Intel® Software Guard Extensions – Trusted Environment Mode
KMRA Key Management Reference Application
mTLS Mutual transport layer security
OS Operating system
PCCS Provisioning Certificate Caching Service
PKCS Public-Key Cryptography Standard
PKCS#11 Public-Key Cryptography Standard. The PKCS#11 standard defines a platform-independent API to cryptographic
tokens, such as hardware security modules (HSM) and smart cards.
PSW Platform software
SGX Intel® Software Guard Extensions (Intel® SGX) is a set of instructions that increase the security of application code and
data, giving them more protection from disclosure or modification.
SSL Secure Sockets Layer is a networking protocol designed for securing connections between web clients and web
servers over an insecure network, such as the internet.
TLS Transport Layer Security
REFERENCE SOURCE
Intel® SGX Programming Reference and SDK for Linux https://software.intel.com/content/www/us/en/develop/articles/intel-
sdm.html#combined
https://download.01.org/intel-sgx/latest/linux-latest/docs/
https://github.com/intel/linux-sgx
PKCS#11 Specification http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-
v2.40.html
ETSI NFV Security Standards (SEC001, SEC012, SEC013, others) http://www.etsi.org/technologies-clusters/technologies/nfv
https://software.intel.com/content/www/us/en/develop/download/intel-
software-guard-extensions-intel-sgx-developer-guide.html
https://software.intel.com/content/www/us/en/develop/articles/intel-
sdm.html
3
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
REFERENCE SOURCE
Intel® SGX Crypto-Toolkit Open Source https://github.com/intel/crypto-api-toolkit
Intel® SGX ECDSA Attestation DCAP and APIs https://download.01.org/intel-sgx/latest/dcap-latest/linux/docs/
https://github.com/cloud-security-research/sgx-ra-tls
https://github.com/intel/SGXDataCenterAttestationPrimitives
Intel® SGX Flexible Launch Control (FLC) https://github.com/intel/linux-sgx/blob/master/psw/ae/ref_le/ref_le.md
https://software.intel.com/content/www/us/en/develop/blogs/an-update-
on-3rd-party-attestation.html
Intel® SGX Open Source Projects https://github.com/intel/intel-sgx-ssl
https://github.com/intel/sgx-ra-sample
Intel® SGX Security Analysis https://www.intel.com/content/www/us/en/security-center/default.html
https://software.intel.com/security-software-guidance/
Intel® Software Guard Extensions (Intel® SGX) - Key Management https://networkbuilders.intel.com/solutionslibrary/intel-sgx-kmra-on-intel-
Reference Application (KMRA) on Intel® Xeon® Processors User xeon-processors-user-guide
Guide
2 Overview
Intel® SGX is a set of instructions on Intel CPUs that helps increase the security of application code and data. Developers can
partition security sensitive code and data into an Intel SGX enclave, which is executed in a CPU protected region. The developer
creates these enclaves on untrusted platforms and uses Intel CPU-based attestation to ensure the integrity of their Intel SGX
enclave setup. After the enclave is verified, the remote attester can provision secrets securely into the enclave. In KMRA, we
provision the NGINX private key. The use of Intel SGX enclave is reserved for applications and cannot be used by an OS or BIOS
driver/module.
4
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
to refer to Intel SGX collateral, including specifications, security analysis, SDK, drivers, and open source applications, from Intel,
academia, and customers.
Intel SGX allows confidential computing services to be delivered on Intel servers. Confidential computing is an emerging industry
paradigm where applications can be run in a cryptographically protected environment. It can allow any application (whole or partial)
to run inside an enclave, and by limiting the trusted compute base, Intel SGX puts application developers in control of their own
application security. However, it is recommended that developers keep the Intel SGX code base small, test for software side channel
resistance, and follow other secure software development guidelines included in the Intel® SGX Developer Guide.
Intel SGX enclaves can be used for applications ranging from private key protection, security credentials management, and security
service provider. The KMRA described in this specification focuses on customer private key protection. However, it is expected that
the broader Intel SGX enabling, provisioning, attestation, and application service delivery components of this KMRA system are
applicable to multiple customer use cases.
Intel SGX includes Intel architecture instruction set extension, which can be used by supervisor mode (like operating system
software) for enclave page cache (EPC) page management, and to create, initialize, and manage enclaves. The user mode
instructions allow an application to enter/exit an enclave, for attestation and key management. A detailed and updated set of Intel®
SGX ISA can be found in the Intel SGX Programing Reference document.
5
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
6
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
7
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
3.2.1.3 Step 3 - NGINX Application Uses the Key Protected Inside the Enclave
The NGINX workload can more securely access the private key through the PKCS#11 interface using the libp11 engine configured
with OpenSSL. NGINX can establish a TLS connection using the private key from the Crypto API Toolkit for Intel® SGX enclave. Since
the private key is never exposed in the clear outside of the enclave, NGINX uses PKCS#11 APIs to perform private key operations
inside the enclave.
8
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
1
http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
9
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
After verifying these parameters and any additional security checks, the remote attestation and key server can then provision
secrets more securely into the enclave.
For more information on KMRA REST API endpoints, refer to the KMRA User Guide: Intel® Software Guard Extensions (Intel® SGX) -
Key Management Reference Application (KMRA) on Intel® Xeon® Processors User Guide.
4 Deployment
4.1 Automated Intel® SGX Deployment with Ansible
KMRA provides Ansible environment setup scripts for installing Intel SGX components and KMRA dependencies. The full demo can
be set up with Ansible scripts to showcase attestation, key provisioning, and NGINX workload setup.
The Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on Intel® Xeon® Processors User
Guide contains step-by-step instructions for running the Ansible scripts.
10
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
11
Technology Guide | Intel® Software Guard Extensions (Intel® SGX) - Key Management Reference Application (KMRA) on 3rd and
4th Gen Intel® Xeon® Processors
6 Summary
Intel® SGX provides a more secure environment for application owners to run their applications’ sensitive code and data inside an
Intel SGX enclave, enhancing protection of their enclave code and data from privileged software and applications. This guide
demonstrates an end-to-end reference architecture for using Intel SGX to protect private key for NGINX application. This document
focuses on making Intel SGX easy to use and deploy, illustrating the overall system architecture and software design components
that enabled the usage. This example can be extended to additional Intel SGX usages, applications, and deployments. It is
recommended that readers refer to this Intel SGX reference architecture and associated collateral to assist in development and
follow their security best practices in the deployment of their Intel SGX systems.
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.
No product or component can be absolutely secure.
Intel does not control or audit third-party data. You should consult other sources to evaluate accuracy.
No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.
The products described may contain design defects or errors known as errata which may cause the product to deviate from published
specifications. Current characterized errata are available on request.
Your costs and results may vary.
Intel technologies may require enabled hardware, software or service activation.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may
be claimed as the property of others.
0722/DN/WIT/PDF 635272-006US
12