Skip to content

acompany-develop/Humane-RAChain-NS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Humane NVIDIA-CC/SEV-SNP Remote Attestation Chain Framework (Humane-RAChain-NS)

Note: An English version of this document is provided in the first half of this file. A Japanese version follows after the separator below. 日本語版は本ドキュメントの埌半に掲茉しおいたす。

This repository provides a Remote Attestation (RA) chain framework that performs RA against both NVIDIA Confidential Computing (a GPU TEE supported from the NVIDIA Hopper architecture onward; hereafter "NCC") and AMD SEV-SNP, primarily intended for execution on Azure's Standard_NCC40ads_H100_v5.

NCC requires that attestation be performed from a Confidential VM (CVM) such as an SEV-SNP CVM; a remote user (Relying Party) of the CVM cannot perform RA directly against NCC without going through the CVM. SEV-SNP itself also has a large Trusted Computing Base (TCB) and a multi-stage boot sequence, which makes performing security best-practice RA — while accounting for the environment — extremely difficult, and there are few existing frameworks for it.

To address this, Humane-RAChain-NS first performs attestation against NCC, then binds the resulting evidence and verification result to a trust chain anchored at SEV-SNP (specifically, the AMD Root Key) — namely, a vTPM Quote whose Attestation Key is bound to the SEV-SNP Attestation Report. By then verifying the SEV-SNP Attestation Report and the vTPM Quote as appropriately as possible, trust can be established in a chained manner — from NCC, through SEV-SNP, through the VM's lower-layer components (vTPM, OVMF, etc.), the kernel, and finally the workload of interest — thereby establishing an RA chain.

At this time, operation on platforms other than Azure is not supported.

What Humane-RAChain-NS Achieves

