fapi-profile(5) File Formats Manual fapi-profile(5) (NAME) fapi-profile - FAPI TPM2-TSS (DESCRIPTION) FAPI TPM . : o (name hash algorithm) o ( ) o PCR ( PCR ) RSA ECC TSS . RSA . . FAPI . TSS /etc/tpm2-tss/profiles/ FAPI /etc/tpm2-tss/ . : o type: . o nameAlg: . o srk_template: /SRK. type Fapi_CreateKey . o srk_description: /EK . Fapi_GetDescription . o ek_template: /EK. type Fapi_CreateKey . o ek_description: /SRK . Fapi_GetDescription . o ecc_signing_scheme: ECC. o rsa_signing_scheme: RSA. o keyBits: RSA. o exponent: (exponent) RSA. o sym_mode: . o sym_parameters: . o sym_block_size: . o session_symmetric: ( sym_parameters). o pcr_selection: PCR FAPI. o curveID: ECC. o ek_policy: JSON /EK. o srk_policy: JSON /SRK. o eh_policy: JSON /HE. o sh_policy: JSON /HS. o lockout_policy: JSON /LOCKOUT. o newMaxTries: (lockout). 5 . o newRecoveryTime: . DA . 1000 . o lockoutRecovery: lockoutAuth lockoutAuth . (reboot) . 1000 . o ignore_ek_template: EK NV ram. no . (EXAMPLES) JSON ECC : { "type": "ecc", "nameAlg":"sha256", "srk_template": "system,restricted,decrypt,0x81000001", "srk_description": "Storage root key SRK", "ek_template": "system,restricted,decrypt", "ek_description": "Endorsement key EK", "ecc_signing_scheme": { "scheme":"ecdsa", "details":{ "hashAlg":"sha256" }, }, "sym_mode":"cfb", "sym_parameters": { "algorithm":"aes", "keyBits":"128", "mode":"cfb" }, "sym_block_size": 16, "pcr_selection": [ { "hash": "sha1", "pcrSelect": [ ], }, { "hash": "sha256", "pcrSelect": [ 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ] } ], "curveID": "nist_p256", "ek_policy": { "description": "Endorsement hierarchy used for policy secret.", "policy":[ { "type":"policysecret", "objectName": "4000000b", } ] } } (storage root key) (endorsement key) . ek_policy TCG Credential profile EK 2.0 . TSS TPM2_ . JSON srk_template ek_template . / . TPM . : o sign: sign () . o decrypt: decrypt () . o sign decrypt . o restricted: restricted () . o restricted sign decrypt ( ) . o noda: noda NV . o : (persistent) . o unique_zero=n: unique n RSA unique x y ECC. o unique=hexstring: unique RSA ( 0c0a0f0f0e). o unique_x=hexstring: unique x ECC ( 0c0a0f0f0e). o unique_y=hexstring: unique y ECC ( 0c0a0f0f0e). RSA : "rsa_signing_scheme": { "scheme":"rsapss", "details":{ "hashAlg":"sha256" } }, "rsa_decrypt_scheme": { "scheme":"oaep", "details":{ "hashAlg":"sha256" } }, : o RSA: RSASSA, RSAPSS o ECC: ECDSA, ECDAA : o CTR, OFB, CBC, CFB, ECB, NULL RSA : o RSAES, OAEP (curve ids) : o ECC_NIST_P192, ECC_NIST_P224, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_BN_P256, ECC_BN_P638, ECC_SM2_P256 PCR 0 10 BIOS IMA SHA1 quote verify quote FAPI PCR : "pcr_selection": [ { "hash": "sha1", "pcrSelect": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], }, { "hash": "sha256", "pcrSelect": [ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ] } ], FAPI ECC RSA . ECC P-256 RSA 2048 : .low-range EK TCG EK Credential Profile TCG TPM 2.0 Provisioning Guidance . .high-range EK . .legacy FAPI 4.1.3 TSS . : o low-range: noDa: 1 unique ( ). o high-range: noDa: 1 unique . o legacy: noDa: 0 unique . SRK (Check existing SRK) SRK FAPI . (dual-boot) SRK systemd . FAPI SRK : #!/bin/bash # FAPI /etc/... # SRK 0x81000001 if ! command -v tss2_provision &> /dev/null; then echo "Error tss2_provisioning not installed." exit 1 fi SRK_HANDLE=0x81000001 if tpm2_getcap handles-persistent| grep $SRK_HANDLE > /dev/null; then echo "Check SRK default handle $SRK_HANDLE" else echo "Persistent SRK handle $SRK_HANDLE does not exist" exit 1 fi PROFILES=( \ P_ECCP256SHA256-low-range \ P_RSA2048SHA256-low-range \ P_ECCP256SHA256-high-range \ P_RSA2048SHA256-high-range \ P_ECCP256SHA256-legacy \ P_RSA2048SHA256-legacy \ P_ECCP384SHA384 \ P_RSA3072SHA384 \ P_ECCP256SHA256 \ P_RSA2048SHA256 \ ) TMPDIR=$(mktemp -d) USER_DIR="${TMPDIR}/tpm2-tss/user/keystore" SYSTEM_DIR="${TMPDIR}/tpm2-tss/system/keystore" LOG_DIR="${TMPDIR}/tpm2-tss/eventlog/" for d in /usr/local/etc/tpm2-tss/fapi-profiles/ /etc/tpm2-tss/fapi-profiles/; do if [[ -d $d ]]; then PROFILE_DIR=$d break; fi done if [ -z "$PROFILE_DIR" ]; then echo "Profile dir not found" exit 1 fi for PROFILE in "${PROFILES[@]}"; do config_file=${TMPDIR}/fapi_config.json cat < "$config_file" { "profile_name": "${PROFILE}", "profile_dir": "${PROFILE_DIR}", "user_dir": "${USER_DIR}", "system_dir": "${SYSTEM_DIR}", "tcti": "", "system_pcrs": [], "log_dir": "${LOG_DIR}", "firmware_log_file": "/sys/kernel/security/tpm0/binary_bios_measurements", "ima_log_file": "/sys/kernel/security/ima/binary_runtime_measurements" } EOF export TSS2_FAPICONF="$config_file" if tss2_provision > /dev/null 2>&1 ;then echo "+ ${PROFILE} provisioned" else echo "- ${PROFILE} failed" fi rm "$config_file" rm -r -f $TMPDIR/tmp2-tss done rm -r -f $TMPDIR (SEE ALSO) fapi-config(5) (COLOPHON) 4.2.0 TCG TPM2 Software Stack (TSS2) . : https://github.com/tpm2-software/tpm2-tss (LICENSE) Creative Commons Attribution 4.0 (CC BY 4.0) . : https://creativecommons.org/licenses/by/4.0 TPM2 Software Stack 2020 fapi-profile(5)