@@ -616,7 +616,7 @@ func (c *Crafter) addMaterial(ctx context.Context, m *schemaapi.CraftingSchema_M
616616 })
617617
618618 // Validate policy groups
619- pgv := policies .NewPolicyGroupVerifier (c .CraftingState .InputSchema , c .attClient , c .Logger )
619+ pgv := policies .NewPolicyGroupVerifier (c .CraftingState .InputSchema , c .attClient , c .Logger , policies . WithAllowedHostnames ( c . CraftingState . Attestation . PoliciesAllowedHostnames ... ) )
620620 policyGroupResults , err := pgv .VerifyMaterial (ctx , mt , value )
621621 if err != nil {
622622 return nil , fmt .Errorf ("error applying policy groups to material: %w" , err )
@@ -657,13 +657,13 @@ func (c *Crafter) addMaterial(ctx context.Context, m *schemaapi.CraftingSchema_M
657657// EvaluateAttestationPolicies evaluates the attestation-level policies and stores them in the attestation state
658658func (c * Crafter ) EvaluateAttestationPolicies (ctx context.Context , attestationID string , statement * intoto.Statement ) error {
659659 // evaluate attestation-level policies
660- pv := policies .NewPolicyVerifier (c .CraftingState .InputSchema , c .attClient , c .Logger )
660+ pv := policies .NewPolicyVerifier (c .CraftingState .InputSchema , c .attClient , c .Logger , policies . WithAllowedHostnames ( c . CraftingState . Attestation . PoliciesAllowedHostnames ... ) )
661661 policyEvaluations , err := pv .VerifyStatement (ctx , statement )
662662 if err != nil {
663663 return fmt .Errorf ("evaluating policies in statement: %w" , err )
664664 }
665665
666- pgv := policies .NewPolicyGroupVerifier (c .CraftingState .InputSchema , c .attClient , c .Logger )
666+ pgv := policies .NewPolicyGroupVerifier (c .CraftingState .InputSchema , c .attClient , c .Logger , policies . WithAllowedHostnames ( c . CraftingState . Attestation . PoliciesAllowedHostnames ... ) )
667667 policyGroupResults , err := pgv .VerifyStatement (ctx , statement )
668668 if err != nil {
669669 return fmt .Errorf ("evaluating policy groups in statement: %w" , err )
0 commit comments