Specifically, Humane-RAChain-NS performs processing that satisfies the following assumptions and goals. In principle, all of the processing below is executed automatically by Humane-RAChain-NS; developers and users who simply use this library do not need to be aware of (or implement) these steps.

  • The flow is: first the SEV-SNP CVM performs attestation of the NCC, and then the CVM itself (SEV-SNP) is attested, thereby establishing an RA chain from the NCC up to the Relying Party. Therefore, NCC attestation is performed first.

  • Using NVIDIA's Attestation SDK, the CVM obtains the NCC Evidence (equivalent to a Quote in SGX). Humane-RAChain-NS then requests NRAS (NVIDIA Remote Attestation Service) to verify this Evidence (Remote GPU Attestation). This realizes CVM↔NCC attestation. The client (Relying Party) sends a nonce, which the CVM uses, as countermeasure against replay attacks on the Evidence.

    • The hash of this Evidence and verification result (Attestation Report) is stored in the PCR (Platform Configuration Register) of a vTPM whose trust is anchored at AMD (hereafter simply "vTPM"). By using this data along with the TPM Quote, its integrity is guaranteed.

    • Regarding PCR banks: each hash algorithm (sha1, sha256, sha384) has its own dedicated bank, but Humane-RAChain-NS uses the sha256 bank uniformly.

  • For TLS communication between the CVM and the Relying Party, a self-signed certificate dynamically generated per session by the CVM and a TLS session (including the TLS channel key) are used. Since the self-signed certificate is hash-measured by the vTPM's PCR, the Relying Party can be confident — as long as it has accepted RA and continues TLS communication tied to this self-signed certificate — that the communication peer is the expected CVM.

    • The binding between the self-signed certificate and the TLS encryption key is automatically guaranteed by verifying — via RA — that Humane-RAChain-NS is operating correctly.
  • After NCC attestation, the CVM next generates the SEV-SNP Attestation Report (a structure that resembles a combined Quote and Attestation Report in SGX). On Azure CVMs, it is generated wrapped inside an HCL Report (a structure consisting of the SEV-SNP Report, a JSON bound into REPORT_DATA, hash-algorithm and TEE-type metadata, etc.). At the same time, the CVM also obtains the certificate for the VCEK used to sign the Attestation Report (VCEK Cert) and the TPM AK (Attestation Key) public key, which is also embedded in (i.e. bound to AMD's trust chain through) the SEV-SNP Attestation Report.

    • These are delivered to the Relying Party. The implementation has the Relying Party verify the authenticity of the SEV-SNP Attestation Report and the TPM AK on the Relying Party side (the Relying Party performs verification of attestation).
  • Once the SEV-SNP-related attestation data has been acquired, the runtime workload — including Humane-RAChain-NS itself — is then measured into vTPM PCR bank 23. Specifically, the following data and files are sequentially Extend-ed into PCR23, so that PCR23 can track the integrity of the required components:

    • The TLS self-signed certificate dynamically generated inside the CVM. As noted above, this is data that can be referenced to uniquely identify the session with the CVM.
    • The VCEK Cert corresponding to the VCEK used to sign the SEV-SNP Attestation Report.
    • The TPM AK public key.
    • The Evidence from NCC Attestation.
    • The NCC Attestation Report.
    • The Humane-RAChain-NS server-side scripts and the NCC Attestation policy.
    • The workload script to run after RA.

    This allows the Relying Party to be confident that the above data definitely originates from the CVM it is communicating with.

  • At this point the SEV-SNP Attestation Report has been generated, the necessary measurements have been registered in the PCRs, and the AK public key — used to sign the TPM Quote based on those PCRs — is bound into the SEV-SNP Attestation Report. So the next step is to actually generate the TPM Quote. When generating the Quote, as with NCC attestation, the nonce sent by the Relying Party is included to prevent replay attacks.

    • By default, the PCR banks included in the TPM Quote are 0–10, 12, 14, and 23. PCR0–7 cover the firmware layer up to just before the guest OS (VMPL0–2). PCR10 holds the IMA (Integrity Measurements Architecture) policy (the OS kernel layer and some runtime workloads). PCR23 stores the hash values of the various data registered above. Banks 9, 10, 12, and 14 are included as a precaution because IMA-related changes may cause them to vary. The boot_aggregate entry in the IMA log is the hash of PCR0–9 concatenated, so PCR8 is also included to allow verification.

    • By loading at boot time an IMA policy that targets Humane-RAChain-NS scripts and the runtime workload, a trust chain analogous to Secure Boot / Measured Boot — SEV-SNP → firmware → OS kernel → Humane-RAChain-NS / workload — can be guaranteed at the SEV-SNP level. However, there is currently no mechanism to bind the IMA policy itself, so the trust chain remains incomplete.

    • The firmware layer corresponding to PCR0–7 (which includes OVMF, SVSM, the vTPM implementation itself, etc.) has its source code unpublished by Azure, so on Azure these become so-called self-asserted measurements. However, if used on a cloud where the source is published, fully zero-trust verification can be achieved by also verifying measurements against the source.

  • At this point all the evidence needed to prove the chain from SEV-SNP through Humane-RAChain-NS and the workload is available, so the CVM transmits the following data to the Relying Party:

    • The dynamically generated self-signed TLS certificate.
    • The VCEK Cert.
    • The HCL Report (including the SEV-SNP Attestation Report).
    • The NCC Attestation Evidence and Attestation Report.
    • The TPM AK public key.
    • The TPM Quote.
    • The IMA policy and measurement log.
  • Ultimately, Linux IMA can measure all runtime content from the OS kernel onward, so depending on IMA policy configuration, Extending into PCR23 is semantically redundant. However, IMA logs tend to be extremely long, which makes manual inspection burdensome. From a usability standpoint, we therefore adopt a two-tier configuration: minimal content (as described above) is also Extended into PCR23 for easy inspection, while PCR10 can also be checked if complete and exhaustive verification is desired.

  • After receiving the above data from the CVM, the Relying Party first verifies the VCEK Cert. It is verified using the AMD intermediate CA certificate (ASK) and the AMD root CA certificate (ARK), confirming the authenticity of the VCEK used.

  • Next, using the verified VCEK Cert, the Relying Party verifies the HCL Report.

    • The signature of the SEV-SNP Attestation Report is verified with the VCEK Cert, and the report is checked against the expected SEV-SNP measurement and against expected machine-configuration requirements (SMT disabled, TSME enabled status, vulnerability mitigations status, etc.).
    • The REPORT_DATA in the SEV-SNP Attestation Report is checked against the hash of the JSON (Runtime Claims) in the HCL Report, and the JSON is checked to confirm that the nonce is included as user-data.
  • Next, in order to verify the TPM Quote, the Relying Party first verifies the TPM AK used to sign the TPM Quote. By verifying that the TPM AK bound in the JSON within the SEV-SNP Attestation Report matches the AK received from the CVM (obtained directly from vTPM) as part of the response, the integrity of the TPM AK is verified.

  • After TPM AK verification, the TPM Quote received is verified using the AK's signature. The integrity of the received PCR list is also verified at this time.

  • Once TPM Quote verification is complete, the PCR banks are checked to see if they match the expected hashes.

    • For PCR0–7, strict checking of the firmware layer could in principle be done by logging into the CVM beforehand and obtaining the hash values to compare against the PCR values in the attestation result, but this check is not currently implemented.

    • For PCR23, the expected PCR23 value is computed from (copies of) the files that are the measurement targets. Specifically, the hash is Updated on the client side in the same order in which it was PCR-Extended on the CVM side, and the final hash value is then checked to match the value of PCR bank 23.

    • For PCR10, the authenticity of the IMA log is confirmed by verifying that the PCR value reproduced from the IMA log matches the received PCR10. Then, by checking whether each entry in the IMA log records the expected hash value, workload integrity is guaranteed.

  • Finally, to address the need for the Relying Party to also be able to perform NCC Attestation as a safeguard (for example, users who suspect that the guest OS might somehow bypass NCC Attestation, even though strict Measured Boot would make this unlikely), the Relying Party can also run NCC Attestation on its own. Similar to the CVM side, it sends the NCC Attestation Evidence to NRAS and obtains verification. Since the Evidence includes a Relying Party-specified nonce, the Relying Party can reliably perform NCC Attestation on its own.

Verified Environments

Server (CVM with NCC)

  • OS: Ubuntu 22.04.5 LTS
  • Azure VM instance: Azure Standard_NCC40ads_H100_v5
  • Linux kernel: 6.8.0-1018-azure
  • nvattest CLI: nvattest 1.2.0+1772475102 (Linux/x86_64) (successor of the legacy nv-attestation-sdk)
  • snpguest: version 0.8.2
  • Python: 3.10.12
  • tpm2_pytss: version 2.3.0
  • tpm2-tools: version 5.2-1build1

Server (CVM without NCC)

  • OS: Ubuntu 24.04.1 LTS
  • Azure VM instance: Azure Standard DC2ads_v6
  • Linux kernel: 6.14.0-1017-azure-fde
  • snpguest: v0.10.0
  • Python: v3.12.3
  • tpm2_pytss: Commit c7fd022
  • tpm2-tools: Commit d15fc36 (next release v5.8.0)

Client

Operation on the same machine (environment) as the server has been verified.

Remote operation has also been verified in the following environment:

  • OS: Ubuntu 22.04.3 LTS
  • Azure VM instance: Standard_DC4s_v3
  • Linux kernel: 6.8.0-1018-azure

Other libraries that overlap with the server have been confirmed to work using the versions on the server. For client-side remote operation we have used an Intel SGX instance (Standard_DC4s_v3) due to local environment constraints, but neither the client nor the server requires Intel SGX functionality. The client is implemented assuming execution on an instance with no TEE at all (including SGX).

Use of Python Virtual Environments (venv)

The server and client in this repository manage Python packages collectively via requirements.txt and are designed to run inside a venv. As of Ubuntu 23.04 and later, direct pip install into the system package directory is restricted by default (PEP 668), making venv use essentially mandatory.

The setup instructions that follow assume that a venv is created under Humane-RAChain-NS/server/ for the server and under Humane-RAChain-NS/client/ for the client. The creation, activation, and installation of dependencies into the venv are expected to be performed by the user in advance; scripts like run-server.sh do not activate the venv or run pip install.

If the venv package is not installed, install it with the following command:

sudo apt install -y python3-venv

Installation

Server (CVM)

The description below assumes installation on an Azure NCC instance.

Cloning the Repository

  • Clone the Humane-RAChain-NS repository. The following prerequisite-installation steps assume that the repository has already been cloned.

    git clone https://github.com/acompany-develop/Humane-RAChain-NS.git

Installing Prerequisite Packages

  • If Python or pip is not installed, install them by following the official procedure. Python 3.10.12 is the verified version.

  • Install the prerequisite packages required for TPM operations from Python via apt:

    sudo apt -y install libtss2-dev pkg-config python3-dev
  • Install the following for the TPM operations used when extracting the Measurement (described later):

    sudo apt -y install tpm2-tools
  • The required Python packages are listed in server/requirements.txt (for tpm2-pytss, the latest version is fetched from GitHub to avoid an unfixed bug on PyPI). Create a server venv under the server directory, activate it, and install them collectively:

    cd Humane-RAChain-NS/server/
    python3 -m venv venv
    source venv/bin/activate
    pip install --upgrade pip
    pip install -r requirements.txt

    All subsequent server-side operations (installation of NCC-related packages described below, execution of run-server.sh, etc.) must be performed with source venv/bin/activate already executed.

Granting vTPM Access Permissions

  • Log in as the user who will run Humane-RAChain-NS and run the following commands. This grants vTPM access without sudo. After running, reboot to make the group addition take effect.

    sudo usermod -aG tss $USER
    newgrp tss

Installing NCC-related Packages

If NCC Attestation is not being performed, this section can be skipped.

  • For NCC GPU Attestation, the NVIDIA-distributed nvattest CLI is used (the legacy nv-attestation-sdk is deprecated). nvattest only needs to be placed on PATH as a system binary; it does not need to be installed inside the Python venv. To install, run the following commands as shown on the download page:

    wget https://developer.download.nvidia.com/compute/nvat/1.2.0/local_installers/nvat-repo-ubuntu2204-1-2-local_1.0-1_amd64.deb
    sudo dpkg -i nvat-repo-ubuntu2204-1-2-local_1.0-1_amd64.deb
    sudo cp /var/nvat-local-repo-ubuntu2204-1.2.0/nvat-*-keyring.gpg /usr/share/keyrings/
    sudo apt-get update
    sudo apt-get -y install nvattest

    Note that the above commands are expected to change with version updates, so verifying the actual command at the linked page is recommended. For different OS versions or distributions, make the appropriate selection at the link above and follow the displayed commands.

  • After installation, verify that the binary is visible on PATH with the following command:

    nvattest --version

    Humane-RAChain-NS calls this nvattest from the server-side attester.py via subprocess and performs attestation in two steps:

    1. nvattest collect-evidence to obtain GPU Evidence (equivalent to a Quote in SGX).
    2. nvattest attest --verifier local to verify the authenticity of the Evidence and obtain an Attestation Report.

    By default, this nvattest binary is also Extended into PCR23 (described later), so prepare a version (including distribution) identical to that of the client for client-side recomputation. Alternatively, it can be excluded from the PCR23 extension targets, as described later.

  • Since CUDA Toolkit is not installed by Azure's official procedure, install it for GPU programming with workloads running on Humane-RAChain-NS:

    wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
    sudo dpkg -i cuda-keyring_1.1-1_all.deb
    sudo apt update
    sudo apt -y install cuda-toolkit-13-1

    Running the following will print version info if installation is successful:

    export PATH=/usr/local/cuda-13.1/bin:$PATH
    nvcc --version

IMA Configuration

To measure content beyond the OS kernel — such as user workloads — Linux's IMA feature must be used. Therefore, IMA-related configuration must also be performed.

  • Log into the TD and create a folder named ima under /etc/.

    sudo mkdir /etc/ima
  • Move into the created folder and create a file named ima-policy. From here on, since shutting down the TD in an incomplete state can result in unrecoverable damage, do not shut down the TD by any means other than the procedure described below.

    cd /etc/ima
    sudo touch ima-policy
  • Populate the file with the following contents. The FILE_CHECK line can remain commented out for now. A more detailed configuration that matches actual operation is described later in the "IMA Detailed Configuration" section.

    # PROC_SUPER_MAGIC
    dont_measure fsmagic=0x9fa0
    # SYSFS_MAGIC
    dont_measure fsmagic=0x62656572
    # DEBUGFS_MAGIC
    dont_measure fsmagic=0x64626720
    # TMPFS_MAGIC
    dont_measure fsmagic=0x1021994
    # DEVPTS_SUPER_MAGIC
    dont_measure fsmagic=0x1cd1
    # BINFMTFS_MAGIC
    dont_measure fsmagic=0x42494e4d
    # SECURITYFS_MAGIC
    dont_measure fsmagic=0x73636673
    # SELINUX_MAGIC
    dont_measure fsmagic=0xf97cff8c
    # SMACK_MAGIC
    dont_measure fsmagic=0x43415d53
    # CGROUP_SUPER_MAGIC
    dont_measure fsmagic=0x27e0eb
    # CGROUP2_SUPER_MAGIC
    dont_measure fsmagic=0x63677270
    # NSFS_MAGIC
    dont_measure fsmagic=0x6e736673 
    
    # Measurement targets and measurement triggers
    
    # Measure files MMAP-ed for program execution
    measure func=MMAP_CHECK mask=MAY_EXEC
    
    # Measure executed binary programs
    measure func=BPRM_CHECK mask=MAY_EXEC
    
    # Measure files opened by root (uid=0)
    # measure func=FILE_CHECK mask=MAY_READ uid=0
    
    # Measure loaded kernel modules
    measure func=MODULE_CHECK
    
    # Measure firmware loaded into the kernel
    measure func=FIRMWARE_CHECK
    
  • Reboot the VM instance.

Client

Cloning the Repository

  • Clone the Humane-RAChain-NS repository. The following prerequisite-installation steps assume that the repository has already been cloned.

    git clone https://github.com/acompany-develop/Humane-RAChain-NS.git

Installing Prerequisite Packages

  • As with the server installation, install Python and pip following the official procedure if they are not already installed. Python 3.10.12 is the verified version.

  • Install the following library required for TPM operations (TPM Quote verification):

    sudo apt -y install tpm2-tools

    As of February 2026, the latest tpm2-tools version 5.7 contains an unfixed bug that affects parts of this repository. The bug will be fixed in the next release 5.8. For now, build the latest patched version from GitHub yourself with the following:

    sudo apt install -y build-essential autoconf autoconf-archive automake libtool pkg-config libssl-dev libtss2-dev libcurl4-openssl-dev
    git clone https://github.com/tpm2-software/tpm2-tools.git
    cd tpm2-tools
    ./bootstrap
    mkdir -p build
    cd build
    ../configure
    make -j"$(nproc)"
    cd tools
    sudo install -m 0755 ./tpm2 /usr/local/bin/tpm2
    sudo ln -sf /usr/local/bin/tpm2 /usr/local/bin/tpm2_checkquote
  • Install snpguest — used for SEV-SNP Attestation Report and VCEK Cert verification — and the Rust toolchain required for it:

    sudo apt install -y build-essential clang
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source "$HOME/.cargo/env"
    git clone https://github.com/virtee/snpguest.git
    cd snpguest
    cargo build -r
  • The required Python packages (requests, cryptography, pyyaml, and the IMA-log verification tool IMA-PCR-Utils) are listed in client/requirements.txt. Create a client venv under the client directory, activate it, and install them collectively:

    cd Humane-RAChain-NS/client/
    python3 -m venv venv
    source venv/bin/activate
    pip install --upgrade pip
    pip install -r requirements.txt

    All subsequent client-side operations (installation of NCC-related packages described below, execution of client.py, etc.) must be performed with source venv/bin/activate already executed.

Installing NCC-related Packages

If NCC Attestation is not being performed, this section can be skipped.

  • If the client also performs a double-check of the NCC Evidence (verify_ncc_flag: true in settings.yaml), the NVIDIA-distributed nvattest CLI needs to be on PATH in the client environment as on the server (the legacy nv-attestation-sdk is deprecated). It also does not need to be installed inside the Python venv.

    After installation, verify that the binary is visible on PATH with the following command:

    nvattest --version

    The Humane-RAChain-NS client writes the Evidence array received from the server to a temporary file and re-verifies it by calling nvattest attest --verifier local --gpu-evidence-source file via subprocess.

    By default, this nvattest binary is also Extended into PCR23 (described later), so prepare a version (including distribution) identical to that of the server for client-side recomputation. Alternatively, it can be excluded from the PCR23 extension targets, as described later.

Configuration

If you just want to verify operation, follow this section only to obtain expected_measurement.dat and specify PLATFORM_INFO (setting it to [2, 2, 2, 2, 2, 2] skips all PLATFORM_INFO checks), then proceed to the "Execution" section.

Server (CVM)

  • The Humane-RAChain-NS scripts, NCC Attestation policy, and runtime workload (the script Humane-RAChain-NS executes after RA acceptance) that are registered into PCR bank 23 are configured in the following portion of Humane-RAChain-NS/server/attester.py:

    # Humane-RAChain-NS script filenames targeted for PCR Extend
    PCR_EXTEND_TARGET_HUMANE_BASE = [
        "api.py", 
        "attester.py", 
        "cert_gen.py",
    ]
    
    # Files added when NCC Attestation is enabled
    PCR_EXTEND_TARGET_HUMANE_GPU = [
        "policy/server_gpu_ra_policy.json",
        "/usr/bin/nvattest",
    ]
    
    # ...
    
    # Workload filenames targeted for PCR Extend
    PCR_EXTEND_TARGET_WORKLOADS = [
        "sample.py"
    ]

    If you change the script structure of Humane-RAChain-NS itself or the NCC Attestation policy file structure, be sure to update the upper PCR_EXTEND_TARGET_HUMANE_* lists. Files not listed here will not have their measurement registered in PCR bank 23 when the TPM Quote is created. Conversely, when changing the runtime workload, add to or modify entries in the lower PCR_EXTEND_TARGET_WORKLOADS list. For example, if you want to run a script other than the default sample, you must edit this section. If a folder is specified, its contents are also measured recursively.

  • The NRAS URL is specified at the following location inside attest_ncc() in Humane-RAChain-NS/server/attester.py:

    NRAS_URL = "https://nras.attestation.nvidia.com/v3/attest/gpu"

    If you need to change this endpoint for any reason — e.g. when NRAS API versions are updated — modify this line directly.

  • Which PCR banks are included when generating the TPM Quote is specified at the following location inside get_tpm_quote() in Humane-RAChain-NS/server/attester.py:

    # PCR list-file generation
    # By default, PCR banks 0-10, 12, 14, and 23 are included
    # Specify sha256:all to include all PCR banks
    selector_str = "sha256:0,1,2,3,4,5,6,7,8,9,10,12,14,23"
    pcr_indices = selector_str_to_pcr_indices(selector_str)
  • Currently, the IMA files are simply copied from the CVM's existing policy and log and presented to the client (the application of IMA-related hashes into PCR bank 10 is performed automatically). The locations of these files are specified in Humane-RAChain-NS/server/run-server.sh:

    SRC_POLICY="/etc/ima/ima-policy"
    SRC_MEASUREMENTS="/sys/kernel/security/ima/ascii_runtime_measurements"

    If these paths need to be changed for any reason — environment differences, etc. — modify these lines.

  • If you want to change the port on which client requests are received, directly modify the following section (port=8080) of Humane-RAChain-NS/server/api.py:

    config = uvicorn.Config(
        app=app,
        host="0.0.0.0",
        port=8080,
        ssl_certfile=cert_file_path,
        ssl_keyfile=key_file_path,
    )
    config.load()
    config.ssl.options |= ssl.OP_NO_TICKET
    
    server = uvicorn.Server(config)
    server.run()

Client

  • Specify the path to the directory containing the built snpguest in the following entry of client/settings.yaml:

    # snpguest_path = "$HOME/snpguest/target/release"
    snpguest_path: "~/snpguest/target/release"

    The default is the path where snpguest has been cloned and built directly under the home directory of the logged-in user (e.g. under /home/username/). Adjust the path if it is cloned elsewhere or if a debug build is used.

  • If you are using an SEV-SNP CVM that is not NCC-compatible, or otherwise not performing NCC Attestation, change the following item in client/settings.yaml from true to false:

    # Flag for whether NCC Attestation is enabled. true means enabled.
    gpu_enabled: true
  • For SEV-SNP Attestation, the SEV-SNP Measurement (identity measurement) must be obtained in advance. For example, log in to the CVM in a previously-trusted situation (e.g. locally before VM deployment) and run Humane-RAChain-NS/subtools/measurement_extractor.py to generate expected_measurement.dat:

    cd subtools
    python3 measurement_extractor.py

    The default is configured for a setup where the server and client run on localhost, so simply running this script will automatically place the above dat file under the client folder. When running remotely, move the generated dat file to the client folder of the client environment yourself.

  • Depending on the use case, you may not want to expose the Humane-RAChain-NS server-side source or runtime workload implementation, or you may not want to recompute file hashes on the client side. For such cases, an option is provided to use a pre-supplied hash list to reproduce PCR23. Change the following part of client/settings.yaml:

    # If you want to simply compare a provided hash list against the PCR23
    # value of the TPM Quote — rather than performing client-side hash
    # recomputation — set this variable to false.
    # The hash list can be generated with subtools/hashlist_generator.py.
    # Set to true if you want recomputation.
    recalculate_pcr23_flag: true

    Setting it to false directly Extends using the hash list in expected_pcr23_hash.dat placed directly under the client folder (no file-hash recomputation is performed). This hash-list file can be generated with subtools/hashlist_generator.py:

    cd subtools/
    python3 hashlist_generator.py

    If NCC Attestation is disabled, run with the --no-gpu flag:

    python3 hashlist_generator.py --no-gpu

    For attestation evidence dynamically delivered per RA session (i.e. non-file evidence), the hash is recomputed from the received data regardless of this option. If you change the files targeted by PCR23, also edit the following part of hashlist_generator.py:

    # Humane-RAChain-NS script filenames targeted for PCR Extend (no GPU)
    PCR_EXTEND_TARGET_HUMANE_BASE = [
        "../server/api.py",
        "../server/attester.py",
        "../server/cert_gen.py",
    ]
    
    # Files added when GPU is enabled
    PCR_EXTEND_TARGET_HUMANE_GPU = [
      "../server/policy/server_gpu_ra_policy.json",
      "/usr/bin/nvattest",
    ]
    
    # Workload filenames targeted for PCR Extend
    PCR_EXTEND_TARGET_WORKLOADS = ["../server/sample.py"]
  • PLATFORM_INFO — a bit string representing SEV-SNP configuration (SMT-enabled status, etc.) — is included in the Attestation Report, and Humane-RAChain-NS verifies it. The client can specify the expected value in the following part of Humane-RAChain-NS/client/settings.yaml:

    # List used to check PLATFORM_INFO in the SEV-SNP Report.
    # Size is 6, ordered from the top: SMT enabled, Transparent SME enabled,
    # ECC enabled, RAPL disabled, DRAM ciphertext hiding enabled, BadRAM
    # mitigation enabled. Use 0 or 1 to indicate what is expected. Use 2 for
    # members that should not be verified.
    expected_platform_info: [0, 2, 0, 0, 0, 2]

    Description of each element's corresponding configuration feature (starting from index 0):

    1. Whether Simultaneous Multi-Threading (SMT) is enabled. 0 = disabled, 1 = enabled. SMT is often abused in various attacks, especially in TEE contexts, so disabling is preferable.
    2. Whether Transparent SME is enabled. 0 = disabled, 1 = enabled. This is an AMD SME feature that automatically encrypts all memory regardless of the C-bit.
    3. Whether ECC is enabled. 0 = disabled, 1 = enabled. ECC provides some resistance to unintended bit flips or deliberate bit-flip attacks (e.g. RowHammer).
    4. Whether RAPL is disabled. 0 = enabled, 1 = disabled. RAPL is a CPU-level power-monitoring interface; if enabled, it may be abused in certain side-channel attacks (e.g. PLATYPUS in the SGX context).
    5. Whether SEV-SNP's Ciphertext Hiding is enabled. 0 = disabled, 1 = enabled. When enabled, reads of SEV-SNP-protected memory from outside return a specific fixed value rather than ciphertext. Similar to SGX's Abort Page Semantics.
    6. Whether mitigation against the BadRAM attack is enabled. 0 = disabled, 1 = enabled. While "enabled" is preferable, as of January 2025 there are still many cases in which this bit is unused.

    Given the above, generally specify the expected bit as 0 or 1. For items that may be either, specify 2 to skip verification. With this in mind, expected_platform_info = [0, 2, 0, 0, 0, 2] means:

    • Require SMT disabled.
    • Do not care about Transparent SME.
    • Require ECC disabled.
    • Require RAPL enabled.
    • Require Ciphertext Hiding disabled.
    • Do not care about BadRAM mitigation.

    However, this is by no means the optimal setup. From a purely security viewpoint, [0, 2, 1, 1, 1, 1] would be best, but whether this is satisfiable depends strongly on the cloud's machines. Adjust this flexibly to your needs and environment.

    To directly check the current value of PLATFORM_INFO on the target CVM, the SEV-SNP Attestation Report can be inspected (run on the CVM):

    export PATH=$PATH:$HOME/snpguest/target/release
    tpm2_nvread -C o 0x01400001 > ./snp_report.bin
    dd skip=32 bs=1 count=1184 if=./snp_report.bin of=./guest_report.bin
    snpguest display report guest_report.bin

    The output of snpguest display includes PLATFORM_INFO information like the following (the ALIAS_CHECK_COMPLETE corresponding to BadRAM mitigation is not yet supported):

    Platform Info (0):
    SMT Enabled:               0
    TSME Enabled:              0
    ECC Enabled:               0
    RAPL Disabled:             0
    Ciphertext Hiding Enabled: 0
  • The CVM URL is specified in the following part of client/configs.yaml, so modify here when running remotely, etc.:

    # Don't forget the trailing "/".
    server_url: "https://localhost:8080/"
  • The Humane-RAChain-NS scripts, policies, and runtime workload expected to be measured into PCR bank 23 are listed on the client side in the following part of Humane-RAChain-NS/client/ra_verifier.py:

    # Humane-RAChain-NS script filenames targeted for PCR Extend
    PCR_EXTEND_TARGET_HUMANE_BASE = [
        "../server/api.py",
        "../server/attester.py",
        "../server/cert_gen.py",
    ]
    
    # Files added for NCC Attestation
    PCR_EXTEND_TARGET_HUMANE_GPU = ["../server/policy/server_gpu_ra_policy.json"]

    As with the server configuration, add to or modify this list as needed. Note that when running the client remotely, the server-side scripts/policies on the client side and the actual ones used on the server (those PCR23-registered on the server side) are assumed to be exactly identical. Therefore, any changes to them must be applied identically to the server-side files on both server and client (otherwise the PCR23 hash check will fail).

  • The NRAS URL is specified at the following location inside verify_ncc_attestation() in Humane-RAChain-NS/client/ra_verifier.py:

    NRAS_URL = "https://nras.attestation.nvidia.com/v3/attest/gpu"

    If you need to change this endpoint for any reason — e.g. NRAS API version updates — modify this line directly.

  • Currently, the functionality to reproduce hashes of the firmware-layer PCR0–7 by building from firmware source on the client side is unimplemented. If needed, you can implement firmware verification after check_tpm_quote() completes successfully inside verify_response() of Humane-RAChain-NS/client/ra_verifier.py, using your prepared reproduced hashes.

  • If self-verification of NCC Attestation Evidence is not needed, as described in the usage section, set the corresponding argument in verify_response() (in Humane-RAChain-NS/client/settings.yaml, this is verify_ncc_flag) to False.

  • If you want each entry of the IMA log to be verified, specify the path to the verification policy in the following part of Humane-RAChain-NS/client/settings.yaml:

    # Path to the IMA appraise policy file (YAML). Specify as a relative
    # path from client.py or as an absolute path. Can be generated by
    # subtools/ima_appraise_policy_generator.py. Only referenced when
    # verify_pcr10_flag is true.
    ima_appraise_policy_path: "ima_appraise_policy.yaml"

    ima_appraise_policy.yaml consists of measurement-target paths (in fnmatch format) and an allow list (or deny list) of hash values:

    home_Humane_RAChain_NS_server_sh:
      path: /home/**/Humane-RAChain-NS/server/*.sh
      allow:
      - 28f97e660dd1061224c64ee4ad9d3a63c9b402465323de962f70ee318d8a88e7
    home_Humane_RAChain_NS_server_py:
      path: /home/**/Humane-RAChain-NS/server/*.py
      allow:
      - 0dce80960c8b3464639aeb7a49eb8a1f13964617f3c06c095db8795a4069245a
      - 0e0de7474b3e4b368d518fd657b4fd6701b27c962b258992dd55e418b96262aa
      - 4ed066d8cc9ea214d78d7de5ad65b76e953c82023efe43f76c1006a3403a5e4b
      - aebf70b1aa84c4bdccd288462ae4c4cb7228695ae27797b0e5c2325481b95a9b
    home_Humane_RAChain_NS_server_policy_server_gpu_ra_policy_json:
      path: /home/**/Humane-RAChain-NS/server/policy/server_gpu_ra_policy.json
      allow:
      - 61e6919e3834b4a07a857de19e475695fa7db1d9bd3d247e8ce828ed8fcbf59b
    usr_bin_python3:
      path: /usr/bin/python3
      allow:
      - e1efa562c2cc2e35521a5c9c9b9939921001ff8ca9708a13ef15ace68cc2ccd7

    For example, by logging into the CVM in a previously-trusted situation and running Humane-RAChain-NS/subtools/ima_appraise_policy_generator.py, the IMA verification policy can be auto-generated based on the hash values of the target files at that point in time:

    python3 ima_appraise_policy_generator.py

    Measurement targets for IMA verification-policy generation are configured at the following location in ima_appraise_policy_generator.py:

    # List of path patterns to be specified as IMA appraise policy.
    # Each element is a path pattern interpreted as a glob (and at run time as fnmatch).
    # If you want recursive expansion, include "**"; this script expands with glob.glob(recursive=True).
    # Note: at runtime, matching is done with fnmatch.fnmatchcase, so write
    # patterns as strict as possible matching the file_path in the actual IMA log.
    APPRAISE_TARGETS = [
        "/home/**/Humane-RAChain-NS/server/*.sh",
        "/home/**/Humane-RAChain-NS/server/*.py",
        "/home/**/Humane-RAChain-NS/server/policy/server_gpu_ra_policy.json",
        "/usr/bin/python3",
    ]

Execution

This section describes the execution procedure for running Humane-RAChain-NS as-is.

Server (CVM)

With the server venv activated, run the launcher shell script as follows. Since run-server.sh itself does not activate the venv or install dependencies, the venv must be created in advance per the installation procedure, and source venv/bin/activate must already have been performed:

cd Humane-RAChain-NS/server/
source venv/bin/activate
./run-server.sh

To disable NCC Attestation, run with the --no-gpu flag:

source venv/bin/activate
./run-server.sh --no-gpu

An example of execution is shown below (only the tail of the log is shown since stdout is large):

[Fetch TPM Attestation PubKey]
Fetched TPM Attestation PubKey successfully.

[Reset PCR bank 23]
PCR 23 was successfully reset.

[Extend PCR with evidences]
Extended PCR 23 with VCEK Cert/AK Pub successfully.
Extended PCR 23 with NCC evidences successfully.

[Get TPM Quote]
Generated TPM Quote successfully.
Generated PCR values list successfully.

[Get IMA-related files]
Got IMA-related files successfully.

INFO:     127.0.0.1:36756 - "POST /attestation HTTP/1.1" 200 OK

[Execute sample secret addition]
Added secrets successfully.

INFO:     127.0.0.1:36756 - "POST /sample-addition HTTP/1.1" 200 OK

Client

With the client venv activated, run client.py as follows. The venv must be created in advance per the installation procedure, and source venv/bin/activate must already have been performed:

cd Humane-RAChain-NS/client/
source venv/bin/activate
python3 client.py

An example of execution is shown below (excerpted because stdout is large):

GPU attestation: disabled
[Send attestation challenge]
Generated Nonces:
 NCC Nonce: 5aab8cd9863372289fb2ad9fb9a412e9ab09545926537ac5afccdd80e1820f08
 TPM Nonce: e3891742fbd624d256fb2acb119f7c699abc24722954f16bec4cafa9a80dd136
 SNP Nonce: 75bef4d5574b8a3625c09e3ec796d7f692cf2e0e12f5cc1ec84b0037a3d9bafae16129df2a9cadd103290b1abf51c4d782a1caee0206676a8d8ad4cd069c6343

...

[Verify HCL Report Data binding]
REPORT_DATA expected (sha256, zero-padded) ->
c855dd11a2ba68ab08653b6becb99e91cc22ca9257db5b596ee3605636b8b3710000000000000000000000000000000000000000000000000000000000000000
REPORT_DATA actual ->
c855dd11a2ba68ab08653b6becb99e91cc22ca9257db5b596ee3605636b8b3710000000000000000000000000000000000000000000000000000000000000000
SNP REPORT_DATA matches hash of Runtime Claims.
Runtime Claims user_data matches client-supplied nonce.

[Verify VCEK Cert with ARK Cert]
The AMD ARK was self-signed!
The AMD ASK was signed by the AMD ARK!
The VCEK was signed by the AMD ASK!

SEV-SNP VCEK is valid.

[Verify SEV-SNP Report]
Reported TCB Boot Loader from certificate matches the attestation report.
Reported TCB TEE from certificate matches the attestation report.
Reported TCB SNP from certificate matches the attestation report.
Reported TCB Microcode from certificate matches the attestation report.
VEK signed the Attestation Report!

SEV-SNP's measurement hash->
e14f74982d655d4cbd686b91bcb9431ddb98b6e210e59647089d203035cf99d9a76efbdee19f0958ff3f1aa4518e86e0

Expected measurement ->
e14f74982d655d4cbd686b91bcb9431ddb98b6e210e59647089d203035cf99d9a76efbdee19f0958ff3f1aa4518e86e0

...

[Verify PCR 10]

Received PCR 10 hash (IMA related PCR) ->
f0d6af60d98acded3c1d509922d1d0579e210dc3431fee065631e03f30d36b18

Calculated PCR 10 hash ->
f0d6af60d98acded3c1d509922d1d0579e210dc3431fee065631e03f30d36b18

Received PCR 10 hash matched calculated PCR 10 hash.

[Verify boot_aggregate]

Received boot_aggregate ->
bbdbca85a82cf96aad024bdfedaa4fcc791d857b338b6f7c5a4625bce0118ac4

Calculated boot_aggregate ->
bbdbca85a82cf96aad024bdfedaa4fcc791d857b338b6f7c5a4625bce0118ac4

Received boot_aggregate matched calculated boot_aggregate.

[Appraise IMA log against IMA appraise policy]
IMA appraise policy path -> /home/azureuser/Humane-RAChain-NS/client/ima_appraise_policy.yaml
IMA appraisal passed: 525 entries (1 allow, 524 neutral).

IMA evidences verification passed.

[Skip NVIDIA CC Attestation]

Accepted RA. Proceed to next process.
Pinned session to attested cert (SHA-256 DER): 089413c0c2f90cb264f5356910955aa909322c27371b3512e69a6f1a16945145

[Request sample secret addition]
Sample secret addition result ->
300

Example of Attestation-evidence JSON

An example of the Attestation-evidence JSON returned in response to an Attestation request sent to the Humane-RAChain-NS server is shown below (the --no-gpu case). This JSON example is shared by both the English and Japanese versions of this document; the Japanese version references this section.

{
  "status": "success",
  "message": "Attestation completed",
  "ssl_cert": "-----BEGIN CERTIFICATE-----\nMIIBxDCCAWqgAwIBAgIUFGJCY7pAQRM+lmRUW6n1IU+d0E4wCgYIKoZIzj0EAwIw\nYjELMAkGA1UEBhMCSlAxDjAMBgNVBAgMBUFpY2hpMQ8wDQYDVQQHDAZOYWdveWEx\nGzAZBgNVBAoMEkFjb21wYW55IGNvLiwgTHRkLjEVMBMGA1UEAwwMYXR0ZXN0ZWQt\nY3ZtMB4XDTI2MDUyMDA0MjEzM1oXDTI2MDYxOTA0MjEzM1owYjELMAkGA1UEBhMC\nSlAxDjAMBgNVBAgMBUFpY2hpMQ8wDQYDVQQHDAZOYWdveWExGzAZBgNVBAoMEkFj\nb21wYW55IGNvLiwgTHRkLjEVMBMGA1UEAwwMYXR0ZXN0ZWQtY3ZtMFkwEwYHKoZI\nzj0CAQYIKoZIzj0DAQcDQgAERlr4Def7dhTa8ZZA11cSXt/NY5YZUHjC9a//3GLN\n2dm89/WN+WHPDd4pw4pL8cGVUKpBWRocDHKl9Y7RFjNCSjAKBggqhkjOPQQDAgNI\nADBFAiEA0ZC9gK/iBXt5eFr/8ZbFLdU6YyVW5szJuO+Obr0cA5MCIEDNEwfl3nYp\nvdE9FflbOn2qk6hOLQBXPXPIL8K5/fdt\n-----END CERTIFICATE-----\n",
  "vcek_cert": "-----BEGIN CERTIFICATE-----\nMIIFPzCCAvOgAwIBAgIBADBBBgkqhkiG9w0BAQowNKAPMA0GCWCGSAFlAwQCAgUA\noRwwGgYJKoZIhvcNAQEIMA0GCWCGSAFlAwQCAgUAogMCATAwezEUMBIGA1UECwwL\nRW5naW5lZXJpbmcxCzAJBgNVBAYTAlVTMRQwEgYDVQQHDAtTYW50YSBDbGFyYTEL\nMAkGA1UECAwCQ0ExHzAdBgNVBAoMFkF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dKbJ/SHFMgvGXxklJL0K7LvYSZWHK137UcahG0CVsDMttWuBAFIDKillrn2DDIRN+xG+EGg5s/gKGIrExF6oZ0iAuDtR9Wnwu31jFJRg4J69QaOXT6QdF51Iw==",
    "pcr_selector": "sha256:0,1,2,3,4,5,6,7,8,9,10,12,14,23",
    "pcr_value": "Exd6ZTW63xlBXAZYlwXdWhiQ9zVFxKn+96z+LGF3ore5FD92r/7VVdhir88GqppoKsaJryHLgOkLhU/ag7htFT1FjP5VzAPqH0Q/FWK+7I31HHXhSp/PmnI0oT8ZjnlpPUWM/lXMA+ofRD8VYr7sjfUcdeFKn8+acjShPxmOeWmrYTRrL+U6POY47LGG9VgNu/e9UinSYYB66Z/YvOgZThjIxWvpP16a3HM2px0ZTDXCRpLGcfI6hi3871QTU6UC+3hn1x1u4jAuw4zvSzIrLZyk0U8yFjNzeXcab3x4DME7IOAiQW/fYdcuTaMrQ1R4G+PeBggRaXbSj/2tjDQdKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmAKnGa8k7WMM0xrJIAPtZgP1Jvpk8FPWfhwpFAwwtYxaOw2/+baFA8jnJlszzkBjPWYJyf5xJCe8jHCxKNxK/fGhQsU1hufiIj7HTl9NGklClWsf2ax4+vzfhRF6o0XaMG+di5TxfZPcbnz49cedZS60xsTRPeLd3CSvQW4T7K+aHhPEDAyltmo5GjA/IOToey3BpbEWsspQXkBtgMYYUA=="
  },
  "ima": {
    "ima-policy": "",
    "ima-measurement": "10 498c9bbfb84cee61be6e0768d4190c4b9b385b3a ima-ng sha256:bbdbca85a82cf96aad024bdfedaa4fcc791d857b338b6f7c5a4625bce0118ac4 boot_aggregate\n10 5a9c34240b2f0cca9f47b4c1fab6d23829392470 ima-ng sha256:9b403ac5877723c568548723d1988e91d30d8a8bb171bdae001126729ee93047 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/fs/autofs/autofs4.ko.zst\n10 a66f62e131afe972f8eec94f91070f5a35499860 ima-ng sha256:910c77268babfc7ea567615d11e393f247db00ee988a8a27117974c1c81d8d2b /usr/lib/modules/6.17.0-1005-azure-fde/kernel/fs/nls/nls_iso8859-1.ko.zst\n10 7d26cfd812dfaf0aad0eef0241bcb2200d7e1e62 ima-ng sha256:1dab38e3bdfa4237150b16a0d07acf273ba72fb691c7008a8cc2cafb5755bcdb /usr/lib/modules/6.17.0-1005-azure-fde/kernel/drivers/md/dm-crypt.ko.zst\n10 3a37c30e81aac2549f1be949be782fa8e0224aad ima-ng sha256:9f0a3cd745d9d1a1726b8da9d4f8c2075b467e5bb5eb479c93db5b8301034e55 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/netfilter/x_tables.ko.zst\n10 1e09e1660f6614fd151bd082fe83872cbe5187a4 ima-ng sha256:e0a0aa856a800bfe0d6942e69797a22dac5f204c0d5977c56c78452f41926e8e /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/ipv4/netfilter/ip_tables.ko.zst\n10 a83d1f35ea2bc128d40dec0d1cc02c10c6df00c5 ima-ng sha256:6fae76abacca399f5ca92d9c12402c43a48aa11d9ffd835454a9bd57c03a55db /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/netfilter/nfnetlink.ko.zst\n10 15b66c4d41920e9da332c26f04893be851c05f30 ima-ng sha256:ff91a4f45969da556f8a0f4ee4eaac5e7c5dfaec38eb8b9544da9aad155b08f0 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/drivers/firmware/efi/efi-pstore.ko.zst\n10 e2e6a22495b392f04137f01a6ed6a3536148e897 ima-ng sha256:1f83aa67d4970d43f0b9146d0ef8cd86797b29c100db4a777a9e8529605ec734 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/drivers/nvme/host/nvme-fabrics.ko.zst\n10 d193ce1b99c0451593bb3b5bc2505ff64f40bb4c ima-ng sha256:c415957fe3da568a97bba088238f58667d9e87f5abc45fc4872b201cbd52e8b2 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/arch/x86/kernel/msr.ko.zst\n10 8f5e95c8825c166037826b24539c7bf0395f3981 ima-ng sha256:599765c622fbe9422bf69e18ed17ff83acc794e7096b7027c02429120101fafd /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/sched/sch_fq_codel.ko.zst\n10 90a59ada9f6241995896eea56ff4caadfacf4d98 ima-ng sha256:b57bd3d7025ff272b4a2da2605798c0456e2b2a80b8947c8e652d4aca1617789 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/drivers/net/hyperv/hv_netvsc.ko.zst\n10 b4c505fcf67959a6b8fef4b3c35b4906abf29279 ima-ng sha256:7b0db1906a3faaf1f2617c07c28b455a471d49e39a2cb05e5f8aa73567cdd9af /usr/lib/modules/6.17.0-1005-azure-fde/kernel/arch/x86/crypto/ghash-clmulni-intel.ko.zst\n10 8d23f2ab9a30a70fbb6d3bfb011a8b2837990bc7 ima-ng sha256:b3d8ec65d4a58030d218dfa89feacd8d56260a3af354350ef51de9bf37792b80 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/arch/x86/crypto/polyval-clmulni.ko.zst\n10 ffeebc34d50b1204fe51d778c9c10fbb25e3c470 ima-ng sha256:22c06a98f245471ef184b55b87ab9f48c2f5222c1f737378a5f237b28d484694 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/fs/binfmt_misc.ko.zst\n10 2cce7cca474ace0c092c1560cf42971a2bf42b95 ima-ng sha256:87b05612f1a971db4b0699eb3e920201a8accf97d4cb9f84ef9d7fec74595c49 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/netfilter/nf_tables.ko.zst\n10 9ef38d7864eff99d1373d245ce182c5aed085d2f ima-ng sha256:77f0a0b4fe97b6587d5aec481674d1a954a1f2a53b873ed58f07176f70667d2f /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/netfilter/nft_compat.ko.zst\n10 4e72419b8787154d060effd4cb2f494361ee8126 ima-ng sha256:29cdd6c455f23f709db5f4f8e0af114ce61f73cc3f2833e67b4d8f3ce97932b9 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/ipv4/netfilter/nf_defrag_ipv4.ko.zst\n10 0fd73de3de67a4b9fd0f91cbb6e41100fd2a009d ima-ng sha256:ea6a9d2e3ced16a0e2019d7ddaa884c19ef871261894b9035eeba76ecac37517 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/ipv6/netfilter/nf_defrag_ipv6.ko.zst\n10 f1219752b5c5f246a1d06bfd78418bd83860850e ima-ng sha256:5c1a9b00749a9279915f6f3e205eff617d4a3ffba601e537aa51908bcc886218 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/netfilter/nf_conntrack.ko.zst\n10 a487a4980cf8602376f0bafd66cc294775031038 ima-ng sha256:c3f37be880c51223066903933cb0d53e91e9c8c1486a05ff462f38eb4cec4d71 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/netfilter/xt_conntrack.ko.zst\n10 d9b00a070e8d534f61f58afd84e7ec9995e9c5de ima-ng sha256:d1252ae6be621cbc1837fefc3e175744659f61675b959b64754c507d33173ffb /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/netfilter/xt_tcpudp.ko.zst\n10 ab08356ffee1e35c96504084d0a6da81439c03ac ima-ng sha256:6b181e5b5eb63c84801c7daf982fc77533ebb6ce13205c76a8fba42157e2c7de /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/netfilter/xt_owner.ko.zst\n10 8e2f0c0e4d094cae01b252f4c0682f61e1f0255e ima-ng sha256:9ecded669738c8b4662a977f1861479813c469abd008fbd5cac9f1b80dbd2548 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/llc/llc.ko.zst\n10 8ee6f3faaf41dce57f8f9fae75a8b0629542a177 ima-ng sha256:583908083e80875d126b8549e0b49e5388b5a53af046ffccbbade7795183dddf /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/802/stp.ko.zst\n10 b296405c888119c34f313f86a545d4930a3c299e ima-ng sha256:d749d850fca26cd0f26f08c933788702ad2b9cacc9ed2949daf76ae18add1e2a /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/802/mrp.ko.zst\n10 e9595e6002ea3ba2ab0a23ddaee9a72240dbee4d ima-ng sha256:4484903ef010b3d7c381c706243fa2fc93a7804262acfae4111e6101de1c2553 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/802/garp.ko.zst\n10 6ce809c30c77453b22a78e8e03ce5cb2e3687377 ima-ng sha256:41b59c82e3cb2909a3655461d177ba2359959903d7ec7de59fe98d6ecb869710 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/8021q/8021q.ko.zst\n10 1803758d74c3fdb901039974bcb956efd6d411e5 ima-ng sha256:4006fc13e5cab0cbacf448a049ae8f0e468a67ad099242a9d923d867b0b5f593 /usr/lib/modules/6.17.0-1005-azure-fde/kernel/net/tls/tls.ko.zst\n"
  }
}

