你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
证明策略的示例
证明策略用于处理证明证据,并确定 Azure 证明是否将颁发证明令牌。 可以通过自定义策略控制证明令牌的生成。 下面是证明策略的一些示例。
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 证明生成的传入声明的详细信息,请参阅声明集。 策略作者可以使用传入声明在自定义策略中定义授权规则。
发布规则部分不是必需的,但可以使用此部分在证明令牌中生成具有自定义名称的其他传出声明。 有关证明令牌中的服务生成的传出声明的详细信息,请参阅声明集。
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);
};
在默认策略中使用的声明被视为已弃用,但完全受支持,并且将来将继续被包含在内。 建议使用未弃用的声明名称。 有关建议的声明名称的详细信息,请参阅声明集。
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=="x-ms-sgx-mrsigner", value=="mrs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