Skip to content

Commit 430f864

Browse files
author
Jason Yellick
committed
[FAB-4749] Document signature policy limitations
The signature policy evaluation consumes signatures in the order they are specified. This can lead to unintuitive policy evaluation with signature sets that appear to satisfy a policy, but do not. This CR documents the limitation as well as a best practice to avoid encountering the unintuitive evaluation. [skip ci] Change-Id: I31c5b21b92f562f98e1290fa635787d479fbcbf1 Signed-off-by: Jason Yellick <[email protected]>
1 parent 90e09ea commit 430f864

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/source/policies.rst

+36
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,42 @@ may be expressed using the SignaturePolicy policy type. For code which
221221
constructs signature policies, consult
222222
``fabric/common/cauthdsl/cauthdsl_builder.go``.
223223

224+
---------
225+
226+
**Limitations**: When evaluating a signature policy against a signature set,
227+
signatures are 'consumed', in the order in which they appear, regardless of
228+
whether they satisfy multiple policy principals.
229+
230+
For example. Consider a policy which requires
231+
232+
::
233+
234+
2 of [org1.Member, org1.Admin]
235+
236+
The naive intent of this policy is to require that both an admin, and a member
237+
sign. For the signature set
238+
239+
::
240+
241+
[org1.MemberSignature, org1.AdminSignature]
242+
243+
the policy evaluates to true, just as expected. However, consider the
244+
signature set
245+
246+
::
247+
248+
[org1.AdminSignature, org1.MemberSignature]
249+
250+
This signature set does not satisfy the policy. This failure is because when
251+
``org1.AdminSignature`` satisfies the ``org1.Member`` role it is considered
252+
'consumed' by the ``org1.Member`` requirement. Because the ``org1.Admin``
253+
principal cannot be satisfied by the ``org1.MemberSignature``, the policy
254+
evaluates to false.
255+
256+
To avoid this pitfall, identities should be specified from most privileged to
257+
least privileged in the policy identities specification, and signatures should
258+
be ordered from least privileged to most privileged in the signature set.
259+
224260
MSP Principals
225261
--------------
226262

0 commit comments

Comments
 (0)