IMA Detailed Configuration

Because the range of what IMA can measure is extremely broad, it is difficult to define a single optimal configuration for IMA policy. The default IMA policy assumed in this repository is shown again below:

# PROC_SUPER_MAGIC
dont_measure fsmagic=0x9fa0
# SYSFS_MAGIC
dont_measure fsmagic=0x62656572
# DEBUGFS_MAGIC
dont_measure fsmagic=0x64626720
# TMPFS_MAGIC
dont_measure fsmagic=0x1021994
# DEVPTS_SUPER_MAGIC
dont_measure fsmagic=0x1cd1
# BINFMTFS_MAGIC
dont_measure fsmagic=0x42494e4d
# SECURITYFS_MAGIC
dont_measure fsmagic=0x73636673
# SELINUX_MAGIC
dont_measure fsmagic=0xf97cff8c
# SMACK_MAGIC
dont_measure fsmagic=0x43415d53
# CGROUP_SUPER_MAGIC
dont_measure fsmagic=0x27e0eb
# CGROUP2_SUPER_MAGIC
dont_measure fsmagic=0x63677270
# NSFS_MAGIC
dont_measure fsmagic=0x6e736673 

# Measurement targets and measurement triggers
# Measure files MMAP-ed for program execution
measure func=MMAP_CHECK mask=MAY_EXEC

