Is There An Sgx Sdk

Latest version

  1. Is There An Sgx Sdk Download
  2. Is There An Sgx Sdk
  3. Is There An Sgx Sdk File
  4. Is There An Sgx Sdk App

The Open Enclave SDK (OE SDK) is an open-source SDK that allows abstraction over different confidential computing-enabled hardware. The OE SDK is built to be a single abstraction layer over any hardware on any CSP. The OE SDK can be used on top of Azure confidential computing virtual machines to create and run applications on top of enclaves. SGX Application Structure. SGX application is consist of two components. Trusted Component: This is the enclave. It is just shared object aka.so,.dll. Untrusted Component: This is the rest of the application and any of its modules. In intel sdk, Enclave directory indicates trusted component and App directory indicates untruste component.

Is There An Sgx Sdk

The Intel® SGX SDK is a collection of APIs, libraries, documentation, sample source code, and tools that allows software developers to create and debug Intel® SGX enabled applications in C/C. Application code executing within an Intel SGX enclave: Benefits from new Intel SGX instructions introduced with 6th Generation Intel® Core. Attestable enclave instead of being fully refactored for SGX. The speed of TPM operations ranges from 10 to 280 µs. 1 We provide further discussion on why SGXv2 is not a panacea in Section 6. 2The Intel SGX SDK Developer Manual v1.9 has 320 pages.Retrofitting and evaluating Nginx/OpenSSL and Memcached using SGX based on lxcsgx.

Released:

Microsoft Azure Attestation Client Library for Python

Project description

The Microsoft Azure Attestation (MAA) service is a unified solution for remotely verifying the trustworthiness of a platform and integrity of the binaries running inside it. The service supports attestation of the platforms backed by Trusted Platform Modules (TPMs) alongside the ability to attest to the state of Trusted Execution Environments (TEEs) such as Intel(tm) Software Guard Extensions (SGX) enclaves and Virtualization-based Security (VBS) enclaves.

Attestation is a process for demonstrating that software binaries were properly instantiated on a trusted platform. Remote relying parties can then gain confidence that only such intended software is running on trusted hardware. Azure Attestation is a unified customer-facing service and framework for attestation.

There

Azure Attestation enables cutting-edge security paradigms such as Azure Confidential computing and Intelligent Edge protection. Customers have been requesting the ability to independently verify the location of a machine, the posture of a virtual machine (VM) on that machine, and the environment within which enclaves are running on that VM. Azure Attestation will empower these and many additional customer requests.

Azure Attestation receives evidence from compute entities, turns them into a set of claims, validates them against configurable policies, and produces cryptographic proofs for claims-based applications (for example, relying parties and auditing authorities).

This package has been tested with Python 2.7, 3.6 to 3.9.

For a more complete view of Azure libraries, see the azure sdk python release.

NOTE: This is a preview SDK for the Microsoft Azure Attestation service. It provides all the essential functionality to access the Azure Attestation service, it should be considered 'as-is' and is subject to changes in the future which may break compatibility with previous versions.

Source code | Package (PyPI) | API reference documentation | Product documentation

Getting started

Prerequisites

  • An Azure subscription. To use Azure services, including the Microsoft Azure Attestation service, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a free trial or use your Visual Studio Subscription benefits when you create an account.
  • An existing Azure Attestation Instance, or you can use the 'shared provider' available in each Azure region. If you need to create an Azure Attestation service instance, you can use the Azure Portal or Azure CLI.

Install the package

Install the Microsoft Azure Attestation client library for Python with PyPI:

Authenticate the client

In order to interact with the Microsoft Azure Attestation service, you'll need to create an instance of the Attestation Client or Attestation Administration Client class. You need a attestation instance url, which you may see as 'DNS Name' in the portal,and client secret credentials (client id, client secret, tenant id) to instantiate a client object.

Client secret credential authentication is being used in this getting started section but you can find more ways to authenticate with Azure identity. To use the DefaultAzureCredential provider shown below,or other credential providers provided with the Azure SDK, you should install the Azure.Identity package:

Create/Get credentials

Use the Azure CLI snippet below to create/get client secret credentials.

  • Create a service principal and configure its access to Azure resources:

    Output:

  • Take note of the service principal objectId

    Output:

  • Use the returned credentials above to set AZURE_CLIENT_ID (appId), AZURE_CLIENT_SECRET (password), and AZURE_TENANT_ID (tenant) environment variables. The following example shows a way to do this in Powershell:

For more information about the Azure Identity APIs and how to use them, see Azure Identity client library

Key concepts

There are four major families of functionality provided in this preview SDK:

  • Attestation policy management certificate management (yes, policy management management).

The Microsoft Azure Attestation service runs in two separate modes: 'Isolated' and 'AAD'. When the service is running in 'Isolated' mode, the customer needs toprovide additional information beyond their authentication credentials to verify that they are authorized to modify the state of an attestation instance.

