證明原則的範例
證明原則會用來處理證明證據,並判斷 Azure 證明是否會發出證明權杖。 您可以使用自訂原則來控制證明權杖的產生。 以下是證明原則的一些範例。
Software Guard Extensions (SGX) 記憶體保護區的範例自訂原則
version= 1.0;
authorizationrules
{
[ type=="x-ms-sgx-is-debuggable", value==false ]
&& [ type=="x-ms-sgx-product-id", value==<product-id> ]
&& [ type=="x-ms-sgx-svn", value>= 0 ]
&& [ type=="x-ms-sgx-mrsigner", value=="<mrsigner>"]
=> permit();
};
issuancerules {
c:[type=="x-ms-sgx-mrsigner"] => issue(type="<custom-name>", value=c.value);
};
如需 Azure 證明所產生的傳入宣告詳細資訊,請參閱 宣告集合。 原則作者可以使用傳入宣告在自訂原則中定義授權規則。
發行規則區段並非必要專案,但可用來在證明權杖中產生其他具有自訂名稱的傳出宣告。 如需證明權杖中的服務所產生的傳出宣告之詳細資訊,請參閱 宣告集合。
SGX 記憶體保護區的預設原則
version= 1.1;
configurationrules{
=> issueproperty(type="x-ms-sgx-tcbidentifier", value="azuredefault");
};
authorizationrules{
=> permit();
};
issuancerules{
c:[type=="x-ms-sgx-is-debuggable"] => issue(type="is-debuggable", value=c.value);
c:[type=="x-ms-sgx-mrsigner"] => issue(type="sgx-mrsigner", value=c.value);
c:[type=="x-ms-sgx-mrenclave"] => issue(type="sgx-mrenclave", value=c.value);
c:[type=="x-ms-sgx-product-id"] => issue(type="product-id", value=c.value);
c:[type=="x-ms-sgx-svn"] => issue(type="svn", value=c.value);
c:[type=="x-ms-attestation-type"] => issue(type="tee", value=c.value);
};
預設原則中使用的宣告會被視為已淘汰,但受到完全支援,且未來將繼續包含。 建議使用未淘汰的宣告名稱。 如需建議宣告名稱的詳細資訊,請參閱 宣告集合。
支援多個 SGX 記憶體保護區的自訂原則範例
version= 1.0;
authorizationrules
{
[ type=="x-ms-sgx-is-debuggable", value==true ]&&
[ type=="x-ms-sgx-mrsigner", value=="mrsigner1"] => permit();
[ type=="x-ms-sgx-is-debuggable", value==true ]&&
[ type=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