# Measure executed binary programs
measure func=BPRM_CHECK mask=MAY_EXEC

# Measure files opened by root (uid=0)
# measure func=FILE_CHECK mask=MAY_READ uid=0

# Measure loaded kernel modules
measure func=MODULE_CHECK

# Measure firmware loaded into the kernel
measure func=FIRMWARE_CHECK

With measure func=BPRM_CHECK mask=MAY_EXEC present, all executed binaries are measured. Combined with measurement of kernel modules, etc., at least basic execution can be traced.

The issue is the commented-out measure func=FILE_CHECK mask=MAY_READ uid=0 portion. Since execution is measured by BPRM_CHECK, measuring all other file reads, writes, and appends requires replacing this part with the following:

measure func=FILE_CHECK mask=MAY_READ
measure func=FILE_CHECK mask=MAY_WRITE
measure func=FILE_CHECK mask=MAY_APPEND

However, this measures all file operations by all users and produces an enormous log volume, raising performance concerns.

There is also a behavior in which the measurement value becomes all-zero when a Read-Open is performed during a Write-Open, so there are operational concerns beyond simple policy definition. In the extreme, this means excluding content that can perform such operations from the source — but in real operation this is not always feasible.

These difficulties with IMA configuration are out of scope for Humane-RAChain-NS, so here we only note that there is a gradient of strictness in IMA configuration.

Limitations

Although many of these overlap with what has been described, the limitations are restated:

  • For the firmware-layer PCR0–7, the functionality to build from firmware source, reproduce the hash, and verify it is not implemented. In Azure's case, since the firmware layer is non-public, such implementation would have to assume another cloud or on-premises environment.

  • Root-filesystem hash measurement is not implemented. If needed, it would have to be combined appropriately with the technique proposed by e.g. SNPGuard; the difficulty is high.

  • Measurement acquisition and RA binding for various Python libraries and the interpreter itself are not implemented. This is fundamentally delegated to IMA.

  • While IMA can measure content beyond the OS kernel, IMA itself does not measure the IMA policy, so the policy can be changed — an IMA-specific issue. We plan to publish a solution to this on the repository when it is resolved.

  • The IMA policy included as evidence is copied from either the loaded policy at /sys/kernel/security/ima/policy or the custom IMA policy file at /etc/ima/ima-policy. The latter is the policy loaded at the next CVM boot, and can be freely rewritten once the CVM is running, so it is not guaranteed to match the former. Read permission to the former is set by the kernel configuration option CONFIG_IMA_READ_POLICY. On Azure NCC machines it is set to false by default, so /etc/ima/ima-policy is used.

Advanced Development Using Humane-RAChain-NS

Server (CVM)

  • On the server side, the simplest approach is to write additional definitions (such as additional workload-execution requests) directly into Humane-RAChain-NS/server/api.py. If you write a server script from scratch — for example because you do not wish to use FastAPI/uvicorn — first add the following import:

    from attester import do_attestation

    Then call the Humane-RAChain-NS server-side Attestation API in your endpoint function as follows:

    result = do_attestation(
        data.ncc_nonce,
        data.tpm_nonce,
        cert_pem.decode("utf-8"),
        gpu_enabled
    )

    Note that cert_pem is the TLS self-signed certificate dynamically generated per session; this dynamic generation and the directive to use it must also be implemented separately.

  • In Humane-RAChain-NS/server/api.py, after creating uvicorn.Config, the SSL context is built with config.load(), and TLS session-ticket resumption is disabled with config.ssl.options |= ssl.OP_NO_TICKET. This ensures that a full TLS handshake is always performed on each reconnect, so that client-side certificate pinning (AttestedCertPinningAdapter in client/client.py) is evaluated every time. Only subsequent requests over a TLS session using the same RA-confirmed certificate are accepted after Attestation.

Client

