Examples of an attestation policy

Attestation policy is used to process the attestation evidence and determine whether Azure Attestation will issue an attestation token. Attestation token generation can be controlled with custom policies. Below are some examples of an attestation policy.

Sample custom policy for a Software Guard Extensions (SGX) enclave

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);
};

For more information on the incoming claims generated by Azure Attestation, see claim sets. Policy authors can use incoming claims to define authorization rules in a custom policy.

Issuance rules section isn't mandatory, but can be used to have additional outgoing claims generated in the attestation token with custom names. For more information on the outgoing claims generated by the service in attestation token, see claim sets.

Default policy for an SGX enclave

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);
};

Claims used in default policy are considered deprecated but are fully supported and will continue to be included in the future. It's recommended to use the nondeprecated claim names. For more information on the recommended claim names, see claim sets.

Sample custom policy to support multiple SGX enclaves

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=="mrsigner2"] => permit(); 
};

Unsigned Polic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