Finally, each region in which the Microsoft Azure Attestation service is available supports a 'shared' instance, whichcan be used to attest SGX enclaves which only need verification against the azure baseline (there are no policies applied to the shared instance). TPM attestation is not available in the shared instance.While the shared instance requires AAD authentication, it does not have any RBAC policies - any customer with a valid AAD bearer token can attest using the shared instance.

Attestation

SGX or TPM attestation is the process of validating evidence collected froma trusted execution environment to ensure that it meets both the Azure baseline for that environment and customer defined policies applied to that environment.

Attestation service token signing certificate discovery and validation

One of the core operational guarantees of the Azure Attestation Service is that the service operates 'operationally out of the TCB'. In other words, there is no way that a Microsoft operator could tamper with the operation of the service, or corrupt data sent from the client. To ensure this guarantee, the core of the attestation service runs in an Intel(tm) SGX enclave.

To allow customers to verify that operations were actually performed inside the enclave, most responses from the Attestation Service are encoded in a JSON Web Token, which is signed by a key held within the attestation service's enclave.

This token will be signed by a signing certificate issued by the MAA service for the specified instance.

If the MAA service instance is running in a region where the service runs in an SGX enclave, thenthe certificate issued by the server can be verified using the oe_verify_attestation_certificate API.

The AttestationResponse object contains two main attributes: token and value. The token attribute contains the complete token returned by the attestation service, the value attribute contains the body of the JSON Web Token response.

Policy Management

Each attestation service instance has a policy applied to it which defines additional criteria which the customer has defined.

For more information on attestation policies, see Attestation Policy

Policy Management certificate management

When an attestation instance is running in 'Isolated' mode, the customer who created the instance will have provideda policy management certificate at the time the instance is created. All policy modification operations require that the customer signthe policy data with one of the existing policy management certificates. The Policy Management Certificate Management APIs enableclients to 'roll' the policy management certificates.

Isolated Mode and AAD Mode

Each Microsoft Azure Attestation service instance operates in either 'AAD' mode or 'Isolated' mode. When an MAA instance is operating in AAD mode, it means that the customer which created the attestation instance allows Azure Active Directory and Azure Role Based Access control policies to verify access to the attestation instance.

AttestationType

The Microsoft Azure Attestation service supports attesting different types of evidence depending on the environment.Currently, MAA supports the following Trusted Execution environments:

Is There An Sgx Sdk Download

  • OpenEnclave - An Intel(tm) Processor running code in an SGX Enclave where the attestation evidence was collected using the OpenEnclave oe_get_report or oe_get_evidence API.
  • SgxEnclave - An Intel(tm) Processor running code in an SGX Enclave where the attestation evidence was collected using the Intel SGX SDK.
  • Tpm - A Virtualization Based Security environment where the Trusted Platform Module of the processor is used to provide the attestation evidence.

Runtime Data and Inittime Data

RuntimeData refers to data which is presented to the Intel SGX Quote generation logic or the oe_get_report/oe_get_evidence APIs. If the caller to the attest API provided a runtime_data attribute, The Azure Attestation service will validate that the first 32 bytes of the report_data field in the SGX Quote/OE Report/OE Evidence matches the SHA256 hash of the runtime_data.

InitTime data refers to data which is used to configure the SGX enclave being attested.

Note that InitTime data is not supported on Azure DCsv2-Series virtual machines.

Additional concepts

Is There An Sgx Sdk

Examples

Create client instance

Creates an instance of the Attestation Client at uri endpoint.

Get attestation policy

The set_policy method retrieves the attestation policy from the service.Attestation Policies are instanced on a per-attestation type basis, the AttestationType parameter defines the type to retrieve.

Set an attestation policy for a specified attestation type

If the attestation service instance is running in Isolated mode, the set_policy API needs to provide a signing certificate (and private key) which can be used to validate that the caller is authorized to modify policy on the attestation instance. If the service instance is running in AAD mode, then the signing certificate and key are optional.

Under the covers, the SetPolicy APIs create a JSON Web Token based on the policy document and signing information which is sent to the attestation service.

If the service instance is running in AAD mode, the call to set_policy can besimplified:

Clients need to be able to verify that the attestation policy document was not modified before the policy document was received by the attestation service's enclave.

Is There An Sgx Sdk

There are two properties provided in the PolicyResult that can be used to verify that the service received the policy document:

  • policy_signer - if the set_policy call included a signing certificate, this will be the certificate provided at the time of the set_policy call. If no policy signer was set, this will be null.
  • policy_token_hash - this is the hash of the JSON Web Token sent to the service.

To verify the hash, clients can generate an attestation token and verify the hash generated from that token:

Attest SGX Enclave

Use the attest_sgx method to attest an SGX enclave.

One of the core challenges customers have interacting with encrypted environments is how to ensure that you can securely communicate with the code running in the environment ('enclave code').

One solution to this problem is what is known as 'Secure Key Release', which is a pattern that enables secure communication with enclave code.

To implement the 'Secure Key Release' pattern, the enclave code generates an ephemeral asymmetric key. It then serializes the public portion of the key to some format (possibly a JSON Web Key, or PEM, or some other serialization format).

The enclave code then calculates the SHA256 value of the public key and passes it as an input to code which generates an SGX Quote (for OpenEnclave, that would be the oe_get_evidence or oe_get_report).

The client then sends the SGX quote and the serialized key to the attestation service. The attestation service will validate the quote and ensure that the hash of the key is present in the quote and will issue an 'Attestation Token'.

The client can then send that Attestation Token (which contains the serialized key) to a 3rd party 'relying party'. The relying party then validates that the attestation token was created by the attestation service, and thus the serialized key can be used to encrypt some data held by the 'relying party' to send to the service.

This example shows one common pattern of calling into the attestation service to retrieve an attestation token associated with a request.

This example assumes that you have an existing AttestationClient object which is configured with the base URI for your endpoint. It also assumes that you have an SGX Quote (quote) generated from within the SGX enclave you are attesting, and 'Runtime Data' (runtime_data) which is referenced in the SGX Quote.

Additional information on how to perform attestation token validation can be found in the MAA Service Attestation Sample.

Retrieve Token Certificates

Use get_signing_certificates to retrieve the certificates which can be used to validate the token returned from the attestation service.

Troubleshooting

Most Attestation service operations will raise exceptions defined in Azure Core. The attestation service APIs will throw a HttpResponseError on failure with helpful error codes. Many of these errors are recoverable.

Additional troubleshooting information for the MAA service can be found here

Next steps

For more information about the Microsoft Azure Attestation service, please see our documentation page.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit the Contributor License Agreement site.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

See CONTRIBUTING.md for details on building, testing, and contributing to these libraries.

Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in theIssuessection of the project.

1.0.0b3 (2021-05-12)

Features Added

  • Added reset_policy API which was missed in the previous API.
  • Added models for all the generated API types.
  • Documentation cleanup for several APIs.

Breaking Changes

  • Creating the StoredAttestationPolicy model type means that the attestation_policykwargs parameter for the constructor has been replaced with a positional policy parameter. As a result of this change, this code:
There

changes to:

  • Several parameters for the AttestationResult type have been renamed, andseveral parameters which were shared with AttestationToken have beenremoved. In general, the naming changes removed some protocol specificelements and replaced them with friendlier names. Finally, the deprecatedattributes have been removed from the AttestationResult

    Full set of changes:

    • iss renamed to issuer
    • cnf renamed to confirmation
    • jti renamed to unique_identifier
    • iat removed
    • exp removed
    • nbf removed
    • deprecated_version removed
    • deprecated_is_debuggable removed
    • deprecated_sgx_collateral removed
    • deprecated_enclave_held_data removed
    • deprecated_enclave_held_data2 removed
    • deprecated_product_id removed
    • deprecated_mr_enclave removed
    • deprecated_mr_signer removed
    • deprecated_svn removed
    • deprecated_tee removed
    • deprecated_policy_signer removed
    • deprecated_policy_hash removed
    • deprecated_rp_data removed

    If customers need to access the removed or renamed fields directly, they canuse the get_body method of the AttestationResponse object:

1.0.0b2 (2021-05-11)

Features Added

  • Preliminary implementation of a Track 2 SDK for the attestation service.

Breaking Changes

  • Complete reimplementation of the API surface, follows the API patterns alreadyestablished for the attestation service.

1.0.0b1 (2021-01-15)

Initial early preview release for MAA Data Plane SDKDemonstrates use of the machine generated MAA APIs.

  • Initial Release

Is There An Sgx Sdk File

Release historyRelease notifications | RSS feed

1.0.0b3 pre-release

1.0.0b2 pre-release

1.0.0b1 pre-release

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for azure-security-attestation, version 1.0.0b3
Filename, sizeFile typePython versionUpload dateHashes
Filename, size azure_security_attestation-1.0.0b3-py2.py3-none-any.whl (71.1 kB) File type Wheel Python version py2.py3 Upload dateHashes
Filename, size azure-security-attestation-1.0.0b3.zip (593.1 kB) File type Source Python version None Upload dateHashes
Close

Hashes for azure_security_attestation-1.0.0b3-py2.py3-none-any.whl

Is There An Sgx Sdk App

Hashes for azure_security_attestation-1.0.0b3-py2.py3-none-any.whl
AlgorithmHash digest
SHA256acf31c96d9dd418934c6355515d2a473301b3eeba061a12ca3caaaf98904f4d5
MD56ca4d5377d4fc54c59a6f24a3c89139d
BLAKE2-256689156190a4d280a1f81a7658779a881e8593f7b8b20f0c0d762b33c1a516c92
Close

Hashes for azure-security-attestation-1.0.0b3.zip

Hashes for azure-security-attestation-1.0.0b3.zip
AlgorithmHash digest
SHA256f9243a04e5cbf744aac9a94b2b812fcd0e3969aeed177300769fb0cc0d6c00ea
MD56c2f5f2032b87224c258793675dcd085
BLAKE2-2564050932bf0a373c9ba88886b3ba10b1100ea1b24108b6af87b636ba3ea9be3d5