For the client-side usage example, the do_attestation() function in Humane-RAChain-NS/client/client.py is a necessary-and-sufficient sample. Detailed implementation details are documented as comments inside that function — refer to those. The do_attestation() function can also of course be reused as-is. Some of the configuration written inside this function is also described in subsequent sections.

  • To use Humane-RAChain-NS on the client side, first add the following import:

    from ra_verifier import init_verifier, send_attestation_challenge, verify_response
  • After specifying the server URL and the snpguest path, call the init_verifier() function for initialization.

  • While taking the server response, the NCC Attestation nonce, and the TPM Quote nonce as return values, call send_attestation_challenge() to send the Attestation request to the CVM. The nonces are randomly generated on the client side inside the called function.

  • If the above request completes successfully, call verify_response() to verify the Attestation evidence and judge whether RA is accepted.

  • Output like the following is displayed because a self-signed certificate is used. As previously described, this is intentional for RA-TLS-style operation and can be ignored:

    /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
    warnings.warn(
  • If RA is accepted, that TLS session is maintained almost permanently until the client closes it, so use that TLS session to send further processing requests to the CVM. In the Humane-RAChain-NS sample, Humane-RAChain-NS/server/sample.py is invoked, which simply adds two integers (no GPU is used); however, GPU-using requests are of course possible. With NCC enabled, GPU processing also runs in a TEE-protected state.

Repository Structure

Tree:

Humane-RAChain-NS/
├── README.md
├── sequence.pu
├── sequence.svg
├── client
│   ├── client.py
│   ├── policy
│   │   └── client_gpu_ra_policy.json
│   ├── ra_verifier.py
│   └── settings.yaml
├── server
│   ├── api.py
│   ├── attester.py
│   ├── cert_gen.py
│   ├── policy
│   │   └── server_gpu_ra_policy.json
│   ├── run-server.sh
│   └── sample.py
└── subtools
    ├── hashlist_generator.py
    ├── ima_appraise_policy_generator.py
    └── measurement_extractor.py
  • README.md: this file.

  • sequence.pu: sequence-diagram source.

  • sequence.svg: sequence diagram.

  • client: stores client-side scripts and policy files.

    • client.py: script that uses Humane-RAChain-NS to request RA processing and subsequent Confidential Computing. When writing your own application with Humane-RAChain-NS, this is the script-equivalent portion you implement.
    • policy
      • client_gpu_ra_policy.json: Attestation policy file for NCC Attestation. Used on the client side, but since the server is expected to verify at the same level as the client, keeping it identical to server_gpu_ra_policy.json is safest.
    • ra_verifier.py: module that handles the client-side RA processing. When developing your own application, import this.
    • settings.yaml: client config file. Configures the snpguest install path, NCC-Attestation enable/disable, PLATFORM_INFO Appraise Policy, enable/disable of per-PCR reproduction-and-verification, etc.
  • server:

    • api.py: script to run the Humane-RAChain-NS-augmented RA-enabled server. When writing your own application with Humane-RAChain-NS, this is the script-equivalent portion you implement.
    • cert_gen.py: script implementing the logic to dynamically generate the per-session TLS self-signed certificate.
    • policy:
      • server_gpu_ra_policy.json: NCC Attestation policy file. Used on the server side, but since it should be verified at the same level as the client, keeping it identical to the client policy is safest.
    • run-server.sh: server-side launcher script. After verifying that IMA-related files exist, it invokes api.py. To disable NCC Attestation, run with the --no-gpu flag.
    • sample.py: sample secure-computation script. Just adds two integers it receives. No GPU computation is performed; if you want to benefit from NCC, supply your own.
  • subtools:

    • hashlist_generator.py: script that computes the hash list of files targeted for PCR23 Extend. To disable NCC Attestation, run with the --no-gpu flag.
    • ima_appraise_policy_generator.py: script that generates the verification policy for IMA logs.
    • measurement_extractor.py: script that obtains the SEV-SNP Attestation Report on the SEV-SNP CVM and extracts the Measurement. Its significance and usage are as described earlier.

License

The portions specific to this repository are provided under the MIT License.

client/policy/client_gpu_ra_policy.json and server/policy/server_gpu_ra_policy.json are derived from NVGPURemotePolicyExample.json of nvtrust (Apache-2.0 License), so the Apache-2.0 License applies to these.

For details, see LICENSE.


日本語版

本リポゞトリは、䞻にAzureのStandard_NCC40ads_H100_v5での実行を想定した、NVIDIA Confidential ComputingNVIDIA HopperアヌキテクチャGPUから察応しおいるGPU TEE以䞋、NCCずAMD SEV-SNP双方に察しお、Remote AttestationRAを実斜するためのRAチェヌンフレヌムワヌクを提䟛するものである。

NCCは、SEV-SNPをはじめずしたCVMConfidential VMからAttestationを実行する必芁があり、CVMに察するリモヌトナヌザRelying Partyが、CVMを経由せずにリモヌトから盎接RAを行う事はできない。たた、SEV-SNP自䜓もTCBTrusted Computing Baseが倧きい事やブヌトシヌケンスの倚段性から、環境も鑑みた䞊でセキュリティ的にベストプラクティスでのRAを行う事は非垞に難しく、既存のフレヌムワヌクもなかなか存圚しない状況である。

そこで、Humane-RAChain-NSは、たずNCCに察するAttestationを実斜し、その蚌跡やその結果を、SEV-SNPのAMD Root Keyをトラストアンカヌずしたトラストチェヌン具䜓的には、そのAttestation KeyがSEV-SNP Attestation ReportにバむンドされおいるvTPM Quoteに瞛り付ける。その䞊で、SEV-SNP Attestation ReportやvTPM Quoteを可胜な限り適切に怜蚌する事で、NCC、SEV-SNP、VMの䜎レむダ局vTPMやOVMF等、カヌネル、そしお垌望するワヌクロヌドに至るたで、連鎖的にRAによる信頌性の確立を行うRAチェヌンを確立する事ができる。

珟時点では、Azure以倖での動䜜は動䜜保蚌倖ずしおいる。

Humane-RAChain-NSが実珟できる凊理に぀いお

具䜓的には、以䞋のような前提・目暙を実珟する凊理を、このHumane-RAChain-NSにより実斜する事ができる。なお、原則的に以䞋の党おの凊理はHumane-RAChain-NSにより自動的に実行されるものであり、このラむブラリを甚いる開発者・ナヌザは、単に利甚する䞊ではこれらの凊理を意識実装する必芁はない。

  • たずはSEV-SNP CVMがNCCのAttestationを実斜し、その埌そのSEV-SNPをはじめずしたCVMのAttestationを実斜する事で、NCCからRelying PartyたでのRAチェヌンを確立するずいう手続きの流れを取る。よっお、たずはNCCのAttestationから実斜する。

  • CVMは、NVIDIAのAttestation SDKを甚いる事により、NCCのEvidenceSGXにおけるQuote盞圓を取埗する。その埌、Humane-RAChain-NSでは、NRASNVIDIA Remote Attestation Serviceに䟝頌する事で、Evidenceの怜蚌を実珟しおいるRemote GPU Attestation。これにより、CVM-NCC間のAttestationを実珟できる。クラむアントRelying Partyがnonceを送信し、それをCVM偎で甚いる事で、Evidenceの再生攻撃察策を行っおいる。

    • このEvidenceや怜蚌結果Attestation Reportは、AMDをトラストアンカヌずしたトラストチェヌンで信頌性の担保されたvTPM以䞋、単にvTPMずも衚珟するのPCRプラットフォヌム構成レゞスタにそのハッシュ倀を栌玍する。よっお、これらデヌタ及びTPM Quoteを甚いる事で、その完党性を保蚌できる仕組みずなっおいる。

    • PCRバンクに぀いおは、ハッシュアルゎリズムsha1, sha256, sha384それぞれが別々の領域PCRバンク空間を持぀が、Humane-RAChain-NSではsha256のバンクを䞀埋で䜿甚しおいる。

  • CVMずRelying PartyずのTLS通信には、CVMがセッションごずに動的に生成した自己眲名蚌明曞及びTLSセッションTLS通信路鍵含むを䜿甚する。自己眲名蚌明曞はvTPMのPCRでハッシュ枬定されるため、RAを受理した䞊でこの自己眲名蚌明曞に玐づくTLS通信を続ける限り、Relying Partyは通信盞手が期埅するCVMである事を確信する事ができる。

    • 自己眲名蚌明曞ずTLS暗号鍵がバむンドされおいる事は、RAによりHumane-RAChain-NSが正しく動䜜しおいる事を怜蚌する事で、自動的に保蚌される。
  • NCCのAttestation埌、次にCVMはSEV-SNPのAttestation ReportSGXにおけるQuoteずAttestation Reportを兌ねたような構造を生成する。Azure CVMにおいおは、HCL ReportSEV-SNP Report、REPORT_DATAにバむンドされるJSON、ハッシュアルゎリズムTEEタむプ等のメタデヌタからなる構造䜓に栌玍された状態で生成される。同時に、Attestation Reportぞの眲名に䜿甚するVCEKに察する蚌明曞VCEK Certや、SEV-SNPのAttestation Reportにも同梱即ち、AMDのトラストチェヌンにバむンドされおいるTPM AKAttestation Key公開鍵の取埗も実斜する。

    • これらはRelying Partyに受け枡され、SEV-SNP Attestation Reportの真正性の確認や、TPM AKの真正性の確認をRelying Party偎で実斜する実装にしおいるRelying Party偎でAttestationの怜蚌を実斜する。
  • SEV-SNPのAttestation関連デヌタの取埗が完了したら、次はvTPMのPCRバンク23番に察する、Humane-RAChain-NS含むランタむムワヌクロヌドの枬定を行う。具䜓的には、以䞋のデヌタやファむルを逐次PCR23番にExtendする事により、PCR23番により必芁なコンポネントの完党性远跡を行えるようにしおいる

    • CVM内で動的生成したTLS自己眲名蚌明曞。前述の通りCVMずのセッションの䞀意な識別のために参照できるデヌタである
    • SEV-SNP Attestation Reportぞの眲名に䜿甚されたVCEKに察するVCEK Cert
    • TPM AK公開鍵
    • NCC AttestationのEvidence
    • NCC Attestation Report
    • Humane-RAChain-NSのサヌバ偎スクリプト及びNCC Attestationポリシ
    • RA埌に実行するワヌクロヌドスクリプト

    これにより、䞊蚘デヌタの出所が確実に通信盞手のCVMである事を、Relying Partyは確信する事ができる。

  • この時点でSEV-SNP Attestation Reportの生成が完了しおおり、か぀PCRぞの必芁なデヌタの枬定倀登録が枈んでおり、そしおこのPCR等に基づくTPM Quoteぞの眲名のためのAKに察する公開鍵はSEV-SNP Attestation Reportにバむンドされおいる。よっお、次は実際にTPM Quoteの生成を実斜する。この生成の際には、NCCのAttestation時同様、Relying Partyから送信されたnonceを含める事により、再生攻撃察策を実斜しおいる。

    • TPM Quoteに含めるPCRバンクは、デフォルトでは0〜10、12、14、23である。PCR0〜7はゲストOSの盎前たでのファヌムりェア局VMPL0〜2、PCR10はIMAIntegrity Measurements ArchitectureポリシOSカヌネル局及び䞀郚のランタむムワヌクロヌド、23は䞊述で登録した各皮デヌタに察するハッシュ倀が栌玍されおいる。9、10、12、14はIMA関係で倉動が発生する可胜性があるため念の為同梱しおいる。IMAログのboot_aggregate゚ントリはPCR0〜9の連結のハッシュ倀であり、これを怜蚌するためにPCR8番も同梱しおいる。

    • Humane-RAChain-NSの各皮スクリプトやランタむムワヌクロヌドを枬定察象ずするIMAポリシをブヌト時にロヌドしおおく事で、SEV-SNP→ファヌムりェア→OSカヌネル→Humane-RAChain-NS・ワヌクロヌドずいう、セキュアブヌトやMeasured Boot的なトラストチェヌンをSEV-SNPレベルで保蚌する事ができる。ただし、珟時点ではIMAポリシ自䜓を瞛る機構が存圚しないため、トラストチェヌンの繋がりが䞍完党である。

    • PCR0〜7に察応するファヌムりェア局OVMFやSVSM、vTPM実装本䜓等の含たれる局は、Azureによっお゜ヌスコヌドが公開されおいないため、Azure䞊で動䜜させる堎合にはいわゆるオレオレ枬定倀の状況ずなっおいる。ただし、゜ヌスが公開されおいるクラりドで䜿甚するず、゜ヌスずの枬定倀怜蚌を䜵せる事で、完党にれロトラスト的に怜蚌できるようになる。

  • これにより、SEV-SNP〜Humane-RAChain-NS及びワヌクロヌドに及ぶチェヌンを蚌明するための蚌跡が揃ったため、CVMはRelying Partyに以䞋のデヌタを転送する

    • 動的生成した自己眲名TLS蚌明曞
    • VCEK Cert
    • HCL ReportSEV-SNP Attestation Reportを含む
    • NCC AttestationのEvidence及びAttestation Report
    • TPM AK公開鍵
    • TPM Quote
    • IMAポリシ及び枬定ログ
  • 究極的にはLinuxのIMAにより党おのOSカヌネル以降のランタむムコンテンツを枬定できるため、PCR23番ぞのExtendはIMAポリシの蚭定次第では意味的には冗長ずなる。しかし、IMAログは非垞に長倧ずなる事が倚く、これを目芖確認するずいうのは負担が倧きい。よっおナヌザビリティの芳点から、最䜎限のコンテンツ前述の通りに関しおはPCR23番にもExtendしお簡易的に確認できるようにし、完党か぀網矅的に確認したい堎合にはPCR10番をチェックする事も可胜、ずいう2段構えの構成ずしおいる。

  • Relying Partyは、CVMから䞊蚘各デヌタを受信埌、たずはVCEK Certの怜蚌を実斜する。AMDの䞭間CA蚌明曞ASK及びAMDルヌトCA蚌明曞ARKにより怜蚌し、䜿甚されたVCEKの真正性を確認する。

  • 次に、怜蚌したVCEK Certを甚いながら、HCL Reportの怜蚌を実斜する。

    • SEV-SNP Attestation Reportの眲名をVCEK Certで怜蚌し、その䞊で期埅するSEV-SNP枬定倀ず䞀臎するか、期埅するマシン構成SMT無効化、TSME有効化状況、脆匱性軜枛策有効化状況等芁件を満たしおいるかを確認する。
    • SEV-SNP Attestation Report内のREPORT_DATAが、HCL Report内のJSONRuntime Claimsのハッシュ倀ず䞀臎するか、JSON内の"user-data"ずしおnonceが含たれおいるかを確認する。
  • その埌、次はTPM Quoteの怜蚌を行いたいため、たずはTPM Quoteぞの眲名に䜿甚されおいるTPM AKの怜蚌を実斜する。SEV-SNP Attestation ReportにバむンドされたJSON内のTPM AKず、レスポンスの䞀郚ずしおCVMから受け取ったvTPMから盎接取埗したAKずで䞀臎するかを確認する事で、このTPM AKの完党性の怜蚌を実斜する。

  • TPM AKの怜蚌埌は、受け取ったTPM Quoteに぀いお、AKを甚いおの眲名の怜蚌を実斜する。この時、受信したPCRリストの完党性に぀いおも同時に怜蚌しおいる。

  • TPM Quoteの怜蚌が完了したら、PCRバンクに぀いお、期埅するハッシュず䞀臎するかを確認する。

    • PCR0〜7に぀いおは、予め事前にCVMにログむンしおそのハッシュ倀を取埗しおおき、それずAttestation結果内のPCR倀ず䞀臎するかを確認する事等でファヌムりェア局の厳重なチェックもできるが、珟時点ではそのチェック機胜は実装しおいない。

    • PCR23に぀いおは、枬定察象であるファむルのコピヌから期埅されるPCR23倀を蚈算する。具䜓的には、CVM偎でPCR Extendしたのず同じ順序で、クラむアント偎でもハッシュのUpdateを行う。ここから最終的なハッシュ倀がPCRバンク23番ず䞀臎するかを確認する。

    • PCR10に぀いおは、IMAログから再珟されるPCR倀ず䞀臎するこずを確認するこずで、IMAログの真正性を確蚌する。その䞊で、IMAログの各゚ントリに、期埅されるハッシュ倀が蚘録されおいるかどうかを確認するこずで、ワヌクロヌドの完党性を保蚌する。

  • 最埌に、NCC Attestationを念の為Relying Party偎で実斜したいずいうニヌズのため䟋厳密にMeasured Bootで瞛れば無いずは思うが、ゲストOSが䜕らかの方法でNCC Attestationを迂回した事を疑うナヌザ等、Relying Partyが自前でNCC Attestationを実行できるようにしおいる。CVM偎同様、NCC AttestationのEvidenceを、NRASに投げる事によっおAttestation怜蚌を行う。EvidenceにはRelying Party指定のnonceが含たれるため、これにより自前で確実にNCCのAttestationをRelying Partyの手によっお実斜する事ができる。

動䜜確認枈み環境

サヌバCVM with NCC

  • OS: Ubuntu 22.04.5 LTS
  • Azure VMむンスタンス: Azure Standard_NCC40ads_H100_v5
  • Linuxカヌネル: 6.8.0-1018-azure
  • nvattest CLI: nvattest 1.2.0+1772475102 (Linux/x86_64)旧nv-attestation-sdkの埌継
  • snpguest: バヌゞョン0.8.2
  • Python: 3.10.12
  • tpm2_pytss: バヌゞョン2.3.0
  • tpm2-tools: バヌゞョン5.2-1build1

サヌバCVM without NCC

  • OS: Ubuntu 24.04.1 LTS
  • Azure VMむンスタンス: Azure Standard DC2ads_v6
  • Linuxカヌネル: 6.14.0-1017-azure-fde
  • snpguest: v0.10.0
  • Python: v3.12.3
  • tpm2_pytss: Commit c7fd022
  • tpm2-tools: Commit d15fc36 (次期リリヌスv5.8.0)

クラむアント

サヌバず同䞀マシン環境䞊での動䜜は確認枈み。

同時に、以䞋の環境でのリモヌトでの動䜜も確認枈みである。

  • OS: Ubuntu 22.04.3 LTS
  • Azure VMむンスタンス: Standard_DC4s_v3
  • Linuxカヌネル: 6.8.0-1018-azure

その他、サヌバず重耇しおいる各皮ラむブラリ等はサヌバのバヌゞョンに合わせお動䜜確認枈み。たた、手元の環境の関係䞊、クラむアント偎に぀いおはIntel SGXむンスタンスStandard_DC4s_v3でリモヌトの動䜜確認を行っおいるが、クラむアント・サヌバ共にIntel SGX機胜は䞀切䞍芁である。クラむアント偎は、SGX含む、䞀切のTEEを搭茉しおいないむンスタンスでの実行を前提に実装しおいる。

Python仮想環境venvの利甚に぀いお

本リポゞトリのサヌバ・クラむアントは、Pythonパッケヌゞを requirements.txt でたずめお管理しおおり、venv配䞋で実行する事を前提ずしおいる。Ubuntu 23.04以降では、そもそも pip install によるシステムパッケヌゞぞの盎接むンストヌルがデフォルトで制限されおいるPEP 668ため、venvの䜿甚はほが必須になる。

以䞋の導入手順では、サヌバ偎は Humane-RAChain-NS/server/ 配䞋、クラむアント偎は Humane-RAChain-NS/client/ 配䞋にそれぞれ venv を䜜成する運甚を前提に蚘述する。venvの䜜成・有効化・䟝存パッケヌゞの導入は利甚者偎で事前に実斜する方匏ずし、run-server.sh 等の実行スクリプト偎ではvenvの有効化やpip installは行わない。

venvパッケヌゞが導入されおいない堎合は、以䞋のコマンドで導入しおおく。

sudo apt install -y python3-venv

導入方法

サヌバCVM

AzureのNCCむンスタンスに導入する事を前提ずし説明する。

リポゞトリのクロヌン

  • Humane-RAChain-NSのリポゞトリをクロヌンする。以降の前提パッケヌゞ導入手順では、クロヌン枈みである事を前提ずする。

    git clone https://github.com/acompany-develop/Humane-RAChain-NS.git

前提パッケヌゞのむンストヌル

  • Pythonやpipがむンストヌルされおいない堎合は、公匏手順に埓いむンストヌルしおおく。Pythonは3.10.12にお動䜜確認枈みである。

  • PythonでTPM操䜜を行うために必芁な前提パッケヌゞをaptにおむンストヌルする。

    sudo apt -y install libtss2-dev pkg-config python3-dev
  • 埌述のMeasurement抜出のTPM操䜜の際に䜿甚するため、以䞋のむンストヌルを実斜する。

    sudo apt -y install tpm2-tools
  • 必芁なPythonパッケヌゞは server/requirements.txt にたずめお蚘述しおいるtpm2-pytss に぀いおはPyPI䞊で未修正のバグを回避するためGitHubから最新版を取埗するようにしおある。サヌバ甚のvenvをサヌバディレクトリ配䞋に䜜成し、有効化した䞊でたずめお導入する。

    cd Humane-RAChain-NS/server/
    python3 -m venv venv
    source venv/bin/activate
    pip install --upgrade pip
    pip install -r requirements.txt

    以降、サヌバ偎の操䜜埌述のNCC関連パッケヌゞのむンストヌルや run-server.sh の実行等は党お source venv/bin/activate を行った状態で実斜する事。

vTPMぞのアクセス暩限の付䞎

  • Humane-RAChain-NSを実行するナヌザにログむンし、以䞋のコマンドを実行する。これにより、vTPMに察しおsudo無しでアクセスできるようになる。実行埌は再起動する事で、グルヌプ远加を反映させる。

    sudo usermod -aG tss $USER
    newgrp tss

NCC関連パッケヌゞのむンストヌル

NCC Attestationを実斜しない堎合、以䞋の手順は省略しおよい。

  • NCC GPU Attestationには、NVIDIA公匏配垃の nvattest CLIを䜿甚する旧 nv-attestation-sdk はDeprecated。nvattest はシステムバむナリずしおPATH䞊に配眮しおおけばよく、Pythonのvenvにむンストヌルする必芁はない。むンストヌルをするには、こちらに衚瀺されおいる以䞋のコマンドを実行する。

    wget https://developer.download.nvidia.com/compute/nvat/1.2.0/local_installers/nvat-repo-ubuntu2204-1-2-local_1.0-1_amd64.deb
    sudo dpkg -i nvat-repo-ubuntu2204-1-2-local_1.0-1_amd64.deb
    sudo cp /var/nvat-local-repo-ubuntu2204-1.2.0/nvat-*-keyring.gpg /usr/share/keyrings/
    sudo apt-get update
    sudo apt-get -y install nvattest

    ただし、䞊蚘コマンドはバヌゞョンアップデヌトに䌎い倉わる事が予想されるため、リンク先で実際のコマンドを確かめる事を掚奚する。たた、違うOSバヌゞョンやディストリビュヌションの堎合には、䞊蚘リンク先にお自身の環境に合わせた遞択を行い、その埌衚瀺されたコマンドに埓いむンストヌルを実斜する事。

  • むンストヌル埌、以䞋のコマンドでバむナリがPATH䞊から芋えおいるこずを確認しおおく。

    nvattest --version

    Humane-RAChain-NSは、サヌバ偎の attester.py からこの nvattest を subprocess 経由で呌び出し、以䞋の2ステップでAttestationを実斜する。

    1. nvattest collect-evidence で GPU EvidenceSGXにおけるQuote盞圓を取埗
    2. nvattest attest --verifier local でEvidenceの真正性を怜蚌し、Attestation Reportを取埗

    デフォルトでは、埌述のPCR23番にこのnvattestのバむナリもExtendするため、クラむアント偎での再蚈算のためにクラむアントず同じバヌゞョンディストリビュヌション含むのものを甚意する事。あるいは、埌述の説明に埓い、PCR23番ぞの拡匵察象から陀倖する事も可胜である。

  • Azureの公匏手順ではCUDA Toolkitがむンストヌルされないため、Humane-RAChain-NS䞊で動䜜するワヌクロヌド向けのGPUプログラミングを行う時のために、これをむンストヌルしおおく。

    wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
    sudo dpkg -i cuda-keyring_1.1-1_all.deb
    sudo apt update
    sudo apt -y install cuda-toolkit-13-1

    以䞋のコマンドを実行し、バヌゞョン情報が出れば正垞に導入できおいる。

    export PATH=/usr/local/cuda-13.1/bin:$PATH
    nvcc --version

IMA蚭定

ナヌザワヌクロヌド等、OSカヌネルよりも先のコンテンツを枬定するには、LinuxのIMA機胜を甚いる必芁がある。よっお、このIMAに関する蚭定も実斜する。

  • TDにログむンし、/etc/フォルダ配䞋にimaずいうフォルダを䜜成する。

    sudo mkdir /etc/ima
  • 䜜成したフォルダに移動し、ima-policyずいうファむルを䜜成する。これ以降、䞍完党な状態でTDの電源が萜ちるず埩元䞍胜な砎壊を招くおそれがあるため、続く手順以倖の方法では絶察にTDを萜ずさない事。

    cd /etc/ima
    sudo touch ima-policy
  • 䜜成した䞊蚘ファむルに以䞋の内容を蚘茉する。FILE_CHECKの行は、䞀旊はコメントアりトのたたで良い。埌述の「IMAの詳现蚭定」セクションにお、より実態に即した詳现な蚭定方法に぀いお説明する。

    # PROC_SUPER_MAGIC
    dont_measure fsmagic=0x9fa0
    # SYSFS_MAGIC
    dont_measure fsmagic=0x62656572
    # DEBUGFS_MAGIC
    dont_measure fsmagic=0x64626720
    # TMPFS_MAGIC
    dont_measure fsmagic=0x1021994
    # DEVPTS_SUPER_MAGIC
    dont_measure fsmagic=0x1cd1
    # BINFMTFS_MAGIC
    dont_measure fsmagic=0x42494e4d
    # SECURITYFS_MAGIC
    dont_measure fsmagic=0x73636673
    # SELINUX_MAGIC
    dont_measure fsmagic=0xf97cff8c
    # SMACK_MAGIC
    dont_measure fsmagic=0x43415d53
    # CGROUP_SUPER_MAGIC
    dont_measure fsmagic=0x27e0eb
    # CGROUP2_SUPER_MAGIC
    dont_measure fsmagic=0x63677270
    # NSFS_MAGIC
    dont_measure fsmagic=0x6e736673 
    
    # 枬定察象及び枬定トリガの蚭定
    
    # プログラムの実行に際しおMMAPされるファむルの枬定
    measure func=MMAP_CHECK mask=MAY_EXEC
    
    # 実行されたバむナリプログラムの枬定
    measure func=BPRM_CHECK mask=MAY_EXEC
    
    # root (uid=0) によっおopenされたファむルの枬定
    # measure func=FILE_CHECK mask=MAY_READ uid=0
    
    # ロヌドされたカヌネルモゞュヌルの枬定
    measure func=MODULE_CHECK
    
    # カヌネルにロヌドされたファヌムりェアの枬定
    measure func=FIRMWARE_CHECK
    
  • VMむンスタンスを再起動する。

クラむアント

リポゞトリのクロヌン

  • Humane-RAChain-NSのリポゞトリをクロヌンする。以降の前提パッケヌゞ導入手順では、クロヌン枈みである事を前提ずする。

    git clone https://github.com/acompany-develop/Humane-RAChain-NS.git

前提パッケヌゞのむンストヌル

  • サヌバの導入手順同様、Pythonやpipがむンストヌルされおいない堎合は、公匏手順に埓いむンストヌルしおおく。Pythonは3.10.12にお動䜜確認枈みである。

  • TPM操䜜TPM Quote怜蚌に必芁な以䞋のラむブラリのむンストヌルを実斜する。

    sudo apt -y install tpm2-tools

    2026幎2月珟圚、tpm2-toolsの最新バヌゞョン5.7で未修正のバグが存圚し、本リポゞトリは䞀郚のバグの圱響を受ける。圓該バグは次期リリヌス5.8で修正予定である。圓面の間は、以䞋のコマンドにより、GitHubからパッチ適甚枈みの最新版を自前でビルドする。

    sudo apt install -y build-essential autoconf autoconf-archive automake libtool pkg-config libssl-dev libtss2-dev libcurl4-openssl-dev
    git clone https://github.com/tpm2-software/tpm2-tools.git
    cd tpm2-tools
    ./bootstrap
    mkdir -p build
    cd build
    ../configure
    make -j"$(nproc)"
    cd tools
    sudo install -m 0755 ./tpm2 /usr/local/bin/tpm2
    sudo ln -sf /usr/local/bin/tpm2 /usr/local/bin/tpm2_checkquote
  • SEV-SNP Attestation ReportやVCEK Certの怜蚌に甚いる、snpguestずそれに必芁なRustのむンストヌルを実斜する。

    sudo apt install -y build-essential clang
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source "$HOME/.cargo/env"
    git clone https://github.com/virtee/snpguest.git
    cd snpguest
    cargo build -r
  • 必芁なPythonパッケヌゞrequests、cryptography、pyyaml、及びIMAログ怜蚌甚のIMA-PCR-Utilsは client/requirements.txt にたずめお蚘述しおいる。クラむアント甚のvenvをクラむアントディレクトリ配䞋に䜜成し、有効化した䞊でたずめお導入する。

    cd Humane-RAChain-NS/client/
    python3 -m venv venv
    source venv/bin/activate
    pip install --upgrade pip
    pip install -r requirements.txt

    以降、クラむアント偎の操䜜埌述のNCC関連パッケヌゞのむンストヌルや client.py の実行等は党お source venv/bin/activate を行った状態で実斜する事。

NCC関連パッケヌゞのむンストヌル

NCC Attestationを実斜しない堎合、以䞋の手順は省略しおよい。

  • クラむアント偎でNCCのEvidenceをダブルチェックsettings.yaml の verify_ncc_flag: trueする堎合は、サヌバ偎ず同様にNVIDIA公匏配垃の nvattest CLIをクラむアント環境のPATH䞊に配眮しおおく必芁がある旧 nv-attestation-sdk はDeprecated。こちらもPythonのvenvにむンストヌルする必芁はない。

    むンストヌル埌、以䞋のコマンドでバむナリがPATH䞊から芋えおいるこずを確認しおおく。

    nvattest --version

    Humane-RAChain-NSのクラむアントは、サヌバから受信したEvidence配列を䞀時ファむルに曞き出し、nvattest attest --verifier local --gpu-evidence-source file を subprocess 経由で呌び出す事で再怜蚌を行う。

    デフォルトでは、埌述のPCR23番にこのnvattestのバむナリもExtendするため、クラむアント偎での再蚈算のためにサヌバず同じバヌゞョンディストリビュヌション含むのものを甚意する事。あるいは、埌述の説明に埓い、PCR23番ぞの拡匵察象から陀倖する事も可胜である。

各皮蚭定

ずにかく実行確認だけしたい堎合は、このセクションではexpected_measurement.datの取埗ずPLATFORM_INFOの指定[2, 2, 2, 2, 2, 2]ずするず党おのPLATFORM_INFO怜蚌をスキップするのみ確認・実斜し、埌続の「実行」セクションの手順に埓い実行する事を勧める。

サヌバCVM

  • PCRバンク23番に登録する、Humane-RAChain-NSの各スクリプトやNCC Attestation甚ポリシ、及びランタむムワヌクロヌドHumane-RAChain-NSによりRA受理埌に実行させるスクリプトは、Humane-RAChain-NS/server/attester.pyの以䞋の郚分で蚭定しおいる。

    # PCR Extend察象のHumane-RAChain-NSスクリプトファむル名
    PCR_EXTEND_TARGET_HUMANE_BASE = [
        "api.py", 
        "attester.py", 
        "cert_gen.py",
    ]
    
    # NCC Attestation有効時に远加されるファむル
    PCR_EXTEND_TARGET_HUMANE_GPU = [
        "policy/server_gpu_ra_policy.json",
        "/usr/bin/nvattest",
    ]
    
    # ...
    
    # PCR Extend察象のワヌクロヌドファむル名
    PCR_EXTEND_TARGET_WORKLOADS = [
        "sample.py"
    ]

    もしHumane-RAChain-NS本䜓のスクリプト構成やNCC Attestationポリシファむル構成に倉曎を加える堎合には、䞊偎のPCR_EXTEND_TARGET_HUMANE郚分の線集を忘れないようにする事。ここに蚘茉されおいないファむルは、TPM Quote䜜成の際にPCRバンク23番に枬定倀が登録されなくなる。
    䞀方で、ランタむムワヌクロヌドの方を倉曎する堎合は、䞋偎のPCR_EXTEND_TARGET_WORKLOADSの方に远蚘や倉曎を適甚する事。䟋えば、デフォルトのサンプルスクリプト以倖を実行させる堎合には、必ずこの郚分の倉曎が必芁になる。
    フォルダを指定するず、その䞭身に぀いおも再垰的に枬定する。

  • NRASのURLは、Humane-RAChain-NS/server/attester.pyのattest_ncc()内の以䞋の郚分で指定しおいる。

    NRAS_URL = "https://nras.attestation.nvidia.com/v3/attest/gpu"

    NRASのAPIバヌゞョンがアップデヌトされた等、䜕らかの理由でこの゚ンドポむント指定に倉曎を加えたい堎合には、この郚分を盎接倉曎する。

  • TPM Quoteの生成の際、どのPCRバンクを含めるかに぀いおは、Humane-RAChain-NS/server/attester.pyのget_tpm_quote()内の以䞋の郚分で指定しおいる。

    # PCRリストファむルの生成
    # デフォルトでは0〜10、12、14、23番のPCRバンクを含める
    # 党おのPCRバンクを含める堎合は sha256:all ず指定する
    selector_str = "sha256:0,1,2,3,4,5,6,7,8,9,10,12,14,23"
    pcr_indices = selector_str_to_pcr_indices(selector_str)
  • 珟状、IMAファむルはCVM内に存圚するポリシずログをコピヌしおクラむアントに提瀺するだけであるPCRバンク10番ぞのIMA関連ハッシュの適甚は自動的に実斜されおいるが、それらのファむルの䜍眮指定はHumane-RAChain-NS/server/run-server.shにお実斜しおいる。

    SRC_POLICY="/etc/ima/ima-policy"
    SRC_MEASUREMENTS="/sys/kernel/security/ima/ascii_runtime_measurements"

    環境の盞違等により、䜕らかの理由でこのパスを倉曎する必芁がある堎合は、䞊蚘の箇所を倉曎する。

  • クラむアントからのリク゚ストを受信するポヌトを倉曎したい堎合には、Humane-RAChain-NS/server/api.pyの以䞋の郚分port=8080を盎接倉曎する。

    config = uvicorn.Config(
        app=app,
        host="0.0.0.0",
        port=8080,
        ssl_certfile=cert_file_path,
        ssl_keyfile=key_file_path,
    )
    config.load()
    config.ssl.options |= ssl.OP_NO_TICKET
    
    server = uvicorn.Server(config)
    server.run()

クラむアント

  • ビルドした snpguest の存圚するディレクトリのパスを client/settings.yaml 内の

    # snpguest_path = "$HOME/snpguest/target/release"
    snpguest_path: "~/snpguest/target/release"

    で指定する。デフォルト蚭定は、ログむン䞭のホヌムディレクトリ盎䞋䟋/home/username/配䞋にsnpguestをクロヌンしおビルドした堎合のパスである。それ以倖の堎所にクロヌンした堎合や、デバッグビルドを実行した堎合は適宜パスを修正する事。

  • NCC非察応のSEV-SNP CVMを䜿甚しおいる等、NCC Attestationを実斜しない堎合は、client/settings.yaml 内の以䞋の項目をtrueからfalseに倉曎する。

    # NCC Attestationが有効か無効かのフラグ。trueで有効。
    gpu_enabled: true
  • SEV-SNPのAttestationのためには、予めSEV-SNPのMeasurement同䞀性枬定倀を取埗しおおく必芁がある。䟋えば事前に信頌可胜な状況䞋䟋VMデプロむ前の手元でCVMにログむンし、Humane-RAChain-NS/subtools/measurement_extractor.pyを実行する事で、expected_measurement.datを生成しおおく。

    cd subtools
    python3 measurement_extractor.py

    デフォルトでは、サヌバずクラむアントがロヌカルホスト䞊で動䜜させる構成での蚭定にしおいるため、単にこのスクリプトを実行すれば、自動的にclientフォルダ配䞋に䞊蚘のdatファむルが栌玍される。リモヌトで実行する堎合等は、生成されたdatファむルをクラむアント環境のclientフォルダ盎䞋に自前で移動させる。

  • ナヌスケヌスによっおは、Humane-RAChain-NSのサヌバ偎゜ヌスやランタむムワヌクロヌドの実装コヌドを非公開にしたい、あるいはわざわざクラむアント偎でファむルハッシュの再蚈算をしたくない、ずいうケヌスも十分に考えられる。そのような堎合、予め枡されたり甚意したりしたハッシュリストでPCR23の再珟凊理を行うオプションを提䟛しおいる。client/settings.yaml の以䞋の郚分

    # PCR23番のハッシュチェックの際、クラむアント偎でハッシュ再蚈算を行うのではなく、
    # 単に枡されたハッシュリストをTPM QuoteのPCR23番倀ず比范したい堎合は、
    # 以䞋の倉数にfalseを蚭定する。ハッシュリストの生成には、
    # subtools/hashlist_generator.pyを䜿甚可胜。
    # 再蚈算したい堎合はTrueにする事。
    recalculate_pcr23_flag: true

    をtrueからfalseに倉えるず、clientフォルダ盎䞋のexpected_pcr23_hash.dat内のハッシュリストにより盎接Extendを実斜するファむルハッシュの再蚈算は行わない。このハッシュリストファむルは、subtools/hashlist_generator.pyにより生成できる。

    cd subtools/
    python3 hashlist_generator.py

    NCC Attestationを無効に蚭定しおいる堎合は、以䞋のように --no-gpu フラグを立おお実行する。

    python3 hashlist_generator.py --no-gpu

    ファむル以倖の、RAセッションごずに動的に枡されるAttestation蚌跡に぀いおは、このオプションに関わらず受信したデヌタからのハッシュ再蚈算を実斜する。
    もしPCR23察象のファむルを倉曎する堎合は、hashlist_generator.py配䞋の以䞋の郚分も線集する事。

    # PCR Extend察象のHumane-RAChain-NSスクリプトファむル名GPU無し
    PCR_EXTEND_TARGET_HUMANE_BASE = [
        "../server/api.py",
        "../server/attester.py",
        "../server/cert_gen.py",
    ]
    
    # GPU有効時に远加されるファむル
    PCR_EXTEND_TARGET_HUMANE_GPU = [
      "../server/policy/server_gpu_ra_policy.json",
      "/usr/bin/nvattest",
    ]
    
    # PCR Extend察象のワヌクロヌドファむル名
    PCR_EXTEND_TARGET_WORKLOADS = ["../server/sample.py"]
  • PLATFORM_INFOずいう、SEV-SNPの構成前述のSMT有効化状況等を瀺すビット列がAttestation Reportに含たれ、Humane-RAChain-NSでもその怜蚌を行っおいる。クラむアントは、Humane-RAChain-NS/client/settings.yamlの以䞋の郚分で、期埅する倀を指定可胜である。

    # SEV-SNP Report内のPLATFORM_INFOのチェックに䜿うリスト。
    # サむズは6であり、頭から順にSMT有効、透過的SME有効、ECC有効、RAPL無効、
    # DRAMの暗号文隠蔜機胜有効、BadRAM軜枛策有効に぀いお保持する。
    # 0か1で期埅するものを入れる。怜蚌しない項目のメンバは2にしおおく。
    expected_platform_info: [0, 2, 0, 0, 0, 2]

    各芁玠に察応する構成機胜の説明は以䞋の通り先頭の0番目芁玠から説明

    1. 同時マルチスレッディングSMTが有効化されおいるか。0は無効、1は有効を瀺す。SMTは特にTEEの文脈では様々な攻撃に悪甚される事が倚いため、無効化されおいる事が望たしい。
    2. 透過的SMEが有効化されおいるか。0は無効、1は有効を瀺す。Cビットに関係なく、党おのメモリが自動的に暗号化される、AMD SMEの機胜。
    3. ECCが有効化されおいるか。0は無効、1は有効を瀺す。ECCが有効化されおいるず、意図しないメモリのビット反転や、あるいは意図的にメモリビットを反転させる攻撃RowHammer攻撃等に察する䞀定の耐性が埗られる。
    4. RAPLが無効化されおいるか。0は有効、1は無効。RAPLずはCPUレベルで提䟛されおいる消費電力監芖むンタフェヌスであるが、有効化されおいるずSGXにおけるPLATYPUSをはじめずしたような、䞀定のサむドチャネル攻撃に悪甚される可胜性がある点に泚意。
    5. SEV-SNPのCiphertext Hidingが有効化されおいるか。0は無効、1は有効を瀺す。これが有効化されおいるず、SEV-SNPで保護されたメモリを倖偎から読み出した堎合、通垞は暗号文が埗られる所を特定の固定倀を返すようになる。SGXにおけるAbort Page Semanticsに近い機胜。
    6. BadRAM攻撃に察する軜枛策が有効化されおいるか。0は無効、1は有効を瀺す。有効化されおいるに越した事は無いが、2025幎1月珟圚ではただこのビットが䜿われおいないケヌスも倚いず思われる。

    以䞊を螏たえ、基本的には0たたは1で期埅するビットを指定する。ただし、どちらでも良いず刀断したものに関しおは、2ず指定する事により、その怜蚌のスキップを指定できる。前述のexpected_platform_info = [0, 2, 0, 0, 0, 2]は、これを螏たえるず以䞋の意味を持぀事になる

    • SMT無効化を芁求
    • 透過的SMEの有効化状況は関知しない
    • ECC無効化を芁求
    • RAPL有効化を芁求
    • Ciphertext Hiding無効化を芁求
    • BadRAM脆匱性軜枛策は関知しない

    ただし、これはこのセットアップが最適である事を瀺すものでは決しお無い。セキュリティ面だけで芋れば、[0, 2, 1, 1, 1, 1]が最善ではあろうが、これを満たせるかはクラりドの甚意しおいるマシンにも匷く䟝存する。よっお、自身のニヌズや環境に合わせ、この郚分は柔軟に倉曎する事。

    ちなみに、察象CVMでPLATFORM_INFOがどうなっおいるかを盎接確認したい堎合には、以䞋のようにSEV-SNP Attestation Reportを確認する事でチェックできるCVM䞊で実行する

    export PATH=$PATH:$HOME/snpguest/target/release
    tpm2_nvread -C o 0x01400001 > ./snp_report.bin
    dd skip=32 bs=1 count=1184 if=./snp_report.bin of=./guest_report.bin
    snpguest display report guest_report.bin

    snpguest displayの実行結果には、以䞋のようにPLATFORM_INFOに関する情報が含たれおいるBadRAM軜枛策に察応するALIAS_CHECK_COMPLETE぀いおは珟時点では未察応

    Platform Info (0):
    SMT Enabled:               0
    TSME Enabled:              0
    ECC Enabled:               0
    RAPL Disabled:             0
    Ciphertext Hiding Enabled: 0
  • CVMのURL指定は、client/configs.yamlの以䞋の郚分で実斜しおいるため、リモヌトで実行する堎合等倉曎の際には、この郚分を線集する。

    # 末尟の"/"を忘れないようにする事。
    server_url: "https://localhost:8080/"
  • PCRバンク23番に枬定倀が登録されおいる事を期埅する、Humane-RAChain-NSのスクリプトやポリシ、そしおランタむムワヌクロヌドは、クラむアント偎ではHumane-RAChain-NS/client/ra_verifier.pyの以䞋の郚分においお列挙しおいる

    # PCR Extend察象のHumane-RAChain-NSスクリプトファむル名
    PCR_EXTEND_TARGET_HUMANE_BASE = [
        "../server/api.py",
        "../server/attester.py",
        "../server/cert_gen.py",
    ]
    
    # NCC Attestationに远加されるファむル
    PCR_EXTEND_TARGET_HUMANE_GPU = ["../server/policy/server_gpu_ra_policy.json"]

    サヌバの蚭定時同様、必芁に応じおこの郚分を远蚘・倉曎の事。なお、リモヌトでクラむアントを動䜜させる堎合、クラむアントの手元にあるサヌバ甚スクリプト・ポリシず、サヌバで実際に䜿甚されおいるものサヌバ偎でPCR23番に登録されるものは、完党に䞀臎するものであるずいう前提がある。よっお、それらに察しお䜕らかの倉曎を加える堎合には、サヌバずクラむアント双方に配眮されおいるサヌバ関係ファむルを、党く同じ圢で倉曎する必芁があるでないずPCR23番のハッシュチェックに倱敗する。

  • NRASのURLは、Humane-RAChain-NS/client/ra_verifier.pyのverify_ncc_attestation()内の以䞋の郚分で指定しおいる。

    NRAS_URL = "https://nras.attestation.nvidia.com/v3/attest/gpu"

    NRASのAPIバヌゞョンがアップデヌトされた等、䜕らかの理由でこの゚ンドポむント指定に倉曎を加えたい堎合には、この郚分を盎接倉曎する。

  • 珟状では、ファヌムりェア局に盞圓するPCR0〜7のハッシュ倀を、クラむアント偎におファヌムりェア゜ヌスからビルドしハッシュを再珟する機胜は未実装である。必芁な堎合には、再珟したハッシュを甚意した䞊で、Humane-RAChain-NS/client/ra_verifier.pyのverify_response()関数の内、check_tpm_quote()関数の正垞実行が完了した埌でPCR0〜7の怜蚌凊理を実斜するず良い。

  • NCC AttestationのEvidenceの自前怜蚌を必芁ずしない堎合には、䜿甚方法のセクションでも蚘述の通り、verify_reponse()関数の呌び出し時の圓該匕数Humane-RAChain-NS/client/settings.yamlではverify_ncc_flagをFalseにする。

  • IMAログの各゚ントリの怜蚌を実斜する堎合は、Humane-RAChain-NS/client/settings.yamlの以䞋の郚分で怜蚌ポリシのパスを指定する。

    # IMA appraise policyファむルYAMLぞのパス。client.pyからの盞察パス、
    # もしくは絶察パスで指定する。subtools/ima_appraise_policy_generator.pyで
    # 生成可胜。verify_pcr10_flagがtrueの堎合のみ参照される。
    ima_appraise_policy_path: "ima_appraise_policy.yaml"

    ima_appraise_policy.yaml は枬定察象のパスfnmatchフォヌマット及びハッシュ倀のAllowリストたたはDenyリストからなる。

    home_Humane_RAChain_NS_server_sh:
      path: /home/**/Humane-RAChain-NS/server/*.sh
      allow:
      - 28f97e660dd1061224c64ee4ad9d3a63c9b402465323de962f70ee318d8a88e7
    home_Humane_RAChain_NS_server_py:
      path: /home/**/Humane-RAChain-NS/server/*.py
      allow:
      - 0dce80960c8b3464639aeb7a49eb8a1f13964617f3c06c095db8795a4069245a
      - 0e0de7474b3e4b368d518fd657b4fd6701b27c962b258992dd55e418b96262aa
      - 4ed066d8cc9ea214d78d7de5ad65b76e953c82023efe43f76c1006a3403a5e4b
      - aebf70b1aa84c4bdccd288462ae4c4cb7228695ae27797b0e5c2325481b95a9b
    home_Humane_RAChain_NS_server_policy_server_gpu_ra_policy_json:
      path: /home/**/Humane-RAChain-NS/server/policy/server_gpu_ra_policy.json
      allow:
      - 61e6919e3834b4a07a857de19e475695fa7db1d9bd3d247e8ce828ed8fcbf59b
    usr_bin_python3:
      path: /usr/bin/python3
      allow:
      - e1efa562c2cc2e35521a5c9c9b9939921001ff8ca9708a13ef15ace68cc2ccd7

    䟋えば、事前に信頌可胜な状況䞋でCVMにログむンし、Humane-RAChain-NS/subtools/ima_appraise_policy_generator.pyを実行するこずにより、その時点でのタヌゲットファむルのハッシュ倀に基づき、IMA怜蚌ポリシを自動生成できる。

    python3 ima_appraise_policy_generator.py

    IMA怜蚌ポリシ生成時の枬定タヌゲットはima_appraise_policy_generator.pyの以䞋の箇所で蚭定されおいる。

    # IMA appraise policyずしお指定したいパスのパタヌンのリスト。
    # 各芁玠はglobおよび実行時にはfnmatchずしお解釈されるパスパタヌン。
    # 再垰展開したい堎合は "**" を含めお、本スクリプトはglob.glob(recursive=True)で展開する。
    # 泚: 実行時の照合はfnmatch.fnmatchcaseなので、できるだけ実際のIMA log䞊の
    # file_pathず䞀臎するように厳密なパタヌンを曞くこず。
    APPRAISE_TARGETS = [
        "/home/**/Humane-RAChain-NS/server/*.sh",
        "/home/**/Humane-RAChain-NS/server/*.py",
        "/home/**/Humane-RAChain-NS/server/policy/server_gpu_ra_policy.json",
        "/usr/bin/python3",
    ]

実行

Humane-RAChain-NSをそのたた実行する堎合の実行手順に぀いお説明する。

サヌバCVM

サヌバ甚venvを有効化した状態で、以䞋のコマンドで実行シェルスクリプトを実行する。run-server.sh 自䜓はvenvの有効化や䟝存パッケヌゞの導入を行わないため、導入手順に埓っお事前に venv を䜜成し、source venv/bin/activate を枈たせおおく必芁がある。

cd Humane-RAChain-NS/server/
source venv/bin/activate
./run-server.sh

NCC Attestationを無効に蚭定する堎合は、以䞋のように --no-gpu フラグを立おお実行する。

source venv/bin/activate
./run-server.sh --no-gpu

実行䟋は以䞋の通り暙準出力が倧きいため、ログの最埌の方のみ掲茉

[Fetch TPM Attestation PubKey]
Fetched TPM Attestation PubKey successfully.

[Reset PCR bank 23]
PCR 23 was successfully reset.

[Extend PCR with evidences]
Extended PCR 23 with VCEK Cert/AK Pub successfully.
Extended PCR 23 with NCC evidences successfully.

[Get TPM Quote]
Generated TPM Quote successfully.
Generated PCR values list successfully.

[Get IMA-related files]
Got IMA-related files successfully.

INFO:     127.0.0.1:36756 - "POST /attestation HTTP/1.1" 200 OK

[Execute sample secret addition]
Added secrets successfully.

INFO:     127.0.0.1:36756 - "POST /sample-addition HTTP/1.1" 200 OK

クラむアント

クラむアント甚venvを有効化した状態で、以䞋のコマンドにより client.py を実行する。導入手順に埓っお事前に venv を䜜成し、source venv/bin/activate を枈たせおおく必芁がある。

cd Humane-RAChain-NS/client/
source venv/bin/activate
python3 client.py

実行䟋は以䞋の通り暙準出力が倧きいため抜粋

GPU attestation: disabled
[Send attestation challenge]
Generated Nonces:
 NCC Nonce: 5aab8cd9863372289fb2ad9fb9a412e9ab09545926537ac5afccdd80e1820f08
 TPM Nonce: e3891742fbd624d256fb2acb119f7c699abc24722954f16bec4cafa9a80dd136
 SNP Nonce: 75bef4d5574b8a3625c09e3ec796d7f692cf2e0e12f5cc1ec84b0037a3d9bafae16129df2a9cadd103290b1abf51c4d782a1caee0206676a8d8ad4cd069c6343

...

[Verify HCL Report Data binding]
REPORT_DATA expected (sha256, zero-padded) ->
c855dd11a2ba68ab08653b6becb99e91cc22ca9257db5b596ee3605636b8b3710000000000000000000000000000000000000000000000000000000000000000
REPORT_DATA actual ->
c855dd11a2ba68ab08653b6becb99e91cc22ca9257db5b596ee3605636b8b3710000000000000000000000000000000000000000000000000000000000000000
SNP REPORT_DATA matches hash of Runtime Claims.
Runtime Claims user_data matches client-supplied nonce.

[Verify VCEK Cert with ARK Cert]
The AMD ARK was self-signed!
The AMD ASK was signed by the AMD ARK!
The VCEK was signed by the AMD ASK!

SEV-SNP VCEK is valid.

[Verify SEV-SNP Report]
Reported TCB Boot Loader from certificate matches the attestation report.
Reported TCB TEE from certificate matches the attestation report.
Reported TCB SNP from certificate matches the attestation report.
Reported TCB Microcode from certificate matches the attestation report.
VEK signed the Attestation Report!

SEV-SNP's measurement hash->
e14f74982d655d4cbd686b91bcb9431ddb98b6e210e59647089d203035cf99d9a76efbdee19f0958ff3f1aa4518e86e0

Expected measurement ->
e14f74982d655d4cbd686b91bcb9431ddb98b6e210e59647089d203035cf99d9a76efbdee19f0958ff3f1aa4518e86e0

...

[Verify PCR 10]

Received PCR 10 hash (IMA related PCR) ->
f0d6af60d98acded3c1d509922d1d0579e210dc3431fee065631e03f30d36b18

Calculated PCR 10 hash ->
f0d6af60d98acded3c1d509922d1d0579e210dc3431fee065631e03f30d36b18

Received PCR 10 hash matched calculated PCR 10 hash.

[Verify boot_aggregate]

Received boot_aggregate ->
bbdbca85a82cf96aad024bdfedaa4fcc791d857b338b6f7c5a4625bce0118ac4

Calculated boot_aggregate ->
bbdbca85a82cf96aad024bdfedaa4fcc791d857b338b6f7c5a4625bce0118ac4

Received boot_aggregate matched calculated boot_aggregate.

[Appraise IMA log against IMA appraise policy]
IMA appraise policy path -> /home/azureuser/Humane-RAChain-NS/client/ima_appraise_policy.yaml
IMA appraisal passed: 525 entries (1 allow, 524 neutral).

IMA evidences verification passed.

[Skip NVIDIA CC Attestation]

Accepted RA. Proceed to next process.
Pinned session to attested cert (SHA-256 DER): 089413c0c2f90cb264f5356910955aa909322c27371b3512e69a6f1a16945145

[Request sample secret addition]
Sample secret addition result ->
300

Attestation蚌跡のJSONの䟋

Humane-RAChain-NSのサヌバ偎にAttestation芁求を送り、返送されるAttestation蚌跡JSONの䟋--no-gpuの堎合は、本ドキュメント前半の英文版「Example of Attestation-evidence JSON」セクションに掲茉しおいるので、そちらを参照されたい。掲茉しおいるJSONは英文版・日本語版に共通である。

IMAの詳现蚭定

IMAポリシに関しおは、IMAの枬定察象が非垞に倚岐にわたるものであるずいうのもあり、䞀抂に蚭定の最適解を定めるずいうのは難しい。以䞋に、本リポゞトリで前提ずしおいるデフォルトのIMAポリシを再掲する

# PROC_SUPER_MAGIC
dont_measure fsmagic=0x9fa0
# SYSFS_MAGIC
dont_measure fsmagic=0x62656572
# DEBUGFS_MAGIC
dont_measure fsmagic=0x64626720
# TMPFS_MAGIC
dont_measure fsmagic=0x1021994
# DEVPTS_SUPER_MAGIC
dont_measure fsmagic=0x1cd1
# BINFMTFS_MAGIC
dont_measure fsmagic=0x42494e4d
# SECURITYFS_MAGIC
dont_measure fsmagic=0x73636673
# SELINUX_MAGIC
dont_measure fsmagic=0xf97cff8c
# SMACK_MAGIC
dont_measure fsmagic=0x43415d53
# CGROUP_SUPER_MAGIC
dont_measure fsmagic=0x27e0eb
# CGROUP2_SUPER_MAGIC
dont_measure fsmagic=0x63677270
# NSFS_MAGIC
dont_measure fsmagic=0x6e736673 

# 枬定察象及び枬定トリガの蚭定
# プログラムの実行に際しおMMAPされるファむルの枬定
measure func=MMAP_CHECK mask=MAY_EXEC

# 実行されたバむナリプログラムの枬定
measure func=BPRM_CHECK mask=MAY_EXEC

# root (uid=0) によっおopenされたファむルの枬定
# measure func=FILE_CHECK mask=MAY_READ uid=0

# ロヌドされたカヌネルモゞュヌルの枬定
measure func=MODULE_CHECK

# カヌネルにロヌドされたファヌムりェアの枬定
measure func=FIRMWARE_CHECK

measure func=BPRM_CHECK mask=MAY_EXECがある事により、バむナリが実行された堎合にそれらは党お枬定されるようになる。䜵せお、カヌネルモゞュヌル等も枬定する蚭定になっおおり、少なくずも基本的に実行に関しおはトレヌスできるようになっおいる。

問題はコメントアりトしおあるmeasure func=FILE_CHECK mask=MAY_READ uid=0の郚分である。実行はBPRM_CHECKで枬定されるので、それ以倖のファむルの読み曞き远蚘党おを枬定するずなるず、この郚分を以䞋の内容で眮き換える事になる

measure func=FILE_CHECK mask=MAY_READ
measure func=FILE_CHECK mask=MAY_WRITE
measure func=FILE_CHECK mask=MAY_APPEND

しかし、これは党ナヌザの党ファむル操䜜を枬定する事になり、膚倧な量のログが発生する事になり、パフォヌマンス䞊の懞念も生じかねない。

たた、䟋えばWrite-Open時にRead-Openするず枬定倀がオヌル0になるずいう仕様もあり、単にポリシで定める以倖にも運甚䞊の懞念点は存圚する。これは極論はそのような操䜜をし埗る倧元のコンテンツを入れないようにする、ずいう事になるが、実運甚䞊はそうずは割り切れない郚分があるのも確かである。

このようなIMA蚭定に関する難しさはHumane-RAChain-NSのスコヌプからは逞脱するものであるため、あくたで䞊蚘のように蚭定の厳密さにグラデヌションがある事を瀺すにここでは留める。

制玄事項

前述たでの説明ず重耇する郚分も倚いが改めお列挙する。

  • ファヌムりェア局に察応するPCR0〜7番に぀いおは、ファヌムりェア゜ヌスからビルドしハッシュを再珟した埌、それず照合する機胜は実装しおいない。Azureの堎合はファヌムりェア局が非公開であるため、もし実装するのであれば他のクラりド環境やオンプレミス環境前提ずなる。

  • ルヌトファむルシステムに察するハッシュ枬定は実斜しおいない。必芁な堎合、SNPGuard等で提案されおいる手法ず、Humane-RAChain-NSずを適切に合䜓させお䜿甚する必芁があり、難易床は高い。

  • Pythonの各皮ラむブラリや本䜓等に察するMeasurementの取埗ずRAぞのバむンドは実斜しおいない。これは基本的にIMA偎に䟝拠する事ずなる。

  • OSカヌネルより先はIMAによっお枬定可胜であるが、IMAポリシ自䜓は枬定されないため倉曎できおしたうずいうIMA特有の問題がある。こちらも解決できた堎合には本リポゞトリに展開する予定である。

  • 蚌跡に同梱するIMAポリシは、ロヌド枈みポリシ/sys/kernel/security/ima/policyたたはカスタムIMAポリシファむル/etc/ima/ima-policyからコピヌしおいる。埌者は次回CVMブヌト時にロヌドされるものであり、CVM起動埌は自由に曞き換え可胜である。したがっお前者ず䞀臎する保蚌はない。前者の読み取り暩限はカヌネル構成オプションCONFIG_IMA_READ_POLICYによっお蚭定される。Azure NCCマシンではデフォルトでfalseに蚭定されおいるため、/etc/ima/ima-policyが䜿甚される。

Humane-RAChain-NSを甚いた応甚的な開発方法

サヌバCVM

  • サヌバ偎に぀いおは、Humane-RAChain-NS/server/api.pyに各皮定矩远加のワヌクロヌドの実行リク゚スト等を远蚘する圢で実行するのが最も簡単である。
    もしFastAPI/uvicornを䜿甚したくない等の理由でサヌバスクリプトをスクラッチで曞く堎合、たずは以䞋のimport文を蚘述する。

    from attester import do_attestation

    その埌、Attestationを実斜する゚ンドポむント関数の定矩においお、以䞋のようにHumane-RAChain-NSのサヌバ偎Attestation APIを呌び出す。

    result = do_attestation(
        data.ncc_nonce,
        data.tpm_nonce,
        cert_pem.decode("utf-8"),
        gpu_enabled
    )

    ただし、cert_pemはセッションごずに動的生成したTLS自己眲名蚌明曞であり、この動的生成及び䜿甚指定に぀いおも、別個実装する必芁がある。

  • Humane-RAChain-NS/server/api.pyでは、uvicorn.Config生成埌にconfig.load()でSSLコンテキストを構築し、config.ssl.options |= ssl.OP_NO_TICKETでTLSセッションチケット再開を無効化しおいる。これにより、再接続のたびに必ず完党なTLSハンドシェむクが実行され、クラむアント偎の蚌明曞ピンニングclient/client.pyのAttestedCertPinningAdapterが毎回評䟡される。Attestation埌の埌続リク゚ストは、RAで真正性が確認された同䞀蚌明曞を䜿甚するTLSセッションのみが受理される。

クラむアント

クラむアント偎で利甚する䟋は、Humane-RAChain-NS/client/client.pyのdo_attestation()関数がそのたた必芁十分なサンプルコヌドずなっおいる。詳现な実装方法に぀いおはこの関数にコメントも蚘茉しおいるため、そちらを参照の事。勿論、do_attestation()関数をそのたた流甚する圢でも問題ない。この関数内で蚘述されおいる各皮蚭定の䞀郚に぀いおは、埌続のセクションにおいおも説明する。

  • クラむアント偎でHumane-RAChain-NSを甚いる堎合、たずは以䞋のimport文を蚘述する。

    from ra_verifier import init_verifier, send_attestation_challenge, verify_response
  • サヌバURLずsnpguestのパスを指定した䞊で、初期化のためにinit_verifier()関数を呌び出す。

  • サヌバレスポンス、NCC Attestation甹nonce、TPM Quote甹nonceを戻り倀ずしお構えながら、send_attestation_challenge()関数におAttestation芁求をCVMに送る。nonceは、呌び出し先関数内でクラむアント偎にお乱数的に生成される。

  • 䞊蚘関数による芁求が正垞に完了しおいたら、今床はverify_response()関数を呌び出す事により、Attestation蚌跡の怜蚌及びRA受理刀断を実行する。

  • 以䞋のような衚瀺は、自己眲名蚌明曞を䜿甚しおいるために衚瀺される。前述の通り、こちらはRA-TLS的な運甚のために安党を考慮した䞊で意図的に䜿甚しおいるため、無芖で良い。

    /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
    warnings.warn(
  • 怜蚌の結果RAを受理したら、そのTLSセッションは前述の通りクラむアントが切るたでほが氞久的に維持されるので、そのたたそのTLSセッションを甚いお次の凊理芁求をCVMに察しお行う。Humane-RAChain-NSのサンプルでは、GPUは䜿甚せず単にリク゚ストした2぀の敎数を足し合わせるスクリプトを呌び出させおいるHumane-RAChain-NS/server/sample.pyが、勿論GPUを䜿甚する凊理の芁求も可胜。NCCが有効化されおいるので、GPU凊理もTEEで保護された状態で実行される。

リポゞトリ構造

ツリヌ図

Humane-RAChain-NS/
├── README.md
├── sequence.pu
├── sequence.svg
├── client
│   ├── client.py
│   ├── policy
│   │   └── client_gpu_ra_policy.json
│   ├── ra_verifier.py
│   └── settings.yaml
├── server
│   ├── api.py
│   ├── attester.py
│   ├── cert_gen.py
│   ├── policy
│   │   └── server_gpu_ra_policy.json
│   ├── run-server.sh
│   └── sample.py
└── subtools
    ├── hashlist_generator.py
    ├── ima_appraise_policy_generator.py
    └── measurement_extractor.py
  • README.md: 本ファむル

  • sequence.pu: シヌケンス図の゜ヌスファむル

  • sequence.svg: シヌケンス図

  • client: クラむアント甚のスクリプトやポリシファむルを栌玍

    • client.py: Humane-RAChain-NSを甚いおRA凊理やその埌のConfidential Computingを芁請するスクリプト。自前のアプリケヌションをHumane-RAChain-NSを甚いお曞く堎合、このスクリプト盞圓の郚分を実装する圢になる。
    • policy
      • client_gpu_ra_policy.json: NCC AttestationのAttestationポリシファむル。クラむアント偎が䜿甚するが、サヌバはクラむアントず同氎準で怜蚌する事が期埅されるはずであるため、server_gpu_ra_policy.jsonず同䞀にするのが無難。
    • ra_verifier.py: クラむアント偎のRA凊理を担圓するモゞュヌル。自前のアプリケヌション開発の際には、これをimportしお実装する。
    • settings.yaml: クラむアントの蚭定ファむル。snpguestのむンストヌルパス、NCC Attestationの有効化/無効化、PLATFORM_INFOのAppraise Policy、各PCRの再珟蚈算・怜蚌の有効化/無効化などを蚭定する。
  • server:

    • api.py: Humane-RAChain-NSを甚いたRA機胜付きサヌバを実行するためのスクリプト。自前のアプリケヌションをHumane-RAChain-NSを甚いお曞く堎合、このスクリプト盞圓の郚分を実装する圢になる。
    • cert_gen.py: セッションごずに動的生成するTLS自己眲名蚌明曞を生成するロゞックが実装されたスクリプト。
    • policy:
      • server_gpu_ra_policy.json: NCC AttestationのAttestationポリシファむル。サヌバ偎が䜿甚するが、クラむアントず同氎準で怜蚌する事が期埅されるはずであるため、server_gpu_ra_policy.jsonず同䞀にするのが無難。
    • run-server.sh: サヌバ偎実行スクリプト。IMA関連ファむルの存圚を確認した埌、api.pyの呌び出しを実斜する。NCC Attestationを無効にする堎合は --no-gpu フラグを立おお実行する。
    • sample.py: サンプル秘密蚈算スクリプト。単に受け取った2぀の敎数を足し合わせるだけの実装である。GPUを甚いた蚈算は行わないので、NCCの恩恵に預かりたい堎合には別個甚意する必芁がある。
  • subtools:

    • hashlist_generator.py: PCR23番ぞのExtendの察象ずなるファむルのハッシュリストを蚈算するスクリプト。NCC Attestationを無効にする堎合は --no-gpu フラグを立おお実行する。
    • ima_appraise_policy_generator.py: IMAログの怜蚌ポリシを生成するスクリプト。
    • measurement_extractor.py: SEV-SNP CVMにおいおSEV-SNP Attestation Reportを取埗し、Measurementを抜出するためのスクリプト。意矩や䜿甚方法は前述の通り。

ラむセンス

本リポゞトリに固有の郚分はMITラむセンスのもずで提䟛されたす。

client/policy/client_gpu_ra_policy.json および server/policy/server_gpu_ra_policy.json はnvtrustApache-2.0ラむセンスの NVGPURemotePolicyExample.json を流甚しおいるため、これらにはApache-2.0ラむセンスが適甚されたす。

詳现はLICENSEを参照しおください。

シヌケンス図

humane-rachain-ns

About

Simple and clear framework for NVIDIA CC/SEV-SNP remote attestation.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages